?? 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 + -