?? system_guest.php
字號:
<?php
require(dirname(__FILE__)."/include/config_base.php");
require(dirname(__FILE__)."/include/config_rglobals.php");
if($action=='save'){
if($g_name==''){
ShowMsg('請輸入會員的姓名','-1');
exit();
}
$loginip=getip();
$logindate=getdatetimemk(time());
$username=str_replace($cfg_cookie_encode,'',$_COOKIE['VioomaUserID']);
$addsql="insert into #@__guest(g_name,g_sex,g_address,g_phone,g_qq,g_birthday,g_card,g_group,g_people,g_dtime) values('$g_name','$g_sex','$g_address','$g_phone','$g_qq','$g_birthday','$g_card','$g_group','$g_people','$logindate')";
$message="添加會員".$g_name."成功";
$asql=New Dedesql(false);
$asql->ExecuteNoneQuery($addsql);
$asql->close();
WriteNote($message,$logindate,$loginip,$username);
showmsg('成功添加了會員','system_guest.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 $cfs_softname;?>會員管理</title>
</head>
<body>
<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> <a href="system_guest.php?action=new">添加會員</a> | <a href="system_guest.php">查看會員</a></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<?php if($action=='new'){ ?><form action="system_guest.php?action=save" method="post">
<table width="100%" cellspacing="0" cellpadding="0" border="0" id="table_border">
<tr>
<td id="row_style"> 會員姓名:</td>
<td>
<input type="text" name="g_name" size="10" id="need"></td>
</tr>
<tr>
<td id="row_style"> 性別:</td>
<td>
<input type="radio" name="g_sex" value="男" checked>男<input type="radio" name="g_sex" value="女">女</td>
</tr>
<tr>
<td id="row_style"> 聯系地址:</td>
<td>
<input type="text" name="g_address" size="25"></td>
</tr>
<tr>
<td id="row_style"> 聯系電話:</td>
<td>
<input type="text" name="g_phone" size="15"></td>
</tr>
<tr>
<td id="row_style"> 即時聯系(QQ):</td>
<td>
<input type="text" name="g_qq" size="15"></td>
</tr>
<tr>
<td id="row_style"> 生日:</td>
<td>
<input type="text" name="g_birthday" size="20"> (格式:2008-08-01)</td>
</tr>
<tr>
<td id="row_style"> 會員卡號:</td>
<td>
<input type="text" name="g_card" size="20"></td>
</tr>
<tr>
<td id="row_style"> 所在分組:</td>
<td>
<?php
getgroup();
?>
</td>
</tr>
<tr>
<td id="row_style"> 操作員:</td>
<td>
<input type="text" name="g_people" size="10" value="<?php echo str_replace($cfg_cookie_encode,'',$_COOKIE['VioomaUserID'])?>" readonly>
</td>
</tr>
<tr>
<td id="row_style"> 操作時間:</td>
<td>
<?php echo getDatetimeMk(time()); ?></td>
</tr>
<tr>
<td id="row_style"> </td>
<td> <input type="submit" name="submit" value=" 添加會員 "></td>
</tr>
</table></form>
<?php
}
else
{
echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" id=\"table_border\">";
$csql=New Dedesql(false);
$csql->SetQuery("select * from #@__guest");
$csql->Execute();
$rowcount=$csql->GetTotalRow();
if($rowcount==0)
echo "<tr><td> 沒有任何會員,請先<a href=system_guest.php?action=new>添加會員</a>。</td></tr>";
else{
echo "<tr class='row_color_head'><td>ID</td><td>姓名</td><td>性別</td><td>聯系地址</td><td>聯系電話</td><td>QQ/MSN</td><td>生日</td><td>會員卡號</td><td>分組</td><td>操作員</td><td>入會時間</td><td>操作</td></tr>";
while($row=$csql->GetArray()){
echo "<tr><td>".$row['id']."</td><td> ".$row['g_name']."</td><td>".$row['g_sex']."</td><td> ".$row['g_address']."</td><td> ".$row['g_phone']."</td><td>".$row['g_qq']."</td><td> ".$row['g_birthday']."</td><td> ".$row['g_card']."</td><td> ".getgroup($row['g_group'],'group')."</td><td>".$row['g_people']."</td><td>".$row['g_dtime']."</td><td><a href=guest_edit.php?id=".$row['id'].">改</a> | <a href=guest_del.php?id=".$row['id'].">刪</a></td></tr>";
}
}
echo "</table>";
$csql->close();
}
?>
</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 + -