📄 index.php
字号:
<?php
include_once( "inc/auth.php" );
include_once( "inc/utility_all.php" );
echo "\r\n<html>\r\n<head>\r\n<title>新建请假登记</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n";
echo "<S";
echo "CRIPT language=javascript src=\"/inc/calendar/calendar.js\"></SCRIPT>\r\n";
echo "<S";
echo "CRIPT language=javascript src=\"/inc/calendar/time.js\"></SCRIPT>\r\n";
echo "<S";
echo "CRIPT language=javascript src=\"/inc/common.js\"></SCRIPT>\r\n";
echo "<s";
echo "cript>\r\nfunction CheckForm()\r\n{\r\n\tvar leavetime_1 = document.getElementById('LEAVE_TIME').value;\r\n\tdocument.getElementById('LEAVE_DATE1a').value = leavetime_1+':00';\r\n\tvar leavetime_2 = document.getElementById('LEAVE_TIME1').value;\r\n\tdocument.getElementById('LEAVE_DATE2a').value = leavetime_2+':00';\r\n if(document.form1.LEAVE_TYPE.value==\"\")\r\n { alert(\"请假原因不能为空!\");\r\n return (false)";
echo ";\r\n }\r\n\r\n if(document.form1.LEAVE_DATE1.value==\"\")\r\n { alert(\"请假开始日期不能为空!\");\r\n return (false);\r\n }\r\n\r\n if(document.form1.LEAVE_DATE2.value==\"\")\r\n { alert(\"请假结束日期不能为空!\");\r\n return (false);\r\n }\r\n\tif(document.form1.LEADER_ID.value==\"\")\r\n {\r\n \t\talert(\"请选择审批人!\");\r\n\t\treturn (false);\r\n }\r\n return (true);\r\n}\r\n\r\nfunction td_calendar(fieldname)\r\n{\r\n";
echo " myleft=document.body.scrollLeft+event.clientX-event.offsetX-80;\r\n mytop=document.body.scrollTop+event.clientY-event.offsetY+140;\r\n window.showModalDialog(\"/inc/calendar.php?FIELDNAME=\"+fieldname,self,\"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:280px;dialogHeight:205px;dialogTop:\"+mytop+\"px;dialogLeft:\"+myleft+\"px\");\r\n}\r\nfunction td_clock(fieldname)\r\n{\r\n myleft=document.body.";
echo "scrollLeft+event.clientX-event.offsetX-80;\r\n mytop=document.body.scrollTop+event.clientY-event.offsetY+140;\r\n\r\n window.showModalDialog(\"/inc/clock1.php?FIELDNAME=\"+fieldname,self,\"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:280px;dialogHeight:120px;dialogTop:\"+mytop+\"px;dialogLeft:\"+myleft+\"px\");\r\n}\r\n</script>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\" onLoad=\"document.form1";
echo ".LEAVE_TYPE.focus();\">\r\n<form action=\"submit.php\" method=\"post\" name=\"form1\" class=\"big1\" onSubmit=\"return CheckForm();\">\r\n<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"0\">\r\n <tr class=\"tablehead1\"> \r\n <td ><img src=\"/images/menu/attendance.gif\" align=\"absmiddle\">新建请假登记\r\n </td>\r\n </tr>\r\n <tr class=\"TableLine2\"><td>\r\n <input type=\"image\" src=\"/images/button/newleave.gif\" borde";
echo "r=\"0\">\r\n <a href=\"#\" onClick=\"history.back()\"><img src=\"/images/button/return.gif\" border=\"0\"></a>\r\n </td>\r\n </tr>\r\n</table>\r\n<br>\r\n";
$CUR_DATE = date( "Y-m-d", time( ) );
$CUR_TIME = date( "H:i", time( ) );
echo "<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\">\r\n <tr>\r\n <td width=\"16%\" class=\"TableLine2\">请假事由</td>\r\n <td width=\"92%\" class=\"TableLine1\">\r\n\t<textarea name=\"LEAVE_TYPE\" cols=\"40\" rows=\"5\"></textarea>\r\n\t</td>\r\n </tr>\r\n <tr>\r\n <td class=\"TableLine2\">开始时间</td>\r\n <td class=\"TableLine1\">\r\n\t\t<input class='Wdate' type=\"text\" name=\"LEAVE_DATE1\" id=\"LEAVE_DATE1\" va";
echo "lue=\"";
echo $CUR_DATE;
echo "\" size=\"12\" maxlength=\"10\" onclick=\"popUpCalendar(document.form1,document.form1.LEAVE_DATE1,'yyyy-mm-dd')\"/>\r\n\r\n <input class=\"Wtime\" type=\"text\" name=\"LEAVE_TIME\" id=\"LEAVE_TIME\" value=\"";
echo $CUR_TIME;
echo "\" size=\"10\" maxlength=\"10\" \r\n\t\tonclick=\"new CallTime(null,null,0,0,null,null).show(this)\"/>\r\n\t\t<input type='hidden' name='LEAVE_DATE1a'>\r\n\t</td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td class=\"TableLine2\">\r\n\t 结束时间\r\n\t </td>\r\n\t <td class=\"TableLine1\">\r\n\t <input class='Wdate' type=\"text\" name=\"LEAVE_DATE2\" id=\"LEAVE_DATE2\" value=\"";
echo $CUR_DATE;
echo "\" size=\"12\" maxlength=\"10\" onclick=\"popUpCalendar(document.form1,document.form1.LEAVE_DATE2,'yyyy-mm-dd')\"/>\r\n\r\n <input class=\"Wtime\" type=\"text\" name=\"LEAVE_TIME1\" id=\"LEAVE_TIME1\" value=\"";
echo $CUR_TIME;
echo "\" size=\"10\" maxlength=\"10\" \r\n\t\tonclick=\"new CallTime(document.getElementById('LEAVE_TIME').value,null,1,0,document.getElementById('LEAVE_DATE1').value,document.getElementById('LEAVE_DATE2').value).show(this)\"/>\r\n\t <input type='hidden' name='LEAVE_DATE2a'>\r\n\t </td>\r\n </tr>\r\n <tr>\r\n <td class=\"TableLine2\">审批者</td>\r\n <td class=\"TableLine1\">";
echo "<s";
echo "elect name=\"LEADER_ID\" >\r\n ";
$connection = openconnection( );
$COUNT = 0;
$query = "select * from ATTEND_MANAGER where MANAGER_ID=1";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$MANAGER_ID = $ROW['MANAGER_ID'];
$MANAGERS = $ROW['MANAGERS'];
}
$query = "SELECT * from USER";
$cursor = exequery( $connection, $query );
while ( $ROW = mysql_fetch_array( $cursor ) )
{
$USER_ID = $ROW['USER_ID'];
$USER_NAME = $ROW['USER_NAME'];
if ( find_id( $MANAGERS, $USER_ID ) )
{
++$COUNT;
echo " <option value=\"";
echo $USER_ID;
echo "\">\r\n ";
echo $USER_NAME;
echo " </option>\r\n ";
}
}
if ( $COUNT == 0 )
{
$query = "SELECT * from USER_PRIV where USER_PRIV={$LOGIN_USER_PRIV}";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$PRIV_NO = $ROW['PRIV_NO'];
}
$query = "SELECT * from USER,USER_PRIV where USER.USER_PRIV=USER_PRIV.USER_PRIV and PRIV_NO< {$PRIV_NO} AND USER.DEPT_ID > '0' order by PRIV_NO,USER_NAME";
$cursor = exequery( $connection, $query );
while ( $ROW = mysql_fetch_array( $cursor ) )
{
$USER_ID = $ROW['USER_ID'];
$USER_NAME = $ROW['USER_NAME'];
echo " <option value=\"";
echo $USER_ID;
echo "\">\r\n ";
echo $USER_NAME;
echo " </option>\r\n ";
}
}
echo " </select><font color=\"#FF0000\" style=\"font-weight:bold\">*</font>【考勤设置】中设置的考勤人为此处的审批者.如果没有考勤人,登记者的上级可以作为审批者</td>\r\n </tr>\r\n\t";
if ( ifsendmbsms( ) )
{
echo "\t\r\n <tr id=\"mbremind\">\r\n <td nowrap class=\"TableLine2\">手机短信提醒:</td>\r\n <td class=\"TableLine1\"><input type=\"checkbox\" name=\"MOBILE_SMS_REMIND\" onClick=\"ShowMbSmsContent();\" value=\"1\"></td>\r\n </tr>\r\n <tr id=\"mbcontent\">\r\n <td nowrap class=\"TableLine2\">手机短信内容:</td>\r\n <td class=\"TableLine1\"><textarea cols=30 name=\"mobilect\" rows=3 class=\"BigInput\" wrap=\"on\" onpaste=\"return ";
echo "checkStrLength();\" onKeyUp=\"return checkStrLength();\">\r\n </textarea>\r\n <input type=\"button\" name=\"签名\" value=\"签名\" class=\"SmallButton\" onClick=\"getUserName();\"></td>\r\n </tr>\r\n\t";
}
echo " \r\n \r\n</table>\r\n</form>\r\n</body>\r\n</html>\r\n";
echo "<s";
echo "cript>\r\nvar strmax=60;\r\nvar smstype = \"请假申请\";\r\nfunction ShowMbSmsContent(){\r\n cc = document.getElementById('MOBILE_SMS_REMIND');\r\n ck = document.getElementById('mbcontent');\r\n if (cc.checked == true){\r\n ck.style.display = '';\r\n\t\tgetMbc();\r\n\t}\r\n\telse{\r\n\t ck.style.display = 'none';\r\n\t}\r\n}\r\n";
if ( ifsendmbsms( ) )
{
echo "document.getElementById('mbcontent').style.display = 'none';\r\n";
}
echo "\r\n\r\nfunction checkStrLength()\r\n{ \r\n mbc = document.getElementById('mobilect');\r\n\tif (mbc.value.length > strmax){\r\n\t mbc.value = mbc.value.substr(0,strmax);\r\n\t}\r\n \r\n}\r\n\r\nfunction getMbc(){\r\n suj = document.getElementById('LEAVE_TYPE');\r\n\tmbc = document.getElementById('mobilect');\r\n mbc.value = smstype+\"-\"+suj.value\r\n\tif (mbc.value.length > strmax){\r\n\t mbc.value = mbc.value.subst";
echo "r(0,strmax);\r\n\t}\r\n}\r\n\r\nfunction getUserName()\r\n{\r\n mbc = document.getElementById('mobilect');\r\n mbc.value+=\" ";
echo $_SESSION['LOGIN_USER_NAME'];
echo "\";\r\n checkStrLength();\r\n mbc.focus();\r\n}\r\n\r\n</script>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -