MINI MINI MANI MO

Path : /home/phaetpan/domains/phaetpanya.com/public_html/vibharamadmin/
File Upload :
Current File : /home/phaetpan/domains/phaetpanya.com/public_html/vibharamadmin/edit_list.php

<!doctype html>
<?php
	session_start();
	if($_SESSION['admin_id'] == "")
	{
		include("session.php");  
	}

		include("connect.php");
		
		$strSQL = "SELECT * FROM admin WHERE admin_id = '".$_SESSION['admin_id']."' ";
		$objQuery = mysqli_query($objCon,$strSQL);
		$objResult = mysqli_fetch_array($objQuery,MYSQLI_ASSOC);
		
		$list_id = null;

		if(isset($_GET['list_id']))
		{
			$list_id = $_GET['list_id'];
		}
		$img = null;

		if(isset($_GET['img']))
			{
				$img = $_GET['img'];
			}

		$strSQL = "SELECT a.*, b.*
		FROM doctor_list a
		LEFT JOIN department b    
		ON a.depart_id=b.depart_id
		WHERE list_id ='".$list_id."'";  
		$objQuery = mysqli_query($objCon,$strSQL);
		$objResult = mysqli_fetch_array($objQuery,MYSQLI_ASSOC); 
?>
<html>
<head>
<?php include("assets/include/link.php"); ?>
	<script language="JavaScript">  
	function validateFileType(file){
        var fileName = document.getElementById("fileUpload").value;
        var idxDot = fileName.lastIndexOf(".") + 1;
        var extFile = fileName.substr(idxDot, fileName.length).toLowerCase();
        if (extFile=="jpg" || extFile=="jpeg" || extFile=="png"){
            //TO DO
		var FileSize = file.files[0].size / 512 / 512; // in MB
        if (FileSize > 0.512) {
            alert('File size exceeds 512 KB');
			window.location.href='JavaScript:history.go();';
         } else {}	
		
        }else{
            alert("Please select .jpg and .png file extension.");
			window.location.href='JavaScript:history.go();';
        }   
    }
	</script>
