[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: client.php
<?php ob_start(); session_start(); include('database.php'); include('header.php'); ?> <script> function check1(){ var a=document.getElementById('typ').value; //alert(a); if(a=='Renew' || a=='AMC'){ document.getElementById('2').style.display='inline-block'; document.getElementById('1').style.display='none'; } else{ document.getElementById('2').style.display='none'; document.getElementById('1').style.display='inline-block'; } } </script> <div id="page-wrapper"> <div class="main-page"> <div class="row"> <div id="col-md-12"> <div class="form-grids row widget-shadow" data-example-id="basic-forms"> <div class="form-title"> <h4>New Client Entry :</h4> </div> <div class="form-body"> <form method="post" data-toggle="validator"> <div class="form-group"> <div class="col-md-6"> <label>Client Type</label> <select class="form-control1" name="type" id="typ" onchange="return check1();" required/> <option value="">Type</option> <option value="New">New</option> <option value="Renew">Renew</option> <option value="AMC">AMC</option> </select></div> <div class="col-md-6"> <label>Client Id</label> <input type="text" class="form-control" placeholder="Client Id:Auto-generated" name="name" size="30" disabled/> </div> <div class="clearfix"></div> </div> <div class="form-group"> <div class="col-md-2"> <label>Type</label> <select class="form-control1" name="tit" required/> <option value="">Title</option> <option value="Mr.">Mr.</option> <option value="Miss.">Miss.</option> <option value="Mrs.">Mrs.</option> <option value="Dr.">Dr.</option> </select> </div> <div class="col-md-4"> <label>Name</label> <input type="text" class="form-control" placeholder="Full Name" name="name" size="30" required> </div> <div class="col-md-6"> <label>Phone</label> <input id="inputPassword" class="form-control" type="text" required="" name="phn" placeholder="Enter your phone number" data-minlength="10" data-toggle="validator" required> </div> <div class="clearfix"></div> </div> <div class="form-group has-feedback"> <div class="col-md-6"> <label>Email</label> <input type="email" class="form-control" data-error="Bruh, that email address is invalid" placeholder="Email address" id="inputEmail" name="em" size="30" required> <span class="glyphicon form-control-feedback" aria-hidden="true"></span> <span class="help-block with-errors"></span> </div> <div class="col-md-6"> <label>Address</label> <textarea class="form-control" name="address" required></textarea> </div> <div class="clearfix"></div> </div> <div class="form-group"> <div class="col-md-6"> <label>Nearest Location</label> <input type="text" class="form-control" placeholder="Nearest Location" name="loc" size="30" required> </div> <div class="col-md-6"> <label>Product Name</label> <input class="form-control" type="text" required name="product_name" placeholder="Product Name" > </div> <div class="clearfix"></div> </div> <div class="form-group"> <div class="col-md-6"> <label>Product Price</label> <input type="text" class="form-control" pattern="[0-9]+" title="Please Provide the price" placeholder="Product Price" name="price" size="30" required> </div> <div class="col-md-6"> <label>Product Serial No.</label> <input class="form-control" type="text" name="pro_serial" placeholder="Product serial no." required> </div> <div class="clearfix"></div> </div> <div class="form-group"> <div class="col-md-6"> <label><div id="1">Purchase Date(If new client)</div></label> <div id="2" style="display:none"> <label>Renewal Date(If renewal) </label> </div> <input type="text" class="form-control" placeholder=" Date" name="date" id="date" size="30" required> </div> <div class="col-md-6"> <label>No. of AMC</label> <input type="text" class="form-control" value="4" size="30" disabled> </div> </div> <div class="clearfix"></div> </div> <div class="form-group"> <div class="col-md-6"> <input type="submit" class="btn btn-info" name="sub" value="Submit"> </div> <div class="clearfix"></div> </div> </div> </form> <?php /*$today1 = date('Y-m-d'); $today = time(); $newDate = date("Y-m-d",strtotime('+!year',$today)); $date = $today1; // End date $date = date ("Y-m-d", strtotime("+1 year", strtotime($newDate))); echo $newDate; */ if(isset($_POST['sub'])){ $newDate = date("Y-m-d",strtotime('+1 year',strtotime($_POST['date']))); include('ids.php'); $date = date("Y-m-d",strtotime($_POST['date'])); echo $date; // End date $end_date = $newDate; while (strtotime($date) < strtotime($end_date)) { // echo date("d M Y", strtotime($date)) . "<br/>"; //$date1=date("d M Y", strtotime($date)) ; $date = date ("Y-m-d", strtotime("+3 months", strtotime($date))); $s="insert into client_visit_date(client_id,product_id,date) values('".$id."','".trim($_POST['pro_serial'])."','".$date."')"; $r=mysqli_query($con,$s); } date("d M Y", strtotime($date)); $date1=date("Y-m-d",strtotime($_POST['date'])); $name=$_POST['tit']." ".$_POST['name']; $expdate = date("Y-m-d",strtotime('+1 year',strtotime($date1))); $sq="insert into client(client_type,client_id,client_name,email,phone,address,nearest_location,product_name,product_price,product_serial_no,date_of_purchase,date_of_expiry) values('".$_POST['type']."','".$id."','".$name."','".trim($_POST['em'])."','".trim($_POST['phn'])."','".trim($_POST['address'])."','".trim($_POST['loc'])."','".trim($_POST['product_name'])."',".$_POST['price'].",'".trim($_POST['pro_serial'])."','".$date1."','".$expdate."')"; $r1=mysqli_query($con,$sq) or die(mysqli_error($sq)); if($r1){ echo"<script>sweetAlert('OK','Thank you','success'); window.location.href='all_client.php'; </script>"; } else echo "ss"; } ?> </div> </div> </div> </div> </div> </div> <script src="js/bootstrap-datepicker.js"></script> <script type="text/javascript"> // When the document is ready $(document).ready(function(){ $("#date").datepicker({ format: 'dd-mm-yyyy', }); }); </script> <!--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.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