hjkhjkjhkhjkgjghjhgjhgjghjhghjghjhgjjnbvnvbnvk
bnmbnmbnhjkhjkhjkhjktyutyutyuytutyutyutyhgjgjghjgjghjguytutyry
/
home
/
b4h4ej4a6kj6
/
public_html
/
kitsandcleats.in
/
admin
/
Upload FileeE
HOME
<?php include('functions.php'); $obj = new Operations(); $w = "where id = 1"; $getrs = $obj->getSingle('contact',$w); if($_POST){ $bnr_image= $_FILES['image']['name']; move_uploaded_file($_FILES['image']['tmp_name'],'./images/'.$bnr_image); if(empty($bnr_image)){ $bnr_image=$_POST['old_image']; } $data = array( 'image'=>$bnr_image, 'email'=>$_POST['email'], 'mobile'=>$_POST['mobile'], 'office_address'=>$_POST['office_address'], 'whatsapp'=>$_POST['whatsapp'], 'fb_link'=>$_POST['fb_link'], 'instagram'=>$_POST['instagram'] ); $obj->update('contact',$data,$getrs['id']); header('location:manage-contact.php'); } include 'header.php'?> <?php require_once 'sidebar.php'?> <!--== SIDEBAR ENDS ==--> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function(){ var mode = '<?php echo $_GET['mode']; ?>'; if(mode == 'success'){ $('#insert_msg').slideDown(); $('#insert_msg').delay(1500).fadeOut(); } if(mode == 'update'){ $('#update_msg').slideDown(); $('#update_msg').delay(1500).fadeOut(); window.location = 'manage-contact.php'; } }); </script> <!-- Main Content --> <div class="main-content"> <section class="section"> <div class="section-body"> <div class="row"> <div class="col-md-12"> <div class="card"> <form method="post" enctype="multipart/form-data"> <div class="card-header justify-content-between"> <h4>Manage Information</h4> <?php if($_GET['action'] == 'edit'){ ?> <a href="manage-contact.php" class="btn btn-warning">Back</a> <?php }else{?> <a href="?action=edit&id=1" class="btn btn-warning">Edit Details</a> <?php }?> </div> <div class="alert alert-success" style="text-align:center;font-size:25px;display:none;" id="insert_msg">Data Inserted Succesfully</div> <div class="alert alert-success" style="text-align:center;font-size:25px;display:none;" id="update_msg">Data Updated Succesfully</div> <?php if($_GET['action'] == 'edit'){ $w = "where id = '".$_GET['id']."'"; $getrs = $obj->getSingle('contact',$w); ?> <div class="card-body"> <div class="form-group"> <label for="name">Logo:</label><br> <input type="hidden" name="old_image" value="<?php echo $getrs['image'] ?>"> <input class="form-control" type="file" name="image" autocomplete="off" > <?php if($_GET['action'] == 'edit'){ ?> <img src="images/<?php echo $getrs['image'] ?>" width="150"> <?php } ?> </div> <div class="form-group"> <label for="name">Email:</label> <input class="form-control" type="text" name="email" autocomplete="off" value="<?php echo $getrs['email'] ?>" > </div> <div class="form-group"> <label for="name">Mobile Number:</label> <input class="form-control" type="text" name="mobile" autocomplete="off" value="<?php echo $getrs['mobile'] ?>" > </div> <div class="form-group"> <label for="name">Office Address:</label> <textarea class="form-control" autocomplete="off" name="office_address"> <?php echo $getrs['office_address'] ?></textarea> </div> <div class="form-group"> <label for="name">Whatsapp Number:</label> <input class="form-control" type="text" name="whatsapp" autocomplete="off" value="<?php echo $getrs['whatsapp'] ?>" > </div> <div class="form-group"> <label for="name">Facebook Link:</label> <input class="form-control" type="text" name="fb_link" autocomplete="off" value="<?php echo $getrs['fb_link'] ?>" > </div> <div class="form-group"> <label for="name">Instagram Link:</label> <input class="form-control" type="text" name="instagram" autocomplete="off" value="<?php echo $getrs['instagram'] ?>" > </div> </div> <div class="card-footer text-right"> <button class="btn btn-primary">Submit</button> </div> <?php }else{?> <div class="card-body"> <div class="form-group"> <label for="name">Logo:</label><br> <img src="images/<?php echo $getrs['image'] ?>" width="150"> </div> <div class="form-group"> <label for="name">Email:</label> <input class="form-control" type="text" name="email" autocomplete="off" placeholder="Name" value="<?php echo $getrs['email'] ?>" disabled> </div> <div class="form-group"> <label for="name">Mobile Number:</label> <input class="form-control" type="text" name="mobile" autocomplete="off" placeholder="Name" value="<?php echo $getrs['mobile'] ?>" disabled> </div> <div class="form-group"> <label for="name">Office Address:</label> <textarea class="form-control" autocomplete="off" name="office_address" disabled> <?php echo $getrs['office_address'] ?></textarea> </div> <div class="form-group"> <label for="name">Whatsapp Number:</label> <input class="form-control" type="text" name="whatsapp" autocomplete="off" placeholder="Name" value="<?php echo $getrs['whatsapp'] ?>" disabled> </div> <div class="form-group"> <label for="name">Facebook Link:</label> <input class="form-control" type="text" name="fb_link" autocomplete="off" placeholder="Name" value="<?php echo $getrs['fb_link'] ?>" disabled> </div> <div class="form-group"> <label for="name">Instagram Link:</label> <input class="form-control" type="text" name="instagram" autocomplete="off" placeholder="Name" value="<?php echo $getrs['instagram'] ?>" disabled> </div> </div> <?php }?> </form> </div> </div> </div> </div> </section> </div> <?php require_once 'footer.php'; ?>