</head>
<body>
<div class="wrapper">
         
       <?php include("nav-menu.php"); ?> 
        		
	<div class="main-panel">
		<?php include("assets/include/account.php"); ?> 
			<div class="content">
				<div class="container-fluid">
					<div class="row">
						<div class="col-md-12">
							<div class="card card-plain">        
								<div class="header">
									<h4 class="title"><a href="doctor2.php">Doctor List</a> <i class="pe-7s-angle-right"></i> Edit Doctor</h4>
								</div>
								<form name="form1" method="post" action="saveedit_list.php" enctype="multipart/form-data">      
								<input type="hidden" name="list_id" value="<?php echo $list_id;?>">     
								<input type="hidden" name="img" value="<?php echo $objResult["img"];?>">
								<input type="hidden" name="admin" value="<?php echo $_SESSION['admin_id'];?>">
									<div class="content table-responsive table-full-width">
										<table class="table table-hover">    
											<thead>
												<th style="width:50%;">Doctor Profile size&nbsp; 200 * 300 px.&nbsp; <a class="text-danger"> File .jpg & .png </a></th>
												<th style="width:50%;">Department</th>
											</thead>
											<tbody>
												<tr>
													<td>
														<div class="form-group">
															<img src="../upload_file/<?php echo $objResult["img"];?>" alt="image" height="135"/><br><br>
															<input onchange="validateFileType(this)" id="fileUpload" name="filUpload" multiple="multiple" type="file"/>   
														</div>
													</td>  
													<td>
														<select class="form-control" name="department" id="department">
															<option value="<?php echo $objResult["depart_id"];?>"><?php echo $objResult["depart1"];?></option>
																<?php
															 	$Connect = mysql_connect('localhost', 'phaetpan_new', 'TO1LqDT9t') or die('Error connecting to MySQL');
															 	mysql_select_db('phaetpan_2018', $Connect) or die('Database phaetpan_2018 does not exist!'); 
															 	mysql_query('SET NAMES UTF8');
																$sql = "select * from department";
																$dbquery = mysql_query($sql);
																while($rw = mysql_fetch_array($dbquery)){?>     
																<option value="<?=$rw['depart_id']?>"><?=$rw['depart1']?></option>
																<? }?>
														</select>
													</td>
												</tr>
											</tbody>
										</table>
										<table class="table table-hover">    
											<thead>
												<th style="width:50%;">ชื่อ นามสกุล (TH)</th>
												<th style="width:50%;">Full Name (EN)</th>
											</thead>
											<tbody>
												<tr>
													<td><input type="text" class="form-control" name="name1" value="<?php echo $objResult["name1"];?>" required></td>  
													<td><input type="text" class="form-control" name="name2" value="<?php echo $objResult["name2"];?>" ></td>
												</tr>
											</tbody>
										</table>
										<!--<table class="table table-hover">    
											<thead>
												<th style="width:50%;">Full Name (CN)</th>
												<th style="width:50%;">Full Name (JP)</th>
											</thead>
											<tbody>
												<tr>
													<td><input type="text" class="form-control" name="name3" value="< ?php echo $objResult["name3"];?>" ></td>  
													<td><input type="text" class="form-control" name="name4" value="< ?php echo $objResult["name4"];?>" ></td>
												</tr>
											</tbody>
										</table>
										<table class="table table-hover">    
											<thead>
												<th style="width:50%;">Full Name (MM)</th>
												<th style="width:50%;">Full Name (ARA)</th>
											</thead>
											<tbody>
												<tr>
													<td><input type="text" class="form-control" name="name5" value="< ?php echo $objResult["name5"];?>" ></td>  
													<td><input type="text" class="form-control" name="name6" value="< ?php echo $objResult["name6"];?>" ></td>
												</tr>
											</tbody>
										</table> -->
										<br><br>
									 
										<table class="table table-hover">    
														<thead>
															<th>Profile (TH)</th>
														</thead>
														<tbody>
															<tr>
																<td><div class="form-group"><textarea id="edit" name="blog1"><?php echo $objResult["blog1"];?></textarea></div>      
																</td>  
															</tr>
														</tbody>
													</table>
													<table class="table table-hover">    
														<thead>
															<th>Profile (EN)</th>
														</thead>
														<tbody>
															<tr>
																<td><div class="form-group"><textarea id="edit2" name="blog2"><?php echo $objResult["blog2"];?></textarea></div>      
																</td>  
															</tr>
														</tbody>
													</table>
												<!--	<table class="table table-hover">    
														<thead>
															<th>Profile (CN)</th>
														</thead>
														<tbody>
															<tr>
																<td><div class="form-group"><textarea id="edit3" name="blog3">< ?php echo $objResult["blog3"];?></textarea></div>      
																</td>  
															</tr>
														</tbody>
													</table>
													<table class="table table-hover">    
														<thead>
															<th>Profile (JP)</th>
														</thead>
														<tbody>
															<tr>
																<td><div class="form-group"><textarea id="edit4" name="blog4">< ?php echo $objResult["blog4"];?></textarea></div>      
																</td>  
															</tr>
														</tbody>
													</table>
													<table class="table table-hover">    
														<thead>
															<th>Profile (MM)</th>
														</thead>
														<tbody>
															<tr>
																<td><div class="form-group"><textarea id="edit5" name="blog5">< ?php echo $objResult["blog5"];?></textarea></div>      
																</td>  
															</tr>
														</tbody>
													</table>
													<table class="table table-hover">    
														<thead>
															<th>Profile (ARA)</th>
														</thead>
														<tbody>
															<tr>
																<td><div class="form-group"><textarea id="edit6" name="blog6">< ?php echo $objResult["blog6"];?></textarea></div>      
																</td>  
															</tr>
														</tbody>
													</table>
										<table class="table">    
											<tr><td> </td></tr>
										</table>-->
										<button type="submit" rel="tooltip" class="btn btn-success btn-simple btn-icon">  
											<i class="fa fa-check-square" aria-hidden="true"></i> Save
										</button>
										<button type="button" rel="tooltip" class="btn btn-default btn-sm btn-simple" onclick="window.location.href='doctor2.php'">
											<i class="fa fa-window-close" aria-hidden="true"></i> Cancel
										</button><br><br>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>
			</div>
    
	</div>
</div>
</body>
<?php include("assets/include/script.php"); ?>
<?php include "texteditor2.php"; ?>
</html>
<?php 
	mysqli_close($objCon);
?>

OHA YOOOO