📄 addadress.php
字号:
<?
include_once('session.php');
include_once('function.php');
include_once('config.php');
if (islogin($_SESSION['username'],$_SESSION['userpass']))
$accept=true;
else {
$accept=false;
exit;
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加程序</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#F3F7FC" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<?
include_once('addclass.php');
$time=time();
$ftime=date("Y-m-d g:i",$time);
$worker_login_name=$_SESSION['username'];
$addname=$_POST['addname'];
$addarea=$_POST['addarea'];
$addmod=$_POST['add_mod'];
$addemail=$_POST['addemail'];
$add=new addclass($dbname);
//$errormeg=$_POST['mod_add'].$addmod;
if ($addname==""&&$addmod&&$accept)
{
$area_value=$_POST['addemail'];
$errormeg="<font color=red >错误 </font>: 姓名不能为空";
}
elseif (isadded($addname,$worker_login_name))
$errormeg="<font color=red>错误 </font> : 此联系人已经存在,可将删除后添加";
elseif (isworker($addname)=="非内部人员")
$errormeg="<font color=red>错误 </font> : 非内部人员";
elseif ($addmod&&$accept&&$addname!="")
{
$flag=$add->addsql("address_list","'$worker_login_name','$addname','$addname','$addemail','$addarea'");
if ($flag)
{
$errormeg="<font color=red>添加成功</font> 可以关闭窗口,或继续添加";
box("添加成功","联系人 $addname 添加成功","addadress.php");
}
else $errormeg="no";
}
elseif(!$accept)
$errormeg="<font color=red> 错误</font> : 没有登陆";
?>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="16" valign="top"><table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="4%"><img src="images/tleft.jpg" width="50" height="18"></td>
<td width="91%" background="images/dmid.jpg"> </td>
<td width="5%"><img src="images/tright.jpg" width="50" height="18"></td>
</tr>
</table>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F3F7FC">
<tr>
<td height="22" valign="top" class="tian4"><div align="center">
<table width="350" border="0" align="left" cellpadding="0" cellspacing="0" >
<tr>
<td width="429" height="40" valign="top"> <form name="form2" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_kuang">
<tr>
<td class="tianchong"> 动作 -> 操作联系人(<font color="#FF0000">*为必填)</font></td>
</tr>
<tr>
<td class="tianchong"><div align="right">
<input name="mod_add" type="hidden" id="mod_add" value="search">
模糊查找已知联系人(可以是添加的也可以是将要删除的)
<input name="key" type="text" id="key" size="15" class="form_format" onMouseOver ="this.style.backgroundColor='#879BD8'" onMouseOut ="this.style.backgroundColor='#f3f3f3'">
<input type="submit" name="Submit4" value="查找" class="buton" onMouseOver ="this.style.backgroundColor='#879BD8'" onMouseOut ="this.style.backgroundColor='#f3f7f3' ">
</div></td>
</tr>
<tr>
<td class="tianchong">
<?
if ($_POST['mod_add']=="search")
find($_POST['key']);
?>
</td>
</tr>
</table>
</form>
<form action="addadress.php" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_kuang">
<tr>
<td class="tian4">
<?
if ($_POST['mod_add']=="del"&&$_POST['del_key']!="no")
dellist($_POST['del_key'],$_SESSION['username']);
?>
<div align="right"> </div></td>
</tr>
<tr>
<td class="tian4"><div align="right">删除联系人
<input name="mod_add" type="hidden" id="mod_add" value="del">
<select name="del_key" id="del_key">
<option value="no" selected>联系人列表</option>
<? createlist($_SESSION['username']); ?>
</select>
<input type="submit" name="Submit5" value="删除" class="buton" onMouseOver ="this.style.backgroundColor='#879BD8'" onMouseOut ="this.style.backgroundColor='#f3f7f3' ">
</div></td>
</tr>
</table>
</form>
<form name="form1" method="post" action="addadress.php">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_kuang">
<tr>
<td class="tianchong"> <div align="left"><font class="size10"><? if ($_POST['add_mod']) echo $errormeg; ?></font>
</div></td>
</tr>
<tr>
<td class="tianchong">添加联系人 </td>
</tr>
<tr>
<td class="tianchong"><input name="addname" type="text" class="form_format" id="addname"
onMouseOver ="this.style.backgroundColor='#879BD8'" onMouseOut ="this.style.backgroundColor='#f3f3f3'" value="<? echo $name_value; ?>" size="20" >
<font color="#FF0000">*登陆名 </font></td>
</tr>
<tr>
<td class="tianchong"> <input name="addemail" type="text" id="addemail" size="20" class="form_format" onMouseOver ="this.style.backgroundColor='#879BD8'" onMouseOut ="this.style.backgroundColor='#f3f3f3'">
email</td>
</tr>
<tr>
<td class="tianchong">其他联系方法:</td>
</tr>
<tr>
<td class="tianchong"><div align="center">
<textarea name="addarea" cols="40" rows="5" class="form_format" id="addarea"
onMouseOver ="this.style.backgroundColor='#FFFFFF'" onMouseOut ="this.style.backgroundColor='#F3F7FC'" ><? echo $area_value; ?></textarea>
</div></td>
</tr>
<tr>
<td class="tianchong"> <div align="left">
<input name="add_mod" type="hidden" id="add_mod2" value="true">
</div></td>
</tr>
<tr>
<td class="tianchong"><div align="center">
<input name="Submit" type="submit" value="添加" class="buton" onMouseOver ="this.style.backgroundColor='#879BD8'" onMouseOut ="this.style.backgroundColor='#f3f7f3' ">
<input type="reset" name="Submit2" value="重置" class="buton" onMouseOver ="this.style.backgroundColor='#879BD8'" onMouseOut ="this.style.backgroundColor='#f3f7f3'">
</div></td>
</tr>
<tr>
<td class="tianchong"><div align="center">
<input type="button" name="Submit3" value="关闭窗口" onClick="window.close(); return false;" class="buton" onMouseOver ="this.style.backgroundColor='#879BD8'" onMouseOut ="this.style.backgroundColor='#f3f7f3'">
</div></td>
</tr>
</table>
</form></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="10">
<tr>
<td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td class="tian4">查看已存在联系人的详细信息</td>
</tr>
<tr>
<td class="tian4"> <form name="form3" method="post" action="">
<select name="list_key" id="list_key">
<option value="no" selected>联系人列表</option>
<? createlist($_SESSION['username']); ?>
</select>
<input type="submit" name="Submit6" value="查看" class="buton" onMouseOver ="this.style.backgroundColor='#879BD8'" onMouseOut ="this.style.backgroundColor='#f3f7f3'">
<input name="mod_add2" type="hidden" id="mod_add2" value="listadded">
</form></td>
</tr>
<tr>
<td class="tian4">
<? if ($_POST['mod_add']=="listadded")
echo "结果";
listadded($_SESSION['username'],$_POST['list_key']); ?>
<div align="left"></div></td>
</tr>
</table></td>
</tr>
</table>
<p> </p>
</div></td>
</tr>
<tr>
<td height="23" valign="top" class="tian4"><div align="center"> </div></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -