MINI MINI MANI MO
<!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);
$service_id = null;
if(isset($_GET['service_id']))
{
$service_id = $_GET['service_id'];
}
$img = null;
if(isset($_GET['img']))
{
$img = $_GET['img'];
}
$strSQL = "SELECT * FROM service WHERE service_id ='".$service_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 / 1024 / 1024; // in MB
if (FileSize > 2) {
alert('File size exceeds 1 MB');
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="service.php">Services</a> <i class="pe-7s-angle-right"></i> Edit Service</h4>
</div>
<form name="form1" method="post" action="saveedit_service.php" enctype="multipart/form-data">
<input type="hidden" name="service_id" value="<?php echo $objResult["service_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%;">Service Images size 640 * 640 px. <a class="text-danger"> File .jpg & .png </a></th>
<th style="width:50%;">Icons</th>
</thead>
<tbody>
<tr>
<td>
<div class="form-group">
<img src="../upload_file/<?php echo $objResult["img"];?>" alt="image" style="width:30%;"/><br><br>
<input onchange="validateFileType(this)" id="fileUpload" name="filUpload" multiple type="file" />
</div>
</td>
<td><input type="text" class="form-control" name="icon" value="<?php echo $objResult["icon"];?>" required></td>
</tr>
</tbody>
</table>
<table class="table table-hover">
<thead>
<th style="width:50%;">Service (TH)</th>
<th style="width:50%;">Service (EN)</th>
</thead>
<tbody>
<tr>
<td><input type="text" class="form-control" name="service1" value="<?php echo $objResult["service1"];?>" required></td>
<td><input type="text" class="form-control" name="service2" value="<?php echo $objResult["service2"];?>" required></td>
</tr>
</tbody>
</table>
<table class="table table-hover">
<thead>
<th style="width:50%;">Service (CN)</th>
<th style="width:50%;">Service (JP)</th>
</thead>
<tbody>
<tr>
<td><input type="text" class="form-control" name="service3" value="<?php echo $objResult["service3"];?>" ></td>
<td><input type="text" class="form-control" name="service4" value="<?php echo $objResult["service4"];?>" ></td>
</tr>
</tbody>
</table>
<table class="table table-hover">
<thead>
<th style="width:50%;">Service (MM)</th>
<th style="width:50%;">Service (ARA)</th>
</thead>
<tbody>
<tr>
<td><input type="text" class="form-control" name="service5" value="<?php echo $objResult["service5"];?>" ></td>
<td><input type="text" class="form-control" name="service6" value="<?php echo $objResult["service6"];?>" ></td>
</tr>
</tbody>
</table>
<table class="table table-hover">
<thead>
<th style="width:50%;">Sub Title (TH)</th>
<th style="width:50%;">Sub Title (EN)</th>
</thead>
<tbody>
<tr>
<td><textarea name="sub1" rows="3" class="form-control"><?php echo $objResult["sub1"];?></textarea></td>
<td><textarea name="sub2" rows="3" class="form-control"><?php echo $objResult["sub2"];?></textarea></td>
</tr>
</tbody>
</table>
<table class="table table-hover">
<thead>
<th style="width:50%;">Sub Title (CN)</th>
<th style="width:50%;">Sub Title (JP)</th>
</thead>
<tbody>
<tr>
<td><textarea name="sub3" rows="3" class="form-control"><?php echo $objResult["sub3"];?></textarea></td>
<td><textarea name="sub4" rows="3" class="form-control"><?php echo $objResult["sub4"];?></textarea></td>
</tr>
</tbody>
</table>
<table class="table table-hover">
<thead>
<th style="width:50%;">Sub Title (MM)</th>
<th style="width:50%;">Sub Title (ARA)</th>
</thead>
<tbody>
<tr>
<td><textarea name="sub5" rows="3" class="form-control"><?php echo $objResult["sub5"];?></textarea></td>
<td><textarea name="sub6" rows="3" class="form-control"><?php echo $objResult["sub6"];?></textarea></td>
</tr>
</tbody>
</table>
<table class="table">
<tr>
<td>
<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='service.php'">
<i class="fa fa-window-close" aria-hidden="true"></i> Cancel
</button>
</td>
</tr>
</table>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<?php include("assets/include/script.php"); ?>
<?php include "texteditor.php"; ?>
</html>
<?php
mysqli_close($objCon);
?>
OHA YOOOO