[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: edit_maker.php
<?php include('header.php'); ?> <style type="text/css"> #fli,#fli1 { width: 79%; height: 42px; } #display { position:absolute; width:303; margin-left:0; margin-top:0; padding:2px; display:none; border-top:0px; overflow:auto; border:1px #CCC solid; background-color: white; z-index:1000; } .show11,.show12 { padding:7px; border-bottom:1px #999 dashed; font-size:13px; } .show11:hover,.show1:hover { background:#1da1f2; color:#000; cursor:pointer; } .widget{ overflow:visible !important; } </style> <script> function fill(Value) { $('#loc').val(Value); $('#display').hide(); //window.location.href='product1.php?cate='+Value+''; } $(document).ready(function(){ $("#loc").keyup(function() { var search = $('#loc').val(); //alert(search); if(search=="") { $("#display").html(""); } else { $.ajax({ type: "POST", url: "ajax_check.php", data: "search_loc="+ search , beforeSend: function(){ /* Show image container */ $("#loader").show(); }, success: function(html){ $("#display").html(html).show(); $("#loader").hide(); } }); } }); }); </script> <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)){ $ustate=$row['state']; $utitle=$row['title']; $maker_id=$row['maker_id']; $uname=$row['name']; $uemail=$row['email']; $uphone=$row['phone']; $ucity=$row['city']; $upincode=$row['pincode']; $uadd=$row['address']; $banner=$row['banner']; $profile_pic=$row['profile_pic']; $local=explode(':',$row['locality']); $locality=$row['locality']; $pid=$row['id']; $comi_percent=$row['comi_percent']; } //echo $ustate; ?> <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">Business 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="title" value="<?=$utitle?>" placeholder="Enter Name"> </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">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="<?=$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="<?=$uname?>" 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="<?=$uemail?>" 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="<?=$uphone?>" 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"> <select name="state" class="form-control" > <option value="">State</option> <?php $table1='states'; $stmt1=$show->state($table1); $num1=$stmt1->rowCount(); if($num1>0){ while($row1=$stmt1->fetch(PDO::FETCH_ASSOC)){ echo "<option value='".$row1['state_name']."'";if($ustate==$row1['state_name']) echo "selected"; echo ">".$row1['state_name']."</option>"; } } ?> </select> </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="<?=$ucity?>" 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="<?=$upincode?>" name="pincode" placeholder="Enter Pincode" required> </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">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="<?=$uadd?>" name="address" placeholder="Enter Address" required> </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">Comission Percent <span class="required-label">*</span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <input type="number" step="any" class="form-control" name="comi_percent" value="<?=$comi_percent?>" 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="<?=$profile_pic?>" name="pic"> <img class="img-upload-preview img-circle" width="100" height="100" src="<?php if($profile_pic==""){?>http://placehold.it/100x100 <?php }else{ echo $pic_img."/".$profile_pic; }?>" alt="preview"> <input type="file" class="form-control form-control-file" id="uploadImg" name="uploadImg" onchange="return fileValidation('uploadImg','2500')" 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 class="form-group form-show-validation row"> <label class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 text-right">Update Banner <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="<?=$banner?>" name="ban"> <img class="img-upload-preview img-circle" width="100" height="100" src="<?php if($banner==""){?>http://placehold.it/100x100 <?php }else{ echo $pic_img."/".$banner; }?>" alt="preview"> <input type="file" class="form-control form-control-file" id="banner" name="banner" onchange="return fileValidation('banner','2500')" accept="image/*" > <label for="banner" 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","locality","title","comi_percent"]; $params = []; $setStr = ""; foreach ($allowed as $key) { if (isset($_POST[$key]) && $key != "uid") { $setStr .= "`$key` = :$key,"; $params[$key] = htmlspecialchars($_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; } if(file_exists($_FILES['banner']['tmp_name']) || is_uploaded_file($_FILES['banner']['tmp_name'])) { $path="../product_img/".$_POST['ban']; unlink($path);//echo $path; $setStr .= "`banner` = :banner,"; $img=$show->imageEdit($_FILES['banner']['name']); move_uploaded_file($_FILES['banner']['tmp_name'],"../product_img/".$img); $params['banner'] =$img; } $locvalue=array(); foreach($_POST['locality'] as $key=>$value){ $locvalue[]=$value; } $newval=implode(':',$locvalue); if($newval==''){ $value_locality=$locality; }else $value_locality=$locality.":".$newval; echo $value_locality; $a=implode(':', $locality); $setStr .= "`locality` = :locality,"; $params['locality'] =$value_locality; $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 type="text/javascript"> $(document).ready(function(){ // Add more $('#addmore').click(function(){ // Get last id var lastname_id = $('.tr_input input[type=text]:nth-child(1)').last().attr('id'); var split_id = lastname_id.split('_'); // alert('ss'); // New index var index = Number(split_id[1]) + 1; document.getElementById('getid').value=index; // Create row with input elements var html = "<tr ><td><div class='col-lg-4 col-md-9 col-sm-8'><input type='text' class='form-control' placeholder='Enter Locality' id='testcode_"+index+"' onkeyup='get_loc("+index+")' name='locality[]'/> <div id='loader"+index+"' style='display: none;'><img src='loader.gif' width='32px' height='32px'></div><div id='display"+index+"'></div></div></td><td><a href='javascript:void(0);' id='remove_field' class='btn btn-danger remCF' >-</a></tr>"; // Append data $('#tab').append(html); }); $("#tab").on('click','.remCF',function(){ $(this).parent().parent().remove(); var lastname_id = document.getElementById('getid').value; //alert(lastname_id); // New index var index = lastname_id - 1; // Create row with input elements document.getElementById('getid').value=index; }); }); function filld(Value,Value1) { $('#testcode_'+Value).val(Value1); $('#display'+Value).hide(); //$('#totalp').val(Value3); //getvalue(Value3); } function get_loc(a){ var test_id='#testcode_'+a; var test_id_value=$(test_id).val(); //alert(test_id); $.ajax({ type:"POST", url:"ajax_check.php", data:"locality="+test_id_value+"&dynamic_num="+a, beforeSend: function(){ $("#loader"+a).show(); }, success: function(html){ $("#display"+a).html(html).show(); $("#loader"+a).hide(); } }); } </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: 677.49 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