|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /var/www/html/eoffice/application/document/ |
Upload File : |
<?
if ($nowdocid == ""){ $nowdocid = $user_id ; }
//function ที่ใช้แสดงวันที่แบบเต็ม ใช้ใน edocument
function fulltime_daythai($temp){
if($temp != "0000-00-00 00:00:00"){
$month = array("ม.ค.", "ก.พ.", "มี.ค", "ม.ย", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย", "ต.ค.", "พ.ย.", "ธ.ค.");
$temp1=explode(" ", $temp);
$num = explode("-", $temp1[0]);
if($num[0] == "0000"){
$date = "ไม่ระบุ";
} else {
$tyear = ($num[0] + 543);
$date = remove_zero($num[2])." ".$month[$num[1] - 1 ]." ".$tyear." ".substr($temp1[1],0,-3);
}
} else {
$date = "ไม่ระบุ";
}
return $date;
} ############### END function fulltime_daythai($temp){
$sql2_all =" SELECT * FROM doc_history Inner Join history_actstatus ON doc_history.action_id = history_actstatus.id WHERE docid = '$nowdocid' ORDER BY timerec";
$result2 = mysql_db_query($dbname , $sql2_all)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
$all_rows=mysql_num_rows($result2);
if(!$hpage){$hpage="1";}
if(!$perpage){$perpage="20";}
$lasthpage=intval($all_rows/$perpage)+1;
$limit_start=($hpage-1)*$perpage;
$limit_code=" limit $limit_start , $perpage ";
$nonm=0;
$sql2=" SELECT * FROM doc_history Inner Join history_actstatus ON doc_history.action_id = history_actstatus.id WHERE docid = '$nowdocid' ORDER BY timerec DESC , history_actstatus.id ASC";
$sql2.=" $limit_code";
$result2 = mysql_db_query($dbname , $sql2)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
?>
<table width="98%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#eeeeee">
<tr>
<td colspan="3" align="center">
<? if($hpage>"1"){?>
<a href="<?=$PHP_SELF?>?type=<?=$type?>&action=<?=$action?>&id=<?=$id?>&hpage=1&history_mode=timeline">
<img src="../../images/page_div_icon/First.gif" border="0" /></a>
<? }else{?>
<img src="../../images/page_div_icon/xFirst.gif" border="0" />
<? }?>
<? if($hpage>"1"){?>
<a href="<?=$PHP_SELF?>?type=<?=$type?>&action=<?=$action?>&id=<?=$id?>&hpage=<?=$hpage-1?>&history_mode=timeline">
<img src="../../images/page_div_icon/Previous.gif" border="0"></a>
<? }else{?>
<img src="../../images/page_div_icon/xPrevious.gif" border="0" />
<? }?>
<?=$hpage?>
/
<?=$lasthpage?>
<? if($hpage<$lasthpage){?>
<a href="<?=$PHP_SELF?>?type=<?=$type?>&action=<?=$action?>&id=<?=$id?>&hpage=<?=$hpage+1?>&history_mode=timeline">
<img src="../../images/page_div_icon/Next.gif" border="0" /></a>
<? }else{?>
<img src="../../images/page_div_icon/xNext.gif" border="0" />
<? }?>
<? if($hpage<$lasthpage){?>
<a href="<?=$PHP_SELF?>?type=<?=$type?>&action=<?=$action?>&id=<?=$id?>&hpage=<?=$lasthpage?>&history_mode=timeline">
<img src="../../images/page_div_icon/Last.gif" border="0" /></a>
<? }else{?>
<img src="../../images/page_div_icon/xLast.gif" border="0">
<? }?> </td>
</tr>
<tr>
<td valign="top" bgcolor="#CCCCCC"><strong>ประวัติกิจกรรมทะเบียนหนังสือ </strong> <a href="?action=view&id=<?=$id?>&type=<?$type?>"><img src="../../images/ico_info.gif" width="16" height="16" border="0" /></a></td>
</tr>
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td width="60" bgcolor="#F5F5F5"><strong>เวลา</strong></td>
<td bgcolor="#F5F5F5"><strong>กิจกรรมทะเบียนหนังสือ</strong></td>
<td bgcolor="#F5F5F5"><strong>หน่วยดำเนินการ</strong></td>
</tr>
<?
while($rs2 = mysql_fetch_assoc($result2)){ ####### Start SELECT * FROM doc_history WHERE docid =
?>
<tr <? if($rs2[doc_action]=="del"){ echo "bgcolor=#FF0000"; } ?>>
<td>
<?
if ( $rs2[timerec] == $historytime){
if ($rs2[action_id]!=$historyact ){ echo " <img src='../../images/$rs2[img]' /> ". fulltime_daythai($rs2[timerec]) ; }
}else{
echo "<img src='../../images/$rs2[img]' /> ". fulltime_daythai($rs2[timerec]) ;
} ######## if ( $rs2[action_id] == 300 ){
?>
</td>
<td>
<?
if ( $rs2[timerec] == $historytime){
if ($rs2[action_id]!=$historyact ){ echo " ". ($rs2[actstatus]) ; }
}else{
echo " ". ($rs2[actstatus]) ;
} ######## if ( $rs2[action_id] == 300 ){
$historytime = $rs2[timerec] ;
$historyact = $rs2[action_id] ;
?>
</td>
<td><?=$rs2[staff_label]?></td>
</tr>
<?
} ## END while($rs2 = mysql_fetch_assoc($result2)){ ####### Start SELECT * FROM doc_history WHERE docid =
?>
</table>