各位大神帮我看看我的代码错在哪里?(人员离职列表)
本帖最后由 gqdm 于 2016-8-8 12:54 编辑以下是人员离职里列表的代码,2011版正常,但是升级到2016后就不能使用了。
<?php
//include_once( "inc/auth.inc.php" );
include_once( "inc/auth.php" );
include_once( "inc/check_type.php" );
include_once( "inc/utility_all.php" );
include_once( "inc/utility_org.php" );
echo "<html>\r\n<head>\r\n<title>离职人员</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<script src=\"/inc/js/module.js\"></script>\r\n</head>\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n";
if ( !$PAGE_SIZE )
{
$PAGE_SIZE = get_page_size( "SMS", 15 );
}
if ( !isset( $start ) )
{
$start = 0;
}
if ( !isset( $TOTAL_ITEMS ) )
{
$query = "SELECT count(hr_staff_info.USER_ID) FROM hr_staff_info,USER,hr_staff_leave where USER.USER_ID=hr_staff_info.USER_ID AND USER.USER_ID=hr_staff_leave.LEAVE_PERSON AND hr_staff_info.WORK_STATUS=02";
$cursor = exequery( $connection, $query );
$ROW = mysql_fetch_array( $cursor );
$TOTAL_ITEMS = $ROW;
}
$query = "SELECT hr_staff_info.USER_ID,USER.USER_NAME,hr_staff_info.STAFF_SEX,hr_staff_info.DEPT_ID,hr_staff_info.WORK_TYPE,hr_staff_info.PHOTO_NAME,hr_staff_leave.QUIT_REASON,hr_staff_leave.QUIT_TIME_FACT,hr_staff_leave.LEAVE_ID FROM hr_staff_info,USER,hr_staff_leave where USER.USER_ID=hr_staff_info.USER_ID AND USER.USER_ID=hr_staff_leave.LEAVE_PERSON AND USER.DEPT_ID=0 order by hr_staff_leave.QUIT_TIME_FACT desc".( " limit ".$start.",{$PAGE_SIZE}" );
$cursor = exequery( $connection, $query );
if ( 0 < $TOTAL_ITEMS )
{
echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" class=\"small\">\r\n<tr>\r\n <td class=\"Big\"><img src=\"/images/menu/hrms.gif\" HEIGHT=\"20\"><span class=\"big3\">离职人员</span><br />\r\n </td>\r\n <td class=\"small1\">共<span class=\"big4\"> ";
echo $TOTAL_ITEMS;
echo "</span> 条信息</td>\r\n <td align=\"center\" class=\"small1\">";
echo page_bar( $start, $TOTAL_ITEMS, $PAGE_SIZE );
echo "</td>\r\n</tr>\r\n</table>\r\n\r\n<table width=\"100%\" class=\"TableList\">\r\n<tr class=\"TableHeader\">\r\n\t<td nowrap align=\"center\">姓名</td>\r\n <td nowrap align=\"center\">性别</td>\r\n <td nowrap align=\"center\">原属部门</td>\r\n <td nowrap align=\"center\">工种</td>\r\n <td nowrap align=\"center\">离职原因</td>\r\n <td nowrap align=\"center\">实际离职时间</td>\r\n <td nowrap align=\"center\">照片</td>\r\n </tr>\r\n";
while ( $ROW = mysql_fetch_array( $cursor ) )
{
$USER_ID = $ROW['USER_ID'];
$USER_NAME = $ROW['USER_NAME'];
$DEPT_ID = $ROW['DEPT_ID'];
$WORK_TYPE = $ROW['WORK_TYPE'];
$REASON = $ROW['QUIT_REASON'];
$TIME_FACT = $ROW['QUIT_TIME_FACT'];
$LEAVE_ID = $ROW['LEAVE_ID'];
$PHOTO = $ROW['PHOTO_NAME'];
if ( $ROW['STAFF_SEX'] == 0 )
{
$SEX_DESC = "男";
}
if ( $ROW['STAFF_SEX'] == 1 )
{
$SEX_DESC = "女";
}
$DEPT_NAME = dept_long_name( $DEPT_ID );
if ( $DEPT_NAME == "" )
{
$DEPT_NAME = "未记录";
}
echo " <tr class=\"TableData\">\r\n <td align=\"center\">";
echo "<a href=\"/general/hr/manage/staff_leave/leave_detail.php?LEAVE_ID=";
echo $LEAVE_ID;
echo "\"target='_blank'>";
echo $USER_NAME;
echo "</a>\r\n ";
echo "</td>\r\n <td align=\"center\">";
echo $SEX_DESC;
echo "</td>\r\n <td>";
echo $DEPT_NAME;
echo "</td>\r\n <td align=\"center\">";
echo $WORK_TYPE;
echo "</td>\r\n <td align=\"center\">";
echo $REASON;
echo "</td>\r\n <td align=\"center\">";
echo $TIME_FACT;
echo "</td>\r\n <td align=\"center\">\r\n";
if ( $PHOTO == "" )
{
echo "<center>暂无照片</center>";
}
else
{
echo "<A border=0 href=\"javascript:open_pic('";
echo $PHOTO;
echo "');\"><img src='/inc/attach_old.php?ATTACHMENT_ID=hrms_pic&DIRECT_VIEW=1&ATTACHMENT_NAME=";
echo $PHOTO;
echo "' width='100' border=0></A>";
}
echo "</td>\r\n </tr>\r\n";
}
echo "</table>\r\n";
}
else
{
echo "<div align=\"center\">\r\n";
message( "", "无离职人员!" );
echo "\t\r\n</div>\t\r\n";
}
echo "</body>\r\n</html>\r\n";
?>
本帖最后由 cgft 于 2016-8-8 20:57 编辑
你这个貌似非授权的破译稿,读起来太累。
连接函数肯定错了。
$cursor = exequery( $connection, $query );应改为:
$cursor = exequery(TD::conn(), $query);
别的,没细看。
之前我们用在2011版上着,现在升级到了2016!非常感谢!谢谢 不过好像还是不行,您试过了? 本帖最后由 gqdm 于 2016-8-9 13:45 编辑
cgft 发表于 2016-8-8 20:44 static/image/common/back.gif
你这个貌似非授权的破译稿,读起来太累。
连接函数肯定错了。
应改为:
行了可以了,谢谢!
页:
[1]