%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 centres where id='".$_REQUEST['id']."'";
 $result=mysqli_query($c,$query);
   while ($row=mysqli_fetch_assoc($result))
{
    // print_r($row['treatment']);die;
    $picture=$row['picture'];
    $picture2=$row['picture2'];
    $picture3=$row['picture3'];
    $picture4=$row['picture4'];
    $picture5=$row['picture5'];
    $picture6=$row['picture6'];
    $picture7=$row['picture7'];
    $picture8=$row['picture8'];
    $city=$row['city'];
    $treatment=$row['treatment'];
    $about=$row['about'];
    $name=$row['name'];
    $ownername=$row['ownername'];
    $username=$row['username'];
    $whatsapp=$row['whatsapp'];
    $email=$row['email'];
    $googlemap=$row['googlemap'];
    $justdial=$row['justdial'];
    $sulekha=$row['sulekha'];
    $facebook=$row['facebook'];
    $instagram=$row['instagram'];
    $youtube=$row['youtube'];
    $address=$row['address'];
    $website=$row['website'];
    $established=$row['established'];
}
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);
}
}
if($_FILES['picture2']['name']!="")
{
$timestamp = strtotime(date('m/d/Y h:i:s a', time()));
$timestamp=$timestamp*rand(1, 5);
$ext = pathinfo($_FILES['picture2']['name'], PATHINFO_EXTENSION);
$picture2=$timestamp.'.'.$ext;
if($ext=='jpg' or $ext=='png' or $ext=='jpeg' or $ext=='JPG')
{
move_uploaded_file($_FILES["picture2"]["tmp_name"],"../webroot/img/".$picture2);
}
}
if($_FILES['picture3']['name']!="")
{
$timestamp = strtotime(date('m/d/Y h:i:s a', time()));
$timestamp=$timestamp*rand(1, 5);
$ext = pathinfo($_FILES['picture3']['name'], PATHINFO_EXTENSION);
$picture3=$timestamp.'.'.$ext;
if($ext=='jpg' or $ext=='png' or $ext=='jpeg' or $ext=='JPG')
{
move_uploaded_file($_FILES["picture3"]["tmp_name"],"../webroot/img/".$picture3);
}
}
if($_FILES['picture4']['name']!="")
{
$timestamp = strtotime(date('m/d/Y h:i:s a', time()));
$timestamp=$timestamp*rand(1, 5);
$ext = pathinfo($_FILES['picture4']['name'], PATHINFO_EXTENSION);
$picture4=$timestamp.'.'.$ext;
if($ext=='jpg' or $ext=='png' or $ext=='jpeg' or $ext=='JPG')
{
move_uploaded_file($_FILES["picture4"]["tmp_name"],"../webroot/img/".$picture4);
}
}
if($_FILES['picture5']['name']!="")
{
$timestamp = strtotime(date('m/d/Y h:i:s a', time()));
$timestamp=$timestamp*rand(1, 5);
$ext = pathinfo($_FILES['picture5']['name'], PATHINFO_EXTENSION);
$picture5=$timestamp.'.'.$ext;
if($ext=='jpg' or $ext=='png' or $ext=='jpeg' or $ext=='JPG')
{
move_uploaded_file($_FILES["picture5"]["tmp_name"],"../webroot/img/".$picture5);
}
}
if($_FILES['picture6']['name']!="")
{
$timestamp = strtotime(date('m/d/Y h:i:s a', time()));
$timestamp=$timestamp*rand(1, 5);
$ext = pathinfo($_FILES['picture6']['name'], PATHINFO_EXTENSION);
$picture6=$timestamp.'.'.$ext;
if($ext=='jpg' or $ext=='png' or $ext=='jpeg' or $ext=='JPG')
{
move_uploaded_file($_FILES["picture6"]["tmp_name"],"../webroot/img/".$picture6);
}
}
if($_FILES['picture7']['name']!="")
{
$timestamp = strtotime(date('m/d/Y h:i:s a', time()));
$timestamp=$timestamp*rand(1, 5);
$ext = pathinfo($_FILES['picture7']['name'], PATHINFO_EXTENSION);
$picture7=$timestamp.'.'.$ext;
if($ext=='jpg' or $ext=='png' or $ext=='jpeg' or $ext=='JPG')
{
move_uploaded_file($_FILES["picture7"]["tmp_name"],"../webroot/img/".$picture7);
}
}
if($_FILES['picture8']['name']!="")
{
$timestamp = strtotime(date('m/d/Y h:i:s a', time()));
$timestamp=$timestamp*rand(1, 5);
$ext = pathinfo($_FILES['picture8']['name'], PATHINFO_EXTENSION);
$picture8=$timestamp.'.'.$ext;
if($ext=='jpg' or $ext=='png' or $ext=='jpeg' or $ext=='JPG')
{
move_uploaded_file($_FILES["picture8"]["tmp_name"],"../webroot/img/".$picture8);
}
}
$treatment="";
foreach ($_REQUEST['treatment'] as $value){ 
$treatment=$treatment.$value.","; 
}
  $query="update centres set city='".$_REQUEST['city']."',treatment='$treatment',email='".$_REQUEST['email']."',name='".$_REQUEST['name']."',ownername='".$_REQUEST['ownername']."',whatsapp='".$_REQUEST['whatsapp']."',address='".$_REQUEST['address']."',website='".$_REQUEST['website']."',googlemap='".$_REQUEST['googlemap']."',justdial='".$_REQUEST['justdial']."',sulekha='".$_REQUEST['sulekha']."',facebook='".$_REQUEST['facebook']."',instagram='".$_REQUEST['instagram']."',youtube='".$_REQUEST['youtube']."',about='".$_REQUEST['about']."',established='".$_REQUEST['established']."',picture='$picture',picture2='$picture2',picture3='$picture3',picture4='$picture4',picture5='$picture5',picture6='$picture6',picture7='$picture7',picture8='$picture8' where id='".$_REQUEST['id']."'"; 
 //$query="update centres set city='".mysqli_real_escape_string($c,$_REQUEST['city'])."',treatment='".mysqli_real_escape_string($c,$_REQUEST['$chk'])."',name='".mysqli_real_escape_string($c,$_REQUEST['name'])."',ownername='".mysqli_real_escape_string($c,$_REQUEST['ownername'])."',username='".mysqli_real_escape_string($c,$_REQUEST['username'])."',whatsapp='".mysqli_real_escape_string($c,$_REQUEST['whatsapp'])."',email='".mysqli_real_escape_string($c,$_REQUEST['email'])."',address='".mysqli_real_escape_string($c,$_REQUEST['address'])."',established='".mysqli_real_escape_string($c,$_REQUEST['established'])."',googlemap='".mysqli_real_escape_string($c,$_REQUEST['googlemap'])."',justdial='".mysqli_real_escape_string($c,$_REQUEST['justdial'])."',sulekha='".mysqli_real_escape_string($c,$_REQUEST['sulekha'])."',facebook='".mysqli_real_escape_string($c,$_REQUEST['facebook'])."',instagram='".mysqli_real_escape_string($c,$_REQUEST['instagram'])."',youtube='".mysqli_real_escape_string($c,$_REQUEST['youtube'])."',picture='".$picture."',picture2='".$picture2."',picture3='".$picture3."',picture4='".$picture4."',picture5='".$picture5."',picture6='".$picture6."',picture7='".$picture7."',picture8='".$picture8."' where id='".$_REQUEST['id']."'";
 $result=mysqli_query($c,$query);
 echo "<script>window.location.href='centres.php';</script>";
    exit;
    }
?>
<div class="content-wrapper"> 
<section class="content-header sty-one">
<h1>Centre Update</h1>
<ol class="breadcrumb">
<li><a href="dashboard.php">Home</a></li>
<li><i class="fa fa-angle-right"></i> Centre Update</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>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-6 col-md-6 col-xs-12">
<div class="form-group">
<label>Treatment</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>Centre Name</label>
<input class="form-control" type="text" name="name" value="<?php echo $name;?>" required>
</div>
</div>
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="form-group">
<label>Owner Name</label>
<input class="form-control" type="text" name="ownername" value="<?php echo $ownername;?>" required>
</div>
</div>
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="form-group">
<label>Phone</label>
<input class="form-control" type="text" name="username" pattern="[7896][0-9]{9}" title="please enter 10 digit mobile number" value="<?php echo $username;?>" required>
</div>
</div>
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="form-group">
<label>Whatsapp Number</label>
<input class="form-control" type="text" name="whatsapp" pattern="[7896][0-9]{9}" title="please enter 10 digit mobile number" value="<?php echo $whatsapp;?>" required>
</div>
</div>
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="form-group">
<label>Email Address</label>
<input class="form-control" type="text" name="email" title="please enter valid email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$" value="<?php echo $email;?>">
</div>
</div>
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="form-group">
<label>Address</label>
<input class="form-control" type="text" name="address" value="<?php echo $address;?>" required>
</div>
</div>
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="form-group">
<label>Start From</label>
<input class="form-control" type="date" name="established" value="<?php echo $established;?>">
</div>
</div>
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="form-group">
<label>Website URL</label>
<input class="form-control" type="text" name="website" value="<?php echo $website;?>">
</div>
</div>
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="form-group">
<label>Google My Business Profile URL</label>
<input class="form-control" type="text" name="googlemap" value="<?php echo $googlemap;?>">
</div>
</div>
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="form-group">
<label>Just Dial Profile URL</label>
<input class="form-control" type="text" name="justdial" value="<?php echo $justdial;?>">
</div>
</div>
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="form-group">
<label>Sulekha Profile URL</label>
<input class="form-control" type="text" name="sulekha" value="<?php echo $sulekha;?>">
</div>
</div>
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="form-group">
<label>Facebook Profile URL</label>
<input class="form-control" type="text" name="facebook" value="<?php echo $facebook;?>">
</div>
</div>
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="form-group">
<label>Instagram Profile URL</label>
<input class="form-control" type="text" name="instagram" value="<?php echo $instagram;?>">
</div>
</div>
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="form-group">
<label>Youtube Profile URL</label>
<input class="form-control" type="text" name="youtube" value="<?php echo $youtube;?>">
</div>
</div>
<div class="col-lg-12 col-md-6 col-xs-12">
<div class="form-group">
<label>About Us</label>
<textarea class="form-control" name="about" required><?php echo $about;?></textarea>
</div>
</div>
<div class="col-lg-3 col-md-3 col-xs-12">
<div class="form-group">
<label>Picture 1</label>
<input class="form-control" type="file" name="picture">
  <img src="../img/<?php echo $picture;?>" width="50">
