?? system_worker_edit.php
字號:
<?php
require(dirname(__FILE__)."/include/config_base.php");
require(dirname(__FILE__)."/include/config_rglobals.php");
if($id=='')
ShowMsg('非法參數,請正確執行此文件。','-1');
if($action=='save'){
if($s_name==''){
ShowMsg('請輸入職工的姓名','-1');
exit();
}
$addsql="update #@__staff set s_name='$s_name',s_address='$s_address',s_phone='$s_phone',s_part='$s_part',s_way='$s_way',s_money='$s_money',s_utype='$s_utype',s_duty='$s_duty' where id='$id'";
$message= "修改公司職工".$s_name."資料成功";
$loginip=getip();
$logindate=getdatetimemk(time());
$username=str_replace($cfg_cookie_encode,'',$_COOKIE["VioomaUserID"]);
$asql=New Dedesql(false);
$asql->ExecuteNoneQuery($addsql);
$asql->ExecuteNoneQuery("insert into #@__recordline(message,date,ip,userid) values('{$message}','{$logindate}','{$loginip}','$username')");
$asql->close();
showmsg('成功修改了職工的資料','system_worker.php');
exit();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="style/main.css" rel="stylesheet" type="text/css" />
<title><?php echo $cfg_softname;?>職工管理</title>
<script language="javascript">
function cway(value){
if(value==0)
document.forms[0].s_e.value="%";
else
document.forms[0].s_e.value="元/件";
}
</script>
</head>
<body>
<?php
$esql=New Dedesql(false);
$query="select * from #@__staff where id='$id'";
$esql->SetQuery($query);
$esql->Execute();
if($esql->GetTotalRow()==0){
ShowMsg('非法調用參數,請重試','-1');
exit();
}
$row=$esql->GetOne($query);
$esql->close();
?>
<table width="100%" border="0" id="table_style_all" cellpadding="0" cellspacing="0">
<tr>
<td id="table_style" class="l_t"> </td>
<td> </td>
<td id="table_style" class="r_t"> </td>
</tr>
<tr>
<td> </td>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="2">
<tr>
<td><strong> 公司員工資料修改</strong></td>
</tr>
<form action="system_worker_edit.php?action=save" method="post">
<tr>
<td bgcolor="#FFFFFF">
<table width="100%" cellspacing="0" cellpadding="0" border="0" id="table_border">
<tr>
<td id="row_style"> 員工姓名:</td>
<td>
<input type="text" name="s_name" size="10" value="<?php echo $row['s_name'] ?>" id="need"><input type="hidden" name="id" value="<?php echo $id; ?>">
</td>
</tr>
<tr>
<td id="row_style"> 員工聯系地址:</td>
<td>
<input type="text" name="s_address" size="30" value="<?php echo $row['s_address'] ?>"></td>
</tr>
<tr>
<td id="row_style"> 員工聯系電話:</td>
<td>
<input type="text" name="s_phone" size="15" value="<?php echo $row['s_phone'] ?>"></td>
</tr>
<tr>
<td id="row_style"> 所在部門:</td>
<td>
<input type="text" name="s_part" size="20" value="<?php echo $row['s_part'] ?>"></td>
</tr>
<tr>
<td id="row_style"> 所任職務:</td>
<td>
<input type="text" name="s_duty" size="20" value="<?php echo $row['s_duty'] ?>"></td>
</tr>
<tr>
<td id="row_style"> 提成方式:</td>
<td>
<?php
if ($cfg_way=='1'){
if ($row['s_way']==0){
?>
<select name="s_way" onchange="cway(this.value)"><option value="0" selected>銷售總額的百分比</option><option value="1">固定提成(按件)</select>
<?php
}
else
echo " <select name=\"s_way\" onchange=\"cway(this.value)\"><option value=\"0\">銷售總額的百分比</option><option value=\"1\" selected>固定提成(按件)</select>";
}
else
echo " 員工提成功能被管理員禁用!";
?>
</td>
</tr>
<tr>
<td id="row_style"> 提成額(為空表示添加的此員工不提成):</td>
<td>
<?php
if ($cfg_way=='1'){
if ($row['s_way']==0){
?>
<input type="text" name="s_money" size="5" value="<?php echo $row['s_money'] ?>">
<input type="text" name="s_e" size="5" style="border:0px;background:transparent;" value="%" readonly>
<?php
}
else
echo " <input type=\"text\" name=\"s_money\" size=\"5\" value=\"".$row['s_money']."\">
<input type=\"text\" name=\"s_e\" size=\"5\" style=\"border:0px;background:transparent;\" value=\"元/件\" readonly>";
}
else
echo " ";
?>
</td>
</tr>
<tr>
<td id="row_style"> 員工類型(類型不同權限不同):</td>
<td>
<?php getusertype($row['s_utype'],1);?></td>
</tr>
<tr>
<td id="row_style"> </td>
<td> <input type="submit" name="submit" value=" 修改員工資料 "></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</td>
<td> </td>
</tr>
<tr>
<td id="table_style" class="l_b"> </td>
<td> </td>
<td id="table_style" class="r_b"> </td>
</tr>
</table>
<?php
copyright();
?>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -