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

源码截图

源码目录树

;
当前路径:system/manage.php
<?php
include("../db.php");
include("../checklogin.php");
if(!islogin()){
	header('location:../index.php');
}
switch ($_GET['action']) {
	case 'list':
	$pindex = max(1, intval($_GET['page']));
    $psize = $_GET['limit'];
	$sdanweiid=$_GET['sdanweiid'];
	$suserxm=$_GET['suserxm'];
	$sxueliid=$_GET['sxueliid'];
	$sxb=$_GET['sxb'];
	$szhiwuid=$_GET['szhiwuid'];
	$scard=$_GET['scard'];
	$stel=$_GET['stel'];
	$sql="SELECT *  FROM ".$db->tablename('vmanage') ." WHERE id>0";
	if($sdanweiid!=''){
	$sql=$sql." and danweiid = '$sdanweiid'";
	}
	if($suserxm!=''){
	$sql=$sql." and (userxm like '%$suserxm%' or loginname like '%$suserxm%')";
	}
	if($sxb!=''){
	$sql=$sql." and xb = '$sxb'";
	}
	if($sxueliid!=''){
	$sql=$sql." and xueliid = '$sxueliid'";
	}
	if($szhiwuid!=''){
	$sql=$sql." and zhiwuid = '$szhiwuid'";
	}
	if($scard!=''){
	$sql=$sql." and card like '%$scard%'";
	}
	if($stel!=''){
	$sql=$sql." and tel like '%$stel%'";
	}
	$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 'addsave':
	    $danweiid=$_POST['danweiid'];
	    $userxm=$_POST['userxm'];
	    $loginname=$_POST['loginname'];
	    $xb=$_POST['xb'];
	    $pwd='E10ADC3949BA59ABBE56E057F20F883E';//初始密码
	    $minzu=$_POST['minzu'];
	    $csny=$_POST['csny'];
	    $xueliid=$_POST['xueliid'];
	    $mianmaoid=$_POST['mianmaoid'];
	    $card=$_POST['card'];
	    $gzny=$_POST['gzny'];
	    $zhiwuid=$_POST['zhiwuid'];
	    $zhuzhi=$_POST['zhuzhi'];
	    $tel=$_POST['tel'];
	    $guhua=$_POST['guhua'];
	    $jinji=$_POST['jinji'];
	    $qq=$_POST['qq'];
	    $email=$_POST['email'];
	    $qita=$_POST['qita'];
	    $jueseid=$_POST['jueseid'];
	    $hunyin=$_POST['hunyin'];
	    $mudidi=$_POST['mudidi'];
	    $beizhu=$_POST['beizhu'];
		$val=$db->exists('manage',['loginname'=>$loginname,'card'=>$card]);
		if($val){
		$arr=  ['isOk'=>0,'message'=>'员工编号或身份证号和原有的一致'];
        exit(json_encode($arr));
		}
		$data=compact('danweiid','userxm','loginname','pwd','xb','minzu','csny','xueliid','mianmaoid','card','gzny','zhiwuid','zhuzhi','tel','guhua','jinji','qq','email','qita','beizhu','jueseid','hunyin','mudidi');
		$db->insert('manage',$data);//查询获取数组
		$arr=['isOk'=>1,'message'=>'添加成功'];
        exit(json_encode($arr));
		break;	
	case 'editsave':
	    $id=$_POST['id'];
		$danweiid=$_POST['danweiid'];
	    $userxm=$_POST['userxm'];
	    $loginname=$_POST['loginname'];
	    $oldloginname=$_POST['oldloginname'];
	    $xb=$_POST['xb'];
	    $minzu=$_POST['minzu'];
	    $csny=$_POST['csny'];
	    $xueliid=$_POST['xueliid'];
	    $mianmaoid=$_POST['mianmaoid'];
	    $card=$_POST['card'];
	    $oldcard=$_POST['oldcard'];
	    $gzny=$_POST['gzny'];
	    $zhiwuid=$_POST['zhiwuid'];
	    $zhuzhi=$_POST['zhuzhi'];
	    $tel=$_POST['tel'];
	    $guhua=$_POST['guhua'];
	    $jinji=$_POST['jinji'];
	    $qq=$_POST['qq'];
	    $email=$_POST['email'];
	    $qita=$_POST['qita'];
		$hunyin=$_POST['hunyin'];
	    $mudidi=$_POST['mudidi'];
	    $beizhu=$_POST['beizhu'];
		$jueseid=$_POST['jueseid'];
		$valn=$db->exists('manage',['loginname'=>$loginname]);
		$valc=$db->exists('manage',['card'=>$card]);
		if($valn&&($loginname!=$oldloginname)){
		$arr=  ['isOk'=>0,'message'=>'员工编号和原有的一致'];
        exit(json_encode($arr));
		}
		if($valc&&($card!=$oldcard)){
		$arr=  ['isOk'=>0,'message'=>'身份证号和原有的一致'];
        exit(json_encode($arr));
		}
		$data=compact('danweiid','userxm','loginname','xb','minzu','csny','xueliid','mianmaoid','card','gzny','zhiwuid','zhuzhi','tel','guhua','jinji','qq','email','qita','beizhu','jueseid','hunyin','mudidi');
		$db->update('manage',$data,['id'=>$id]);//查询获取数组
		$arr=  ['isOk'=>1,'message'=>'修改成功'];
        exit(json_encode($arr));
		break;	
	case 'delall':
		$id = $_POST['ids'];
		$ids=explode(',',$id);//拆分为数组
        if($id==''){
        $arr=['isOk'=>0,'message'=>'删除记录不能为空'];
        exit(json_encode($arr));
        }
       // $data = compact('id');//构造数组等同array("id"=>2)
        $db->delete('manage',['id'=>$ids]);
        $arr=  ['isOk'=>1,'message'=>'删除成功'];
        exit(json_encode($arr));
		break;
	case "into":
	include("../Api/function.php");
		$str;
		$num=0;
		$filePath=$_POST['hidexcel'];
		$ExcleArr=analysisExcel($filePath);
		foreach($ExcleArr as $key => $value){
		       if($key!=0){
		       $danweiid=getdanweiid($value[0],$db);
		       $loginname=$value[1];
		       $userxm=$value[2];
		       $xb=$value[3];
		       $minzu=$value[4];
		       $card=$value[5];
		       $csny=$value[6];
		       $gzny=$value[7];
		       $zhiwuid=getzhiwuid($value[8],$db);
		       $tel=$value[9];
		       $val1=$db->exists('manage',['card'=>$card]);
		       $val2=$db->exists('manage',['loginname'=>$loginname]);
		       if($val1||$val2){
		           $str=$str.$barcode.'跳过';
		        }else {
	               $data=compact('danweiid','loginname','userxm','xb','minzu','card','csny','gzny','zhiwuid','tel');
		           $db->insert('manage',$data);//查询获取数组
				   $num++;
                 }
		       }
         }
		 $arr=['isOk'=>1,'message'=>'导入成功'.$num."条".$str];
        exit(...
完整源码文件,请先购买后再查看
关于我们 | 顾问团队 | 发展历程 | 联系我们 | 源码上传
联系电话(Tel):4008-010-151(免长途)
地址:北京市海淀区大恒科技大厦五层 邮编:100080
Floor 5th,Daheng Building,Zhongguancun,Beijing,China,100080
51Aspx.com 版权所有 CopyRight © 2006-2022. 京ICP备09089570号 | 京公网安备11010702000869号