</div>
</div>
<div class="col-lg-3 col-md-3 col-xs-12">
<div class="form-group">
<label>Picture 2</label>
<input class="form-control" type="file" name="picture2">
  <img src="../img/<?php echo $picture2;?>" width="100">
</div>
</div>
<div class="col-lg-3 col-md-3 col-xs-12">
<div class="form-group">
<label>Picture 3</label>
<input class="form-control" type="file" name="picture3">
  <img src="../img/<?php echo $picture3;?>" width="100">
</div>
</div>
<div class="col-lg-3 col-md-3 col-xs-12">
<div class="form-group">
<label>Picture 4</label>
<input class="form-control" type="file" name="picture4">
  <img src="../img/<?php echo $picture4;?>" width="100">
</div>
</div>
<div class="col-lg-3 col-md-3 col-xs-12">
<div class="form-group">
<label>Picture 5</label>
<input class="form-control" type="file" name="picture5" >
  <img src="../img/<?php echo $picture5;?>" width="100">
</div>
</div>
<div class="col-lg-3 col-md-3 col-xs-12">
<div class="form-group">
<label>Picture 6</label>
<input class="form-control" type="file" name="picture6">
  <img src="../img/<?php echo $picture6;?>" width="100">
</div>
</div>
<div class="col-lg-3 col-md-3 col-xs-12">
<div class="form-group">
<label>Picture 7</label>
<input class="form-control" type="file" name="picture7">
  <img src="../img/<?php echo $picture7;?>" width="100">
</div>
</div>
<div class="col-lg-3 col-md-3 col-xs-12">
<div class="form-group">
<label>Picture 8</label>
<input class="form-control" type="file" name="picture8">
  <img src="../img/<?php echo $picture8;?>" width="100">
</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";
?>