|
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/agenda/ |
Upload File : |
<?
session_start();
include("../../config/config.inc.php");
include("function/function.php");
include("function.listfile.php");
$id=($_GET[id])?$_GET[id]:'0000';
if($id=='0000'){echo 'DIE';die;}
$sql ="SELECT comment_by FROM tbl_subject_approve WHERE tbl_subject_approve.id_subject='$id' group by comment_by";
$rs_checkg=@mysql_query($sql);
while($rs_checkgroup=mysql_fetch_assoc($rs_checkg)){
$sql ="SELECT * FROM tbl_subject_approve WHERE tbl_subject_approve.id_subject='$id' AND comment_by='".$rs_checkgroup[comment_by]."' ORDER by comment_date ASC";
$rs_checkroe=mysql_query($sql);
$num_row=@mysql_num_rows($rs_checkroe);
if($num_row>1){
$num_x=$num_row;
while($rs_copy=mysql_fetch_assoc($rs_checkroe)){
$sql="insert into tbl_subject_approve_history (id_subject,approve_type,comment_detail,comment_by,comment_date) values( '$rs_copy[id_subject]','$rs_copy[approve_type]','$rs_copy[comment_detail]','$rs_copy[comment_by]','$rs_copy[comment_date]' )";
mysql_query($sql);
$num_x--;
if($num_x==1){ break;}
}
$sql="DELETE FROM `tbl_subject_approve` WHERE tbl_subject_approve.id_no='$rs_copy[id_no]'";
mysql_query($sql);
}
}
echo "FIN";
?>