|
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 : |
<link href="../../common/style.css" rel="stylesheet" type="text/css" />
<SCRIPT LANGUAGE="JavaScript"><!--
function checkempty() {
checknotempty="";
if(document.post.c1.checked==true) {checknotempty=true}
if(document.post.c2.checked==true) {checknotempty=true}
if(document.post.c3.checked==true) {checknotempty=true}
if(document.post.c4.checked==true) {checknotempty=true}
if(document.post.c5.checked==true) {checknotempty=true}
if(document.post.c6.checked==true) {checknotempty=true}
if(document.post.c7.checked==true) {checknotempty=true}
if(document.post.c8.checked==true) {checknotempty=true}
if(document.post.c9.checked==true) {checknotempty=true}
if(document.post.c10.checked==true) {checknotempty=true}
if(checknotempty==""){document.post.setting[0].checked='ture';normaldisabled();}
// alert(checknotempty);
}
function normaldisabled() {
if(document.post.setting[0].checked==true) {
document.post.c1.disabled=true;
document.post.c2.disabled=true;
document.post.c3.disabled=true;
document.post.c4.disabled=true;
document.post.c5.disabled=true;
document.post.c6.disabled=true;
document.post.c7.disabled=true;
document.post.c8.disabled=true;
document.post.c9.disabled=true;
document.post.c10.disabled=true;
document.post.cs1.disabled=true;
document.post.cs2.disabled=true;
document.post.cs3.disabled=true;
document.post.cs4.disabled=true;
document.post.cs5.disabled=true;
document.post.cs6.disabled=true;
document.post.cs7.disabled=true;
document.post.cs8.disabled=true;
document.post.cs9.disabled=true;
document.post.cs10.disabled=true;
}
}
function normalanabled() {
if(document.post.setting[1].checked==true) {
document.post.c1.disabled=false;
document.post.c2.disabled=false;
document.post.c3.disabled=false;
document.post.c4.disabled=false;
document.post.c5.disabled=false;
document.post.c6.disabled=false;
document.post.c7.disabled=false;
document.post.c8.disabled=false;
document.post.c9.disabled=false;
document.post.c10.disabled=false;
checkall();
document.post.cs1.disabled=false;
document.post.cs2.disabled=false;
document.post.cs3.disabled=false;
document.post.cs4.disabled=false;
document.post.cs5.disabled=false;
document.post.cs6.disabled=false;
document.post.cs7.disabled=false;
document.post.cs8.disabled=false;
document.post.cs9.disabled=false;
document.post.cs10.disabled=false;
}
}
function checkall() {
document.post.c1.checked=true;
document.post.c2.checked=true;
document.post.c3.checked=true;
document.post.c4.checked=true;
document.post.c5.checked=true;
document.post.c6.checked=true;
document.post.c7.checked=true;
document.post.c8.checked=true;
document.post.c9.checked=true;
document.post.c10.checked=true;
}
//--></SCRIPT>
<?
if ($_SERVER[REQUEST_METHOD] == "POST"){
//echo "NOW LOADING...";
//echo "<pre>";
$sql_deloldseting="
delete from doc_setting where staffid = '$_SESSION[session_staffid]';
";
$result = mysql_query($sql_deloldseting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
if($c1=="1"){
$sql_insertsetting="
INSERT INTO doc_setting ( id , staffid , colump , status , colump_val ) VALUES ( NULL , $session_staffid, 'c1' , '$c1' , '$cs1')
";
$result = mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
}
if($c2=="1"){
$sql_insertsetting="
INSERT INTO doc_setting ( id , staffid , colump , status , colump_val ) VALUES ( NULL , $session_staffid, 'c2' , '$c2' , '$cs2')
";
$result = mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
}
if($c3=="1"){
$sql_insertsetting="
INSERT INTO doc_setting ( id , staffid , colump , status , colump_val ) VALUES ( NULL , $session_staffid, 'c3' , '$c3' , '$cs3')
";
$result = mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
}
if($c4=="1"){
$sql_insertsetting="
INSERT INTO doc_setting ( id , staffid , colump , status , colump_val ) VALUES ( NULL , $session_staffid, 'c4' , '$c4' , '$cs4')
";
$result = mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
}
if($c5=="1"){
$sql_insertsetting="
INSERT INTO doc_setting ( id , staffid , colump , status , colump_val ) VALUES ( NULL , $session_staffid, 'c5' , '$c5' , '$cs5')
";
$result = mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
}
if($c6=="1"){
$sql_insertsetting="
INSERT INTO doc_setting ( id , staffid , colump , status , colump_val ) VALUES ( NULL , $session_staffid, 'c6' , '$c6' , '$cs6')
";
$result = mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
}
if($c7=="1"){
$sql_insertsetting="
INSERT INTO doc_setting ( id , staffid , colump , status , colump_val ) VALUES ( NULL , $session_staffid, 'c7' , '$c7' , '$cs7')
";
$result = mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
}
if($c8=="1"){
$sql_insertsetting="
INSERT INTO doc_setting ( id , staffid , colump , status , colump_val ) VALUES ( NULL , $session_staffid, 'c8' , '$c8' , '$cs8')
";
$result = mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
}
if($c9=="1"){
$sql_insertsetting="
INSERT INTO doc_setting ( id , staffid , colump , status , colump_val ) VALUES ( NULL , $session_staffid, 'c9' , '$c9' , '$cs9')
";
$result = mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
}
if($c10=="1"){
$sql_insertsetting="
INSERT INTO doc_setting ( id , staffid , colump , status , colump_val ) VALUES ( NULL , $session_staffid, 'c10' , '$c10' , '$cs10')
";
$result = mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
}
if($setting_year){
$sql_insertsetting="
INSERT INTO doc_setting ( id , staffid , colump , status , colump_val ) VALUES ( NULL , $session_staffid, 'year_setting' , '1' , '$setting_year')
";
$result = mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
}
$msg.= "เปลี่ยนแปลงข้อมูลเรียบร้อย";
include('msg_box.php');
echo "<meta http-equiv='refresh' content='1;url=$PHP_SELF?page=$page'>" ;
exit;
//echo "</pre>";
}
?>
<form action="" method="post" enctype="multipart/form-data" name="post" id="post">
<table width="72%" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#EEEEEE">
<tr>
<td align="right" bgcolor="#999999"><table width="100%" border="0" cellpadding="1" cellspacing="0">
<tr>
<td align="left" background="../../images/bg_tr_blue.gif" class="executive_bg">ปีที่ต้องการแสดงทะเบียนหนังสือ</td>
</tr>
<?
$sql_setting_list="
select * from $eoffice_select.doc_setting where staffid = '$_SESSION[session_staffid]';
";
$result = mysql_query($sql_setting_list)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
if($result){$rs_row=mysql_num_rows($result);}
while($srs = mysql_fetch_assoc($result)){
$c_select[$srs [colump]]=$srs [colump];
if($srs [colump]=="year_setting"){$d_year=$srs [colump_val];}
}
?>
<tr>
<td height="20" align="left" valign="top" class="index2">
<select name="setting_year" id="setting_year">
<?
$sql_year="
SELECT
YEAR(pdate) as year
FROM
document
WHERE
pdate Is NOT NULL
GROUP BY
YEAR(pdate)
";
if(!$d_year){ $d_year=date(Y);}
$result = mysql_query($sql_year)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
while($yrs = mysql_fetch_assoc($result)){
?>
<option value="<?=$yrs[year]?>" <? if($yrs[year]==$d_year){echo "selected";} ?>><?=$yrs[year]+543?>
</option>
<? }?>
</select>
</td>
<? if(!$checkDB){?>
<script language="JavaScript" type="text/javascript">normaldisabled();</script>
<? } ?>
</tr>
</table></td>
</tr>
</table>
<br />
<table width="72%" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#EEEEEE">
<tr>
<td align="right" bgcolor="#999999">
<table width="100%" border="0" cellpadding="1" cellspacing="0">
<tr>
<td colspan="6" align="left" background="../../images/bg_tr_blue.gif" class="executive_bg">กาารปรับแต่งคอลัมน์</td>
</tr>
<?
$sql_setting_list="
select * from $eoffice_select.doc_setting where staffid = '$_SESSION[session_staffid]' AND colump != 'year_setting'
";
$result = mysql_query($sql_setting_list)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
if($result){$rs_row=mysql_num_rows($result);}
while($srs = mysql_fetch_assoc($result)){
$c_select[$srs [colump]]="on";
}
?>
<tr>
<td width="20" height="20" align="right" class="index2"><input name="setting" type="radio" value="1" onclick="normaldisabled();" <? if(!$rs_row){echo "checked=checked"; } ?> /></td>
<? if(!$checkDB){?><script language=javascript>normaldisabled();</script><? } ?>
<td height="20" colspan="5" align="left" class="index2">มาตรฐาน</td>
</tr>
<tr>
<td height="20" align="right" class="index2"><input name="setting" type="radio" value="2" onclick="normalanabled();" <? if($rs_row){echo "checked=checked"; } ?>/></td>
<td height="20" colspan="5" align="left" class="index2">ส่วนตัว</td>
</tr>
<tr>
<td align="right" class="index2"> </td>
<td height="20" colspan="5" align="left" class="index2"><strong>คอลัมน์</strong></td>
</tr>
<tr>
<td align="right" class="index2"> </td>
<td width="20" align="left" class="index2">
<input type="checkbox" name="c1" value="1" onclick="if(document.post.c1.checked){document.post.setting[1].checked='ture'};checkempty();" <? if($c_select[c1]){echo "checked=checked"; } ?> <? if(!$rs_row){echo "disabled"; } ?>/> </td>
<td width="60" height="20" align="left" class="index2">ลำดับ</td>
<td width="20" align="left" class="index2"><input name="c5" type="checkbox" id="c5" onclick="if(document.post.c5.checked){document.post.setting[1].checked='ture'};checkempty();" value="1" <? if($c_select[c5]){echo "checked=checked"; } ?> <? if(!$rs_row){echo "disabled"; } ?>/></td>
<td align="left" class="index2">จาก</td>
<td width="60%" height="20" align="left" class="index2"> </td>
</tr>
<tr>
<td align="right" class="index2"> </td>
<td align="left" class="index2"><input name="c2" type="checkbox" id="c2" onclick="if(document.post.c2.checked){document.post.setting[1].checked='ture'};checkempty();" value="1" <? if($c_select[c2]){echo "checked=checked"; } ?> <? if(!$rs_row){echo "disabled"; } ?>/></td>
<td height="20" align="left" class="index2">เลขหนังสือ</td>
<td width="20" align="left" class="index2"><input name="c6" type="checkbox" id="c6" onclick="if(document.post.c6.checked){document.post.setting[1].checked='ture'};checkempty();" value="1" <? if($c_select[c6]){echo "checked=checked"; } ?> <? if(!$rs_row){echo "disabled"; } ?>/></td>
<td align="left" class="index2">ถึง</td>
<td height="20" align="left" class="index2"> </td>
</tr>
<tr>
<td align="right" class="index2"> </td>
<td align="left" class="index2"><input name="c3" type="checkbox" id="c3" onclick="if(document.post.c3.checked){document.post.setting[1].checked='ture'};checkempty();" value="1" <? if($c_select[c3]){echo "checked=checked"; } ?> <? if(!$rs_row){echo "disabled"; } ?>/></td>
<td height="20" align="left" class="index2">เอกสารเลขที่</td>
<td align="left" class="index2"><input name="c7" type="checkbox" id="c7" onclick="if(document.post.c7.checked){document.post.setting[1].checked='ture'};checkempty();" value="1" <? if($c_select[c7]){echo "checked=checked"; } ?> <? if(!$rs_row){echo "disabled"; } ?>/></td>
<td align="left" class="index2">เรื่อง</td>
<td height="20" align="left" class="index2"> </td>
</tr>
<tr>
<td align="right" class="index2"> </td>
<td align="left" class="index2">
<input name="c4" type="checkbox" id="c4" onclick="if(document.post.c4.checked){document.post.setting[1].checked='ture'};checkempty();" value="1" <? if($c_select[c4]){echo "checked=checked"; } ?> <? if(!$rs_row){echo "disabled"; } ?>/>
</td>
<td height="20" align="left" class="index2">ลงวันที่</td>
<td align="left" class="index2">
<!--<input name="c9" type="checkbox" id="c9" onclick="if(document.post.c9.checked){document.post.setting[1].checked='ture'};checkempty();" value="1" <? if($c_select[c9]){echo "checked=checked"; } ?> <? if(!$rs_row){echo "disabled"; } ?>/>-->
</td>
<td align="left" class="index2"> <!--สถานะเอกสาร--></td>
<td height="20" align="left" class="index2"> </td>
</tr>
<tr>
<td align="right" class="index2"> </td>
<td align="right" class="index2"> </td>
<td height="20" align="left" class="index2"> </td>
<td align="right" class="index2"> </td>
<td align="left" class="index2"> </td>
<td height="20" align="left" class="index2"> </td>
</tr>
<tr>
<td height="20" colspan="6" align="center" class="index2">
</td>
</tr
><tr>
<td height="20" colspan="6" align="center" class="index2"><HR color="#eeeeee">
<input name="submit2" type="submit" class="input" style="width:100;" value="บันทึกข้อมูล" />
<input name="button" type="button" class="input" style="width:100;" onclick="window.location.replace('?type=get')" value="กลับหน้าหลัก" /></td>
</tr>
</table>
</td>
</tr>
</table>
</form>