📁 File Manager
Editing:
/home/u845030939/domains/shahrikin.com/public_html/admin/doctor.php
<?php include("config.php") ?> <?php include("function.php") ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <link rel="shortcut icon" href="images/logo2.png"> <title>Admin | Services Detail</title> <!-- Base Css Files --> <link href="css/bootstrap.min.css" rel="stylesheet" /> <!-- Font Icons --> <link href="assets/font-awesome/css/font-awesome.min.css" rel="stylesheet" /> <link href="assets/ionicon/css/ionicons.min.css" rel="stylesheet" /> <link href="css/material-design-iconic-font.min.css" rel="stylesheet"> <!-- animate css --> <link href="css/animate.css" rel="stylesheet" /> <!-- Waves-effect --> <link href="css/waves-effect.css" rel="stylesheet"> <!-- Custom Files --> <link href="css/helper.css" rel="stylesheet" type="text/css" /> <link href="css/style.css" rel="stylesheet" type="text/css" /> <script src="js/modernizr.min.js"></script> <link href="assets/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css" /> <link href="assets/select2/select2.css" rel="stylesheet" type="text/css" /> <script src="https://cdn.ckeditor.com/4.14.1/standard/ckeditor.js"></script> <script src="ckeditor/ckeditor.js"></script> <script> function getSubcat(val) { $.ajax({ type: "POST", url: "get_subcat.php", data: 'p_id=' + val, success: function(data) { $("#subcategory").html(data); } }); } function selectCountry(val) { $("#search-box").val(val); $("#suggesstion-box").hide(); } </script> </head> <body class="fixed-left"> <!-- Begin page --> <div id="wrapper"> <!-- Top Bar Start --> <?php include("top.php"); ?> <!-- Top Bar End --> <!-- ========== Left Sidebar Start ========== --> <?php include("sidebar.php"); ?> <!-- Left Sidebar End --> <!-- ============================================================== --> <!-- Start right Content here --> <!-- ============================================================== --> <div class="content-page"> <!-- Start content --> <div class="content"> <div class="container"> <!-- Page-Title --> <div class="row"> <div class="col-sm-12"> <h4 class="pull-left page-title">Doctor</h4> <ol class="breadcrumb pull-right"> <li><a href="dashboard.php">Dashboard</a></li> <li class="active">Doctor</li> </ol> </div> </div> <?php if(isset($_GET['delete'])) { $delete=$_GET['delete']; } else { $delete=0; $slug=""; } $sql="delete from doctor where id='$delete'"; $res=mysqli_query($db,$sql); ?> <?php if(isset($_GET['slug'])) { $slug=$_GET['slug']; } else { $slug=0; } $sql="select * from doctor where id='$slug'"; $res=mysqli_query($db,$sql); $row=mysqli_fetch_array($res); $name=$row['name']; $email=$row['email']; $phone=$row['phone']; $gender=$row['gender']; $desc=$row['desc']; $education=$row['education']; $speciality=$row['speciality']; $area=$row['area']; $img=$row['image']; ?> <div class="row"> <div class="col-sm-12"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Doctor </h3> </div> <div class="panel-body"> <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data"> <div class="form-group"> <label class="col-md-2 control-label">Doctor Name</label> <div class="col-md-6"> <input type="text" class="form-control" name="name" value="<?php echo $name ?>" placeholder="Doctor Name"> </div> </div> <div class="form-group"> <label class="col-md-2 control-label">Doctor Email</label> <div class="col-md-6"> <input type="text" class="form-control" name="email" value="<?php echo $email ?>" placeholder="Doctor Email"> </div> </div> <div class="form-group"> <label class="col-md-2 control-label">Doctor phone</label> <div class="col-md-6"> <input type="tel" class="form-control" name="phone" value="<?php echo $phone ?>" placeholder="Doctor Phone"> </div> </div> <div class="form-group"> <label class="col-md-2 control-label">Gender</label> <div class="col-md-6"> <input type="radio" <?php echo $gender == 'male' ? 'checked':'' ?> name="gender" value="male"> Male <input type="radio" <?php echo $gender == 'female' ? 'checked':'' ?> name="gender" value="female"> Female </div> </div> <div class="form-group"> <label class="col-md-2 control-label">Doctor Education</label> <div class="col-md-6"> <input type="text" class="form-control" name="education" value="<?php echo $education ?>" placeholder="Doctor Education"> </div> </div> <div class="form-group"> <label class="col-md-2 control-label">Description</label> <div class="col-md-10"> <textarea class="wysihtml5 form-control" rows="5" name="desc"><?php echo $desc ?></textarea> </div> </div> <div class="form-group"> <label class="col-md-2 control-label">Speciality</label> <div class="col-md-6"> <input type="text" class="form-control" name="speciality" value="<?php echo $speciality ?>" placeholder="Doctor Area"> </div> </div> <div class="form-group"> <label class="col-md-2 control-label">Area of expertise</label> <div class="col-md-6"> <input type="text" class="form-control" name="area" value="<?php echo $area ?>" placeholder="Doctor Area"> </div> </div> <div class="form-group"> <label class="col-md-2 control-label">Doctor Image</label> <div class="col-md-3"> <div class="fileUpload btn btn-primary waves-effect waves-light"> <span>upload image here...</span> <input type="file" name="image" class="upload"> </div> </div> <div class="col-md-4"> <img src="upload/<?php echo $img; ?>" style="width: 100px;"> </div> </div> <div class="form-group"> <label class="col-md-2 control-label"></label> <div class="col-md-10"> <button type="submit" name="<?php if(isset($_GET['slug'])){ echo "Update"; }else { echo "Submit";} ?>" class="btn btn-purple waves-effect waves-light"><?php if(isset($_GET['slug'])){ echo "Update"; }else { echo "Submit";} ?></button> </div> </div> </form> <?php if(isset($_POST['Submit'])) { $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $gender = $_POST['gender']; $desc = $_POST['desc']; $education = $_POST['education']; $speciality = $_POST['speciality']; $area = $_POST['area']; $image = $_FILES['image']['name']; if(!$image) { $image = $img; } else { $file_path = 'upload/' . basename($_FILES['image']['name']); if(move_uploaded_file($_FILES['image']['tmp_name'], $file_path)) { } } $sql = "INSERT INTO `doctor` (`name`, `email`, `phone`, `gender`, `image`, `desc`, `education`, `speciality`, `area`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"; $stmt = $db->prepare($sql); $stmt->bind_param('sssssssss', $name, $email, $phone, $gender, $image, $desc, $education, $speciality, $area); if($stmt->execute()) { echo ("<script LANGUAGE='JavaScript'>window.alert('Successfully added.!!');window.location.href='doctor.php';</script>"); } else { echo ("<script LANGUAGE='JavaScript'>window.alert('Product Not Added.!!');window.location.href='doctor.php';</script>"); } $stmt->close(); } ?> <?php if(isset($_POST['Update'])) { $slug=$_GET['slug']; $name=$_POST['name']; $email=$_POST['email']; $phone=$_POST['phone']; $desc=$_POST['desc']; $education=$_POST['education']; $area=$_POST['area']; $image = $_FILES['image']['name']; if(!$image) { $image=$img; } else { $file_path = 'upload/'; $file_path = $file_path . basename( $_FILES['image']['name']); if(move_uploaded_file($_FILES['image']['tmp_name'], $file_path)) { } } // $sql="INSERT INTO `doctor` ( `name`,`email`,`phone`,`image`,`desc`,`education`,`educatio_desc`,`area_expertise`) VALUES ('$name','$email','$phone',' $image','$desc','$education','$education_desc','$area')"; $sql="update `doctor` set `name`='$name',`email`='$email',`phone`='$phone',`image`='$image',`desc`='$desc',`education`='$education',`area`='$area' where `id` ='$slug'"; $res=mysqli_query($db,$sql); if($res==1) { echo ("<script LANGUAGE='JavaScript'>window.alert('Succesfully Updated'); window.location.href='doctor.php';</script>"); header("doctor.php"); } else { echo ("<script LANGUAGE='JavaScript'>window.alert('Not Updated Data.!'); window.location.href='doctor.php';</script>"); /*echo "data not save";*/ } } ?> </div> <!-- panel-body --> </div> <!-- panel --> </div> <!-- col --> </div> <!-- End row --> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">View Product</h3> </div> <div class="panel-body"> <div class="row"> <div class="col-md-12 col-sm-12 col-xs-12"> <div class="table-responsive"> <table id="datatable" class="table table-striped table-bordered"> <thead> <tr> <th>ID</th> <th>Name</th> <th>Email</th> <th>Phone</th> <th>Gender</th> <th>Speciality</th> <th>Education</th> <!-- <th>Desc</th> --> <th>Area of Expertise</th> <th>Image</th> <th>Setting</th> </tr> </thead> <tbody> <?php $sql="SELECT * FROM `doctor` WHERE id"; $res=mysqli_query($db,$sql); while($row=mysqli_fetch_array($res)) { ?> <tr> <td><?php echo $row['id']; ?></td> <td><?php echo $row['name']; ?></td> <td><?php echo $row['email']; ?></td> <td><?php echo $row['phone']; ?></td> <td><?php echo $row['gender']; ?></td> <td><?php echo $row['speciality']; ?></td> <td><?php echo $row['education']; ?></td> <!-- <td><?php echo $row['desc']; ?></td> --> <td><?php echo $row['area']; ?></td> <td><img style="width: 80px;" src="upload/<?php echo$row['image']; ?>"></td> <td> <a href="doctor.php?slug=<?php echo $row['id']; ?>"> <button class="btn btn-icon waves-effect waves-light btn-primary m-b-5"> <i class="fa fa-pencil"></i> </button> </a> <a href="doctor.php?delete=<?php echo $row['id']; ?>"> <button class="btn btn-icon waves-effect waves-light btn-danger m-b-5" onclick="return confirm('Are you sure you want to delete this item?');"> <i class="fa fa-remove"></i> </button> </a> </td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> </div> </div> </div> <!-- End Row --> </div> <!-- container --> </div> <!-- content --> <?php include("footer.php") ?> </div> <!-- ============================================================== --> <!-- End Right content here --> <!-- ============================================================== --> <!-- Right Sidebar --> <!-- /Right-bar --> </div> <!-- END wrapper --> <script> var resizefunc = []; </script> <!-- jQuery --> <script src="js/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/waves.js"></script> <script src="js/wow.min.js"></script> <script src="js/jquery.nicescroll.js" type="text/javascript"></script> <script src="js/jquery.scrollTo.min.js"></script> <script src="assets/jquery-detectmobile/detect.js"></script> <script src="assets/fastclick/fastclick.js"></script> <script src="assets/jquery-slimscroll/jquery.slimscroll.js"></script> <script src="assets/jquery-blockui/jquery.blockUI.js"></script> <!-- CUSTOM JS --> <script src="js/jquery.app.js"></script> <script src="assets/datatables/jquery.dataTables.min.js"></script> <script src="assets/datatables/dataTables.bootstrap.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#datatable').dataTable(); }); </script> <script type="text/javascript"> jQuery(document).ready(function() { jQuery(".select2").select2({ width: '100%' }); }); </script> <script src="assets/select2/select2.min.js" type="text/javascript"></script> <script> CKEDITOR.replace('editor1'); </script> <script> CKEDITOR.replace('editor2'); </script> <script src="assets/select2/select2.min.js" type="text/javascript"></script> <script type="text/javascript" src="assets/bootstrap-wysihtml5/wysihtml5-0.3.0.js"></script> <script type="text/javascript" src="assets/bootstrap-wysihtml5/bootstrap-wysihtml5.js"></script> <!--form validation init--> <script> $(document).on("change keyup blur", "#chDiscount", function() { var main = $('#cBalance').val(); var disc = $('#chDiscount').val(); var dec = (disc / 100).toFixed(2); //its convert 10 into 0.10 var mult = main * dec; // gives the value for subtract from main value var discont = main - mult; $('#result').val(discont); }); </script> </body> </html>
Save
Cancel