点击回首页
我的浏览记录 | | 帮助?
当前位置:
首页>> 企业应用>> 新翔网络OA系统V1.0>> 源文件浏览
[商业版 200RMB] WebForm,下载次数:1 次 | 关键字: PHP MYSQL OA 办公 网络办公

源码截图

源码目录树

;
当前路径:system/zidian.php
<?php
include("../db.php");
include("../checklogin.php");
if(!islogin()){
	header('location:../index.php');
}
switch ($_GET['action']) {
	case 'xiangmulist':
	$pindex = max(1, intval($_GET['page']));
    $psize = $_GET['limit'];
	$zdid=$_GET['zdid'];
	$zidian=$_GET['zidian'];
	$xiangmu=$_GET['xiangmu'];
	$sql="SELECT *  FROM ".$db->tablename('xiangmu') ." WHERE id>0";
	if($zdid!=''){
	$sql=$sql." and zdid = '$zdid'";
	}
	if($zidian!=''){
	$sql=$sql." and zidian LIKE '%$zidian%'";
	}
	if($xiangmu!=''){
	$sql=$sql." and xiangmu LIKE '%$xiangmu%'";
	}
	$sql=$sql."  ORDER BY id asc LIMIT ".($pindex - 1) * $psize.','.$psize;
    $list =$db->fetchall($sql);
    $total =count($list);
    $arr = [
        'msg' => '请求成功',
        'code' => 0,
        'data' => $list,
        'count' => $total
    ];
    exit(json_encode($arr));
		break;
	case 'zidianlist':
	//$pindex = max(1, intval($_GET['page']));
   // $psize = $_GET['limit'];
	$key=$_GET['zidian'];
	$sql="SELECT *  FROM ".$db->tablename('zidian') ." WHERE id>0";
	if($key!=''){
	$sql=$sql." and zidian LIKE '%$key%'";
	}
	$sql=$sql."  ORDER BY bianhao  asc";
    $list =$db->fetchall($sql);
    $total = $db->getcolumn('zidian', array(), "count(*)");
    $arr = [
        'msg' => '请求成功',
        'code' => 0,
        'data' => $list,
        'count' => $total
    ];
    exit(json_encode($arr));
		break;
	case 'zidianedit':
	    $id=$_POST['id'];//获取id
        $data=compact('id');//构造数组
		$val=$db->get('zidian',$data,['id','bianhao','zidian']);//查询获取数组
        exit(json_encode($val));//返回
		break;	
	case 'xiangmuedit':
	    $id=$_POST['id'];//获取id
        $data=compact('id');//构造数组
		$val=$db->get('xiangmu',$data,['id','bianhao','zdid','xiangmu']);//查询获取数组
        exit(json_encode($val));//返回
		break;	
	case 'zidianaddsave':
	    $bianhao=$_GET['bianhao'];
	    $zidian=$_GET['zidian'];
		$data=compact('bianhao','zidian');
		$db->insert('zidian',$data);//查询获取数组
		$arr=['isOk'=>1,'message'=>'字典添加成功'];
        exit(json_encode($arr));
		break;	
	case 'xiangmuaddsave':
	    $bianhao=$_GET['bianhao'];
	    $zdid=$_GET['zdid'];
	    $xiangmu=$_GET['xiangmu'];
		$data=compact('bianhao','zdid','xiangmu');
		$db->insert('xiangmu',$data);//查询获取数组
		$arr=['isOk'=>1,'message'=>'字典项目添加成功'];
        exit(json_encode($arr));
		break;	
	case 'zidianeditsave':
	    $id=$_GET['id'];
	    $bianhao=$_GET['bianhao'];
	    $zidian=$_GET['zidian'];
		$data=compact('bianhao','zidian');
		$db->update('zidian',$data,['id'=>$id]);//查询获取数组
		$arr=  ['isOk'=>1,'message'=>'字典项目修改成功'];
        exit(json_encode($arr));
		break;
	case 'xiangmueditsave':
	    $id=$_GET['id'];
	    $bianhao=$_GET['bianhao'];
		$zdid=$_GET['zdid'];
	    $xiangmu=$_GET['xiangmu'];
		$data=compact('bianhao','xiangmu');
		$db->update('xiangmu',$data,['id'=>$id]);//查询获取数组
		$arr=  ['isOk'=>1,'message'=>'修改成功'];
        exit(json_encode($arr));
		break;		
	case 'zidiandelall':
		$id = $_GET['ids'];
		$ids=explode(',',$id);//拆分为数组
        if($id==''){
        $arr=['isOk'=>0,'message'=>'删除记录不能为空'];
        exit(json_encode($arr));
        }
       // $data = compact('id');//构造数组等同array("id"=>2)
        $db->delete('zidian',['id'=>$ids]);
        $arr=  ['isOk'=>1,'message'=>'删除成功'];
        exit(json_encode($arr));
		break;
	case 'xiangmudelall':
		if(isset($_GET["ids"])&&$_GET["ids"]!=''){
		   $ids = $_GET['ids'];
		   $aids=explode(',',$ids);//拆分为数组
           if($ids==''){
               $arr=['isOk'=>0,'message'=>'删除记录不能为空'];
              exit(json_encode($arr));
           }
		    $db->delete('xiangmu',['id'=>$aids]);
		 }
        if(isset($_GET["id"])&&$_GET["id"]!=''){
		    $id = $_GET['id'];
		    $db->delete('xiangmu',['id'=>$id]);
		 }
        $arr=  ['isOk'=>1,'message'=>'删除成功'];
        exit(json_encode($arr));
	...
完整源码文件,请先购买后再查看
关于我们 | 顾问团队 | 发展历程 | 联系我们 | 源码上传
联系电话(Tel):4008-010-151(免长途)
地址:北京市海淀区大恒科技大厦五层 邮编:100080
Floor 5th,Daheng Building,Zhongguancun,Beijing,China,100080
51Aspx.com 版权所有 CopyRight © 2006-2022. 京ICP备09089570号 | 京公网安备11010702000869号