📄 left.php
字号:
<?php
include_once( "inc/global.inc" );
include_once( $GLOBALEL['root_lib']."Template.inc" );
include_once( $GLOBALEL['root_lib']."SymsDb.inc" );
include_once( "inc/common.inc" );
include_once( "inc/auth.php" );
require_once( "include/index.inc" );
$term = true;
$msg = "";
while ( $term )
{
if ( !isset( $edb ) || !is_object( $edb ) )
{
$edb = "";
if ( !com_opendb( $edb, $GLOBALEL['db_debug'] ) )
{
$term = false;
$error = "8600900000000001";
break;
}
}
if ( !isset( $_REQUEST['step'] ) )
{
$step = 1;
}
else
{
$step = $_REQUEST['step'];
}
if ( $step == 1 )
{
$result = array( );
$parr = array( );
if ( $_REQUEST['type'] == 1 )
{
$parr['board_id'] = $_REQUEST['id'];
$parr['user_id'] = $_SESSION['LOGIN_USER_ID'];
if ( $_REQUEST['order'] == "" )
{
$parr['order'] = "DESC";
}
else
{
$parr['order'] = $_REQUEST['order'];
}
if ( $_REQUEST['ordertype'] == "" )
{
$parr['ordertype'] = "ID";
}
else
{
$parr['ordertype'] = $_REQUEST['ordertype'];
}
if ( !( $result = dml_btopiclist( $edb, $nd, $einfo, $parr ) ) && $nd === false )
{
$msg = $einfo;
break;
}
$a_result = array( );
if ( !( $a_result = dml_atopicinfo( $edb, $nd, $einfo, $parr ) ) && $nd === false )
{
$msg = $einfo;
$term = false;
break;
}
$res_atten = count( $a_result );
}
else
{
$parr['user_id'] = $_SESSION['LOGIN_USER_ID'];
if ( $_REQUEST['order'] == "" )
{
$parr['order'] = "DESC";
}
else
{
$parr['order'] = $_REQUEST['order'];
}
if ( $_REQUEST['ordertype'] == "" )
{
$parr['ordertype'] = "ID";
}
else
{
$parr['ordertype'] = $_REQUEST['ordertype'];
}
if ( !( $result = dml_topicinfo( $edb, $nd, $einfo, $parr ) ) && $nd === false )
{
$term = false;
$msg = $einfo;
break;
}
}
$res_cnt = count( $result );
}
if ( !( $step == 2 ) )
{
break;
}
$parr['title'] = com_str4db( $_REQUEST['title'] );
$parr['creator'] = com_str4db( $_REQUEST['creator'] );
$parr['member'] = com_str4db( $_REQUEST['member'] );
$parr['START_DATE'] = com_str4db( $_REQUEST['START_DATE'] );
$parr['END_DATE'] = com_str4db( $_REQUEST['END_DATE'] );
$parr['ESTART_DATE'] = com_str4db( $_REQUEST['ESTART_DATE'] );
$parr['EEND_DATE'] = com_str4db( $_REQUEST['EEND_DATE'] );
$parr['user_id'] = $_SESSION['LOGIN_USER_ID'];
$parr['board_id'] = $_REQUEST['board'];
$parr['state'] = $_REQUEST['state'];
if ( $parr['board_id'] == 0 )
{
if ( !( $res = dml_boardinfo( $edb, $nd, $einfo, $parr ) ) && $nd === false )
{
$term = false;
$msg = $einfo;
break;
}
}
else if ( ( $res = dml_sboardinfo( $edb, $nd, $einfo, $parr ) ) && $nd === false )
{
$term = false;
$msg = $einfo;
break;
}
$i = 0;
for ( ; $i < count( $res ); ++$i )
{
$manager[$i] = $res[$i]['MANAGER'];
$member[$i] = $res[$i]['MEMBER'];
}
if ( find_id( implode( ",", $manager ), $_SESSION['LOGIN_USER_ID'] ) )
{
$mag_flag = 1;
}
if ( $mag_flag == 1 )
{
if ( !( $result = dml_searchtopicinfo( $edb, $nd, $einfo, $parr ) ) && $nd === false )
{
$term = false;
$msg = $einfo;
break;
}
}
else
{
$parr['userid'] = $_SESSION['LOGIN_USER_ID'];
if ( !( $result = dml_tsearchtopicinfo( $edb, $nd, $einfo, $parr ) ) && $nd === false )
{
$term = false;
$msg = $einfo;
break;
}
}
$res_cnt = count( $result );
$a_result = array( );
if ( !( $a_result = dml_atopicinfo( $edb, $nd, $einfo, $parr ) ) && $nd === false )
{
$msg = $einfo;
$term = false;
break;
}
$res_atten = count( $a_result );
break;
}
if ( isset( $edb ) && is_object( $edb ) )
{
@com_closedb( $edb, $term );
}
$fa = array( );
$fa['fh'] = "base.html";
$t = new template( $GLOBALEL['root_tpl'] );
while ( $term )
{
if ( $step == 1 )
{
if ( $_REQUEST['type'] == 1 )
{
$fa['fh_main'] = "cooperation/left.htm";
if ( $_REQUEST['order'] == "" )
{
if ( $result[0]['ID'] != "" )
{
$fa['fh_table'] = "cooperation/table/topiclist_table.htm";
}
else
{
$fa['fh_table'] = "cooperation/table/topiclist_table_error.htm";
}
}
else
{
$fa['fh_table'] = "cooperation/table/topiclist_table_1.htm";
}
if ( 1 <= $res_atten && $a_result[0]['TITLE'] != "" )
{
$fa['fh_attention'] = "cooperation/table/topiclist_attention.htm";
}
}
else
{
$fa['fh_main'] = "cooperation/left.htm";
if ( $_REQUEST['order'] == "" )
{
if ( $result[0]['ID'] != "" )
{
$fa['fh_table'] = "cooperation/table/topiclist_table.htm";
}
else
{
$fa['fh_table'] = "cooperation/table/topiclist_table_error.htm";
}
}
else
{
$fa['fh_table'] = "cooperation/table/topiclist_table_1.htm";
}
}
$t->set_file( $fa );
if ( $_REQUEST['ordertype'] == "TITLE" )
{
if ( $_REQUEST['order'] == "ASC" )
{
$t->set_var( "VAR_TIMG", "<img id=\"TITLEIMG\" src='/images/arrow_up.gif' border=\"0\">" );
}
else
{
$t->set_var( "VAR_TIMG", "<img id=\"TITLEIMG\" src='/images/arrow_down.gif' border=\"0\">" );
}
}
if ( $_REQUEST['ordertype'] == "CREATOR" )
{
if ( $_REQUEST['order'] == "ASC" )
{
$t->set_var( "VAR_CIMG", "<img id=\"CREATORIMG\" src='/images/arrow_up.gif' border=\"0\">" );
}
else
{
$t->set_var( "VAR_CIMG", "<img id=\"CREATORIMG\" src='/images/arrow_down.gif' border=\"0\">" );
}
}
if ( $_REQUEST['ordertype'] == "CREATE_DATE" )
{
if ( $_REQUEST['order'] == "ASC" )
{
$t->set_var( "VAR_CDIMG", "<img id=\"CREATE_DATEIMG\" src='/images/arrow_up.gif' border=\"0\">" );
}
else
{
$t->set_var( "VAR_CDIMG", "<img id=\"CREATE_DATEIMG\" src='/images/arrow_down.gif' border=\"0\">" );
}
}
$t->set_var( "VAR_BOARD", $_REQUEST['id'] );
$t->set_var( "VAR_TYPE", $_REQUEST['type'] );
$t->set_block( "fh_table", "topiclist_block", "topiclist_blk" );
$i = 0;
for ( ; $i < $res_cnt; ++$i )
{
if ( $i % 2 == 1 )
{
$t->set_var( "VAR_TableLine", "TableLine2" );
}
else
{
$t->set_var( "VAR_TableLine", "TableLine1" );
}
$topic_date = date( "Y-m-d", strtotime( $result[$i]['END_DATE'] ) );
$now_date = date( "Y-m-d" );
if ( $topic_date == date( "Y-m-d", strtotime( "0000-00-00" ) ) )
{
if ( find_id( $result[$i]['ISNEW'], $_SESSION['LOGIN_USER_ID'] ) )
{
$t->set_var( "VAR_STATE", "<strong>" );
$t->set_var( "VAR_STATE1", "</strong>" );
}
else
{
$t->set_var( "VAR_STATE", "" );
}
}
else if ( $topic_date < $now_date )
{
$topic_date = "已过期";
$flag = 0;
$t->set_var( "VAR_STATE", "<img src='/images/email_open.gif' border='0' alt='已过期'>" );
}
else if ( find_id( $result[$i]['ISNEW'], $_SESSION['LOGIN_USER_ID'] ) )
{
$t->set_var( "VAR_STATE", "<strong>" );
$t->set_var( "VAR_STATE1", "</strong>" );
}
else
{
$t->set_var( "VAR_STATE", "" );
}
if ( $result[$i]['FLAGOR'] == "" )
{
$t->set_var( "VAR_TIMPORTENT", "notimportent" );
}
else
{
$j = 0;
for ( ; $j < count( $result[$i]['FLAGOR'] ); ++$j )
{
if ( find_id( $result[$i]['FLAGOR'], $_SESSION['LOGIN_USER_ID'] ) )
{
$t->set_var( "VAR_TIMPORTENT", "importent" );
}
else
{
$t->set_var( "VAR_TIMPORTENT", "notimportent" );
}
}
}
$t->set_var( "VAR_ID", $result[$i]['ID'] );
$t->set_var( "VAR_TITLE", $result[$i]['TITLE'] );
$t->set_var( "VAR_USERID", $_SESSION['LOGIN_USER_ID'] );
$t->set_var( "VAR_USER_NAME", $result[$i]['USER_NAME'] );
$t->set_var( "VAR_MSG", "暂无协作。" );
$t->set_var( "VAR_CREATE_DATE", date( "Y-m-d", strtotime( $result[$i]['CREATE_DATE'] ) ) );
$t->parse( "topiclist_blk", "topiclist_block", true );
}
$t->parse( "topiclist", "fh_table", true );
if ( 1 <= $res_atten && $a_result[0]['TITLE'] != "" )
{
$t->set_block( "fh_attention", "topiclistatten_block", "topiclistatten_blk" );
$i = 0;
for ( ; $i < $res_atten; ++$i )
{
if ( $i % 2 == 1 )
{
$t->set_var( "VAR_TableLine", "TableLine2" );
}
else
{
$t->set_var( "VAR_TableLine", "TableLine1" );
}
$topic_date = date( "Y-m-d", strtotime( $a_result[$i]['END_DATE'] ) );
$now_date = date( "Y-m-d" );
if ( $topic_date == date( "Y-m-d", strtotime( "0000-00-00" ) ) )
{
if ( find_id( $a_result[$i]['ISNEW'], $_SESSION['LOGIN_USER_ID'] ) )
{
$topic_date = "进行中";
$t->set_var( "VAR_ASTATE", "<strong>" );
$t->set_var( "VAR_ASTATE1", "</strong>" );
}
else
{
$t->set_var( "VAR_ASTATE", "" );
}
}
else if ( $topic_date < $now_date )
{
$topic_date = "已过期";
$flag = 0;
$t->set_var( "VAR_ASTATE", "<img src='/images/email_open.gif' border='0' alt='已过期'>" );
}
else if ( find_id( $a_result[$i]['ISNEW'], $_SESSION['LOGIN_USER_ID'] ) )
{
$t->set_var( "VAR_ASTATE", "<strong>" );
$t->set_var( "VAR_ASTATE1", "</strong>" );
}
else
{
$t->set_var( "VAR_ASTATE", "" );
}
$t->set_var( "VAR_AID", $a_result[$i]['ID'] );
$t->set_var( "VAR_ATITLE", $a_result[$i]['TITLE'] );
$t->set_var( "VAR_AUSER_NAME", $a_result[$i]['USER_NAME'] );
$t->set_var( "VAR_ACREATE_DATE", date( "Y-m-d", strtotime( $a_result[$i]['CREATE_DATE'] ) ) );
$t->parse( "topiclistatten_blk", "topiclistatten_block", true );
}
$t->parse( "topiclistattention", "fh_attention", true );
}
}
if ( !( $step == 2 ) )
{
break;
}
$fa['fh_main'] = "cooperation/left.htm";
if ( 1 <= $res_cnt && $result[0]['ID'] != "" )
{
$fa['fh_table'] = "cooperation/table/topiclist_table.htm";
}
else
{
$fa['fh_table'] = "cooperation/table/topiclist_table_error.htm";
}
$fa['fh_attention'] = "cooperation/table/topiclist_attention.htm";
$t->set_file( $fa );
$t->set_var( "VAR_BOARD", $_REQUEST['id'] );
if ( 1 <= $res_cnt && $result[0]['ID'] != "" )
{
$t->set_block( "fh_table", "topiclist_block", "topiclist_blk" );
$i = 0;
for ( ; $i < $res_cnt; ++$i )
{
if ( $i % 2 == 1 )
{
$t->set_var( "VAR_TableLine", "TableLine2" );
}
else
{
$t->set_var( "VAR_TableLine", "TableLine1" );
}
$topic_date = date( "Y-m-d", strtotime( $result[$i]['END_DATE'] ) );
$now_date = date( "Y-m-d" );
if ( $topic_date == date( "Y-m-d", strtotime( "0000-00-00" ) ) )
{
if ( find_id( $result[$i]['ISNEW'], $_SESSION['LOGIN_USER_ID'] ) )
{
$t->set_var( "VAR_STATE", "<strong>" );
$t->set_var( "VAR_STATE1", "</strong>" );
}
else
{
$t->set_var( "VAR_STATE", "" );
}
}
else if ( $topic_date < $now_date )
{
$topic_date = "已过期";
$flag = 0;
$t->set_var( "VAR_STATE", "<img src='/images/email_open.gif' border='0' alt='已过期'>" );
}
else if ( $result[$i]['TYPE'] == 0 )
{
$t->set_var( "VAR_STATE", "<strong>" );
$t->set_var( "VAR_STATE1", "</strong>" );
}
else
{
$t->set_var( "VAR_STATE", "" );
}
if ( $result[$i]['FLAGOR'] == "" )
{
$t->set_var( "VAR_TIMPORTENT", "notimportent" );
}
else
{
$j = 0;
for ( ; $j < count( $result[$i]['FLAGOR'] ); ++$j )
{
if ( find_id( $result[$i]['FLAGOR'], $_SESSION['LOGIN_USER_ID'] ) )
{
$t->set_var( "VAR_TIMPORTENT", "importent" );
}
else
{
$t->set_var( "VAR_TIMPORTENT", "notimportent" );
}
}
}
$t->set_var( "VAR_ID", $result[$i]['ID'] );
$t->set_var( "VAR_TITLE", $result[$i]['TITLE'] );
$t->set_var( "VAR_USERID", $_SESSION['LOGIN_USER_ID'] );
$t->set_var( "VAR_USER_NAME", $result[$i]['USER_NAME'] );
$t->set_var( "VAR_CREATE_DATE", date( "Y-m-d", strtotime( $result[$i]['CREATE_DATE'] ) ) );
$t->parse( "topiclist_blk", "topiclist_block", true );
}
}
else
{
$t->set_var( "VAR_MSG", "没有查询到协作主题,请重新输入查询条件" );
}
if ( 1 <= $res_atten && $a_result[0]['TITLE'] != "" )
{
$t->set_block( "fh_attention", "topiclistatten_block", "topiclistatten_blk" );
$i = 0;
for ( ; $i < $res_atten; ++$i )
{
if ( $parr['title'] != "" )
{
if ( !strstr( $a_result[$i]['TITLE'], $parr['title'] ) )
{
continue;
}
}
else if ( $parr['creator'] != "" )
{
if ( !strstr( $a_result[$i]['CREATOR'], $parr['creator'] ) )
{
continue;
}
}
else if ( $parr['START_DATE'] != "" && !strstr( $a_result[$i]['CREATE_DATE'], $parr['START_DATE'] ) )
{
continue;
}
if ( $i % 2 == 1 )
{
$t->set_var( "VAR_TableLine", "TableLine2" );
}
else
{
$t->set_var( "VAR_TableLine", "TableLine1" );
}
$topic_date = date( "Y-m-d", strtotime( $a_result[$i]['END_DATE'] ) );
$now_date = date( "Y-m-d" );
if ( $topic_date == date( "Y-m-d", strtotime( "0000-00-00" ) ) )
{
if ( find_id( $a_result[$i]['ISNEW'], $_SESSION['LOGIN_USER_ID'] ) )
{
$topic_date = "进行中";
$t->set_var( "VAR_ASTATE", "<strong>" );
$t->set_var( "VAR_ASTATE1", "</strong>" );
}
else
{
$t->set_var( "VAR_ASTATE", "" );
}
}
else if ( $topic_date < $now_date )
{
$topic_date = "已过期";
$flag = 0;
$t->set_var( "VAR_ASTATE", "<img src='/images/email_open.gif' border='0' alt='已过期'>" );
}
else if ( find_id( $a_result[$i]['ISNEW'], $_SESSION['LOGIN_USER_ID'] ) )
{
$t->set_var( "VAR_ASTATE", "<strong>" );
$t->set_var( "VAR_ASTATE1", "</strong>" );
}
else
{
$t->set_var( "VAR_ASTATE", "" );
}
$t->set_var( "VAR_AID", $a_result[$i]['ID'] );
$t->set_var( "VAR_ATITLE", $a_result[$i]['TITLE'] );
$t->set_var( "VAR_AUSER_NAME", $a_result[$i]['USER_NAME'] );
$t->set_var( "VAR_ACREATE_DATE", date( "Y-m-d", strtotime( $a_result[$i]['CREATE_DATE'] ) ) );
$t->parse( "topiclistatten_blk", "topiclistatten_block", true );
}
$t->parse( "topiclistattention", "fh_attention", true );
}
$t->parse( "topiclist", "fh_table", true );
break;
}
if ( !$term )
{
$fa['fh_error'] = "error.html";
$t->set_file( $fa );
$t->set_var( "BODY_MAIN", "" );
$t->set_var( "VAR_ERROR_MSG", com_addappendixhref( $msg ) );
$t->parse( "BODY_ERROR", "fh_error" );
}
else
{
$t->set_var( "BODY_ERROR", "" );
$t->parse( "BODY_MAIN", "fh_main" );
}
$t->parse( "final_output", "fh" );
$t->p( "final_output" );
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -