|
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 : |
<?
###################################################################
##
## Version : 2010008.003
## Modified Detail: NEW APPROVE STEP FROM PROVINCE WEBSITE
## Modified Date : 2010-02-08 13:00
## Modified By : Mr.PUDIS PROMSRI (PAAK)
##
###################################################################
include("../../config/config.inc.php");
include("../../common/function.php");
function Query1($sql){
$result = mysql_query($sql);
echo mysql_error();
$rs = mysql_fetch_array($result);
return $rs[0];
}
function randomcharactor ($length)
{
$possible = '0198765432';
$possible.= 'abcdefghijklmnopqrstuvwxyz';
$str=" ";
while ( strlen ($str) <= $length)
{
$str .= substr ($possible, (rand() % strlen($possible)), 1);
}
return ($str);
}
if ($_SERVER[REQUEST_METHOD] == "POST"){
//echo "<pre>"; print_r($_POST); echo "</pre>"; die;
$strSQLe = "SELECT tbl_subject.*,org_staffgroup.gid as owner_id,org_staffgroup.groupname as owner
FROM tbl_subject LEFT JOIN org_staffgroup ON tbl_subject.org_owner = org_staffgroup.gid WHERE id_sub='$id_sub' limit 1";
$Resulte= mysql_db_query($dbname,$strSQLe);
$Rse = mysql_fetch_assoc($Resulte);
$sql_logon=" select * from $table_staff where username='$uname' ";
$result = @mysql_query("$sql_logon");
$rs = @mysql_fetch_assoc($result); //print_r($rs);
if ($rs && $pwd == $rs[password]){
$path = "attach_file/temp/";
$con_status=$con_status;
$id=$id_sub;
$session_staffid=$rs[staffid];
$name_title="$rs[title]";
$xdetail=$comment;
$xtype=($con_status!="no")?"1":"2";
$confirm_step=($con_status!="no")?"รับรอง":"ไม่รับรอง";
//echo "<!--$confirm_step-->";
// เก็บ log login รวม
addlog("login","0");
############ บันทึก สถานะรับรองการประชุม
$sql="Update tbl_subject set confirm='$comment', confirmby='$session_staffid' where id_sub='$id'";
@mysql_query($sql);
## COPY HISTORY
$sql ="SELECT *
FROM tbl_subject_approve
WHERE tbl_subject_approve.id_subject='$id'
AND comment_by='$session_staffid'
";
$rs_checkroe=@mysql_query($sql);
$num_row=@mysql_num_rows($rs_checkroe);
if($num_row>0){
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);
}
$sql="DELETE FROM `tbl_subject_approve` WHERE tbl_subject_approve.id_subject='$id' AND (`comment_by`='$session_staffid') ";
mysql_query($sql);
}
if($_FILES['file_attach']){
$name_random=randomcharactor(16);
$name_random=trim($name_random);
$f_ext = getFileExtension($_FILES['file_attach']['name']);
$file_name_path=$name_random.".".$f_ext;
$file_path=$path.$file_name_path;
@copy($file_attach,$file_path);
if(PHP_OS=='Linux'){ chmod("$file_path",0777);}
}
$sql="insert into tbl_subject_approve(id_subject,approve_type,comment_detail,comment_by,comment_date,comment_file) values('$id','$xtype','$xdetail','$session_staffid',NOW(),'$file_name_path')";
//echo "<pre>".$sql;die;
mysql_query($sql);
############
?>
<script language="javascript">
alert('<?=$name_title?> \nได้ยืนยันสถานะ "<?=$confirm_step?>" \nให้รายงานการประชุม "<?=$Rse[subject]?>" แล้วค่ะ!');
opener.document.location.reload();
window.close();
</script>
<?
exit;
}else{
$msg = "Username หรือ Password ไม่ถูกต้อง";
addlog("พยายาม login เป็น user :$uname: by :$pwd:","0");
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title><?=$show_title?> <? if($provincename) {echo "จังหวัด".$provincename;}?></title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<LINK href="common/style.css" rel=stylesheet>
<LINK href="../common/style.css" rel=stylesheet>
<style type="text/css">
<!--
.header1 { font-family:"MS Sans Serif", Tahoma, Arial;
font-size:1em;
font-weight:bold;
color: #FFFFFF;
}
.main { font-family:"MS Sans Serif", Tahoma, Arial;
font-size:0.8em;
color:#FF0000;
font-weight:bold;
}
.normal { font-family:"MS Sans Serif", Tahoma, Arial;
font-size:0.8em;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.h3 {
font-size: xx-small;
color: #333333;
text-shadow: -1px 0 #dddddd, 0 1px #dddddd,
1px 0 #dddddd, 0 -1px #dddddd}
-->
</style>
</head>
<script language="javascript">
function detail_check(){
if(document.getElementById('uname').value=="" && document.getElementById('pwd').value==""){
alert('กรุณาระบุ username หน่วยงาน ด้วยคะ!');
return false;
}else if(document.getElementById('confirm').value=="no" && document.getElementById('comment').value==""){
alert('กรุณาระบุ รายละเอียด ไม่รับรองผลการประชุม ด้วยคะ!');
return false;
}
}
</script>
<body>
<FORM METHOD='POST' name="post" id="post" enctype="multipart/form-data" ACTION="" onSubmit="return detail_check();">
<table width="100%" height="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top">
<table width="350" border="0" bgcolor="#ECECEC" >
<tr border="0">
<td align="left">
<br>
<?
$strSQLe = "SELECT tbl_subject.*,org_staffgroup.gid as owner_id,org_staffgroup.groupname as owner
FROM tbl_subject LEFT JOIN org_staffgroup ON tbl_subject.org_owner = org_staffgroup.gid WHERE id_sub='$id_sub' limit 1";
$Resulte= mysql_db_query($dbname,$strSQLe);
$Rse = mysql_fetch_assoc($Resulte);
?>
<b>รายการงานประชุม หัวข้อ :</b>
<h4><?=$Rse[subject]?></h4>
<strong>วันที่ประชุม :</strong>
<?=daythai2(($Rse[meeting_date])?$Rse[meeting_date]:"0000-00-00")?><br>
<strong>โดยคุณเลือก : </strong>
<?
if($mode_select=="confirm"||!$mode_select){
$con_status="yes";
?>
<div class="epm_button" align="center" ><img src="images/approve.gif" width="16" height="16" > รับรองการประชุม</div> <br>
<? }else{
$con_status="no";
?>
<div class="epm_button" align="center" ><nobr><img src="images/notapprove.gif" width="16" height="16"> ไม่รับรองการประชุม</div>
<br><b>รายละเอียด :</b><br>
<textarea id="comment" name="comment" cols="42" rows="3"><?=$comment?></textarea>
<br><b>ไฟล์แนบ :</b>
<input type="file" name="file_attach" id="file_attach" style="width:180">
<br>
<? }?>
<br>
<strong style="position:static">
กรุณาระบุรหัสผ่านของหน่วยงานท่าน<br>
เพื่อรับรองสถานะรับรองการประชุม
</strong>
</td>
</tr>
<tr border="0">
<td height="400" align="right" valign="top"><table width="350" border="0" cellpadding="0" cellspacing="0" bgcolor="#ECECEC">
<tr>
<td width="40" align="right" valign="top" background="../../images/emp_main_new_27.gif" style=" background-repeat:repeat-y; background-position:left;"><img src="../../images/emp_main_new_19.gif"></td>
<td width="264" background="../../images/emp_main_new_20.gif" style="background-repeat:repeat-x; background-position:top">
<br>
<table border=0 align=center>
<tr>
<td align="right" style="color:#FFFFFF"> </td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr>
<td align="right" style="color:#666666"><B>Username</B></td>
<td align="left"> </td>
<td align="left"><INPUT NAME="uname" TYPE="text" class="epm_inputbox" value="" size=20 maxlength=20></td>
</tr>
<tr>
<td align="right" style="color:#666666"><B>Password</B></td>
<td align="left"> </td>
<td align="left"><INPUT NAME="pwd" TYPE="password" class="epm_inputbox" value="" size=20 maxlength=20></td>
</tr>
<tr>
<td> </td>
<td align="left"> </td>
<td align="left"><input name="submit" type=submit class="epm_button" value="บันทึกสถานะรับรอง"></td>
</tr>
<tr>
<td colspan="3" align="center"><div align="center"><font color="RED"><b>
<?=$msg?>
</b></font></div></td>
</tr>
</TABLE>
<input type="hidden" id="con_status" name="con_status" value="<?=($con_status)?$con_status:"yes"?>">
<input type="hidden" id="id_sub" name="id_sub" value="<?=$id_sub?>"></td>
<td width="7" align="right" valign="top" background="../../images/emp_main_new_25.gif" style="background-repeat: repeat-y; background-position:right"><img src="../../images/emp_main_new_22.gif" width="7" height="15"></td>
</tr>
<tr>
<td valign="bottom" background="../../images/emp_main_new_27.gif" style=" background-repeat:repeat-y; background-position:left;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="bottom" background="../../images/emp_main_new_31.gif"><img src="../../images/emp_main_new_30.gif" width="7" height="6"></td>
</tr>
</table></td>
<td background="../../images/emp_main_new_31.gif" style="background-repeat:repeat-x; background-position:bottom"> </td>
<td align="right" valign="bottom" background="../../images/emp_main_new_25.gif" style="background-repeat: repeat-y; background-position:right"><img src="../../images/emp_main_new_33.gif" width="7" height="6"></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
</FORM>
</body>
</html>