%PDF- %GIF98; %PNG;
 
Server : ApacheSystem : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : addictionfreeind ( 1003) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Directory : /home/addictionfreeind/public_html/admin/  | 
Upload File :  | 
<?php
include "top.php";
$query="select * from citybanner where id='".$_REQUEST['id']."'";
 $result=mysqli_query($c,$query);
   while ($row=mysqli_fetch_assoc($result))
{
    $picture=$row['picture'];   
    $city=$row['city'];
    $treatment=$row['treatment'];  
}
if(!isset($_SESSION['admin']))
{
header("location:index.php");
}
if(isset($_REQUEST['submit']))
{
if($_FILES['picture']['name']!="")
{
$timestamp = strtotime(date('m/d/Y h:i:s a', time()));
$timestamp=$timestamp*rand(1, 5);
$ext = pathinfo($_FILES['picture']['name'], PATHINFO_EXTENSION);
$picture=$timestamp.'.'.$ext;
if($ext=='jpg' or $ext=='png' or $ext=='jpeg' or $ext=='JPG')
{
move_uploaded_file($_FILES["picture"]["tmp_name"],"../webroot/img/".$picture);
}
}
$treatment="";
foreach ($_REQUEST['treatment'] as $value){ 
$treatment=$treatment.$value.","; 
}
$query="update citybanner set city='".$_REQUEST['city']."',treatment='$treatment',picture='$picture' where id='".$_REQUEST['id']."'"; 
//$query="update citybanner set city='".mysqli_real_escape_string($c,$_REQUEST['city'])."',link='".mysqli_real_escape_string($c,$_REQUEST['link'])."',picture='".$picture."' where id='".$_REQUEST['id']."'";
$result=mysqli_query($c,$query);
 echo "<script>window.location.href='citybanner.php';</script>";
    exit;
}
?>
<div class="content-wrapper"> 
<section class="content-header sty-one">
<h1>City Banner Edit</h1>
<ol class="breadcrumb">
<li><a href="dashboard.php">Home</a></li>
<li><i class="fa fa-angle-right"></i> City Banner Edit</li>
</ol>
</section>
<section class="content">
<div class="card-body">
<form class="form" method="post" enctype="multipart/form-data">
<div class="row">
    
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="form-group">
<label>Treatments</label>
<select name="treatment[]" multiple="true" class="country">
<?php 
$query="select * from treatments order by name";
$result=mysqli_query($c,$query);
while($row	=	mysqli_fetch_array($result))
{
?>
<option <?php if (strpos($treatment,$row['name']) !== false) { echo 'selected';}?> value="<?php echo $row['name'];?>"><?php echo $row['name'];?></option>
<?php 
}
?>
</select>
</div>
</div>
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="form-group">
<label>City</label>
 <select name="city" id="" class="form-control">
  <?php
$query="select * from cities";
$result=mysqli_query($c,$query);
while($row  =   mysqli_fetch_array($result))
{
?>      
<option <?php if($city==$row['name']){ echo 'selected';};?>>
    <?php echo $row['name'];?></option>
<?php
}
?>  
</select>
</div>
</div>
<div class="col-lg-3 col-md-3 col-xs-12">
<div class="form-group">
<label>Picture</label>
<input class="form-control" type="file" name="picture" >
  <img src="../img/<?php echo $picture;?>" width="200">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-3 col-xs-6">
<button type="submit" name="submit" class="btn">Submit</button>
</div>
</div>
</form>
</div>
</section>
<?php
include "footer.php";
?>