submit.php

来自「极限网络智能办公系统—MYOA26—100%—源程序。」· PHP 代码 · 共 48 行

PHP
48
字号
<?php

include_once( "inc/auth.php" );
include_once( "inc/utility_all.php" );
include_once( "inc/utility_sms1.php" );
include_once( "ikernel/utility.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</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n";
if ( $LEAVE_DATE1 != "" )
{
	$TIME_OK = is_date_time( $LEAVE_DATE1 );
	if ( !$TIME_OK )
	{
		message( "错误", "请假开始日期格式不对,应形如 1999-1-2 09:26:33" );
		button_back( );
		exit( );
	}
}
if ( $LEAVE_DATE2 != "" )
{
	$TIME_OK = is_date_time( $LEAVE_DATE2 );
	if ( !$TIME_OK )
	{
		message( "错误", "请假结束日期格式不对,应形如 1999-1-2 09:26:33" );
		button_back( );
		exit( );
	}
}
if ( 0 <= compare_date_time( $LEAVE_DATE1, $LEAVE_DATE2 ) )
{
	message( "错误", "请假开始日期不能晚于请假结束日期" );
	button_back( );
	exit( );
}
$connection = openconnection( );
$query = "insert into ATTEND_LEAVE(USER_ID,LEADER_ID,LEAVE_TYPE,LEAVE_DATE1,LEAVE_DATE2,STATUS,ALLOW) values ('{$LOGIN_USER_ID}','{$LEADER_ID}','{$LEAVE_TYPE}','{$LEAVE_DATE1}','{$LEAVE_DATE2}','1','0')";
exequery( $connection, $query );
$query = "SELECT * from USER where USER_ID='{$LOGIN_USER_ID}'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
	$USER_NAME = $ROW['USER_NAME'];
}
$SMS_CONTENT = $USER_NAME."提交请假申请,请批示!";
send_sms( $connection, $LOGIN_USER_ID, $LEADER_ID, 6, $SMS_CONTENT );
header( "location: ../" );
echo "\r\n</body>\r\n</html>\r\n";
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?