[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: add_customer.php
<?php include 'header.php';?> <style> .col-md-3,.col-md-2,.col-md-6{ display:inline-block !important; } </style> <script> $(document).ready(function(){ // Add more $('#type').change(function(){ var type = $('#type').val(); // alert(type); if(type=='Direct'){ $('#direct').show(); $('#agent').hide(); }else{ $('#direct').hide(); $('#agent').show(); } }); }); </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">Add Customer</div> </div> <form method="post" id="exampleValidation" data-toggle="validator" enctype="multipart/form-data" > <div class="card-body"> <div class="form-group form-show-validation row"> <div class="col-lg-3 col-md-12 col-sm-12"> <label>Source Type <span class="required-label">*</span></label> <select name="type" id="type" class="form-control" required> <option value="">Type</option> <option value="Direct">Direct</option> <option value="Via Agent">Via Agent</option> </select> </div> <div class="col-lg-3 col-md-12 col-sm-12" id="direct" style="display:none"> <label>Source <span class="required-label">*</span></label> <select name="source" class="form-control"> <option value="">Source</option> <?php $table1='source'; $stmt=$show->readAll($table1); $num=$stmt->rowCount(); if($num>0){ while($row=$stmt->fetch(PDO::FETCH_ASSOC)){ echo "<option value='".$row['source']."'"; echo ">".$row['source']."</option>"; } } ?> </select> </div> <div class="col-lg-3 col-md-12 col-sm-12" id="agent" style="display:none"> <label>Choose Agent <span class="required-label">*</span></label> <select name="agent" class="form-control" > <option value="">Agent</option> <?php $table1='agent'; $stmt=$show->readAll($table1); $num=$stmt->rowCount(); if($num>0){ while($row=$stmt->fetch(PDO::FETCH_ASSOC)){ echo "<option value='".$row['agent_id'].":".$row['name'].":".$row['phone']."'"; echo ">".$row['name']."</option>"; } } ?> </select> </div> </div> <div class="form-group form-show-validation row"> <label for="name" class="col-lg-1 col-md-3 col-sm-4 mt-sm-2 ">Name <span class="required-label">*</span></label> <div class="col-lg-3 col-md-12 col-sm-12"> <input type="text" name="name" class="form-control" placeholder="Name"> </div> <label for="name" class="col-lg-1 col-md-3 col-sm-4 mt-sm-2 ">Phone <span class="required-label">*</span></label> <div class="col-lg-3 col-md-12 col-sm-12"> <input type="text" name="phone" class="form-control" placeholder="Phone" required> </div> <label for="name" class="col-lg-1 col-md-3 col-sm-4 mt-sm-2 ">Alt Phone </label> <div class="col-lg-3 col-md-12 col-sm-12"> <input type="text" name="alt_phone" class="form-control" placeholder="Phone" > </div> </div> <div class="form-group form-show-validation row"> <label for="name" class="col-lg-1 col-md-3 col-sm-4 mt-sm-2 ">Email </label> <div class="col-lg-3 col-md-12 col-sm-12"> <input type="email" name="email" class="form-control" placeholder="Email"> </div> <label for="name" class="col-lg-1 col-md-3 col-sm-4 mt-sm-2 ">Address</label> <div class="col-lg-3 col-md-12 col-sm-12"> <input type="text" name="address" class="form-control" placeholder="Address"> </div> <label for="name" class="col-lg-1 col-md-3 col-sm-4 mt-sm-2 ">Location </label> <div class="col-lg-3 col-md-12 col-sm-12"> <input type="text" name="location" class="form-control" placeholder="Location"> </div> </div> <div class="form-group form-show-validation row"> <label for="name" class="col-lg-1 col-md-3 col-sm-4 mt-sm-2 ">Country </label> <div class="col-lg-3 col-md-12 col-sm-12"> <input type="text" name="country" class="form-control" placeholder="Country"> </div> <label for="name" class="col-lg-2 col-md-3 col-sm-4 mt-sm-2 ">Company Name </label> <div class="col-lg-3 col-md-12 col-sm-12"> <input type="text" name="company_name" class="form-control" placeholder="Company Name"> </div> </div> <div class="form-group form-show-validation row"> <label for="name" class="col-lg-2 col-md-3 col-sm-4 mt-sm-2 ">Company Address</label> <div class="col-lg-6 col-md-12 col-sm-12"> <input type="text" name="company_address" class="form-control" placeholder="Company Address"> </div> <label for="name" class="col-lg-1 col-md-3 col-sm-4 mt-sm-2 ">State</label> <div class="col-lg-3 col-md-12 col-sm-12"> <select name="state" class="form-control" > <option value="">State</option> <?php $table1='state_list'; $stmt=$show->state($table1); $num=$stmt->rowCount(); if($num>0){ while($row=$stmt->fetch(PDO::FETCH_ASSOC)){ echo "<option value='".$row['state']."'"; echo ">".$row['state']."</option>"; } } ?> </select> </div> </div> <div class="form-group form-show-validation row"> <label for="name" class="col-lg-2 col-md-3 col-sm-4 mt-sm-2 ">GSTIN</label> <div class="col-lg-3 col-md-12 col-sm-12"> <input type="text" name="gstin" class="form-control" placeholder="GSTIN"> </div> <label for="name" class="col-lg-2 col-md-3 col-sm-4 mt-sm-2 ">Other Details</label> <div class="col-lg-5 col-md-12 col-sm-12"> <input type="text" name="others" class="form-control" placeholder="Other Details"> </div> </div> <div class="form-group form-show-validation row"> <label for="name" class="col-lg-2 col-md-3 col-sm-4 mt-sm-2 ">Description </label> <div class="col-lg-9 col-md-12 col-sm-12"> <textarea name="description" class="form-control" placeholder="Country"></textarea> </div> </div> <div class="card-action"> <div class="row"> <div class="col-md-12"> <input class="btn btn-success" type="submit" name="sub" value="Submit"> </div> </div> </div> </div> </form> <?php if(isset($_POST['sub'])){ $uid=$show->getid('ids','CLI'); $client=explode(':',$_POST['agent']); $data = array( 'name' =>htmlspecialchars($_POST['name']), 'phone' =>htmlspecialchars($_POST['phone']), 'alt_phone' =>htmlspecialchars($_POST['alt_phone']), 'email' =>htmlspecialchars($_POST['email']), 'address' =>htmlspecialchars($_POST['address']), 'country' =>htmlspecialchars($_POST['country']), 'location' =>htmlspecialchars($_POST['location']), 'company_name' =>htmlspecialchars($_POST['company_name']), 'company_address' =>htmlspecialchars($_POST['company_address']), 'description' =>htmlspecialchars($_POST['description']), 'type' =>htmlspecialchars($_POST['type']), 'source' =>htmlspecialchars($_POST['source']), 'state' =>htmlspecialchars($_POST['state']), 'agent_id' =>$client[0], 'agent_name' =>$client[1], 'agent_phone' =>$client[2], 'client_id' =>$uid, 'status' =>'Active', 'gstin' =>htmlspecialchars($_POST['gstin']), 'others' =>htmlspecialchars($_POST['others']), ); //print_r($data); if($show->insert('client',$data)){ echo '<script> setTimeout(function() { swal({ title: "Thank You !", text: "Your Client has been submitted.", type: "success" }, function() { window.location = "'.$_SERVER['REQUEST_URI'].'"; }); }, 1000); </script>'; //echo "<script>swal('Thank you for Registration.');window.location.href='".$_SERVER['request_uri']."';</script>"; } } ?> </div> </div> </div> </div> </div> <?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.72 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