?? job_message.php
字號:
<?
session_start();
include "middle.php";
require_once "../MessageBox.php";
$date = Date("Y-m-j H:i:s");
$Message = new MessageBox;
?>
<link href="../css/a1.css" rel="stylesheet" type="text/css">
<body leftmargin="0" topmargin="0">
<table width="789" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><img src="../images/home_12.jpg" width="789" height="12"></td>
</tr>
<tr>
<td width="776" valign="top">
<?php
if ( !empty($_SESSION["userid"]) ) {
include "../datasource.inc.php";
$page = $_REQUEST['page'];
$action = $_REQUEST['action'];
$id = $_REQUEST['id'];
$name = $_REQUEST['name'];
$sex = $_REQUEST['sex'];
$company = $_REQUEST['company'];
$post = $_REQUEST['post'];
$address = $_REQUEST['address'];
$code = $_REQUEST['code'];
$country = $_REQUEST['country'];
$phone1 = $_REQUEST['phone1'];
$phone2 = $_REQUEST['phone2'];
$phone3 = $_REQUEST['phone3'];
$phone4 = $_REQUEST['phone4'];
$email = $_REQUEST['email'];
$http = $_REQUEST['http'];
$body = str_replace("\n", "<BR>", $_REQUEST['body']);
$date = Date("Y-m-j");
//$department = $_REQUEST['department'];
if ($action == 'add') {
$sql = "insert into job_message (id,userid,name,sex,company,post,address,code,country,phone1,phone2,phone3,phone4,email,http,body,date,department) values ('','$_SESSION[userid]','$name','$sex','$company','$post','$address','$code','$country','$phone1','$phone2','$phone3','$phone4','$email','$http','$body','$date','$_SESSION[department]');";
$result = mysql_query($sql);
$Message->setMessage("添加成功!","job_message.php");
$Message->showMessage();
}
if ($action == "update") {
$query ="update job_message set name='$name',sex='$sex',company='$company',post='$post',address='$address',code='$code',country='$country',phone1='$phone1',phone2='$phone2',phone3='$phone3',phone4='$phone4',email='$email',http='$http',body='$body' where id='$id';";
$result =mysql_query($query);
$Message->setMessage("修改成功!","job_message.php");
$Message->showMessage();
}
?>
<script language=javascript>
function check_input()
{
if (document.form.name.value=='') {
alert("請輸入姓名!");
return false;
}
return true;
}
</script>
<table width="700" border="0" cellspacing="0" cellpadding="0">
<tr>
<TD vAlign=top><FONT color=#565656> <IMG height=14
src="../images/closedfold.gif" width=14> 您當前的位置<BR> <IMG
height=15 src="../images/bar.gif" width=15> <IMG height=14
src="../images/openfold.gif" width=14> 個人通訊錄</FONT></TD>
</tr>
</table>
<table border=0 cellpadding=0 cellspacing=0 width=766 align="right">
<tr><td width=766 bgcolor=#3494d4 height=1></td>
</tr>
</table><br>
<center>
<?php
// if ($_SESSION['userjs'] == "1" ) {
?>
<table width="776" border="0" cellspacing="0" cellpadding="0">
<tr>
<TD Align="right"><a href="job_message.php?page=add">新增聯系人</a> <a href="job_message.php?page=select">瀏覽全部</a></TD>
</tr>
</table>
<?php
//}
switch ($page){
case "add":
?>
<!--<p align="center"> <b><font size="3">新增聯系人名片電話</font></b></p>-->
<form action="job_message.php" method=post name=form onsubmit="return check_input()">
<table width=776 border=0 cellspacing=0 cellpadding=0 >
<tr><td width=10 bgcolor=#ffffff> </td>
<td><table width="766" border="0" cellspacing="1" cellpadding="0" bgcolor=#3494d4>
<tr>
<td width="150" height="24" align="center" bgColor=#ffffff>姓 名:</td>
<td width="233" bgColor=#ffffff> <input type="text" size="25" name="name" maxlength="12"></td>
<td width="150" bgColor=#ffffff align="center">性 別:</td>
<td width="233" bgColor=#ffffff>
<input type="radio" name="sex" value="男" checked>男
<input type="radio" name="sex" value="女" >女
</td>
</tr>
<tr>
<td width="150" height="24" bgColor=#ffffff align="center">公 司:</td>
<td width="233" bgColor=#ffffff> <input type="text" size="25" name="company" maxlength="40"></td>
<td width="150" bgColor=#ffffff align="center">職 稱:</td>
<td width="233" bgColor=#ffffff> <input type="text" size="25" name="post" maxlength="20"></td>
</tr>
<tr>
<td height="24" bgColor=#ffffff align="center">地 址:</td>
<td colspan="3" bgColor=#ffffff> <input type="text" size="30" name="address" maxlength="80"></td>
</tr>
<tr>
<td height="24" bgColor=#ffffff align="center">郵編區號:</td>
<td bgColor=#ffffff> <input type="text" size="25" name="code" maxlength="6"></td>
<td bgColor=#ffffff align="center">國 家:</td>
<td bgColor=#ffffff> <input type="text" size="25" name="country" maxlength="30"></td>
</tr>
<tr>
<td height="24" bgColor=#ffffff align="center">公司電話:</td>
<td bgColor=#ffffff> <input type="text" size="25" name="phone1" maxlength="16"></td>
<td bgColor=#ffffff align="center">傳 真:</td>
<td bgColor=#ffffff> <input type="text" size="25" name="phone2" maxlength="16"></td>
</tr>
<tr>
<td height="24" bgColor=#ffffff align="center">家中電話:</td>
<td bgColor=#ffffff> <input type="text" size="25" name="phone3" maxlength="16"></td>
<td bgColor=#ffffff align="center">行動電話:</td>
<td bgColor=#ffffff> <input type="text" size="25" name="phone4" maxlength="16"></td>
</tr>
<tr>
<td height="24" bgColor=#ffffff align="center">電 郵:</td>
<td bgColor=#ffffff> <input type="text" size="20" name="email" maxlength="40"></td>
<td bgColor=#ffffff align="center">網 址:</td>
<td bgColor=#ffffff> <input type="text" size="20" name="http" maxlength="40"></td>
</tr>
<tr>
<td align="center" bgColor=#ffffff>備 注:</td>
<td colspan="3" bgColor=#ffffff> <textarea name="body" cols="65" rows="6"></textarea></td>
</tr>
</table></td></table>
<br>
<input type="hidden" value="$_SESSION[department]" name="department">
<input type="hidden" value="add" name="action">
<input type="submit" name="submit" value=" 確 定 "> <input type="reset" name="submit1" value=" 重 置 ">
</form>
<?php
break;
case "delete":
$query = "delete from job_message where id='$id' and userid='$_SESSION[userid]';";
mysql_query($query);
$Message->setMessage("刪除成功!","job_message.php");
$Message->showMessage();
break;
case "update":
$sql = "select * from job_message where id='$id';";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$body = str_replace("<BR>", "\n", $row['body']);
?>
<form action="job_message.php" method=post name=form onsubmit="return check_input()">
<table border=0 cellpadding=0 cellspacing=0 width=776>
<tr><td width=10 bgcolor=#ffffff> </td>
<td><table width="766" border="0" cellspacing="1" cellpadding="0" bgcolor=#3494d4>
<tr>
<td width="150" height="24" bgColor=#ffffff align="center">姓 名:</td>
<td width="233" bgColor=#ffffff> <?php echo "<input type=text size=25 name=name maxlength=12 value=\"$row[name]\">";?></td>
<td width="150" bgColor=#ffffff align="center">性 別:</td>
<td width="233" bgColor=#ffffff>
<?php
if ($row['sex']=="男"){
echo "<input type=radio name=sex value=男 checked>男 ";
echo "<input type=radio name=sex value=女>女";
}else{
echo "<input type=radio name=sex value=男>男 ";
echo "<input type=radio name=sex value=女 checked>女";
}
?>
</td>
</tr>
<tr>
<td width="150" height="24" bgColor=#ffffff align="center">公 司:</td>
<td width="233" bgColor=#ffffff> <?php echo "<input type=text size=25 name=company maxlength=40 value=\"$row[company]\">";?></td>
<td width="150" bgColor=#ffffff align="center">職 稱:</td>
<td width="233" bgColor=#ffffff> <?php echo "<input type=text size=25 name=post maxlength=20 value=\"$row[post]\">";?></td>
</tr>
<tr>
<td height="24" bgColor=#ffffff align="center">地 址:</td>
<td colspan="3" bgColor=#ffffff> <?php echo "<input type=text size=30 name=address maxlength=80 value=\"$row[address]\">";?></td>
</tr>
<tr>
<td height="24" bgColor=#ffffff align="center">郵編區號:</td>
<td bgColor=#ffffff> <?php echo "<input type=text size=25 name=code maxlength=6 value=\"$row[code]\">";?></td>
<td bgColor=#ffffff align="center">國 家:</td>
<td bgColor=#ffffff> <?php echo "<input type=text size=25 name=country maxlength=30 value=\"$row[country]\">";?></td>
</tr>
<tr>
<td height="24" bgColor=#ffffff align="center">公司電話:</td>
<td bgColor=#ffffff> <?php echo "<input type=text size=25 name=phone1 maxlength=16 value=\"$row[phone1]\">";?></td>
<td bgColor=#ffffff align="center">傳 真:</td>
<td bgColor=#ffffff> <?php echo "<input type=text size=25 name=phone2 maxlength=16 value=\"$row[phone2]\">";?></td>
</tr>
<tr>
<td height="24" bgColor=#ffffff align="center">家中電話:</td>
<td bgColor=#ffffff> <?php echo "<input type=text size=25 name=phone3 maxlength=16 value=\"$row[phone3]\">";?></td>
<td bgColor=#ffffff align="center">行動電話:</td>
<td bgColor=#ffffff> <?php echo "<input type=text size=25 name=phone4 maxlength=16 value=\"$row[phone4]\">";?></td>
</tr>
<tr>
<td height="24" bgColor=#ffffff align="center">電 郵:</td>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -