<?php
!defined('IN_TOA') && exit('Access Denied!');
//获取工作流数据
function home_workclass($num){
global $db,$_USER;
echo '<div id="module_'.$num.'" class="module listColor">';
echo '<div class="head">';
echo '<h4 id="module_'.$num.'_head" class="module_0169c2 color_style_0 moduleHeader">';
echo '<a href="javascript:_resize('.$num.');" class="expand expand_arrow" id="img_resize_'.$num.'" title="折叠"></a><span id="module_'.$num.'_text" class="text" onclick="_resize('.$num.');">工作流审批</span>';
echo '</h4>';
echo '</div>';
echo '<div id="module_'.$num.'_body" class="module_body">';
echo '<div id="module_'.$num.'_ul" class="module_div">';
$query = $db->query("SELECT a.* FROM ".DB_TABLEPRE."workclass a,".DB_TABLEPRE."workclass_personnel b WHERE a.id=b.workid and (b.pertype=0 or b.pertype=4) and b.name like '%".get_realname($_USER->id)."%' and a.type!=1 order by b.perid asc");
while ($row = $db->fetch_array($query)) {
echo '<ul>';
echo '<li>【';
echo public_value('typename','workclass_type','tid='.$row['typeid']);
echo '】【';
echo public_value('title','workclass_template','tplid='.$row['tplid']);
echo '】 <a href="admin.php?ac=list&do=view&fileurl=workclass&workid='.$row['id'].'" target="_blank">'.$row['title'].'</a> <a href="admin.php?ac=list&do=personnel&fileurl=workclass&workid='.$row['id'].'"><font color=red>审批>></font></a></li>';
echo '</ul>';
}
echo '</div>';
echo '</div>';
echo '</div>';
}
//公告
function home_news_34($num){
global $db,$_USER;
echo '<div id="module_'.$num.'" class="module listColor">';
echo '<div class="head">';
echo '<h4 id="module_'.$num.'_head" class="module_032034 color_style_0 moduleHeader">';
echo '<a href="javascript:_resize('.$num.');" class="expand expand_arrow" ';
echo ' id="img_resize_'.$num.'" title="折叠"></a>';
echo '<span id="module_'.$num.'_text" class="text" onclick="_resize('.$num.');">公告通知</span>';
echo '</h4>';
echo '</div>';
echo '<div id="module_'.$num.'_body" class="module_body">';
echo '<div id="module_'.$num.'_ul" class="module_div">';
$query = $db->query("SELECT * FROM ".DB_TABLEPRE."news WHERE (receive like'%".get_realname($_USER->id)."%' or receive='0' or uid='".$_USER->id."') and (type ='3' or type ='4') ORDER BY id desc LIMIT 0,8");
while ($row = $db->fetch_array($query)) {
echo '<ul>';
echo '<li>【';
if($row['type']==3){
echo '公告';
}else{
echo '通知';
}
echo '】<a href="admin.php?ac=news&fileurl=workbench&do=views&id='.$row['id'].'&type=';
echo $row['type'].'" target="_blank">'.$row['subject'].'</a></li>';
echo '</ul>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
}
//新闻
function home_news_1($num){
global $db,$_USER;
echo '<div id="module_'.$num.'" class="module listColor">';
echo '<div class="head">';
echo '<h4 id="module_'.$num.'_head" class="module_f3660a color_style_0 moduleHeader">';
echo '<a href="javascript:_resize('.$num.');" class="expand expand_arrow" id="img_resize_'.$num.'" title="折叠"></a>';
echo '<span id="module_'.$num.'_text" class="text" onclick="_resize('.$num.');">新闻</span>';
echo '</h4>';
echo '</div>';
echo '<div id="module_'.$num.'_body" class="module_body">';
echo '<div id="module_'.$num.'_ul" class="module_div">';
$query = $db->query("SELECT * FROM ".DB_TABLEPRE."news WHERE type =1 AND (receive like'%".get_realname($_USER->id)."%' or receive='0') ORDER BY id desc LIMIT 8");
while ($row = $db->fetch_array($query)) {
echo '<ul>';
echo '<li><a href="admin.php?ac=news&fileurl=workbench&do=views&id='.$row['id'].'&type=';
echo $row['type'].'" target="_blank">'.$row['subject'].'</a></li>';
echo '</ul>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
}
//电子期刊
function home_news_6($num){
global $db,$_USER;
echo '<div id="module_'.$num.'" class="module listColor">';
echo '<div class="head">';
echo '<h4 id="module_'.$num.'_head" class="module_ed0282 color_style_0 moduleHeader">';
echo '<a href="javascript:_resize('.$num.');" class="expand expand_arrow" id="img_resize_'.$num.'" title="折叠"></a>';
echo '<span id="module_'.$num.'_text" class="text" onclick="_resize('.$num.');">电子期刊</span>';
echo '</h4>';
echo '</div>';
echo '<div id="module_'.$num.'_body" class="module_body">';
echo '<div id="module_'.$num.'_ul" class="module_div">';
$query = $db->query("SELECT * FROM ".DB_TABLEPRE."news WHERE type =6 AND (receive like'%".get_realname($_USER->id)."%' or receive='0') ORDER BY id desc LIMIT 8");
while ($row = $db->fetch_array($query)) {
echo '<ul>';
echo '<li><a href="admin.php?ac=news&fileurl=workbench&do=views&id='.$row['id'].'&type=';
echo $row['type'].'" target="_blank">'.$row['subject'].'</a></li>';
echo '</ul>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
}
//大事记
function home_news_5($num){
global $db,$_USER;
echo '<div id="module_'.$num.'" class="module listColor">';
echo '<div class="head">';
echo '<h4 id="module_'.$num.'_head" class="module_57c4ff color_style_0 moduleHeader">';
echo '<a href="javascript:_resize('.$num.');" class="expand expand_arrow" id="img_resize_'.$num.'" title="折叠"></a>';
echo '<span id="module_'.$num.'_text" class="text" onclick="_resize('.$num.');">大事记</span>';
echo '</h4>';
echo '</div>';
echo '<div id="module_'.$num.'_body" class="module_body">';
echo '<div id="module_'.$num.'_ul" class="module_div">';
$query = $db->query("SELECT * FROM ".DB_TABLEPRE."news WHERE type =5 AND (receive like'%".get_realname($_USER->id)."%' or receive='0') ORDER BY id desc LIMIT 8");
while ($row = $db->fetch_array($query)) {
echo '<ul>';
echo '<li><a href="admin.php?ac=news&fileurl=workbench&do=views&id='.$row['id'].'&type=';
echo $row['type'].'" target="_blank">'.$row['subject'].'</a></li>';
echo '</ul>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
}
//公文审批
function home_app($num){
global $db,$_USER;
echo '<div id="module_'.$num.'" class="module listColor">';
echo '<div class="head">';
echo '<h4 id="module_'.$num.'_head" class="module_fd2d11 color_style_0 moduleHeader">';
echo '<a href="javascript:_resize('.$num.');" class="expand expand_arrow" id="img_resize_'.$num.'" title="折叠"></a>';
echo '<span id="module_'.$num.'_text" class="text" onclick="_resize('.$num.');">公文审批</span>';
echo '</h4>';
echo '</div>';
echo '<div id="module_'.$num.'_body" class="module_body">';
echo '<div id="module_'.$num.'_ul" class="module_div">';
$query = $db->query("SELECT type,fileid FROM ".DB_TABLEPRE."personnel where (pkey=0 or pkey=4) and name like '%".get_realname($_USER->id)."%' order by id asc");
while ($row = $db->fetch_array($query)) {
if($row['type']==1){
$table = "attachment";
}else{
$table = "approval";
}
$sql = "SELECT category,title,id FROM ".DB_TABLEPRE.$table." WHERE id = '".$row['fileid']."'";
$rs = $db->fetch_one_array($sql);
echo '<ul>';
echo '<li>【';
if($row['type']==1){
echo '收文';
}else{
echo '发文';
}
echo '】 <a href="admin.php?ac='.$table.'&do=view&fileurl=app&fileid='.$rs['id'].'&apptype=';
echo $rs['category'].'" target="_blank">'.$rs['title'].'</a>';
echo ' <a href="admin.php?ac='.$table.'&fileurl=app&type=1">';
echo '<font color="#FF0000">进入办理</font></a></li>';
echo '</ul>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
}
//日程安排
function home_workdate($num){
global $db,$_USER;
echo '<div id="module_'.$num.'" class="module_right listColor ">';
echo '<div class="head">';
echo '<h4 id="module_'.$num.'_head" class="module_01c03f color_style_0 moduleHeader ">';
echo '<a href="javascript:_resize('.$num.');" id="img_resize_'.$num.'" class="expand expand_arrow" title="折叠"