📄 client.php
字号:
<?
/********************************************************************************/
/* 极限办公自动化系统 (极限OA) */
/* ======================== */
/* 欢迎使用 极限OA,在您开始使用之前,请务必完整阅读本软件附带的全部说明档 */
/********************************************************************************/
/* Welcome to http://www.xsp.cn & http://oa.xsp.cn */
/* 技术支持论坛 http://www.1119.net */
/********************************************************************************/
/* 商业购买请联系 临海市极限网络有限公司 */
/* 联系电话: (0576) 5131349 邮件: mkt@xsp.cn QQ: 562873 */
/********************************************************************************/
if(!defined('KIN_UNION')){die("Hacking attempt");}
$pre_s = true;
if($sysaction == 'del') {
checkright(51,11,4);
if(is_array($delete)) {
$ids = "0";
foreach($delete as $val) {
$ids .= ",$val";
}
$db->query("DELETE FROM $table_client WHERE id IN ($ids)");
}elseif($id) {
$db->query("DELETE FROM $table_client WHERE id='$id'");
}
header("Location:client.php?action=client");
}
if($sysaction == 'add') {
checkright(51,11,2);
if($corpname && $tel && $email) {
if($id) {
checkright(51,11,3);
$db->query("update $table_client set type='$type',contactor='$contactor',corpname='$corpname',tel='$tel',fax='$fax',email='$email',province='$province2',city='$city2',address='$address',des='$des' where id='$id'");
header("Location:client.php?action=client");
}else {
$db->query("insert into $table_client (type,contactor,corpname,tel,fax,email,province,city,address,url,des,mid)
values ('$type','$contactor','$corpname','$tel','$fax','$email','$province2','$city2','$address','$url','$des','$union_uid')");
}
header("Location:client.php?action=client");
}else {
$pre_s = false;
if($id) {
$cli_t = $db->query_fetch("select * from $table_client where id='$id'");
}
$jsinit = ' onload="areainit()"';
$query = $db->query("select * from $table_dict where cid=5 order by id ASC");
while($list = $db->fetch_array($query)) {
if($cli_t[type] == $list[id]) $list[sel] = ' selected';
else $list[sel] = '';
$dict_list[$list[id]] = $list;
}
}
}elseif($sysaction == 'show') {
if($addnote == 1) {
if($time && $stype && $des) {
$db->query("insert into $table_cli_note (cid,type,des,time) values ('$id','$stype','$des','$time')");
header("Location:client.php?action=client&sysaction=show&id=$id");
exit;
}
}
$query = $db->query("select * from $table_cli_note where cid='$id' order by id DESC");
while($list = $db->fetch_array($query)) {
$list[des] = nl2br($list[des]);
$note_list[$list[id]] = $list;
}
$query = $db->query("select * from $table_dict where cid=5 order by id ASC");
while($list = $db->fetch_array($query)) {
$dict_list[$list[id]] = $list;
}
$query = $db->query("select uid,realname from $table_members where fig='1'");
$num = $db->num_rows($query);
while($list = $db->fetch_array($query)) {
$member_list[$list[uid]] = $list;
}
$cli_t = $db->query_fetch("select * from $table_client where id='$id'");
$cli_t[type] = $cli_t[type]?$dict_list[$cli_t[type]][name]:'空';
$cli_t[mid] = $cli_t[mid]?$member_list[$cli_t[mid]][realname]:'空';
$cli_t[polity] = $cli_t[polity]?$dict_list[$cli_t[polity]][name]:'空';
$cli_t[duty] = $cli_t[duty]?$dict_list[$cli_t[duty]][name]:'空';
$cli_t[des] = $cli_t[des]?(nl2br($cli_t[des])):'空';
$cli_t[employtype] = $cli_t[employtype]?'正式':'实习';
foreach($cli_t as $key=>$val) {
if(empty($val))
$cli_t[$key] = '空';
}
$cli_t['time'] = date('Y-m-d',$timestamp);
include getData('client_client_show');
exit;
}
if($pre_s) {
$query = $db->query("select * from $table_dict where cid=5 order by id ASC");
while($list = $db->fetch_array($query)) {
$type_list[$list[id]] = $list;
}
$query = $db->query("select uid,realname from $table_members where fig='1'");
$num = $db->num_rows($query);
while($list = $db->fetch_array($query)) {
$member_list[$list[uid]] = $list;
}
if($type) {
$condi = " where type='$type'";
}else
$condi = '';
$perpage = 20;
if(!$page) {
$page = 1;
}
$offset = ($page - 1) * $perpage;
$query = $db->query("SELECT COUNT(*) FROM $table_client$condi");
$num = $total = $db->result($query, 0);
$multipage = pages($num, $perpage, $page, "client.php?action=client&type=$type");
$query = $db->query("select * from $table_client$condi order by id ASC LIMIT $offset, $perpage");
$num = $db->num_rows($query);
while($list = $db->fetch_array($query)) {
$list[type] = $type_list[$list[type]][name];
$list[mid] = $member_list[$list[mid]][realname];
$dict_list[$list[id]] = $list;
}
}
include getData('client_client');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -