[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: edit_suppliers.php
<?php include('header.php'); ?> <script> $( function() { $( "#datepicker" ).datepicker({ dateFormat: 'dd-mm-yy', }); }); $(document).ready(function(){ $("#date").datepicker({ dateFormat: 'dd-mm-yy', }); }); </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 Suppliers</div> </div> <?php $sr='suppliers'; $stmt =$show->readwithdata($sr,'id',$_REQUEST['id']); $num = $stmt->rowCount(); if($num>0){ $count=1; while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){ $uname=$row['company_name']; $uemail=$row['company_email']; $uphone=$row['company_phone']; $address=$row['address']; $pid=$row['id']; $website=$row['website']; $type=$row['type']; $manu_address=$row['manu_address']; $manu_pincode=$row['manu_pincode']; $product_information=$row['product_information']; $other_information=$row['other_information']; $date=date('d-m-Y',strtotime($row['date'])); $manu_city=$row['manu_city']; $manu_country=$row['manu_country']; $pincode=$row['pincode']; $city=$row['city']; $country=$row['country']; $name=$row['name']; $email=$row['email']; $phone=$row['phone']; } } ?> <form method="post" id="exampleValidation" data-toggle="validator" enctype="multipart/form-data" > <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">Type<span class="required-label">*</span></label> <div class="col-lg-9 col-md-9 col-sm-8"> <?php $interests = array('manufacturer','trader'); ?> <select class="form-control" name="type" onchange="status(<?=$count;?>)" id="status<?=$count;?>"> <?php foreach( $interests as $interest ): ?> <option value="<?php echo $interest ?>"<?php if( $interest==$type): ?> selected="selected"<?php endif; ?>><?php echo $interest ?></option> <?php endforeach; ?> </select> </div> </div> <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">Company 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="company_name" value="<?=$uname?>" placeholder="Enter Name" > </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">Company 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="company_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">Company 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="company_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="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="<?=$address?>" name="address" placeholder="Enter Address" required> </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">Country<span class="required-label"></span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <input type="text" class="form-control" name="country" value="<?=$country?>" placeholder="Country" > </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">City<span class="required-label"></span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <input type="text" class="form-control" name="city" value="<?=$city?>" placeholder="City" > </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">Pincode<span class="required-label"></span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <input type="text" class="form-control" name="pincode" value="<?=$pincode?>" placeholder="pincode" > </div> </div> <?php if($type=="manufacturer"){ ?> <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">Manufacturer unit 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="<?=$manu_address?>" name="manu_address" placeholder="Enter Address" required> </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">Manufacturer unit Country</label> <div class="col-lg-4 col-md-9 col-sm-8"> <input type="text" class="form-control" name="manu_country" value="<?=$manu_country?>" placeholder="Country" > </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">Manufacturer unit City</label> <div class="col-lg-4 col-md-9 col-sm-8"> <input type="text" class="form-control" name="manu_city" value="<?=$manu_city?>" placeholder="City" > </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">Manufacturer unit Pincode</label> <div class="col-lg-4 col-md-9 col-sm-8"> <input type="text" class="form-control" name="manu_pincode" value="<?=$manu_pincode?>" placeholder="pincode" > </div> </div> <?php } ?> <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">Product Information<span class="required-label"></span></label> <div class="col-lg-9 col-md-9 col-sm-8"> <input type="text" class="form-control" name="product_information" value="<?=$product_information?>" placeholder="pincode" > </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">Other Information<span class="required-label"></span></label> <div class="col-lg-9 col-md-9 col-sm-8"> <input type="text" class="form-control" name="other_information" value="<?=$other_information?>" placeholder="pincode" > </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="<?=$name?>" placeholder="Enter Name" > </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 <span class="required-label"></span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <input type="email" class="form-control" value="<?=$email?>" name="email" id="email" placeholder="Enter Email"> </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-9 col-md-9 col-sm-8"> <input type="text" class="form-control" id="phn" value="<?=$phone?>" name="phone" placeholder="Enter Phone" > </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> </div> </div> <?php if(isset($_POST['sub'])){ $allowed = ["email","phone","name","p_address","company_name","company_email","company_phone","website","country","city","pincode","address","type","manu_country","manu_city", "manu_pincode","manu_address","product_information","other_information","email","name","phone"]; $params = []; $setStr = ""; foreach ($allowed as $key) { if (isset($_POST[$key]) && $key != "uid") { $setStr .= "`$key` = :$key,"; $params[$key] = htmlspecialchars(strip_tags($_POST[$key])); } } $setStr = rtrim($setStr, ","); $params['id'] =$_REQUEST['id']; $show->table ='suppliers'; $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"; } }?> </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