D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
vitalityhealth
/
www
/
superadmin
/
Filename :
edit-business.php
back
Copy
<?php include 'cn.php'; session_start(); $sno=$_GET["id"]; $sql = "SELECT * FROM business WHERE id='$sno'" ; $result = $con->query($sql); $row = $result->fetch_assoc(); if(isset($_SESSION['username'])) { if(isset($_POST['submit'])) { date_default_timezone_set('Asia/Kolkata'); $curdate= date('d-m-Y H:i'); if($_FILES['file1']['name']==''){ $f1 = $row['image']; }else{ $f1 = $_FILES['file1']['name']; move_uploaded_file($_FILES['file1']['tmp_name'],'business/'.$f1); } $dec= $_POST['editor']; /* echo $imageName; echo $_POST['name']; echo $_POST['price']; echo $_POST['category']; echo $_POST['description']; echo $_POST['pid'];die;*/ $query1 ="UPDATE `business` SET `name`='".$_POST['name']."',`category`='".$_POST['category']."',`tag`='".$_POST['tag']."',`image`='".$f1."',`address`='".$_POST['address']."',`website`='".$_POST['website']."',`facebook`='".$_POST['facebook']."',`instagram`='".$_POST['instagram']."',`whatsapp`='".$_POST['whatsapp']."',`number`='".$_POST['number']."',`email`='".$_POST['email']."',`verified`='".$_POST['verified']."',`city`='".$_POST['city']."' WHERE id='$sno'"; $result=mysqli_query($con,$query1); echo "<script type='text/javascript'>alert(\"Updated Successfully\") location.href='business.php'; </script>"; } ?> <!doctype html><html class="fixed dark" data-style-switcher-options="{'backgroundColor': 'dark'}"> <head> <!-- Basic --> <meta charset="UTF-8"> <title>Mether</title> <!-- Mobile Metas --> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <!-- Web Fonts --> <link href="css?family=Poppins:300,400,500,600,700,800|Shadows+Into+Light" rel="stylesheet" type="text/css"> <!-- Vendor CSS --> <link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.css"> <link rel="stylesheet" href="vendor/animate/animate.compat.css"> <link rel="stylesheet" href="vendor/font-awesome/css/all.min.css"> <link rel="stylesheet" href="vendor/boxicons/css/boxicons.min.css"> <link rel="stylesheet" href="vendor/magnific-popup/magnific-popup.css"> <link rel="stylesheet" href="vendor/bootstrap-datepicker/css/bootstrap-datepicker3.css"> <!-- Specific Page Vendor CSS --> <!-- Theme CSS --> <link rel="stylesheet" href="css/theme.css"> <!-- Theme Custom CSS --> <link rel="stylesheet" href="css/custom.css"> <!-- Head Libs --> <script src="vendor/modernizr/modernizr.js"></script> <script src="master/style-switcher/style.switcher.localstorage.js"></script> </head> <body> <section class="body"> <!-- start: header --> <?php include("header.php"); ?> <!-- end: header --> <div class="inner-wrapper"> <!-- start: sidebar --> <?php include("leftnav.php"); ?> <!-- end: sidebar --> <section role="main" class="content-body card-margin"> <header class="page-header"> <h2>Edit Business</h2> <div class="right-wrapper text-end"> <ol class="breadcrumbs"> <li> <a href="index.php"> <i class="bx bx-home-alt"></i> </a> </li> <li><span>Edit Business</span></li> </ol> <a class="sidebar-right-toggle" data-open="sidebar-right"><i class="fas fa-chevron-left"></i></a> </div> </header> <!-- start: page --> <div class="row"> <div class="col-lg-12"> <section class="card"> <header class="card-header"> <div class="card-actions"> <a href="#" class="card-action card-action-toggle" data-card-toggle=""></a> </div> <h2 class="card-title">Edit Business</h2> </header> <form action="" method="post" enctype="multipart/form-data"> <div class="card-body"> <div class="row form-group pb-3"> <div class="col-lg-4"> <div class="form-group"> <label class="col-form-label" for="formGroupExampleInput">Name</label> <input type="text" class="form-control" name="name" placeholder="" required value="<?php echo $row['name']; ?>"> </div> </div> <div class="col-lg-4"> <div class="form-group"> <label class="col-form-label" for="formGroupExampleInput">Category </label> <select name="category" class="form-control"> <option value="<?php echo $row['category']; ?> "><?php echo $row['category']; ?> </option> <?php include("superadmin/cn.php"); $sql1 ="SELECT * FROM `category`"; $run1 =mysqli_query($con,$sql1); while($row1 = $run1->fetch_assoc()) { ?> <option value="<?php echo $row1['name']; ?> "><?php echo $row1['name']; ?> </option> <?php } ?> </select> </div> </div> <div class="col-lg-4"> <div class="form-group"> <label class="col-form-label" for="formGroupExampleInput">Category </label> <select name="tag" class="form-control"> <option value="<?php echo $row['tag']; ?> "><?php echo $row['tag']; ?> </option> <?php include("superadmin/cn.php"); $sql2 ="SELECT * FROM `tags`"; $run2 =mysqli_query($con,$sql2); while($row2 = $run2->fetch_assoc()) { ?> <option value="<?php echo $row2['name']; ?> "><?php echo $row2['name']; ?> </option> <?php } ?> </select> </div> </div> <div class="col-lg-4"> <div class="form-group"> <label class="col-form-label" for="formGroupExampleInput">Image</label> <input type="file" class="form-control" name="file1" id="file1" > <img src="business/<?php echo $row['image']; ?>" style="width:50px;height:50px;"/> </div> </div> <div class="col-lg-8"> <div class="form-group"> <label class="col-form-label" for="formGroupExampleInput">Address</label> <input type="text" class="form-control" name="address" placeholder="" value="<?php echo $row['address']; ?>"> </div> </div> <div class="col-lg-3"> <div class="form-group"> <label class="col-form-label" for="formGroupExampleInput">Website URL</label> <input type="text" class="form-control" name="website" placeholder="" value="<?php echo $row['website']; ?>"> </div> </div> <div class="col-lg-3"> <div class="form-group"> <label class="col-form-label" for="formGroupExampleInput">Facebook URL</label> <input type="text" class="form-control" name="facebook" placeholder="" value="<?php echo $row['facebook']; ?>"> </div> </div> <div class="col-lg-3"> <div class="form-group"> <label class="col-form-label" for="formGroupExampleInput">Instagram</label> <input type="text" class="form-control" name="instagram" placeholder="" required value="<?php echo $row['instagram']; ?>"> </div> </div> <div class="col-lg-3"> <div class="form-group"> <label class="col-form-label" for="formGroupExampleInput">Whatsapp</label> <input type="text" class="form-control" name="whatsapp" placeholder="" required value="<?php echo $row['whatsapp']; ?>"> </div> </div> <div class="col-lg-3"> <div class="form-group"> <label class="col-form-label" for="formGroupExampleInput">Phone</label> <input type="text" class="form-control" name="number" placeholder="" required value="<?php echo $row['number']; ?>"> </div> </div> <div class="col-lg-3"> <div class="form-group"> <label class="col-form-label" for="formGroupExampleInput">Email</label> <input type="email" class="form-control" name="email" placeholder="" required value="<?php echo $row['email']; ?>"> </div> </div> <div class="col-lg-3"> <div class="form-group"> <label class="col-form-label" for="formGroupExampleInput">City</label> <select name="city" class="form-control"> <option value="<?php echo $row['city']; ?>"><?php echo $row['city']; ?></option> <?php $sql1 ="SELECT * FROM `city`"; $run1 =mysqli_query($con,$sql1); $i=1; while($row1 = $run1->fetch_assoc()) { ?> <option value="<?php echo $row1['name']; ?>"><?php echo $row1['name']; ?></option> <?php } ?> </select> </div> </div> <div class="col-lg-3"> <div class="form-group"> <label class="col-form-label" for="formGroupExampleInput">Verfied</label> <select name="verified" class="form-control"> <option value="<?php echo $row['verified']; ?>"><?php echo $row['verified']; ?></option> <option value="Yes">Yes</option> <option value="No">No</option> </select> </div> </div> </div> </div> <footer class="card-footer text-end"> <center> <button class="mb-1 mt-1 me-1 btn btn-success" name="submit">Submit</button></center> </footer> </form> </section> </div> </div> <!-- end: page --> </section> </div> <?php include("rightnav.php"); ?> </section> <!-- Vendor --> <script src="vendor/jquery/jquery.js"></script> <script src="vendor/jquery-browser-mobile/jquery.browser.mobile.js"></script> <script src="vendor/jquery-cookie/jquery.cookie.js"></script> <script src="vendor/popper/umd/popper.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> <script src="vendor/bootstrap-datepicker/js/bootstrap-datepicker.js"></script> <script src="vendor/common/common.js"></script> <script src="vendor/nanoscroller/nanoscroller.js"></script> <script src="vendor/magnific-popup/jquery.magnific-popup.js"></script> <script src="vendor/jquery-placeholder/jquery.placeholder.js"></script> <!-- Specific Page Vendor --> <!-- Theme Base, Components and Settings --> <script src="js/theme.js"></script> <!-- Theme Custom --> <script src="js/custom.js"></script> <!-- Theme Initialization Files --> <script src="js/theme.init.js"></script> <!-- Analytics to Track Preview Website --> </body> </html> <?php } else { header("location:login.php"); } ?>