[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: edit_maker.php
<?php include('header.php'); ?> <script> $(document).ready(function(){ $('#phn').blur(function(){ var phn1=$('#phn').val(); //alert(phn1); $.ajax({ type:"POST", url:"ajax_check.php", data:$('#exampleValidation').serialize(), success: function (response){ //alert(response); if(response>0){ $('#error').show(); $('#phn').val(''); // sweetAlert('Phone no given is already in use'); document.getElementById("btn").disabled = true; }else{ // sweetAlert('Oops','Phone no given is already in use','error'); $('#error').hide(); document.getElementById("btn").disabled = false; } } }); }); }); $(document).ready(function(){ $('#email').blur(function(){ var em=$('#email').val(); $.ajax({ type:"POST", url:"ajax_check.php", data:$('#exampleValidation').serialize(), success: function (response){ if(response>0){alert(response); $('#error1').show(); $('#email').val(''); document.getElementById("btn").disabled = true; }else{ $('#error1').hide(); document.getElementById("btn").disabled = false; } } }); }); }); </script> <div class="main-panel"> <div class="content"> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="card"> <div class="card-header"> <div class="card-title">Edit Food Makers</div> </div> <?php $sr='food_maker'; $stmt =$show->readwithdata($sr,'id',$_REQUEST['id']); $num = $stmt->rowCount(); if($num>0){ $count=1; while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){ ?> <form method="post" id="exampleValidation" data-toggle="validator" enctype="multipart/form-data" > <input type="hidden" name="tablename" value="food_maker"> <div class="card-body"> <div class="form-group form-show-validation row"> <label for="name" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 text-right">Maker ID <span class="required-label">*</span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <input type="text" class="form-control" id="name" name="name" value="<?=$row['maker_id']?>" placeholder="Enter Name" readonly> </div> </div> <div class="form-group form-show-validation row"> <label for="name" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 text-right">Name <span class="required-label">*</span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <input type="text" class="form-control" id="name" name="name" value="<?=$row['name']?>" placeholder="Enter Name" readonly> </div> </div> <div class="form-group form-show-validation row"> <label for="email" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 text-right">Email Address <span class="required-label"></span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <input type="email" class="form-control" value="<?=$row['email']?>" name="email" id="email" placeholder="Enter Email"> <small class="text-warning" id="error1" style="display:none">Email ID already in use.Please Give another Email ID</small> </div> </div> <div class="form-group form-show-validation row"> <label for="email" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 text-right">Phone<span class="required-label">*</span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <input type="text" class="form-control" id="phn" value="<?=$row['phone']?>" name="phone" placeholder="Enter Phone" required> <small class="text-warning" id="error" style="display:none">Phone Number already in use.Please Give another Phone Number</small> </div> </div> <div class="seperator-solid"></div> <div class="form-group form-show-validation row"> <label for="birth" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 text-right">State <span class="required-label">*</span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <div class="select2-input"> <select id="state" name="state" class="form-control" > <option value="">State</option> <?php $table1='state_list'; $stmt1=$show->state($table1); $num1=$stmt1->rowCount(); if($num1>0){ while($row1=$stmt1->fetch(PDO::FETCH_ASSOC)){ echo "<option value='".$row1['state']."'";if($row['state']==$row1['state']) echo "selected"; echo ">".$row1['state']."</option>"; } } ?> </select> </div> </div> </div> <div class="form-group form-show-validation row"> <label for="confirmpassword" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 text-right">City<span class="required-label">*</span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <input type="text" class="form-control" value="<?=$row['city']?>" name="city" placeholder="Enter City" required> </div> </div> <div class="form-group form-show-validation row"> <label for="confirmpassword" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 text-right">Pincode<span class="required-label">*</span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <input type="text" class="form-control" value="<?=$row['pincode']?>" name="pincode" placeholder="Enter Pincode" required> </div> </div> <div class="form-group form-show-validation row"> <label for="confirmpassword" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 text-right">Address<span class="required-label">*</span></label> <div class="col-lg-8 col-md-9 col-sm-8"> <input type="text" class="form-control" value="<?=$row['address']?>" name="address" placeholder="Enter Address" required> </div> </div> <div class="seperator-solid"></div> <div class="form-group form-show-validation row"> <label class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 text-right">Update Image <span class="required-label">*</span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <div class="input-file input-file-image"> <input type="hidden" value="<?=$row['profile_pic']?>" name="pic"> <img class="img-upload-preview img-circle" width="100" height="100" src="<?php if($row['profile_pic']==""){?>http://placehold.it/100x100 <?php }else{ echo $pic_img."/".$row['profile_pic']; }?>" alt="preview"> <input type="file" class="form-control form-control-file" id="uploadImg" name="uploadImg" onchange="return fileValidation('uploadImg','100')" accept="image/*" > <label for="uploadImg" class=" label-input-file btn btn-icon btn-primary btn-round btn-lg"><i class="la la-file-image-o"></i> Upload a Image</label> </div> </div> </div> </div> <div class="card-action"> <div class="row"> <div class="col-md-12"> <input class="btn btn-success" type="submit" name="sub" value="Update"> <button class="btn btn-danger">Cancel</button> </div> </div> </div> </form> <?php } } ?> </div> </div> <?php if(isset($_POST['sub'])){ $allowed = ["email","phone","address","state","pincode","city"]; $params = []; $setStr = ""; foreach ($allowed as $key) { if (isset($_POST[$key]) && $key != "uid") { $setStr .= "`$key` = :$key,"; $params[$key] = htmlspecialchars(strip_tags($_POST[$key])); } } if(file_exists($_FILES['uploadImg']['tmp_name']) || is_uploaded_file($_FILES['uploadImg']['tmp_name'])) { $path="../product_img/".$_POST['pic']; unlink($path);//echo $path; $setStr .= "`profile_pic` = :profile_pic,"; $img=$show->imageEdit($_FILES['uploadImg']['name']); move_uploaded_file($_FILES['uploadImg']['tmp_name'],"../product_img/".$img); $params['profile_pic'] =$img; } $setStr = rtrim($setStr, ","); $params['id'] =$_REQUEST['id']; $show->table ='food_maker'; $show->cols =$setStr; $show->id_name ='id'; $show->params =$params; print_r($params); if($show->update_all()){ echo '<script> setTimeout(function() { swal({ title: "Thank You ", text: "for Updating!", type: "success" }, function() { window.location = "'.$_SERVER['REQUEST_URI'].'"; }); }, 1000); </script>'; } else{ echo "ss"; } }?> <script src="assets/js/plugin/datepicker/bootstrap-datetimepicker.min.js"></script> <script src="assets/js/plugin/datepicker/bootstrap-datepicker.js"></script> <script> $(document).ready(function(){ $("#date1").datepicker({ format: 'dd-mm-yyyy', }); $("#date2").datepicker({ format: 'dd-mm-yyyy', }); $("#date3").datepicker({ format: 'dd-mm-yyyy', }); $("#date4").datepicker({ format: 'dd-mm-yyyy', }); });</script> </div></div> </div> </div> <!--footer--> <?php include('footer.php'); ?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 692.03 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619