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);
date_default_timezone_set('Asia/Bangkok');
$pro_id = null;
if(isset($_GET['pro_id']))
{
$pro_id = $_GET['pro_id'];
}
$img = null;
if(isset($_GET['img']))
{
$img = $_GET['img'];
}
$strSQL = "SELECT * FROM promotion WHERE pro_id ='".$pro_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>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
</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="promotion3.php">Promotion</a> <i class="pe-7s-angle-right"></i> Edit Promotion (CN)</h4>
</div>
<form name="form1" method="post" action="saveedit_promotion3.php" enctype="multipart/form-data">
<input type="hidden" name="pro_id" value="<?php echo $objResult["pro_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%;">Promotion Images size 1000 * 1400 px. <a class="text-danger"> File .jpg & .png </a></th>
<th style="width:50%;">Date</th>
</thead>
<tbody>
<tr>
<td>
<div class="form-group">
<img src="../upload_file/<?php echo $objResult["img"];?>" alt="image" style="width:25%;"/><br><br>
<input onchange="validateFileType(this)" id="fileUpload" name="filUpload" multiple="multiple" type="file" />
</div>
</td>
<td>
<input type="text" id="datepicker" name="datepicker" class="form-control" style="width:50%;" value="<?php echo date("m/d/Y",strtotime($objResult["prodate"]));?>">
</td>
</tr>
</tbody>
</table>
<table class="table table-hover">
<thead>
<th style="width:50%;">Promotion (CN)</th>
<th style="width:50%;">Sub Title (CN)</th>
</thead>
<tbody>
<tr>
<td><textarea name="pro3" rows="2" class="form-control"><?php echo $objResult["pro3"];?></textarea></td>
<td><textarea name="sub3" rows="2" class="form-control"><?php echo $objResult["sub3"];?></textarea></td>
</tr>
</tbody>
</table>
<table class="table table-hover">
<thead>
<th>Blogs (CN)</th>
</thead>
<tbody>
<tr>
<td><div class="form-group"><textarea id="edit" name="blog3"><?php echo $objResult["blog3"];?></textarea></div></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='promotion3.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"; ?>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$( function() {
$( "#datepicker" ).datepicker();
} );
</script>
</html>
<?php
mysqli_close($objCon);
?>
OHA YOOOO