mirror of https://github.com/itflow-org/itflow
Updated New Client form with location phone number, renamed address tab to location, moved website from contact tab to Details tab, along with other UI cleanup
This commit is contained in:
parent
29828f8653
commit
d02a121dfa
|
|
@ -15,7 +15,7 @@
|
|||
<a class="nav-link active" data-toggle="pill" href="#pills-details">Details</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-address">Address</a>
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-location">Location</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-contact">Contact</a>
|
||||
|
|
@ -80,10 +80,31 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Website</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-globe"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="website" placeholder="ex. google.com">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-address">
|
||||
|
||||
<div class="tab-pane fade" id="pills-location">
|
||||
|
||||
<label>Location Phone</label>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="location_phone" placeholder="Location's Phone Number">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Address</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -163,7 +184,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<label>Phone</label>
|
||||
<label>Contact Phone</label>
|
||||
<div class="form-row">
|
||||
<div class="col-8">
|
||||
<div class="form-group">
|
||||
|
|
@ -171,43 +192,33 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="phone" placeholder="Phone Number">
|
||||
<input type="text" class="form-control" name="contact_phone" placeholder="Contact's Phone Number">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<input type="text" class="form-control" name="extension" placeholder="Extension">
|
||||
<input type="text" class="form-control" name="contact_extension" placeholder="Extension">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label>Mobile</label>
|
||||
<label>Contact Mobile</label>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-mobile-alt"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="mobile" placeholder="Mobile Number">
|
||||
<input type="text" class="form-control" name="contact_mobile" placeholder="Contact's Mobile Number">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Email</label>
|
||||
<label>Contact Email</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="email" placeholder="Email Address">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Website</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-globe"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="website" placeholder="ex. google.com">
|
||||
<input type="email" class="form-control" name="contact_email" placeholder="Contact's Email Address">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
15
post.php
15
post.php
|
|
@ -1109,6 +1109,7 @@ if(isset($_POST['add_client'])){
|
|||
|
||||
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
|
||||
$type = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['type'])));
|
||||
$location_phone = preg_replace("/[^0-9]/", '',$_POST['location_phone']);
|
||||
$address = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['address'])));
|
||||
$city = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['city'])));
|
||||
$state = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['state'])));
|
||||
|
|
@ -1116,10 +1117,10 @@ if(isset($_POST['add_client'])){
|
|||
$country = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['country'])));
|
||||
$contact = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['contact'])));
|
||||
$title = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['title'])));
|
||||
$phone = preg_replace("/[^0-9]/", '',$_POST['phone']);
|
||||
$extension = preg_replace("/[^0-9]/", '',$_POST['extension']);
|
||||
$mobile = preg_replace("/[^0-9]/", '',$_POST['mobile']);
|
||||
$email = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['email'])));
|
||||
$contact_phone = preg_replace("/[^0-9]/", '',$_POST['contact_phone']);
|
||||
$contact_extension = preg_replace("/[^0-9]/", '',$_POST['contact_extension']);
|
||||
$contact_mobile = preg_replace("/[^0-9]/", '',$_POST['contact_mobile']);
|
||||
$contact_email = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['contact_email'])));
|
||||
$website = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['website'])));
|
||||
$referral = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['referral'])));
|
||||
$currency_code = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['currency_code'])));
|
||||
|
|
@ -1136,7 +1137,7 @@ if(isset($_POST['add_client'])){
|
|||
}
|
||||
|
||||
//Add Location
|
||||
if(!empty($address) OR !empty($city) OR !empty($state) OR !empty($zip)){
|
||||
if(!empty($location_phone) OR !empty($address) OR !empty($city) OR !empty($state) OR !empty($zip)){
|
||||
mysqli_query($mysqli,"INSERT INTO locations SET location_name = 'Primary', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_country = '$country', location_created_at = NOW(), location_client_id = $client_id, company_id = $session_company_id");
|
||||
|
||||
//Update Primay location in clients
|
||||
|
|
@ -1149,8 +1150,8 @@ if(isset($_POST['add_client'])){
|
|||
|
||||
|
||||
//Add Contact
|
||||
if(!empty($contact) OR !empty($title) OR !empty($phone) OR !empty($mobile) OR !empty($email)){
|
||||
mysqli_query($mysqli,"INSERT INTO contacts SET contact_name = '$contact', contact_title = '$title', contact_phone = '$phone', contact_extension = '$extension', contact_mobile = '$mobile', contact_email = '$email', contact_photo = '$path', contact_notes = '$notes', contact_created_at = NOW(), contact_client_id = $client_id, company_id = $session_company_id");
|
||||
if(!empty($contact) OR !empty($title) OR !empty($contact_phone) OR !empty($contact_mobile) OR !empty($contact_email)){
|
||||
mysqli_query($mysqli,"INSERT INTO contacts SET contact_name = '$contact', contact_title = '$title', contact_phone = '$contact_phone', contact_extension = '$contact_extension', contact_mobile = '$contact_mobile', contact_email = '$contact_email', contact_created_at = NOW(), contact_client_id = $client_id, company_id = $session_company_id");
|
||||
|
||||
//Update Primay contact in clients
|
||||
$contact_id = mysqli_insert_id($mysqli);
|
||||
|
|
|
|||
Loading…
Reference in New Issue