Tons of UI and code cleanups, renamed many sql tables and fields, started adding created_at and updated_at fields

This commit is contained in:
root 2019-05-17 01:09:16 -04:00
parent 4b3c2c8c2a
commit fa08853640
72 changed files with 1625 additions and 3305 deletions

76
OLD_edit_client_modal.php Normal file
View File

@ -0,0 +1,76 @@
<div class="modal" id="editClientModal<?php echo $client_id; ?>" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-user-edit mr-2"></i>Edit <?php echo $client_name; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<div class="modal-body bg-white">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>" >
<div class="form-group row">
<label class="col-sm-2 col-form-label">Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="name" value="<?php echo $client_name; ?>" required>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Phone</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="phone" data-inputmask="'mask': '999-999-9999'" value="<?php echo $client_phone; ?>" required>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Email</label>
<div class="col-sm-10">
<input type="email" class="form-control" name="email" value="<?php echo $client_email; ?>" required>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Website</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="website" value="<?php echo $client_website; ?>">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Address</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="address" value="<?php echo $client_address; ?>" required>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">City</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="city" value="<?php echo $client_city; ?>" required>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">State</label>
<div class="col-sm-10">
<select class="form-control" name="state" required>
<option value="">- State -</option>
<?php
foreach($states_array as $state_abbr => $state_name){
?>
<option <?php if($client_state == $state_abbr) { echo "selected"; } ?> value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Zip</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="zip" value="<?php echo $client_zip; ?>" required>
</div>
</div>
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="edit_client" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div>
</div>

70
OLDedit_vendor_modal.php Normal file
View File

@ -0,0 +1,70 @@
<div class="modal" id="editVendorModal<?php echo $vendor_id; ?>" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-building mr-2"></i><?php echo $vendor_name; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="vendor_id" value="<?php echo $vendor_id; ?>">
<div class="modal-body bg-white">
<div class="form-group">
<label>Name</label>
<input type="text" class="form-control" name="name" value="<?php echo "$vendor_name"; ?>" required>
</div>
<div class="form-group">
<label>Description</label>
<input type="text" class="form-control" name="description" value="<?php echo $vendor_description; ?>">
</div>
<div class="form-group">
<label>Address</label>
<input type="text" class="form-control" name="address" value="<?php echo $vendor_address; ?>">
</div>
<div class="form-row">
<div class="form-group col">
<label>City</label>
<input type="text" class="form-control" name="city" value="<?php echo $vendor_city; ?>">
</div>
<div class="form-group col">
<label>State</label>
<select class="form-control" name="state">
<?php foreach($states_array as $state_abbr => $state_name) { ?>
<option <?php if($vendor_state == $state_abbr){ echo "selected"; } ?> value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
<?php } ?>
</select>
</div>
<div class="form-group col">
<label>Zip</label>
<input type="text" class="form-control" name="zip" value="<?php echo $vendor_zip; ?>">
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label>Phone</label>
<input type="text" class="form-control" name="phone" value="<?php echo $vendor_phone; ?>">
</div>
<div class="form-group col">
<label>Email</label>
<input type="email" class="form-control" name="email" value="<?php echo $vendor_email; ?>">
</div>
<div class="form-group col">
<label>Website</label>
<input type="text" class="form-control" name="website" value="<?php echo $vendor_website; ?>">
</div>
</div>
<div class="form-group">
<label>Account Number</label>
<input type="text" class="form-control" name="account_number" value="<?php echo $vendor_account_number; ?>">
</div>
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="edit_vendor" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div>
</div>

View File

@ -1,4 +1,4 @@
<div class="modal" id="addClientAssetModal" tabindex="-1">
<div class="modal" id="addAssetModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
@ -97,10 +97,10 @@
<option value="">- Location -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM client_locations WHERE client_id = $client_id");
$sql = mysqli_query($mysqli,"SELECT * FROM locations WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql)){
$location_id = $row['client_location_id'];
$location_name = $row['client_location_name'];
$location_id = $row['location_id'];
$location_name = $row['location_name'];
?>
<option value="<?php echo $location_id; ?>"><?php echo $location_name; ?></option>
@ -121,12 +121,12 @@
<option value="">- Contact -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM client_contacts WHERE client_id = $client_id");
$sql = mysqli_query($mysqli,"SELECT * FROM contacts WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql)){
$client_contact_id = $row['client_contact_id'];
$client_contact_name = $row['client_contact_name'];
$contact_id = $row['contact_id'];
$contact_name = $row['contact_name'];
?>
<option value="<?php echo $client_contact_id; ?>"><?php echo $client_contact_name; ?></option>
<option value="<?php echo $contact_id; ?>"><?php echo $contact_name; ?></option>
<?php
}
@ -149,12 +149,12 @@
<option value="">- Vendor -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM client_vendors WHERE client_id = $client_id");
$sql = mysqli_query($mysqli,"SELECT * FROM vendors WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql)){
$client_vendor_id = $row['client_vendor_id'];
$client_vendor_name = $row['client_vendor_name'];
$vendor_id = $row['vendor_id'];
$vendor_name = $row['vendor_name'];
?>
<option value="<?php echo $client_vendor_id; ?>"><?php echo $client_vendor_name; ?></option>
<option value="<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></option>
<?php
}
@ -210,7 +210,7 @@
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="add_client_asset" class="btn btn-primary">Save</button>
<button type="submit" name="add_asset" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -11,12 +11,12 @@
<div class="modal-body bg-white">
<div class="form-group">
<label>Name</label>
<input type="text" class="form-control" name="name" required autofocus>
<input type="text" class="form-control" name="name" placeholder="Category name" required autofocus>
</div>
<div class="form-group">
<label>Type</label>
<select class="form-control" name="type" required>
<option value="">Select a type...</option>
<option value="">- Type -</option>
<?php foreach($category_types_array as $category_type) { ?>
<option><?php echo $category_type; ?></option>
<?php } ?>
@ -24,7 +24,7 @@
</div>
<div class="form-group">
<label>Color</label>
<input type="color" class="form-control" name="color">
<input type="color" class="form-control col-md-2" name="color">
</div>
</div>
<div class="modal-footer bg-white">

View File

@ -21,7 +21,7 @@
<a class="nav-link" id="pills-contact-tab" data-toggle="pill" href="#pills-contact" role="tab" aria-controls="pills-contact" aria-selected="false">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-contact-tab" data-toggle="pill" href="#pills-more" role="tab" aria-controls="pills-more" aria-selected="false">More</a>
<a class="nav-link" id="pills-more-tab" data-toggle="pill" href="#pills-more" role="tab" aria-controls="pills-more" aria-selected="false">More</a>
</li>
</ul>
@ -41,6 +41,21 @@
</div>
</div>
<div class="form-group">
<label>Type</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-list"></i></span>
</div>
<select class="form-control" name="type" required>
<option value="">- Type -</option>
<?php foreach($client_types_array as $client_type) { ?>
<option><?php echo $client_type; ?></option>
<?php } ?>
</select>
</div>
</div>
</div>
<div class="tab-pane fade" id="pills-address" role="tabpanel" aria-labelledby="pills-address-tab">
@ -57,22 +72,37 @@
<div class="form-group">
<label>City</label>
<input type="text" class="form-control" name="city" placeholder="City" required>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-city"></i></span>
</div>
<input type="text" class="form-control" name="city" placeholder="City" required>
</div>
</div>
<div class="form-group">
<label>State</label>
<select class="form-control" name="state">
<option value="">- State -</option>
<?php foreach($states_array as $state_abbr => $state_name) { ?>
<option value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
<?php } ?>
</select>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-flag"></i></span>
</div>
<select class="form-control" name="state">
<option value="">- State -</option>
<?php foreach($states_array as $state_abbr => $state_name) { ?>
<option value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-group">
<label>Zip</label>
<input type="text" class="form-control" name="zip" placeholder="Zip">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fab fa-fw fa-usps"></i></span>
</div>
<input type="text" class="form-control" name="zip" placeholder="Zip">
</div>
</div>
</div>
@ -130,11 +160,11 @@
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
</div>
<select class="form-control" name="net_terms">
<option value="7">Default (7 Days)</option>
<option value="1">Upon Reciept</option>
<option value="14">14 Day</option>
<option value="30">30 Day</option>
</select>
<option value="">- Net Terms -</option>
<?php foreach($net_terms_array as $net_term_value => $net_term_name) { ?>
<option value="<?php echo $net_term_value; ?>"><?php echo $net_term_name; ?></option>
<?php } ?>
</select>
</div>
</div>

View File

@ -1,71 +0,0 @@
<div class="modal" id="addClientVendorModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
<h5 class="modal-title"><i class="fa fa-fw fa-building mr-2"></i>New Vendor</h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<div class="modal-body bg-white">
<div class="form-group">
<label>Vendor Name</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-building"></i></span>
</div>
<input type="text" class="form-control" name="name" placeholder="Name of the vendor" required autofocus>
</div>
</div>
<div class="form-group">
<label>Description</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-comment"></i></span>
</div>
<input type="text" class="form-control" name="description" placeholder="Description of the Vendor" required>
</div>
</div>
<div class="form-group">
<label>Account Number</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-barcode"></i></span>
</div>
<input type="text" class="form-control" name="account_number" placeholder="Account number">
</div>
</div>
<center><a class="btn btn-link" data-toggle="collapse" href="#optionsCollapse" role="button" aria-expanded="false" aria-controls="optionsCollapse">Add a pasword</a></center>
<div class="collapse multi-collapse" id="optionsCollapse">
<div class="form-group">
<label>Username</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
</div>
<input type="text" class="form-control" name="username" placeholder="Username">
</div>
</div>
<div class="form-group">
<label>Password</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-lock"></i></span>
</div>
<input type="text" class="form-control" name="password" placeholder="Password">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="add_client_vendor" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div>
</div>

View File

@ -1,4 +1,4 @@
<div class="modal" id="addClientContactModal" tabindex="-1">
<div class="modal" id="addContactModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
@ -56,7 +56,7 @@
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="add_client_contact" class="btn btn-primary">Save</button>
<button type="submit" name="add_contact" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -1,4 +1,4 @@
<div class="modal" id="addClientDomainModal" tabindex="-1">
<div class="modal" id="addDomainModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
@ -30,12 +30,12 @@
<option value="">- Vendor -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM client_vendors WHERE client_id = $client_id");
$sql = mysqli_query($mysqli,"SELECT * FROM vendors WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql)){
$client_vendor_id = $row['client_vendor_id'];
$client_vendor_name = $row['client_vendor_name'];
$vendor_id = $row['vendor_id'];
$vendor_name = $row['vendor_name'];
?>
<option value="<?php echo $client_vendor_id; ?>"><?php echo $client_vendor_name; ?></option>
<option value="<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></option>
<?php
}
@ -54,12 +54,12 @@
<option value="">- Vendor -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM client_vendors WHERE client_id = $client_id");
$sql = mysqli_query($mysqli,"SELECT * FROM vendors WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql)){
$client_vendor_id = $row['client_vendor_id'];
$client_vendor_name = $row['client_vendor_name'];
$vendor_id = $row['vendor_id'];
$vendor_name = $row['vendor_name'];
?>
<option value="<?php echo $client_vendor_id; ?>"><?php echo $client_vendor_name; ?></option>
<option value="<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></option>
<?php
}
@ -81,7 +81,7 @@
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="add_client_domain" class="btn btn-primary">Save</button>
<button type="submit" name="add_domain" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -32,7 +32,7 @@
<label>Account</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-university"></i></span>
<span class="input-group-text"><i class="fa fa-fw fa-piggy-bank"></i></span>
</div>
<select class="form-control" name="account" required>
<?php
@ -67,7 +67,7 @@
<label>Vendor</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-briefcase"></i></span>
<span class="input-group-text"><i class="fa fa-fw fa-building"></i></span>
</div>
<select class="form-control" name="vendor" required>
<?php

View File

@ -32,7 +32,7 @@
<label>Account</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-university"></i></span>
<span class="input-group-text"><i class="fa fa-fw fa-piggy-bank"></i></span>
</div>
<select class="form-control" name="account" required>
<option value="">- Account -</option>
@ -69,7 +69,7 @@
<label>Vendor</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-briefcase"></i></span>
<span class="input-group-text"><i class="fa fa-fw fa-building"></i></span>
</div>
<select class="form-control" name="vendor" required>
<option value="">- Vendor -</option>

View File

@ -1,4 +1,4 @@
<div class="modal" id="addClientFileModal" tabindex="-1">
<div class="modal" id="addFileModal" tabindex="-1">
<div class="modal-dialog modal-sm">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
@ -8,7 +8,7 @@
</button>
</div>
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $_GET['client_id']; ?>">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<div class="modal-body bg-white">
<div class="form-group">
@ -20,7 +20,7 @@
</div>
</div>
<div class="modal-footer bg-white">
<button type="submit" name="add_client_file" class="btn btn-primary">Upload</button>
<button type="submit" name="add_file" class="btn btn-primary">Upload</button>
</div>
</form>
</div>

View File

@ -32,24 +32,24 @@
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label>Invoice Date</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
</div>
<input type="date" class="form-control" name="date" value="<?php echo date("Y-m-d"); ?>" required>
<div class="form-group">
<label>Invoice Date</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
</div>
<input type="date" class="form-control" name="date" value="<?php echo date("Y-m-d"); ?>" required>
</div>
<div class="form-group col">
<label>Payment Due</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-calendar-alt"></i></span>
</div>
<input type="date" class="form-control" name="due" required>
</div>
<div class="form-group">
<label>Payment Due</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-calendar-alt"></i></span>
</div>
<input type="date" class="form-control" name="due" required>
</div>
</div>

View File

@ -1,4 +1,4 @@
<div class="modal" id="addClientLocationModal" tabindex="-1">
<div class="modal" id="addLocationModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
@ -31,21 +31,39 @@
<div class="form-group">
<label>City</label>
<input type="text" class="form-control" name="city" placeholder="City" required>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-city"></i></span>
</div>
<input type="text" class="form-control" name="city" placeholder="City" required>
</div>
</div>
<div class="form-group">
<label>State</label>
<select class="form-control" name="state" required>
<option value="">- State -</option>
<?php foreach($states_array as $state_abbr => $state_name) { ?>
<option value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
<?php } ?>
</select>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-flag"></i></span>
</div>
<select class="form-control" name="state" required>
<option value="">- State -</option>
<?php foreach($states_array as $state_abbr => $state_name) { ?>
<option value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-group">
<label>Zip</label>
<input type="text" class="form-control" name="zip" placeholder="Zip" required>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fab fa-fw fa-usps"></i></span>
</div>
<input type="text" class="form-control" name="zip" placeholder="Zip" required>
</div>
</div>
<div class="form-group">
<label>Phone</label>
<div class="input-group">
@ -69,7 +87,7 @@
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="add_client_location" class="btn btn-primary">Save</button>
<button type="submit" name="add_location" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -1,4 +1,4 @@
<div class="modal" id="addClientLoginModal" tabindex="-1">
<div class="modal" id="addLoginModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
@ -71,10 +71,10 @@
<option value="">- Vendor -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM client_vendors WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql)){
$vendor_id = $row['client_vendor_id'];
$vendor_name = $row['client_vendor_name'];
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql_vendors)){
$vendor_id = $row['vendor_id'];
$vendor_name = $row['vendor_name'];
?>
<option value="<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></option>
@ -96,10 +96,10 @@
<option value="">- Asset -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM client_assets WHERE client_id = $client_id");
$sql = mysqli_query($mysqli,"SELECT * FROM assets WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql)){
$asset_id = $row['client_asset_id'];
$asset_name = $row['client_asset_name'];
$asset_id = $row['asset_id'];
$asset_name = $row['asset_name'];
?>
<option value="<?php echo $asset_id; ?>"><?php echo $asset_name; ?></option>
@ -121,12 +121,12 @@
<option value="">- Application -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM client_applications WHERE client_id = $client_id");
$sql = mysqli_query($mysqli,"SELECT * FROM applications WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql)){
$client_application_id = $row['client_application_id'];
$client_application_name = $row['client_application_name'];
$application_id = $row['application_id'];
$application_name = $row['application_name'];
?>
<option value="<?php echo $client_application_id; ?>"><?php echo $client_application_name; ?></option>
<option value="<?php echo $application_id; ?>"><?php echo $application_name; ?></option>
<?php
}
@ -140,7 +140,7 @@
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="add_client_login" class="btn btn-primary">Save</button>
<button type="submit" name="add_login" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -1,4 +1,4 @@
<div class="modal" id="addClientNetworkModal" tabindex="-1">
<div class="modal" id="addNetworkModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
@ -52,7 +52,7 @@
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="add_client_network" class="btn btn-primary">Save</button>
<button type="submit" name="add_network" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -1,4 +1,4 @@
<div class="modal" id="addClientNoteModal" tabindex="-1">
<div class="modal" id="addNoteModal" tabindex="-1">
<div class="modal-dialog modal-xl">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
@ -21,7 +21,7 @@
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="add_client_note" class="btn btn-primary">Save</button>
<button type="submit" name="add_note" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -11,85 +11,86 @@
<input type="hidden" name="invoice_id" value="<?php echo $invoice_id; ?>">
<input type="hidden" name="balance" value="<?php echo $balance; ?>">
<div class="modal-body bg-white">
<div class="form-row">
<div class="form-group col">
<label>Date</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
</div>
<input type="date" class="form-control" name="date" value="<?php echo date("Y-m-d"); ?>" required>
</div>
</div>
<div class="form-group col">
<label>Amount</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
</div>
<input type="number" class="form-control" step="0.01" min="0.00" name="amount" value="<?php echo $balance; ?>" required>
<div class="form-group">
<label>Date</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
</div>
<input type="date" class="form-control" name="date" value="<?php echo date("Y-m-d"); ?>" required>
</div>
</div>
<div class="form-group">
<label>Amount</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
</div>
<input type="number" class="form-control" step="0.01" min="0.00" name="amount" value="<?php echo $balance; ?>" required>
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label>Account</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-university"></i></span>
</div>
<select class="form-control" name="account" required>
<option value="">- Account -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM accounts");
while($row = mysqli_fetch_array($sql)){
$account_id = $row['account_id'];
$account_name = $row['account_name'];
$opening_balance = $row['opening_balance'];
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS total_payments FROM payments WHERE account_id = $account_id");
$row = mysqli_fetch_array($sql_payments);
$total_payments = $row['total_payments'];
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE account_id = $account_id");
$row = mysqli_fetch_array($sql_expenses);
$total_expenses = $row['total_expenses'];
$balance = $opening_balance + $total_payments - $total_expenses;
?>
<option value="<?php echo $account_id; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
<div class="form-group">
<label>Account</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-piggy-bank"></i></span>
</div>
<select class="form-control" name="account" required>
<option value="">- Account -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM accounts");
while($row = mysqli_fetch_array($sql)){
$account_id = $row['account_id'];
$account_name = $row['account_name'];
$opening_balance = $row['opening_balance'];
<?php
}
?>
</select>
</div>
</div>
<div class="form-group col">
<label>Payment Method</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-money-check-alt"></i></span>
</div>
<select class="form-control" name="payment_method" required>
<option value="">- Method -</option>
<?php
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS total_payments FROM payments WHERE account_id = $account_id");
$row = mysqli_fetch_array($sql_payments);
$total_payments = $row['total_payments'];
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Payment Method'");
while($row = mysqli_fetch_array($sql)){
$category_name = $row['category_name'];
?>
<option><?php echo "$category_name"; ?></option>
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE account_id = $account_id");
$row = mysqli_fetch_array($sql_expenses);
$total_expenses = $row['total_expenses'];
$balance = $opening_balance + $total_payments - $total_expenses;
<?php
}
?>
</select>
</div>
?>
<option value="<?php echo $account_id; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
<?php
}
?>
</select>
</div>
</div>
<div class="form-group">
<label>Payment Method</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-money-check-alt"></i></span>
</div>
<select class="form-control" name="payment_method" required>
<option value="">- Method of Payment -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Payment Method'");
while($row = mysqli_fetch_array($sql)){
$category_name = $row['category_name'];
?>
<option><?php echo "$category_name"; ?></option>
<?php
}
?>
</select>
</div>
</div>
<div class="form-group">
<label>Reference</label>
<div class="input-group">

View File

@ -1,4 +1,4 @@
<div class="modal" id="addRecurringInvoiceModal" tabindex="-1">
<div class="modal" id="addRecurringModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
@ -32,31 +32,32 @@
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label>Start Date</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
</div>
<input type="date" class="form-control" name="start_date" value="<?php echo date("Y-m-d"); ?>" required>
</div>
</div>
<div class="form-group col">
<label>Frequency</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-clock"></i></span>
</div>
<select class="form-control" name="frequency" required>
<option value="">- Frequency -</option>
<option value="week">Weekly</option>
<option value="month">Monthly</option>
<option value="year">Yearly</option>
</select>
<div class="form-group">
<label>Start Date</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
</div>
<input type="date" class="form-control" name="start_date" value="<?php echo date("Y-m-d"); ?>" required>
</div>
</div>
<div class="form-group">
<label>Frequency</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-clock"></i></span>
</div>
<select class="form-control" name="frequency" required>
<option value="">- Frequency -</option>
<option value="week">Weekly</option>
<option value="month">Monthly</option>
<option value="year">Yearly</option>
</select>
</div>
</div>
<div class="form-group">
<label>Income Category</label>
@ -84,7 +85,7 @@
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="add_recurring_invoice" class="btn btn-primary">Save</button>
<button type="submit" name="add_recurring" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -1,8 +1,8 @@
<div class="modal" id="addClientApplicationModal" tabindex="-1">
<div class="modal" id="addSoftwareModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
<h5 class="modal-title"><i class="fa fa-fw fa-rocket mr-2"></i>New Application</h5>
<h5 class="modal-title"><i class="fa fa-fw fa-rocket mr-2"></i>New Software</h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
@ -12,12 +12,12 @@
<div class="modal-body bg-white">
<div class="form-group">
<label>Application Name</label>
<label>Software Name</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-cube"></i></span>
</div>
<input type="text" class="form-control" name="name" placeholder="Application name" required autofocus>
<input type="text" class="form-control" name="name" placeholder="Software name" required autofocus>
</div>
</div>
@ -29,8 +29,8 @@
</div>
<select class="form-control" name="type" required>
<option value="">- Type -</option>
<?php foreach($application_types_array as $application_type) { ?>
<option><?php echo $application_type; ?></option>
<?php foreach($software_types_array as $software_type) { ?>
<option><?php echo $software_type; ?></option>
<?php } ?>
</select>
</div>
@ -71,7 +71,7 @@
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="add_client_application" class="btn btn-primary">Save</button>
<button type="submit" name="add_software" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -1,4 +1,4 @@
<div class="modal" id="addMileageModal" tabindex="-1">
<div class="modal" id="addTripModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
@ -137,10 +137,10 @@
<option value="">- Location -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM client_locations, clients WHERE client_locations.client_id = clients.client_id ORDER BY clients.client_id DESC");
$sql = mysqli_query($mysqli,"SELECT * FROM locations, clients WHERE locations.client_id = clients.client_id ORDER BY clients.client_id DESC");
while($row = mysqli_fetch_array($sql)){
$location_id = $row['client_location_id'];
$location_name = $row['client_location_name'];
$location_id = $row['location_id'];
$location_name = $row['location_name'];
$client_name = $row['client_name'];
?>
<option value="<?php echo $location_id; ?>"><?php echo "$client_name - $location_name"; ?></option>
@ -181,7 +181,7 @@
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="add_mileage" class="btn btn-primary">Save</button>
<button type="submit" name="add_trip" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -8,6 +8,7 @@
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<div class="modal-body bg-white">
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab" role="tablist">

View File

@ -9,6 +9,7 @@ if(isset($_GET['client_id'])){
$row = mysqli_fetch_array($sql);
$client_name = $row['client_name'];
$client_type = $row['client_type'];
$client_address = $row['client_address'];
$client_city = $row['client_city'];
$client_state = $row['client_state'];
@ -36,32 +37,32 @@ if(isset($_GET['client_id'])){
//Badge Counts
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_contact_id') AS num FROM client_contacts WHERE client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('contact_id') AS num FROM contacts WHERE client_id = $client_id"));
$num_contacts = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_location_id') AS num FROM client_locations WHERE client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('location_id') AS num FROM locations WHERE client_id = $client_id"));
$num_locations = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_asset_id') AS num FROM client_assets WHERE client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('asset_id') AS num FROM assets WHERE client_id = $client_id"));
$num_assets = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('ticket_id') AS num FROM tickets WHERE client_id = $client_id"));
$num_tickets = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_vendor_id') AS num FROM client_vendors WHERE client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('vendor_id') AS num FROM vendors WHERE client_id = $client_id"));
$num_vendors = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_login_id') AS num FROM client_logins WHERE client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('login_id') AS num FROM logins WHERE client_id = $client_id"));
$num_logins = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_network_id') AS num FROM client_networks WHERE client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('network_id') AS num FROM networks WHERE client_id = $client_id"));
$num_networks = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_domain_id') AS num FROM client_domains WHERE client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('domain_id') AS num FROM domains WHERE client_id = $client_id"));
$num_domains = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_application_id') AS num FROM client_applications WHERE client_id = $client_id"));
$num_applications = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('software_id') AS num FROM software WHERE client_id = $client_id"));
$num_software = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('invoice_id') AS num FROM invoices WHERE client_id = $client_id"));
$num_invoices = $row['num'];
@ -69,7 +70,7 @@ if(isset($_GET['client_id'])){
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('quote_id') AS num FROM quotes WHERE client_id = $client_id"));
$num_quotes = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('recurring_invoice_id') AS num FROM recurring_invoices, invoices WHERE recurring_invoices.invoice_id = invoices.invoice_id AND invoices.client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('recurring_id') AS num FROM recurring, invoices WHERE recurring.invoice_id = invoices.invoice_id AND invoices.client_id = $client_id"));
$num_recurring = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('payment_id') AS num FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND invoices.client_id = $client_id"));
@ -78,7 +79,7 @@ if(isset($_GET['client_id'])){
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('file_id') AS num FROM files WHERE client_id = $client_id"));
$num_files = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_note_id') AS num FROM client_notes WHERE client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('note_id') AS num FROM notes WHERE client_id = $client_id"));
$num_notes = $row['num'];
?>

View File

@ -1,9 +1,9 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM client_assets WHERE client_id = $client_id ORDER BY client_asset_id DESC"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM assets WHERE client_id = $client_id ORDER BY asset_id DESC"); ?>
<div class="card">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-laptop"></i> Assets</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addClientAssetModal"><i class="fa fa-plus"></i></button>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addAssetModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
@ -24,73 +24,73 @@
<?php
while($row = mysqli_fetch_array($sql)){
$client_asset_id = $row['client_asset_id'];
$client_asset_type = $row['client_asset_type'];
$client_asset_name = $row['client_asset_name'];
$client_asset_make = $row['client_asset_make'];
$client_asset_model = $row['client_asset_model'];
$client_asset_serial = $row['client_asset_serial'];
$client_asset_purchase_date = $row['client_asset_purchase_date'];
$client_asset_warranty_expire = $row['client_asset_warranty_expire'];
$client_vendor_id = $row['client_vendor_id'];
$client_location_id = $row['client_location_id'];
$client_contact_id = $row['client_contact_id'];
$asset_id = $row['asset_id'];
$asset_type = $row['asset_type'];
$asset_name = $row['asset_name'];
$asset_make = $row['asset_make'];
$asset_model = $row['asset_model'];
$asset_serial = $row['asset_serial'];
$asset_purchase_date = $row['asset_purchase_date'];
$asset_warranty_expire = $row['asset_warranty_expire'];
$vendor_id = $row['vendor_id'];
$location_id = $row['location_id'];
$contact_id = $row['contact_id'];
if($client_asset_type == 'Laptop'){
if($asset_type == 'Laptop'){
$device_icon = "laptop";
}elseif($client_asset_type == 'Desktop'){
}elseif($asset_type == 'Desktop'){
$device_icon = "desktop";
}elseif($client_asset_type == 'Server'){
}elseif($asset_type == 'Server'){
$device_icon = "server";
}elseif($client_asset_type == 'Printer'){
}elseif($asset_type == 'Printer'){
$device_icon = "print";
}elseif($client_asset_type == 'Camera'){
}elseif($asset_type == 'Camera'){
$device_icon = "video";
}elseif($file_ext == 'Switch' or $file_ext == 'Firewall/Router'){
$device_icon = "network";
}elseif($client_asset_type == 'Access Point'){
}elseif($asset_type == 'Access Point'){
$device_icon = "wifi";
}elseif($client_asset_type == 'Phone'){
}elseif($asset_type == 'Phone'){
$device_icon = "phone";
}elseif($client_asset_type == 'Mobile Phone'){
}elseif($asset_type == 'Mobile Phone'){
$device_icon = "mobile-alt";
}elseif($client_asset_type == 'Tablet'){
}elseif($asset_type == 'Tablet'){
$device_icon = "tablet-alt";
}elseif($client_asset_type == 'TV'){
}elseif($asset_type == 'TV'){
$device_icon = "tv";
}elseif($client_asset_type == 'Virtual Machine'){
}elseif($asset_type == 'Virtual Machine'){
$device_icon = "cloud";
}else{
$device_icon = "tag";
}
$sql_logins = mysqli_query($mysqli,"SELECT * FROM client_logins WHERE client_asset_id = $client_asset_id");
$sql_logins = mysqli_query($mysqli,"SELECT * FROM logins WHERE asset_id = $asset_id");
$row = mysqli_fetch_array($sql_logins);
$client_login_id = $row['client_login_id'];
$client_login_username = $row['client_login_username'];
$client_login_password = $row['client_login_password'];
$client_asset_id_relation = $row['client_asset_id'];
$login_id = $row['login_id'];
$login_username = $row['login_username'];
$login_password = $row['login_password'];
$asset_id_relation = $row['asset_id'];
?>
<tr>
<td><i class="fa fa-fw text-secondary fa-<?php echo $device_icon; ?> mr-3"></i><?php echo $client_asset_type; ?></td>
<td><?php echo $client_asset_name; ?></td>
<td><?php echo $client_asset_make; ?></td>
<td><?php echo $client_asset_model; ?></td>
<td><?php echo $client_asset_serial; ?></td>
<td><i class="fa fa-fw text-secondary fa-<?php echo $device_icon; ?> mr-3"></i><?php echo $asset_type; ?></td>
<td><?php echo $asset_name; ?></td>
<td><?php echo $asset_make; ?></td>
<td><?php echo $asset_model; ?></td>
<td><?php echo $asset_serial; ?></td>
<td>
<?php
if($client_asset_id == $client_asset_id_relation){
if($asset_id == $asset_id_relation){
?>
<button type="button" class="btn btn-dark btn-sm" data-toggle="modal" data-target="#viewPasswordModal<?php echo $client_login_id; ?>"><i class="fas fa-key"></i></button>
<button type="button" class="btn btn-dark btn-sm" data-toggle="modal" data-target="#viewPasswordModal<?php echo $login_id; ?>"><i class="fas fa-key"></i></button>
<div class="modal" id="viewPasswordModal<?php echo $client_login_id; ?>" tabindex="-1">
<div class="modal" id="viewPasswordModal<?php echo $login_id; ?>" tabindex="-1">
<div class="modal-dialog modal-sm">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
<h5 class="modal-title"><i class="fa fa-fw fa-key mr-2"></i><?php echo $client_asset_name; ?> Login</h5>
<h5 class="modal-title"><i class="fa fa-fw fa-key mr-2"></i><?php echo $asset_name; ?> Login</h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
@ -101,7 +101,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-user"></i></span>
</div>
<input type="text" class="form-control" value="<?php echo $client_login_username; ?>" readonly>
<input type="text" class="form-control" value="<?php echo $login_username; ?>" readonly>
</div>
</div>
<div class="form-group">
@ -109,7 +109,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lock"></i></span>
</div>
<input type="text" class="form-control" value="<?php echo $client_login_password; ?>" readonly>
<input type="text" class="form-control" value="<?php echo $login_password; ?>" readonly>
</div>
</div>
</div>
@ -126,15 +126,15 @@
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientAssetModal<?php echo $client_asset_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_client_asset=<?php echo $client_asset_id; ?>">Delete</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editAssetModal<?php echo $asset_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_asset=<?php echo $asset_id; ?>">Delete</a>
</div>
</div>
</td>
</tr>
<?php
include("edit_client_asset_modal.php");
include("edit_asset_modal.php");
}
?>
@ -144,4 +144,4 @@
</div>
</div>
<?php include("add_client_asset_modal.php"); ?>
<?php include("add_asset_modal.php"); ?>

View File

@ -1,8 +1,8 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM client_contacts WHERE client_id = $client_id ORDER BY client_contact_id DESC"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM contacts WHERE client_id = $client_id ORDER BY contact_id DESC"); ?>
<div class="card">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-users"></i> Contacts</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addClientContactModal"><i class="fa fa-plus"></i></button>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addContactModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<div class="table-responsive">
@ -20,25 +20,25 @@
<?php
while($row = mysqli_fetch_array($sql)){
$client_contact_id = $row['client_contact_id'];
$client_contact_name = $row['client_contact_name'];
$client_contact_title = $row['client_contact_title'];
$client_contact_phone = $row['client_contact_phone'];
if(strlen($client_contact_phone)>2){
$client_contact_phone = substr($row['client_contact_phone'],0,3)."-".substr($row['client_contact_phone'],3,3)."-".substr($row['client_contact_phone'],6,4);
$contact_id = $row['contact_id'];
$contact_name = $row['contact_name'];
$contact_title = $row['contact_title'];
$contact_phone = $row['contact_phone'];
if(strlen($contact_phone)>2){
$contact_phone = substr($row['contact_phone'],0,3)."-".substr($row['contact_phone'],3,3)."-".substr($row['contact_phone'],6,4);
}
$client_contact_email = $row['client_contact_email'];
$client_contact_photo = $row['client_contact_photo'];
$contact_email = $row['contact_email'];
$contact_photo = $row['contact_photo'];
?>
<tr>
<td class="text-center">
<img height="48" width="48" class="img-fluid rounded-circle" src="<?php echo $client_contact_photo; ?>">
<div class="text-secondary"><?php echo $client_contact_name; ?></div>
<img height="48" width="48" class="img-fluid rounded-circle" src="<?php echo $contact_photo; ?>">
<div class="text-secondary"><?php echo $contact_name; ?></div>
</td>
<td><?php echo $client_contact_title; ?></td>
<td><a href="mailto:<?php echo $client_contact_email; ?>"><?php echo $client_contact_email; ?></a></td>
<td><?php echo $client_contact_phone; ?></td>
<td><?php echo $contact_title; ?></td>
<td><a href="mailto:<?php echo $contact_email; ?>"><?php echo $contact_email; ?></a></td>
<td><?php echo $contact_phone; ?></td>
<td>
<div class="dropdown dropleft text-center">
@ -46,15 +46,15 @@
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientContactModal<?php echo $client_contact_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_client_contact=<?php echo $client_contact_id; ?>">Delete</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editContactModal<?php echo $contact_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_contact=<?php echo $contact_id; ?>">Delete</a>
</div>
</div>
</td>
</tr>
<?php
include("edit_client_contact_modal.php");
include("edit_contact_modal.php");
}
?>
@ -64,4 +64,4 @@
</div>
</div>
<?php include("add_client_contact_modal.php"); ?>
<?php include("add_contact_modal.php"); ?>

View File

@ -1,9 +1,9 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM client_domains WHERE client_id = $client_id ORDER BY client_domain_id DESC"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM domains WHERE client_id = $client_id ORDER BY domain_id DESC"); ?>
<div class="card">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-globe"></i> Domains</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addClientDomainModal"><i class="fa fa-plus"></i></button>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addDomainModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
@ -22,41 +22,41 @@
<?php
while($row = mysqli_fetch_array($sql)){
$client_domain_id = $row['client_domain_id'];
$client_domain_name = $row['client_domain_name'];
$client_domain_registrar = $row['client_domain_registrar'];
$client_domain_webhost = $row['client_domain_webhost'];
$client_domain_expire = $row['client_domain_expire'];
$domain_id = $row['domain_id'];
$domain_name = $row['domain_name'];
$domain_registrar = $row['domain_registrar'];
$domain_webhost = $row['domain_webhost'];
$domain_expire = $row['domain_expire'];
$sql_client_domain_registrar = mysqli_query($mysqli,"SELECT client_vendor_name FROM client_vendors WHERE client_vendor_id = $client_domain_registrar");
$row = mysqli_fetch_array($sql_client_domain_registrar);
$client_domain_registrar = $row['client_vendor_name'];
$sql_domain_registrar = mysqli_query($mysqli,"SELECT vendor_name FROM vendors WHERE vendor_id = $domain_registrar");
$row = mysqli_fetch_array($sql_domain_registrar);
$domain_registrar_name = $row['vendor_name'];
$sql_client_domain_webhost = mysqli_query($mysqli,"SELECT client_vendor_name FROM client_vendors WHERE client_vendor_id = $client_domain_webhost");
$row = mysqli_fetch_array($sql_client_domain_webhost);
$client_domain_webhost = $row['client_vendor_name'];
$sql_domain_webhost = mysqli_query($mysqli,"SELECT vendor_name FROM vendors WHERE vendor_id = $domain_webhost");
$row = mysqli_fetch_array($sql_domain_webhost);
$domain_webhost_name = $row['vendor_name'];
?>
<tr>
<td><?php echo $client_domain_name; ?></td>
<td><?php echo $client_domain_registrar; ?></td>
<td><?php echo $client_domain_webhost; ?></td>
<td><?php echo $client_domain_expire; ?></td>
<td><?php echo $domain_name; ?></td>
<td><?php echo $domain_registrar_name; ?></td>
<td><?php echo $domain_webhost_name; ?></td>
<td><?php echo $domain_expire; ?></td>
<td>
<div class="dropdown dropleft text-center">
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientDomainModal<?php echo $client_domain_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_client_domain=<?php echo $client_domain_id; ?>">Delete</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editDomainModal<?php echo $domain_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_domain=<?php echo $domain_id; ?>">Delete</a>
</div>
</div>
</td>
</tr>
<?php
include("edit_client_domain_modal.php");
include("edit_domain_modal.php");
}
?>
@ -66,4 +66,4 @@
</div>
</div>
<?php include("add_client_domain_modal.php"); ?>
<?php include("add_domain_modal.php"); ?>

View File

@ -5,7 +5,7 @@
<div class="card">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-file"></i> Uploaded Files</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addClientFileModal"><i class="fa fa-cloud-upload-alt"></i></button>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addFileModal"><i class="fa fa-cloud-upload-alt"></i></button>
</div>
<div class="card-body">
@ -22,7 +22,7 @@
<div class="col-xl-3 col-lg-3 col-md-6 col-sm-6 mb-3">
<div class="card">
<a href="#" data-toggle="modal" data-target="#viewClientFileModal<?php echo $file_id; ?>">
<a href="#" data-toggle="modal" data-target="#viewFileModal<?php echo $file_id; ?>">
<img class="img-fluid" src="<?php echo $file_name; ?>">
</a>
<div class="card-footer p-1">
@ -37,7 +37,7 @@
</div>
<?php
include("view_client_file_modal.php");
include("view_file_modal.php");
}
?>
</div>
@ -83,4 +83,4 @@
</div>
</div>
<?php include("add_client_file_modal.php"); ?>
<?php include("add_file_modal.php"); ?>

View File

@ -1,9 +1,9 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM client_locations WHERE client_id = $client_id ORDER BY client_location_id DESC"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM locations WHERE client_id = $client_id ORDER BY location_id DESC"); ?>
<div class="card">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-map-marker-alt"></i> Locations</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addClientLocationModal"><i class="fa fa-plus"></i></button>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addLocationModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
@ -21,37 +21,38 @@
<?php
while($row = mysqli_fetch_array($sql)){
$client_location_id = $row['client_location_id'];
$client_location_name = $row['client_location_name'];
$client_location_address = $row['client_location_address'];
$client_location_city = $row['client_location_city'];
$client_location_state = $row['client_location_state'];
$client_location_zip = $row['client_location_zip'];
$client_location_phone = $row['client_location_phone'];
if(strlen($client_location_phone)>2){
$client_location_phone = substr($row['client_location_phone'],0,3)."-".substr($row['client_location_phone'],3,3)."-".substr($row['client_location_phone'],6,4);
$location_id = $row['location_id'];
$location_name = $row['location_name'];
$location_address = $row['location_address'];
$location_city = $row['location_city'];
$location_state = $row['location_state'];
$location_zip = $row['location_zip'];
$location_phone = $row['location_phone'];
if(strlen($location_phone)>2){
$location_phone = substr($row['location_phone'],0,3)."-".substr($row['location_phone'],3,3)."-".substr($row['location_phone'],6,4);
}
$location_hours = $row['location_hours'];
?>
<tr>
<td><?php echo "$client_location_name"; ?></td>
<td><a href="//maps.<?php echo $session_map_source; ?>.com?q=<?php echo "$client_location_address $client_location_zip"; ?>" target="_blank"><?php echo "$client_location_address"; ?></a></td>
<td><?php echo "$client_location_phone"; ?></td>
<td><?php echo "$location_name"; ?></td>
<td><a href="//maps.<?php echo $session_map_source; ?>.com?q=<?php echo "$location_address $location_zip"; ?>" target="_blank"><?php echo "$location_address"; ?></a></td>
<td><?php echo "$location_phone"; ?></td>
<td>
<div class="dropdown dropleft text-center">
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientLocationModal<?php echo $client_location_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_client_location=<?php echo $client_location_id; ?>">Delete</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editLocationModal<?php echo $location_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_location=<?php echo $location_id; ?>">Delete</a>
</div>
</div>
</td>
</tr>
<?php
include("edit_client_location_modal.php");
include("edit_location_modal.php");
}
?>
@ -61,4 +62,4 @@
</div>
</div>
<?php include("add_client_location_modal.php"); ?>
<?php include("add_location_modal.php"); ?>

View File

@ -1,9 +1,9 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM client_logins WHERE client_id = $client_id ORDER BY client_login_id DESC"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM logins WHERE client_id = $client_id ORDER BY login_id DESC"); ?>
<div class="card">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-key"></i> Logins</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addClientLoginModal"><i class="fa fa-plus"></i></button>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addLoginModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<div class="table-responsive">
@ -20,37 +20,37 @@
<?php
while($row = mysqli_fetch_array($sql)){
$client_login_id = $row['client_login_id'];
$client_login_description = $row['client_login_description'];
$client_login_web_link = $row['client_login_web_link'];
if(!empty($client_login_web_link)){
$client_login_description_td = "<a href='$client_login_web_link' target='_blank'>$client_login_description <i class='fa fa-link'></i></a>";
$login_id = $row['login_id'];
$login_description = $row['login_description'];
$login_web_link = $row['login_web_link'];
if(!empty($login_web_link)){
$login_description_td = "<a href='$login_web_link' target='_blank'>$login_description <i class='fa fa-link'></i></a>";
}else{
$client_login_description_td = $row['client_login_description'];
$login_description_td = $row['login_description'];
}
$client_login_username = $row['client_login_username'];
$client_login_password = $row['client_login_password'];
$login_username = $row['login_username'];
$login_password = $row['login_password'];
?>
<tr>
<td><?php echo $client_login_description_td; ?></td>
<td><?php echo $client_login_username; ?></td>
<td><?php echo $client_login_password; ?></td>
<td><?php echo $login_description_td; ?></td>
<td><?php echo $login_username; ?></td>
<td><?php echo $login_password; ?></td>
<td>
<div class="dropdown dropleft text-center">
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientLoginModal<?php echo $client_login_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_client_login=<?php echo $client_login_id; ?>">Delete</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editLoginModal<?php echo $login_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_login=<?php echo $login_id; ?>">Delete</a>
</div>
</div>
</td>
</tr>
<?php
include("edit_client_login_modal.php");
include("edit_login_modal.php");
}
?>
@ -60,4 +60,4 @@
</div>
</div>
<?php include("add_client_login_modal.php"); ?>
<?php include("add_login_modal.php"); ?>

View File

@ -1,9 +1,9 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM client_networks WHERE client_id = $client_id ORDER BY client_network_id DESC"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM networks WHERE client_id = $client_id ORDER BY network_id DESC"); ?>
<div class="card">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-network-wired"></i> Networks</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addClientNetworkModal"><i class="fa fa-plus"></i></button>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addNetworkModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<div class="table-responsive">
@ -21,34 +21,34 @@
<?php
while($row = mysqli_fetch_array($sql)){
$client_network_id = $row['client_network_id'];
$client_network_name = $row['client_network_name'];
$client_network = $row['client_network'];
$client_network_gateway = $row['client_network_gateway'];
$client_network_dhcp_range = $row['client_network_dhcp_range'];
$network_id = $row['network_id'];
$network_name = $row['network_name'];
$network = $row['network'];
$network_gateway = $row['network_gateway'];
$network_dhcp_range = $row['network_dhcp_range'];
?>
<tr>
<td><?php echo $client_network_name; ?></td>
<td><?php echo $client_network; ?></td>
<td><?php echo $client_network_gateway; ?></td>
<td><?php echo $client_network_dhcp_range; ?></td>
<td><?php echo $network_name; ?></td>
<td><?php echo $network; ?></td>
<td><?php echo $network_gateway; ?></td>
<td><?php echo $network_dhcp_range; ?></td>
<td>
<div class="dropdown dropleft text-center">
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientNetworkModal<?php echo $client_network_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_client_network=<?php echo $client_network_id; ?>">Delete</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editNetworkModal<?php echo $network_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_network=<?php echo $network_id; ?>">Delete</a>
</div>
</div>
</td>
</tr>
<?php
include("edit_client_network_modal.php");
include("edit_network_modal.php");
}
?>
@ -58,4 +58,4 @@
</div>
</div>
<?php include("add_client_network_modal.php"); ?>
<?php include("add_network_modal.php"); ?>

View File

@ -1,32 +1,32 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM client_notes WHERE client_id = $client_id ORDER BY client_note_id DESC"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM notes WHERE client_id = $client_id ORDER BY note_id DESC"); ?>
<div class="card">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-edit"></i> Notes</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addClientNoteModal"><i class="fa fa-plus"></i></button>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addNoteModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<?php
while($row = mysqli_fetch_array($sql)){
$client_note_id = $row['client_note_id'];
$client_note_subject = $row['client_note_subject'];
$client_note_body = $row['client_note_body'];
$note_id = $row['note_id'];
$note_subject = $row['note_subject'];
$note_body = $row['note_body'];
?>
<div class="card mb-5">
<div class="card-header">
<?php echo $client_note_subject; ?>
<?php echo $note_subject; ?>
<div class="dropdown dropleft text-center float-right">
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#viewClientNoteModal<?php echo $client_note_id; ?>">View</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientNoteModal<?php echo $client_note_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_client_note=<?php echo $client_note_id; ?>">Delete</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#viewNoteModal<?php echo $note_id; ?>">View</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editNoteModal<?php echo $note_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_note=<?php echo $note_id; ?>">Delete</a>
</div>
</div>
@ -34,7 +34,7 @@
<div class="card-body">
<?php
$Parsedown = new Parsedown();
echo $Parsedown->text("$client_note_body");
echo $Parsedown->text("$note_body");
?>
</div>
<div class="card-footer">
@ -43,8 +43,8 @@
</div>
<?php
include("view_client_note_modal.php");
include("edit_client_note_modal.php");
include("view_note_modal.php");
include("edit_note_modal.php");
}
@ -52,4 +52,4 @@
</div>
</div>
<?php include("add_client_note_modal.php"); ?>
<?php include("add_note_modal.php"); ?>

View File

@ -21,15 +21,15 @@ if(isset($_GET['client_id'])){
$client_website = $row['client_website'];
//Query each table and store them in their array
$sql_contacts = mysqli_query($mysqli,"SELECT * FROM client_contacts WHERE client_id = $client_id ORDER BY client_contact_id DESC");
$sql_locations = mysqli_query($mysqli,"SELECT * FROM client_locations WHERE client_id = $client_id ORDER BY client_location_id DESC");
$sql_assets = mysqli_query($mysqli,"SELECT * FROM client_assets WHERE client_id = $client_id ORDER BY client_asset_id DESC");
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM client_vendors WHERE client_id = $client_id ORDER BY client_vendor_id DESC");
$sql_logins = mysqli_query($mysqli,"SELECT * FROM client_logins WHERE client_id = $client_id ORDER BY client_login_id DESC");
$sql_networks = mysqli_query($mysqli,"SELECT * FROM client_networks WHERE client_id = $client_id ORDER BY client_network_id DESC");
$sql_domains = mysqli_query($mysqli,"SELECT * FROM client_domains WHERE client_id = $client_id ORDER BY client_domain_id DESC");
$sql_applications = mysqli_query($mysqli,"SELECT * FROM client_applications WHERE client_id = $client_id ORDER BY client_application_id DESC");
$sql_invoices = mysqli_query($mysqli,"SELECT * FROM invoices WHERE client_id = $client_id ORDER BY invoices.invoice_date DESC");
$sql_contacts = mysqli_query($mysqli,"SELECT * FROM contacts WHERE client_id = $client_id ORDER BY contact_id DESC");
$sql_locations = mysqli_query($mysqli,"SELECT * FROM locations WHERE client_id = $client_id ORDER BY location_id DESC");
$sql_assets = mysqli_query($mysqli,"SELECT * FROM assets WHERE client_id = $client_id ORDER BY asset_id DESC");
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE client_id = $client_id ORDER BY vendor_id DESC");
$sql_logins = mysqli_query($mysqli,"SELECT * FROM logins WHERE client_id = $client_id ORDER BY login_id DESC");
$sql_networks = mysqli_query($mysqli,"SELECT * FROM networks WHERE client_id = $client_id ORDER BY network_id DESC");
$sql_domains = mysqli_query($mysqli,"SELECT * FROM domains WHERE client_id = $client_id ORDER BY domain_id DESC");
$sql_applications = mysqli_query($mysqli,"SELECT * FROM applications WHERE client_id = $client_id ORDER BY application_id DESC");
$sql_invoices = mysqli_query($mysqli,"SELECT * FROM invoices WHERE client_id = $client_id ORDER BY invoice_date DESC");
$sql_payments = mysqli_query($mysqli,"SELECT * FROM payments, invoices, accounts
WHERE invoices.client_id = $client_id
@ -44,24 +44,24 @@ if(isset($_GET['client_id'])){
AND invoices.client_id = $client_id
ORDER BY recurring_invoices.recurring_invoice_id DESC");
$sql_notes = mysqli_query($mysqli,"SELECT * FROM client_notes WHERE client_id = $client_id ORDER BY client_note_id DESC");
$sql_notes = mysqli_query($mysqli,"SELECT * FROM notes WHERE client_id = $client_id ORDER BY note_id DESC");
//Get Counts
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_contact_id') AS num FROM client_contacts WHERE client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('contact_id') AS num FROM contacts WHERE client_id = $client_id"));
$num_contacts = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_location_id') AS num FROM client_locations WHERE client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('location_id') AS num FROM locations WHERE client_id = $client_id"));
$num_locations = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_asset_id') AS num FROM client_assets WHERE client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('asset_id') AS num FROM assets WHERE client_id = $client_id"));
$num_assets = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_vendor_id') AS num FROM client_vendors WHERE client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('vendor_id') AS num FROM vendors WHERE client_id = $client_id"));
$num_vendors = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_login_id') AS num FROM client_logins WHERE client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('login_id') AS num FROM logins WHERE client_id = $client_id"));
$num_logins = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_network_id') AS num FROM client_networks WHERE client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('network_id') AS num FROM networks WHERE client_id = $client_id"));
$num_networks = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_domain_id') AS num FROM client_domains WHERE client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('domain_id') AS num FROM domains WHERE client_id = $client_id"));
$num_domains = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_application_id') AS num FROM client_applications WHERE client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('application_id') AS num FROM applications WHERE client_id = $client_id"));
$num_applications = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('invoice_id') AS num FROM invoices WHERE client_id = $client_id"));
@ -76,7 +76,7 @@ if(isset($_GET['client_id'])){
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('recurring_invoice_id') AS num FROM recurring_invoices, invoices WHERE recurring_invoices.invoice_id = invoices.invoice_id AND invoices.client_id = $client_id"));
$num_recurring = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_note_id') AS num FROM client_notes WHERE client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('note_id') AS num FROM notes WHERE client_id = $client_id"));
$num_notes = $row['num'];
?>
@ -163,21 +163,21 @@ if(isset($_GET['client_id'])){
<?php
while($row = mysqli_fetch_array($sql_contacts)){
$client_contact_id = $row['client_contact_id'];
$client_contact_name = $row['client_contact_name'];
$client_contact_title = $row['client_contact_title'];
$client_contact_phone = $row['client_contact_phone'];
if(strlen($client_contact_phone)>2){
$client_contact_phone = substr($row['client_contact_phone'],0,3)."-".substr($row['client_contact_phone'],3,3)."-".substr($row['client_contact_phone'],6,4);
$contact_id = $row['contact_id'];
$contact_name = $row['contact_name'];
$contact_title = $row['contact_title'];
$contact_phone = $row['contact_phone'];
if(strlen($contact_phone)>2){
$contact_phone = substr($row['contact_phone'],0,3)."-".substr($row['contact_phone'],3,3)."-".substr($row['contact_phone'],6,4);
}
$client_contact_email = $row['client_contact_email'];
$contact_email = $row['contact_email'];
?>
<tr>
<td><?php echo "$client_contact_name"; ?></td>
<td><?php echo "$client_contact_title"; ?></td>
<td><?php echo "$client_contact_phone"; ?></td>
<td><?php echo "$client_contact_email"; ?></td>
<td><?php echo $contact_name; ?></td>
<td><?php echo $contact_title; ?></td>
<td><?php echo $contact_phone; ?></td>
<td><?php echo $contact_email; ?></td>
</tr>
<?php
@ -203,22 +203,22 @@ if(isset($_GET['client_id'])){
<?php
while($row = mysqli_fetch_array($sql_locations)){
$client_location_id = $row['client_location_id'];
$client_location_name = $row['client_location_name'];
$client_location_address = $row['client_location_address'];
$client_location_city = $row['client_location_city'];
$client_location_state = $row['client_location_state'];
$client_location_zip = $row['client_location_zip'];
$client_location_phone = $row['client_location_phone'];
if(strlen($client_location_phone)>2){
$client_location_phone = substr($row['client_location_phone'],0,3)."-".substr($row['client_location_phone'],3,3)."-".substr($row['client_location_phone'],6,4);
$location_id = $row['location_id'];
$location_name = $row['location_name'];
$location_address = $row['location_address'];
$location_city = $row['location_city'];
$location_state = $row['location_state'];
$location_zip = $row['location_zip'];
$location_phone = $row['location_phone'];
if(strlen($location_phone)>2){
$location_phone = substr($row['location_phone'],0,3)."-".substr($row['location_phone'],3,3)."-".substr($row['location_phone'],6,4);
}
?>
<tr>
<td><?php echo "$client_location_name"; ?></td>
<td><?php echo "$client_location_address $client_location_city $client_location_state $client_location_zip"; ?></td>
<td><?php echo "$client_location_phone"; ?></td>
<td><?php echo $location_name; ?></td>
<td><?php echo "$location_address $location_city $location_state $location_zip"; ?></td>
<td><?php echo $location_phone; ?></td>
</tr>
<?php
@ -240,6 +240,7 @@ if(isset($_GET['client_id'])){
<th>Type</th>
<th>Name</th>
<th>Make</th>
<th>Model</th>
<th>Serial</th>
</tr>
</thead>
@ -247,19 +248,20 @@ if(isset($_GET['client_id'])){
<?php
while($row = mysqli_fetch_array($sql_assets)){
$client_asset_id = $row['client_asset_id'];
$client_asset_type = $row['client_asset_type'];
$client_asset_name = $row['client_asset_name'];
$client_asset_make = $row['client_asset_make'];
$client_asset_model = $row['client_asset_model'];
$client_asset_serial = $row['client_asset_serial'];
$asset_id = $row['asset_id'];
$asset_type = $row['asset_type'];
$asset_name = $row['asset_name'];
$asset_make = $row['asset_make'];
$asset_model = $row['asset_model'];
$asset_serial = $row['asset_serial'];
?>
<tr>
<td><?php echo $client_asset_type; ?></td>
<td><?php echo $client_asset_name; ?></td>
<td><?php echo "$client_asset_make $client_asset_model"; ?></td>
<td><?php echo $client_asset_serial; ?></td>
<td><?php echo $asset_type; ?></td>
<td><?php echo $asset_name; ?></td>
<td><?php echo $asset_make; ?></td>
<td><?php echo $asset_model; ?></td>
<td><?php echo $asset_serial; ?></td>
</tr>
<?php
@ -285,16 +287,16 @@ if(isset($_GET['client_id'])){
<?php
while($row = mysqli_fetch_array($sql_vendors)){
$client_vendor_id = $row['client_vendor_id'];
$client_vendor_name = $row['client_vendor_name'];
$client_vendor_description = $row['client_vendor_description'];
$client_vendor_account_number = $row['client_vendor_account_number'];
$vendor_id = $row['vendor_id'];
$vendor_name = $row['vendor_name'];
$vendor_description = $row['vendor_description'];
$vendor_account_number = $row['vendor_account_number'];
?>
<tr>
<td><?php echo $client_vendor_name; ?></td>
<td><?php echo $client_vendor_description; ?></td>
<td><?php echo $client_vendor_account_number; ?></td>
<td><?php echo $vendor_name; ?></td>
<td><?php echo $vendor_description; ?></td>
<td><?php echo $vendor_account_number; ?></td>
</tr>
<?php
@ -320,16 +322,16 @@ if(isset($_GET['client_id'])){
<?php
while($row = mysqli_fetch_array($sql_logins)){
$client_login_id = $row['client_login_id'];
$client_login_description = $row['client_login_description'];
$client_login_username = $row['client_login_username'];
$client_login_password = $row['client_login_password'];
$login_id = $row['login_id'];
$login_description = $row['login_description'];
$login_username = $row['login_username'];
$login_password = $row['login_password'];
?>
<tr>
<td><?php echo $client_login_description; ?></td>
<td><?php echo $client_login_username; ?></td>
<td><?php echo $client_login_password; ?></td>
<td><?php echo $login_description; ?></td>
<td><?php echo $login_username; ?></td>
<td><?php echo $login_password; ?></td>
</tr>
<?php
@ -356,19 +358,19 @@ if(isset($_GET['client_id'])){
<?php
while($row = mysqli_fetch_array($sql_networks)){
$client_network_id = $row['client_network_id'];
$client_network_name = $row['client_network_name'];
$client_network = $row['client_network'];
$client_network_gateway = $row['client_network_gateway'];
$client_network_dhcp_range = $row['client_network_dhcp_range'];
$network_id = $row['network_id'];
$network_name = $row['network_name'];
$network = $row['network'];
$network_gateway = $row['network_gateway'];
$network_dhcp_range = $row['network_dhcp_range'];
?>
<tr>
<td><?php echo $client_network_name; ?></td>
<td><?php echo $client_network; ?></td>
<td><?php echo $client_network_gateway; ?></td>
<td><?php echo $client_network_dhcp_range; ?></td>
<td><?php echo $network_name; ?></td>
<td><?php echo $network; ?></td>
<td><?php echo $network_gateway; ?></td>
<td><?php echo $network_dhcp_range; ?></td>
</tr>
<?php
@ -387,26 +389,37 @@ if(isset($_GET['client_id'])){
<tr>
<th>Domain</th>
<th>Registrar</th>
<th>Webhost</th>
<th>Expire</th>
<th>Server</th>
</tr>
</thead>
<tbody>
<?php
while($row = mysqli_fetch_array($sql_domains)){
$client_domain_id = $row['client_domain_id'];
$client_domain_name = $row['client_domain_name'];
$client_domain_registrar = $row['client_domain_registrar'];
$client_domain_expire = $row['client_domain_expire'];
$client_domain_server = $row['client_domain_server'];
$domain_id = $row['domain_id'];
$domain_name = $row['domain_name'];
$domain_registrar = $row['domain_registrar'];
$domain_webhost = $row['domain_webhost'];
$domain_expire = $row['domain_expire'];
$sql_domain_registrar = mysqli_query($mysqli,"SELECT vendor_name FROM vendors WHERE vendor_id = $domain_registrar");
$row = mysqli_fetch_array($sql_domain_registrar);
$domain_registrar = $row['vendor_name'];
$sql_domain_webhost = mysqli_query($mysqli,"SELECT vendor_name FROM vendors WHERE vendor_id = $domain_webhost");
$row = mysqli_fetch_array($sql_domain_webhost);
$domain_webhost = $row['vendor_name'];
?>
<tr>
<td><?php echo $client_domain_name; ?></td>
<td><?php echo $client_domain_registrar; ?></td>
<td><?php echo $client_domain_expire; ?></td>
<td><?php echo $client_domain_server; ?></td>
<td><?php echo $domain_name; ?></td>
<td><?php echo $domain_registrar; ?></td>
<td><?php echo $domain_webhost; ?></td>
<td><?php echo $domain_expire; ?></td>
</tr>
<?php
@ -432,16 +445,16 @@ if(isset($_GET['client_id'])){
<?php
while($row = mysqli_fetch_array($sql_applications)){
$client_application_id = $row['client_application_id'];
$client_application_name = $row['client_application_name'];
$client_application_type = $row['client_application_type'];
$client_application_license = $row['client_application_license'];
$application_id = $row['application_id'];
$application_name = $row['application_name'];
$application_type = $row['application_type'];
$application_license = $row['application_license'];
?>
<tr>
<td><?php echo $client_application_name; ?></td>
<td><?php echo $client_application_type; ?></td>
<td><?php echo $client_application_license; ?></td>
<td><?php echo $application_name; ?></td>
<td><?php echo $application_type; ?></td>
<td><?php echo $application_license; ?></td>
</tr>
<?php
@ -643,14 +656,14 @@ if(isset($_GET['client_id'])){
<?php
while($row = mysqli_fetch_array($sql_notes)){
$client_note_id = $row['client_note_id'];
$client_note_subject = $row['client_note_subject'];
$client_note_body = $row['client_note_body'];
$note_id = $row['note_id'];
$note_subject = $row['note_subject'];
$note_body = $row['note_body'];
?>
<h6><?php echo "$client_note_subject"; ?></h6>
<h6><?php echo $note_subject; ?></h6>
<hr>
<p class="mb-4"><?php echo "$client_note_body"; ?></p>
<p class="mb-4"><?php echo $note_body; ?></p>
<?php } ?>

View File

@ -1,15 +1,15 @@
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM recurring_invoices, invoices
WHERE invoices.invoice_id = recurring_invoices.invoice_id
$sql = mysqli_query($mysqli,"SELECT * FROM recurring, invoices
WHERE invoices.invoice_id = recurring.invoice_id
AND invoices.client_id = $client_id
ORDER BY recurring_invoices.recurring_invoice_id DESC");
ORDER BY recurring.recurring_id DESC");
?>
<div class="card">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-copy"></i> Recurring Invoices</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addRecurringInvoiceModal"><i class="fa fa-plus"></i></button>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addRecurringModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
@ -29,17 +29,17 @@
<?php
while($row = mysqli_fetch_array($sql)){
$recurring_invoice_id = $row['recurring_invoice_id'];
$recurring_invoice_frequency = $row['recurring_invoice_frequency'];
$recurring_invoice_status = $row['recurring_invoice_status'];
$recurring_invoice_start_date = $row['recurring_invoice_start_date'];
$recurring_invoice_last_sent = $row['recurring_invoice_last_sent'];
if($recurring_invoice_last_sent == 0){
$recurring_invoice_last_sent = "-";
$recurring_id = $row['recurring_id'];
$recurring_frequency = $row['recurring_frequency'];
$recurring_status = $row['recurring_status'];
$recurring_start_date = $row['recurring_start_date'];
$recurring_last_sent = $row['recurring_last_sent'];
if($recurring_last_sent == 0){
$recurring_last_sent = "-";
}
$recurring_invoice_next_date = $row['recurring_invoice_next_date'];
$recurring_next_date = $row['recurring_next_date'];
$invoice_id = $row['invoice_id'];
if($recurring_invoice_status == 1){
if($recurring_status == 1){
$status = "Active";
$status_badge_color = "success";
}else{
@ -50,10 +50,10 @@
?>
<tr>
<td><?php echo ucwords($recurring_invoice_frequency); ?>ly</td>
<td><?php echo $recurring_invoice_start_date; ?></td>
<td><?php echo $recurring_invoice_last_sent; ?></td>
<td><?php echo $recurring_invoice_next_date; ?></td>
<td><?php echo ucwords($recurring_frequency); ?>ly</td>
<td><?php echo $recurring_start_date; ?></td>
<td><?php echo $recurring_last_sent; ?></td>
<td><?php echo $recurring_next_date; ?></td>
<td>
<span class="p-2 badge badge-<?php echo $status_badge_color; ?>">
<?php echo $status; ?>
@ -65,11 +65,11 @@
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="recurring_invoice.php?recurring_invoice_id=<?php echo $recurring_invoice_id; ?>">Edit</a>
<?php if($recurring_invoice_status == 1){ ?>
<a class="dropdown-item" href="post.php?recurring_deactivate=<?php echo $recurring_invoice_id; ?>">Deactivate</a>
<a class="dropdown-item" href="recurring_invoice.php?recurring_id=<?php echo $recurring_id; ?>">Edit</a>
<?php if($recurring_status == 1){ ?>
<a class="dropdown-item" href="post.php?recurring_deactivate=<?php echo $recurring_id; ?>">Deactivate</a>
<?php }else{ ?>
<a class="dropdown-item" href="post.php?recurring_activate=<?php echo $recurring_invoice_id; ?>">Activate</a>
<a class="dropdown-item" href="post.php?recurring_activate=<?php echo $recurring_id; ?>">Activate</a>
<?php } ?>
<a class="dropdown-item" href="post.php?delete_invoice=<?php echo $invoice_id; ?>">Delete</a>
</div>
@ -79,8 +79,6 @@
<?php
//include("edit_invoice_modal.php");
include("add_invoice_copy_modal.php");
}
?>
@ -91,4 +89,4 @@
</div>
</div>
<?php include("add_recurring_invoice_modal.php"); ?>
<?php include("add_recurring_modal.php"); ?>

View File

@ -25,8 +25,8 @@ if(isset($_GET['tab'])){
elseif($_GET['tab'] == "domains"){
include("client_domains.php");
}
elseif($_GET['tab'] == "applications"){
include("client_applications.php");
elseif($_GET['tab'] == "software"){
include("client_software.php");
}
elseif($_GET['tab'] == "invoices"){
include("client_invoices.php");

View File

@ -1,9 +1,10 @@
<!-- Sidebar -->
<!-- Client Sidebar -->
<ul class="sidebar navbar-nav d-print-none">
<li class="nav-item my-3">
<h2 class="text-white text-center"><?php echo $client_name; ?></h2>
<h6 class="text-secondary text-center"><?php echo $client_type; ?></h6>
</li>
<li class="nav-item">
@ -21,7 +22,6 @@
<i class="fas fa-fw fa-chart-bar mx-2"></i>
<span>Overview</span>
</a>
</li>
<li class="nav-item <?php if($_GET['tab'] == "contacts") { echo "active"; } ?>">
@ -144,14 +144,14 @@
</a>
</li>
<li class="nav-item <?php if($_GET['tab'] == "applications") { echo "active"; } ?>">
<li class="nav-item <?php if($_GET['tab'] == "software") { echo "active"; } ?>">
<a class="nav-link"
href="?client_id=<?php echo $client_id; ?>&tab=applications">
href="?client_id=<?php echo $client_id; ?>&tab=software">
<i class="fas fa-fw fa-rocket mx-2"></i>
<span>Applications
<span>Software
<?php
if($num_applications > 0){ ?>
<small class="float-right badge-secondary badge-pill mt-1"><?php echo $num_applications; ?></small>
if($num_software > 0){ ?>
<small class="float-right badge-secondary badge-pill mt-1"><?php echo $num_software; ?></small>
<?php
}
?>

View File

@ -1,16 +1,16 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM client_applications WHERE client_id = $client_id ORDER BY client_application_id DESC"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM software WHERE client_id = $client_id ORDER BY software_id DESC"); ?>
<div class="card">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-rocket mr-2"></i>Applications</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addClientApplicationModal"><i class="fa fa-plus"></i></button>
<h6 class="float-left mt-1"><i class="fa fa-rocket mr-2"></i>Software</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addSoftwareModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>Application</th>
<th>Software</th>
<th>Type</th>
<th>License</th>
<th></th>
@ -21,30 +21,30 @@
<?php
while($row = mysqli_fetch_array($sql)){
$client_application_id = $row['client_application_id'];
$client_application_name = $row['client_application_name'];
$client_application_type = $row['client_application_type'];
$client_application_license = $row['client_application_license'];
$software_id = $row['software_id'];
$software_name = $row['software_name'];
$software_type = $row['software_type'];
$software_license = $row['software_license'];
$sql2 = mysqli_query($mysqli,"SELECT * FROM client_logins WHERE client_vendor_id = $client_vendor_id");
$row = mysqli_fetch_array($sql2);
$client_login_id = $row['client_login_id'];
$client_login_username = $row['client_login_username'];
$client_login_password = $row['client_login_password'];
$client_application_id_relation = $row['client_application_id'];
$sql_login = mysqli_query($mysqli,"SELECT * FROM logins WHERE vendor_id = $vendor_id");
$row = mysqli_fetch_array($sql_login);
$login_id = $row['login_id'];
$login_username = $row['login_username'];
$login_password = $row['login_password'];
$software_id_relation = $row['software_id'];
?>
<tr>
<td><?php echo $client_application_name; ?></td>
<td><?php echo $client_application_type; ?></td>
<td><?php echo $client_application_license; ?></td>
<td><?php echo $software_name; ?></td>
<td><?php echo $software_type; ?></td>
<td><?php echo $software_license; ?></td>
<td>
<?php
if($client_application_id == $client_application_id_relation){
if($software_id == $software_id_relation){
?>
<button type="button" class="btn btn-dark btn-sm" data-toggle="modal" data-target="#viewPasswordModal<?php echo $client_login_id; ?>"><i class="fas fa-key"></i></button>
<button type="button" class="btn btn-dark btn-sm" data-toggle="modal" data-target="#viewPasswordModal<?php echo $login_id; ?>"><i class="fas fa-key"></i></button>
<div class="modal" id="viewPasswordModal<?php echo $client_login_id; ?>" tabindex="-1">
<div class="modal" id="viewPasswordModal<?php echo $login_id; ?>" tabindex="-1">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
@ -54,8 +54,8 @@
</button>
</div>
<div class="modal-body">
<h2><?php echo $client_login_username; ?></h2>
<h3><?php echo $client_login_password; ?></h3>
<h2><?php echo $login_username; ?></h2>
<h3><?php echo $login_password; ?></h3>
</div>
</div>
</div>
@ -70,15 +70,15 @@
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientApplicationModal<?php echo $client_application_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_client_application=<?php echo $client_application_id; ?>">Delete</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editSoftwareModal<?php echo $software_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_software=<?php echo $software_id; ?>">Delete</a>
</div>
</div>
</td>
</tr>
<?php
include("edit_client_application_modal.php");
include("edit_software_modal.php");
}
?>
@ -88,4 +88,4 @@
</div>
</div>
<?php include("add_client_application_modal.php"); ?>
<?php include("add_software_modal.php"); ?>

View File

@ -1,9 +1,9 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM client_vendors WHERE client_id = $client_id ORDER BY client_vendor_id DESC"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM vendors WHERE client_id = $client_id ORDER BY vendor_id DESC"); ?>
<div class="card">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-building"></i> Vendors</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addClientVendorModal"><i class="fa fa-plus"></i></button>
<h6 class="float-left mt-1"><i class="fa fa-fw fa-building mr-2"></i>Vendors</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addVendorModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<div class="table-responsive">
@ -21,27 +21,36 @@
<?php
while($row = mysqli_fetch_array($sql)){
$client_vendor_id = $row['client_vendor_id'];
$client_vendor_name = $row['client_vendor_name'];
$client_vendor_description = $row['client_vendor_description'];
$client_vendor_account_number = $row['client_vendor_account_number'];
$client_login_id = $row['client_login_id'];
$vendor_id = $row['vendor_id'];
$vendor_name = $row['vendor_name'];
$vendor_description = $row['vendor_description'];
$vendor_account_number = $row['vendor_account_number'];
$vendor_address = $row['vendor_address'];
$vendor_city = $row['vendor_city'];
$vendor_state = $row['vendor_state'];
$vendor_zip = $row['vendor_zip'];
$vendor_phone = $row['vendor_phone'];
if(strlen($vendor_phone)>2){
$vendor_phone = substr($row['vendor_phone'],0,3)."-".substr($row['vendor_phone'],3,3)."-".substr($row['vendor_phone'],6,4);
}
$vendor_email = $row['vendor_email'];
$vendor_website = $row['vendor_website'];
$sql2 = mysqli_query($mysqli,"SELECT * FROM client_logins WHERE client_vendor_id = $client_vendor_id");
$sql2 = mysqli_query($mysqli,"SELECT * FROM client_logins WHERE vendor_id = $vendor_id");
$row = mysqli_fetch_array($sql2);
$client_login_id = $row['client_login_id'];
$client_login_username = $row['client_login_username'];
$client_login_password = $row['client_login_password'];
$client_vendor_id_relation = $row['client_vendor_id'];
$vendor_id_relation = $row['vendor_id'];
?>
<tr>
<td><?php echo $client_vendor_name; ?></td>
<td><?php echo $client_vendor_description; ?></td>
<td><?php echo $client_vendor_account_number; ?></td>
<td><?php echo $vendor_name; ?></td>
<td><?php echo $vendor_description; ?></td>
<td><?php echo $vendor_account_number; ?></td>
<td>
<?php
if($client_vendor_id == $client_vendor_id_relation){
if($vendor_id == $vendor_id_relation){
?>
<button type="button" class="btn btn-dark btn-sm" data-toggle="modal" data-target="#viewPasswordModal<?php echo $client_login_id; ?>"><i class="fas fa-key"></i></button>
@ -49,7 +58,7 @@
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fa fa-key"></i> <?php echo $client_vendor_name; ?> Login</h5>
<h5 class="modal-title"><i class="fa fa-key"></i> <?php echo $vendor_name; ?> Login</h5>
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
@ -86,15 +95,15 @@
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientVendorModal<?php echo $client_vendor_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_client_vendor=<?php echo $client_vendor_id; ?>">Delete</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editVendorModal<?php echo $vendor_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_vendor=<?php echo $vendor_id; ?>">Delete</a>
</div>
</div>
</td>
</tr>
<?php
include("edit_client_vendor_modal.php");
include("edit_vendor_modal.php");
}
?>
@ -104,4 +113,4 @@
</div>
</div>
<?php include("add_client_vendor_modal.php"); ?>
<?php include("add_vendor_modal.php"); ?>

View File

@ -14,6 +14,7 @@
<thead class="thead-dark">
<tr>
<th>Name</th>
<th>Type</th>
<th>Email</th>
<th>Phone</th>
<th class="text-right">Balance</th>
@ -26,6 +27,7 @@
while($row = mysqli_fetch_array($sql)){
$client_id = $row['client_id'];
$client_name = $row['client_name'];
$client_type = $row['client_type'];
$client_address = $row['client_address'];
$client_city = $row['client_city'];
$client_state = $row['client_state'];
@ -59,9 +61,10 @@
?>
<tr>
<td><a href="client.php?client_id=<?php echo $client_id; ?>"><?php echo "$client_name"; ?></a></td>
<td><a href="mailto:<?php echo$email; ?>"><?php echo "$client_email"; ?></a></td>
<td><?php echo "$client_phone"; ?></td>
<td><a href="client.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a></td>
<td><?php echo $client_type; ?></td>
<td><a href="mailto:<?php echo $client_email; ?>"><?php echo $client_email; ?></a></td>
<td><?php echo $client_phone; ?></td>
<td class="text-right text-monospace <?php echo $balance_text_color; ?>">$<?php echo number_format($balance,2); ?></td>
<td>
<div class="dropdown dropleft text-center">

View File

@ -42,6 +42,20 @@
$_SESSION['alert_message'] = '';
$_SESSION['alert_type'] = "warning";
$client_types_array = array(
'Residential',
'Law',
'Tax and Accounting',
'General Contractor',
'Medical',
'Non Profit',
'Industrial',
'Automotive',
'Retail',
'Staffing Agency',
'Other'
);
$net_terms_array = array(
'0'=>'On Reciept',
'7'=>'7 Days',
@ -132,7 +146,8 @@
'Other'
);
$application_types_array = array(
$software_types_array = array(
'Operating System',
'Web App',
'Desktop App',
'Other'

100
cron.php
View File

@ -8,74 +8,74 @@
//DOMAINS EXPIRING
//Get Domains Expiring within 1 days
$sql = mysqli_query($mysqli,"SELECT * FROM client_domains, clients
WHERE client_domains.client_id = clients.client_id
AND client_domain_expire = CURDATE() + INTERVAL 1 DAY
ORDER BY client_domain_id DESC"
$sql = mysqli_query($mysqli,"SELECT * FROM domains, clients
WHERE domains.client_id = clients.client_id
AND domain_expire = CURDATE() + INTERVAL 1 DAY
ORDER BY domain_id DESC"
);
while($row = mysqli_fetch_array($sql)){
$client_domain_id = $row['client_domain_id'];
$client_domain_name = $row['client_domain_name'];
$client_domain_expire = $row['client_domain_expire'];
$domain_id = $row['domain_id'];
$domain_name = $row['domain_name'];
$domain_expire = $row['domain_expire'];
$client_id = $row['client_id'];
$client_name = $row['client_name'];
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Domain', alert_message = 'Domain $client_domain_name will expire tomorrow on $client_domain_expire', alert_date = CURDATE()");
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Domain', alert_message = 'Domain $domain_name will expire tomorrow on $domain_expire', alert_date = CURDATE()");
}
//Get Domains Expiring within 14 days
$sql = mysqli_query($mysqli,"SELECT * FROM client_domains, clients
WHERE client_domains.client_id = clients.client_id
AND client_domain_expire = CURDATE() + INTERVAL 14 DAY
ORDER BY client_domain_id DESC"
$sql = mysqli_query($mysqli,"SELECT * FROM domains, clients
WHERE domains.client_id = clients.client_id
AND domain_expire = CURDATE() + INTERVAL 1 DAY
ORDER BY domain_id DESC"
);
while($row = mysqli_fetch_array($sql)){
$client_domain_id = $row['client_domain_id'];
$client_domain_name = $row['client_domain_name'];
$client_domain_expire = $row['client_domain_expire'];
$domain_id = $row['domain_id'];
$domain_name = $row['domain_name'];
$domain_expire = $row['domain_expire'];
$client_id = $row['client_id'];
$client_name = $row['client_name'];
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Domain', alert_message = 'Domain $client_domain_name will expire in 14 Days on $client_domain_expire', alert_date = CURDATE()");
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Domain', alert_message = 'Domain $domain_name will expire in 14 Days on $domain_expire', alert_date = CURDATE()");
}
//Get Domains Expiring within 30 days
$sql = mysqli_query($mysqli,"SELECT * FROM client_domains, clients
WHERE client_domains.client_id = clients.client_id
AND client_domain_expire = CURDATE() + INTERVAL 30 DAY
ORDER BY client_domain_id DESC"
$sql = mysqli_query($mysqli,"SELECT * FROM domains, clients
WHERE domains.client_id = clients.client_id
AND domain_expire = CURDATE() + INTERVAL 1 DAY
ORDER BY domain_id DESC"
);
while($row = mysqli_fetch_array($sql)){
$client_domain_id = $row['client_domain_id'];
$client_domain_name = $row['client_domain_name'];
$client_domain_expire = $row['client_domain_expire'];
$domain_id = $row['domain_id'];
$domain_name = $row['domain_name'];
$domain_expire = $row['domain_expire'];
$client_id = $row['client_id'];
$client_name = $row['client_name'];
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Domain', alert_message = 'Domain $client_domain_name will expire in 30 Days on $client_domain_expire', alert_date = CURDATE()");
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Domain', alert_message = 'Domain $domain_name will expire in 30 Days on $domain_expire', alert_date = CURDATE()");
}
//Get Domains Expiring within 90 days
$sql = mysqli_query($mysqli,"SELECT * FROM client_domains, clients
WHERE client_domains.client_id = clients.client_id
AND client_domain_expire = CURDATE() + INTERVAL 90 DAY
ORDER BY client_domain_id DESC"
$sql = mysqli_query($mysqli,"SELECT * FROM domains, clients
WHERE domains.client_id = clients.client_id
AND domain_expire = CURDATE() + INTERVAL 1 DAY
ORDER BY domain_id DESC"
);
while($row = mysqli_fetch_array($sql)){
$client_domain_id = $row['client_domain_id'];
$client_domain_name = $row['client_domain_name'];
$client_domain_expire = $row['client_domain_expire'];
$domain_id = $row['domain_id'];
$domain_name = $row['domain_name'];
$domain_expire = $row['domain_expire'];
$client_id = $row['client_id'];
$client_name = $row['client_name'];
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Domain', alert_message = 'Domain $client_domain_name will expire in 90 Days on $client_domain_expire', alert_date = CURDATE()");
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Domain', alert_message = 'Domain $domain_name will expire in 90 Days on $domain_expire', alert_date = CURDATE()");
}
@ -177,15 +177,15 @@ while($row = mysqli_fetch_array($sql)){
//Send Recurring Invoices that match todays date and are active
$sql_recurring_invoices = mysqli_query($mysqli,"SELECT * FROM recurring_invoices, clients, invoices WHERE clients.client_id = invoices.client_id AND invoices.invoice_id = recurring_invoices.invoice_id AND recurring_invoices.recurring_invoice_next_date = CURDATE() AND recurring_invoices.recurring_invoice_status = 1");
$sql_recurring = mysqli_query($mysqli,"SELECT * FROM recurring, clients, invoices WHERE clients.client_id = invoices.client_id AND invoices.invoice_id = recurring.invoice_id AND recurring.recurring_next_date = CURDATE() AND recurring.recurring_status = 1");
while($row = mysqli_fetch_array($sql_recurring_invoices)){
$recurring_invoice_id = $row['recurring_invoice_id'];
$recurring_invoice_frequency = $row['recurring_invoice_frequency'];
$recurring_invoice_status = $row['recurring_invoice_status'];
$recurring_invoice_start_date = $row['recurring_invoice_start_date'];
$recurring_invoice_last_sent = $row['recurring_invoice_last_sent'];
$recurring_invoice_next_date = $row['recurring_invoice_next_date'];
$recurring_id = $row['recurring_id'];
$recurring_frequency = $row['recurring_frequency'];
$recurring_status = $row['recurring_status'];
$recurring_start_date = $row['recurring_start_date'];
$recurring_last_sent = $row['recurring_last_sent'];
$recurring_next_date = $row['recurring_next_date'];
$invoice_id = $row['invoice_id'];
$invoice_status = $row['invoice_status'];
$invoice_amount = $row['invoice_amount'];
@ -206,25 +206,25 @@ while($row = mysqli_fetch_array($sql_recurring_invoices)){
//Copy Items from original invoice to new invoice
$sql_invoice_items = mysqli_query($mysqli,"SELECT * FROM invoice_items WHERE invoice_id = $invoice_id ORDER BY invoice_item_id ASC");
$sql_invoice_items = mysqli_query($mysqli,"SELECT * FROM invoice_items WHERE invoice_id = $invoice_id ORDER BY item_id ASC");
while($row = mysqli_fetch_array($sql_invoice_items)){
$invoice_item_id = $row['invoice_item_id'];
$invoice_item_name = $row['invoice_item_name'];
$invoice_item_description = $row['invoice_item_description'];
$invoice_item_quantity = $row['invoice_item_quantity'];
$invoice_item_price = $row['invoice_item_price'];
$invoice_item_subtotal = $row['invoice_item_price'];
$invoice_item_tax = $row['invoice_item_tax'];
$invoice_item_total = $row['invoice_item_total'];
$item_id = $row['item_id'];
$item_name = $row['item_name'];
$item_description = $row['item_description'];
$item_quantity = $row['item_quantity'];
$item_price = $row['item_price'];
$item_subtotal = $row['item_price'];
$item_tax = $row['item_tax'];
$item_total = $row['item_total'];
mysqli_query($mysqli,"INSERT INTO invoice_items SET invoice_item_name = '$invoice_item_name', invoice_item_description = '$invoice_item_description', invoice_item_quantity = $invoice_item_quantity, invoice_item_price = '$invoice_item_price', invoice_item_subtotal = '$invoice_item_subtotal', invoice_item_tax = '$invoice_item_tax', invoice_item_total = '$invoice_item_total', invoice_id = $new_invoice_id");
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$item_name', item_description = '$item_description', item_quantity = $item_quantity, item_price = '$item_price', item_subtotal = '$item_subtotal', item_tax = '$item_tax', item_total = '$item_total', invoice_id = $new_invoice_id");
}
mysqli_query($mysqli,"INSERT INTO invoice_history SET invoice_history_date = CURDATE(), invoice_history_status = 'Draft', invoice_history_description = 'INVOICE added!', invoice_id = $new_invoice_id");
//update the recurring invoice with the new dates
mysqli_query($mysqli,"UPDATE recurring_invoices SET recurring_invoice_last_sent = CURDATE(), recurring_invoice_next_date = DATE_ADD(CURDATE(), INTERVAL 1 $recurring_invoice_frequency) , invoice_id = $new_invoice_id WHERE recurring_invoice_id = $recurring_invoice_id");
mysqli_query($mysqli,"UPDATE recurring SET recurring_last_sent = CURDATE(), recurring_next_date = DATE_ADD(CURDATE(), INTERVAL 1 $recurring_frequency) , invoice_id = $new_invoice_id WHERE recurring_id = $recurring_id");
}
?>

677
db.sql
View File

@ -1,677 +0,0 @@
-- MySQL dump 10.16 Distrib 10.1.38-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: pittpc
-- ------------------------------------------------------
-- Server version 10.1.38-MariaDB-0ubuntu0.18.04.2
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `accounts`
--
DROP TABLE IF EXISTS `accounts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accounts` (
`account_id` int(11) NOT NULL AUTO_INCREMENT,
`account_name` varchar(200) NOT NULL,
`opening_balance` decimal(15,2) NOT NULL,
PRIMARY KEY (`account_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `alerts`
--
DROP TABLE IF EXISTS `alerts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `alerts` (
`alert_id` int(11) NOT NULL AUTO_INCREMENT,
`alert_type` varchar(200) NOT NULL,
`alert_message` varchar(200) NOT NULL,
`alert_date` date NOT NULL,
`alert_ack_date` date NOT NULL,
PRIMARY KEY (`alert_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `c4v_invoices`
--
DROP TABLE IF EXISTS `c4v_invoices`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `c4v_invoices` (
`invoice_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`company_id` int(11) NOT NULL,
`invoice_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`order_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`invoice_status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`invoice_date` datetime NOT NULL,
`invoice_due` datetime NOT NULL,
`invoice_amount` double(15,4) NOT NULL,
`currency_code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`currency_rate` double(15,8) NOT NULL,
`client_id` int(11) NOT NULL,
`customer_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`customer_email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`customer_tax_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`customer_phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`customer_address` text COLLATE utf8mb4_unicode_ci,
`invoice_note` text COLLATE utf8mb4_unicode_ci,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`category_id` int(11) NOT NULL,
`parent_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`invoice_id`),
UNIQUE KEY `invoices_company_id_invoice_number_deleted_at_unique` (`company_id`,`invoice_number`,`deleted_at`),
KEY `invoices_company_id_index` (`company_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `calendar_events`
--
DROP TABLE IF EXISTS `calendar_events`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `calendar_events` (
`calendar_event_id` int(11) NOT NULL AUTO_INCREMENT,
`calendar_event_title` varchar(200) NOT NULL,
`calendar_event_start` datetime NOT NULL,
`calendar_event_end` datetime NOT NULL,
`client_id` int(11) NOT NULL,
`client_location_id` int(11) NOT NULL,
`calendar_id` int(11) NOT NULL,
PRIMARY KEY (`calendar_event_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `calendars`
--
DROP TABLE IF EXISTS `calendars`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `calendars` (
`calendar_id` int(11) NOT NULL AUTO_INCREMENT,
`calendar_name` varchar(200) NOT NULL,
PRIMARY KEY (`calendar_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `categories`
--
DROP TABLE IF EXISTS `categories`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `categories` (
`category_id` int(11) NOT NULL AUTO_INCREMENT,
`category_name` varchar(200) NOT NULL,
`category_type` varchar(200) NOT NULL,
`category_color` varchar(200) NOT NULL,
PRIMARY KEY (`category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=64 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `client_applications`
--
DROP TABLE IF EXISTS `client_applications`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `client_applications` (
`client_application_id` int(11) NOT NULL AUTO_INCREMENT,
`client_application_name` varchar(200) NOT NULL,
`client_application_type` varchar(200) NOT NULL,
`client_application_license` varchar(200) NOT NULL,
`client_id` int(11) NOT NULL,
PRIMARY KEY (`client_application_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `client_assets`
--
DROP TABLE IF EXISTS `client_assets`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `client_assets` (
`client_asset_id` int(11) NOT NULL AUTO_INCREMENT,
`client_asset_type` varchar(200) NOT NULL,
`client_asset_name` varchar(200) NOT NULL,
`client_asset_make` varchar(200) NOT NULL,
`client_asset_model` varchar(200) NOT NULL,
`client_asset_serial` varchar(200) NOT NULL,
`client_asset_purchase_date` date NOT NULL,
`client_asset_warranty_expire` date NOT NULL,
`client_asset_reciept` varchar(200) NOT NULL,
`client_asset_note` varchar(200) NOT NULL,
`client_password_id` int(11) NOT NULL,
`client_vendor_id` int(11) NOT NULL,
`client_location_id` int(11) NOT NULL,
`client_contact_id` int(11) NOT NULL,
`client_id` int(11) NOT NULL,
PRIMARY KEY (`client_asset_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `client_contacts`
--
DROP TABLE IF EXISTS `client_contacts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `client_contacts` (
`client_contact_id` int(11) NOT NULL AUTO_INCREMENT,
`client_contact_name` varchar(200) NOT NULL,
`client_contact_title` varchar(200) NOT NULL,
`client_contact_email` varchar(200) NOT NULL,
`client_contact_phone` varchar(200) NOT NULL,
`client_contact_primary` tinyint(1) NOT NULL,
`client_contact_recieve_invoices` tinyint(1) NOT NULL,
`client_contact_photo` varchar(200) NOT NULL,
`location_id` int(11) NOT NULL,
`client_id` int(11) NOT NULL,
PRIMARY KEY (`client_contact_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `client_domains`
--
DROP TABLE IF EXISTS `client_domains`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `client_domains` (
`client_domain_id` int(11) NOT NULL AUTO_INCREMENT,
`client_domain_name` varchar(200) NOT NULL,
`client_domain_registrar` int(11) NOT NULL,
`client_domain_webhost` int(11) NOT NULL,
`client_domain_expire` date NOT NULL,
`client_id` int(11) NOT NULL,
PRIMARY KEY (`client_domain_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `client_locations`
--
DROP TABLE IF EXISTS `client_locations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `client_locations` (
`client_location_id` int(11) NOT NULL AUTO_INCREMENT,
`client_location_name` varchar(200) NOT NULL,
`client_location_address` varchar(200) NOT NULL,
`client_location_city` varchar(200) NOT NULL,
`client_location_state` varchar(200) NOT NULL,
`client_location_zip` varchar(200) NOT NULL,
`client_location_phone` varchar(200) NOT NULL,
`client_location_hours` varchar(200) NOT NULL,
`client_id` int(11) NOT NULL,
PRIMARY KEY (`client_location_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `client_logins`
--
DROP TABLE IF EXISTS `client_logins`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `client_logins` (
`client_login_id` int(11) NOT NULL AUTO_INCREMENT,
`client_login_description` varchar(200) NOT NULL,
`client_login_web_link` varchar(200) NOT NULL,
`client_login_username` varchar(200) NOT NULL,
`client_login_password` varchar(200) NOT NULL,
`client_login_note` text NOT NULL,
`client_vendor_id` int(11) NOT NULL,
`client_asset_id` int(11) NOT NULL,
`client_application_id` int(11) NOT NULL,
`client_id` int(11) NOT NULL,
PRIMARY KEY (`client_login_id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `client_networks`
--
DROP TABLE IF EXISTS `client_networks`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `client_networks` (
`client_network_id` int(11) NOT NULL AUTO_INCREMENT,
`client_network_name` varchar(200) NOT NULL,
`client_network` varchar(200) NOT NULL,
`client_network_gateway` varchar(200) NOT NULL,
`client_network_dhcp_range` varchar(200) NOT NULL,
`client_network_notes` text NOT NULL,
`client_id` int(11) NOT NULL,
PRIMARY KEY (`client_network_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `client_notes`
--
DROP TABLE IF EXISTS `client_notes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `client_notes` (
`client_note_id` int(11) NOT NULL AUTO_INCREMENT,
`client_note_subject` varchar(200) NOT NULL,
`client_note_body` text NOT NULL,
`client_id` int(11) NOT NULL,
PRIMARY KEY (`client_note_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `client_vendors`
--
DROP TABLE IF EXISTS `client_vendors`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `client_vendors` (
`client_vendor_id` int(11) NOT NULL AUTO_INCREMENT,
`client_vendor_name` varchar(200) NOT NULL,
`client_vendor_description` varchar(200) NOT NULL,
`client_vendor_account_number` varchar(200) NOT NULL,
`client_vendor_note` text NOT NULL,
`client_id` int(11) NOT NULL,
PRIMARY KEY (`client_vendor_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `clients`
--
DROP TABLE IF EXISTS `clients`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `clients` (
`client_id` int(11) NOT NULL AUTO_INCREMENT,
`client_name` varchar(200) NOT NULL,
`client_address` varchar(200) NOT NULL,
`client_city` varchar(200) NOT NULL,
`client_state` varchar(200) NOT NULL,
`client_zip` varchar(200) NOT NULL,
`client_phone` varchar(200) NOT NULL,
`client_email` varchar(200) NOT NULL,
`client_website` varchar(200) NOT NULL,
`client_net_terms` int(10) NOT NULL,
`client_created_at` int(11) NOT NULL,
`client_updated_at` int(11) NOT NULL,
PRIMARY KEY (`client_id`)
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `expenses`
--
DROP TABLE IF EXISTS `expenses`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `expenses` (
`expense_id` int(11) NOT NULL AUTO_INCREMENT,
`expense_description` text NOT NULL,
`expense_amount` decimal(15,2) NOT NULL,
`expense_date` date NOT NULL,
`expense_reference` varchar(200) NOT NULL,
`expense_receipt` varchar(200) NOT NULL,
`vendor_id` int(11) NOT NULL,
`category_id` int(11) NOT NULL,
`account_id` int(11) NOT NULL,
PRIMARY KEY (`expense_id`)
) ENGINE=InnoDB AUTO_INCREMENT=381 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `files`
--
DROP TABLE IF EXISTS `files`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `files` (
`file_id` int(11) NOT NULL AUTO_INCREMENT,
`reference_file_name` varchar(200) NOT NULL,
`file_name` varchar(200) NOT NULL,
`file_ext` varchar(200) NOT NULL,
`client_id` int(11) NOT NULL,
PRIMARY KEY (`file_id`)
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `invoice_history`
--
DROP TABLE IF EXISTS `invoice_history`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `invoice_history` (
`invoice_history_id` int(11) NOT NULL AUTO_INCREMENT,
`invoice_history_date` date NOT NULL,
`invoice_history_status` varchar(200) NOT NULL,
`invoice_history_description` varchar(200) NOT NULL,
`invoice_id` int(11) NOT NULL,
PRIMARY KEY (`invoice_history_id`)
) ENGINE=InnoDB AUTO_INCREMENT=402 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `invoice_items`
--
DROP TABLE IF EXISTS `invoice_items`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `invoice_items` (
`invoice_item_id` int(11) NOT NULL AUTO_INCREMENT,
`invoice_item_name` varchar(200) NOT NULL,
`invoice_item_description` text NOT NULL,
`invoice_item_quantity` decimal(15,2) NOT NULL,
`invoice_item_price` decimal(15,2) NOT NULL,
`invoice_item_subtotal` decimal(15,2) NOT NULL,
`invoice_item_tax` decimal(15,2) NOT NULL,
`invoice_item_total` decimal(15,2) NOT NULL,
`invoice_id` int(11) NOT NULL,
`quote_id` int(11) NOT NULL,
PRIMARY KEY (`invoice_item_id`)
) ENGINE=InnoDB AUTO_INCREMENT=564 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `invoices`
--
DROP TABLE IF EXISTS `invoices`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `invoices` (
`invoice_id` int(11) NOT NULL AUTO_INCREMENT,
`invoice_number` int(11) NOT NULL,
`invoice_status` varchar(200) NOT NULL,
`invoice_date` date NOT NULL,
`invoice_due` date NOT NULL,
`invoice_amount` decimal(15,2) NOT NULL,
`invoice_note` text NOT NULL,
`category_id` int(11) NOT NULL,
`client_id` int(11) NOT NULL,
PRIMARY KEY (`invoice_id`)
) ENGINE=InnoDB AUTO_INCREMENT=138 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `mileage`
--
DROP TABLE IF EXISTS `mileage`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mileage` (
`mileage_id` int(11) NOT NULL AUTO_INCREMENT,
`mileage_date` date NOT NULL,
`mileage_purpose` varchar(200) NOT NULL,
`mileage_starting_location` varchar(200) NOT NULL,
`mileage_destination` varchar(200) NOT NULL,
`mileage_start_odometer` int(11) DEFAULT NULL,
`mileage_end_odmeter` int(11) DEFAULT NULL,
`mileage_miles` int(11) NOT NULL,
`client_id` int(11) DEFAULT NULL,
`invoice_id` int(11) NOT NULL,
`location_id` int(11) NOT NULL,
`vendor_id` int(11) NOT NULL,
PRIMARY KEY (`mileage_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `payments`
--
DROP TABLE IF EXISTS `payments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payments` (
`payment_id` int(11) NOT NULL AUTO_INCREMENT,
`payment_date` date NOT NULL,
`payment_amount` decimal(15,2) NOT NULL,
`payment_method` varchar(200) NOT NULL,
`payment_reference` varchar(200) NOT NULL,
`account_id` int(11) NOT NULL,
`invoice_id` int(11) NOT NULL,
PRIMARY KEY (`payment_id`)
) ENGINE=InnoDB AUTO_INCREMENT=143 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `products`
--
DROP TABLE IF EXISTS `products`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `products` (
`product_id` int(11) NOT NULL AUTO_INCREMENT,
`product_name` varchar(200) NOT NULL,
`product_description` text NOT NULL,
`product_cost` decimal(15,2) NOT NULL,
PRIMARY KEY (`product_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `quotes`
--
DROP TABLE IF EXISTS `quotes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `quotes` (
`quote_id` int(11) NOT NULL AUTO_INCREMENT,
`quote_number` varchar(200) NOT NULL,
`quote_status` varchar(200) NOT NULL,
`quote_date` date NOT NULL,
`quote_amount` decimal(15,2) NOT NULL,
`quote_note` text NOT NULL,
`quote_url_key` varchar(200) NOT NULL,
`category_id` int(11) NOT NULL,
`client_id` int(11) NOT NULL,
PRIMARY KEY (`quote_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `recurring_invoices`
--
DROP TABLE IF EXISTS `recurring_invoices`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `recurring_invoices` (
`recurring_invoice_id` int(11) NOT NULL AUTO_INCREMENT,
`recurring_invoice_frequency` varchar(200) NOT NULL,
`recurring_invoice_start_date` date NOT NULL,
`recurring_invoice_last_sent` date NOT NULL,
`recurring_invoice_next_date` date NOT NULL,
`recurring_invoice_status` int(1) NOT NULL,
`invoice_id` int(11) NOT NULL,
PRIMARY KEY (`recurring_invoice_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settings`
--
DROP TABLE IF EXISTS `settings`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `settings` (
`config_default_expense_account` varchar(200) NOT NULL,
`config_default_payment_account` varchar(200) NOT NULL,
`config_default_net_terms` varchar(200) NOT NULL,
`config_start_page` varchar(200) NOT NULL,
`config_company_name` varchar(200) NOT NULL,
`config_company_address` varchar(200) NOT NULL,
`config_company_city` varchar(200) NOT NULL,
`config_company_state` varchar(200) NOT NULL,
`config_company_zip` varchar(200) NOT NULL,
`config_company_phone` varchar(200) NOT NULL,
`config_company_site` varchar(200) NOT NULL,
`config_smtp_host` varchar(200) NOT NULL,
`config_smtp_username` varchar(200) NOT NULL,
`config_smtp_password` varchar(200) NOT NULL,
`config_smtp_port` int(200) NOT NULL,
`config_mail_from_email` varchar(200) NOT NULL,
`config_mail_from_name` varchar(200) NOT NULL,
`config_account_balance_threshold` varchar(200) NOT NULL,
`config_invoice_logo` varchar(200) NOT NULL,
`config_invoice_footer` text NOT NULL,
`config_next_invoice_number` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ticket_updates`
--
DROP TABLE IF EXISTS `ticket_updates`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ticket_updates` (
`ticket_update_id` int(11) NOT NULL AUTO_INCREMENT,
`ticket_update` text NOT NULL,
`ticket_update_created_at` datetime NOT NULL,
`user_id` int(11) NOT NULL,
`ticket_id` int(11) NOT NULL,
PRIMARY KEY (`ticket_update_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `tickets`
--
DROP TABLE IF EXISTS `tickets`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tickets` (
`ticket_id` int(11) NOT NULL AUTO_INCREMENT,
`ticket_category` varchar(200) NOT NULL,
`ticket_subject` varchar(200) NOT NULL,
`ticket_details` text NOT NULL,
`ticket_status` varchar(200) NOT NULL,
`ticket_created_at` datetime NOT NULL,
`ticket_updated_at` datetime NOT NULL,
`ticket_closed_at` datetime NOT NULL,
`client_id` int(11) NOT NULL,
`vendor_id` int(11) NOT NULL,
PRIMARY KEY (`ticket_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transfers`
--
DROP TABLE IF EXISTS `transfers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `transfers` (
`transfer_id` int(11) NOT NULL AUTO_INCREMENT,
`transfer_amount` decimal(15,2) NOT NULL,
`transfer_date` date NOT NULL,
`transfer_account_from` int(11) NOT NULL,
`transfer_account_to` int(11) NOT NULL,
`expense_id` int(11) NOT NULL,
`payment_id` int(11) NOT NULL,
PRIMARY KEY (`transfer_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`user_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(200) NOT NULL,
`email` varchar(200) NOT NULL,
`password` varchar(200) NOT NULL,
`avatar` varchar(200) NOT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `vendors`
--
DROP TABLE IF EXISTS `vendors`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vendors` (
`vendor_id` int(11) NOT NULL AUTO_INCREMENT,
`vendor_name` varchar(200) NOT NULL,
`vendor_description` varchar(200) NOT NULL,
`vendor_address` varchar(200) NOT NULL,
`vendor_city` varchar(200) NOT NULL,
`vendor_state` varchar(200) NOT NULL,
`vendor_zip` varchar(200) NOT NULL,
`vendor_phone` varchar(200) NOT NULL,
`vendor_email` varchar(200) NOT NULL,
`vendor_website` varchar(200) NOT NULL,
`vendor_account_number` varchar(200) NOT NULL,
`vendor_created_at` int(11) NOT NULL,
`vendor_updated_at` int(11) NOT NULL,
PRIMARY KEY (`vendor_id`)
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2019-05-14 19:02:29

View File

@ -2,7 +2,7 @@
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-piggy-bank mr-2"></i>Modify Account</h5>
<h5 class="modal-title text-white"><i class="fa fa-fw fa-piggy-bank mr-2"></i><?php echo $account_name; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>

View File

@ -1,39 +1,39 @@
<div class="modal" id="editClientAssetModal<?php echo $client_asset_id; ?>" tabindex="-1">
<div class="modal" id="editAssetModal<?php echo $asset_id; ?>" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-<?php echo $device_icon; ?> mr-2"></i>Edit Asset</h5>
<h5 class="modal-title text-white"><i class="fa fa-fw fa-<?php echo $device_icon; ?> mr-2"></i><?php echo $asset_name; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="client_asset_id" value="<?php echo $client_asset_id; ?>">
<input type="hidden" name="client_login_id" value="<?php echo $client_login_id; ?>">
<input type="hidden" name="asset_id" value="<?php echo $asset_id; ?>">
<input type="hidden" name="login_id" value="<?php echo $login_id; ?>">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<div class="modal-body bg-white">
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab<?php echo $client_asset_id; ?>" role="tablist">
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab<?php echo $asset_id; ?>" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="pills-basic-tab<?php echo $client_asset_id; ?>" data-toggle="pill" href="#pills-basic<?php echo $client_asset_id; ?>" role="tab" aria-controls="pills-home<?php echo $client_asset_id; ?>" aria-selected="true">Basic</a>
<a class="nav-link active" id="pills-basic-tab<?php echo $asset_id; ?>" data-toggle="pill" href="#pills-basic<?php echo $asset_id; ?>" role="tab" aria-controls="pills-home<?php echo $asset_id; ?>" aria-selected="true">Basic</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-assignment-tab<?php echo $client_asset_id; ?>" data-toggle="pill" href="#pills-assignment<?php echo $client_asset_id; ?>" role="tab" aria-controls="pills-assignment<?php echo $client_asset_id; ?>" aria-selected="false">Assignment</a>
<a class="nav-link" id="pills-assignment-tab<?php echo $asset_id; ?>" data-toggle="pill" href="#pills-assignment<?php echo $asset_id; ?>" role="tab" aria-controls="pills-assignment<?php echo $asset_id; ?>" aria-selected="false">Assignment</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-purchase-tab<?php echo $client_asset_id; ?>" data-toggle="pill" href="#pills-purchase<?php echo $client_asset_id; ?>" role="tab" aria-controls="pills-purchase<?php echo $client_asset_id; ?>" aria-selected="false">Purchase</a>
<a class="nav-link" id="pills-purchase-tab<?php echo $asset_id; ?>" data-toggle="pill" href="#pills-purchase<?php echo $asset_id; ?>" role="tab" aria-controls="pills-purchase<?php echo $asset_id; ?>" aria-selected="false">Purchase</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-login-tab<?php echo $client_asset_id; ?>" data-toggle="pill" href="#pills-login<?php echo $client_asset_id; ?>" role="tab" aria-controls="pills-login<?php echo $client_asset_id; ?>" aria-selected="false">Login</a>
<a class="nav-link" id="pills-login-tab<?php echo $asset_id; ?>" data-toggle="pill" href="#pills-login<?php echo $asset_id; ?>" role="tab" aria-controls="pills-login<?php echo $asset_id; ?>" aria-selected="false">Login</a>
</li>
</ul>
<hr>
<div class="tab-content" id="pills-tabContent<?php echo $client_asset_id; ?>">
<div class="tab-content" id="pills-tabContent<?php echo $asset_id; ?>">
<div class="tab-pane fade show active" id="pills-basic<?php echo $client_asset_id; ?>" role="tabpanel" aria-labelledby="pills-basic-tab<?php echo $client_asset_id; ?>">
<div class="tab-pane fade show active" id="pills-basic<?php echo $asset_id; ?>" role="tabpanel" aria-labelledby="pills-basic-tab<?php echo $asset_id; ?>">
<div class="form-group">
<label>Asset Name</label>
@ -41,7 +41,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
</div>
<input type="text" class="form-control" name="name" placeholder="Name the asset" value="<?php echo $client_asset_name; ?>" required>
<input type="text" class="form-control" name="name" placeholder="Name the asset" value="<?php echo $asset_name; ?>" required>
</div>
</div>
@ -52,8 +52,8 @@
<span class="input-group-text"><i class="fa fa-fw fa-tags"></i></span>
</div>
<select class="form-control" name="type" required>
<?php foreach($asset_types_array as $asset_type) { ?>
<option <?php if($client_asset_type == $asset_type) { echo "selected"; } ?>><?php echo $asset_type; ?></option>
<?php foreach($asset_types_array as $asset_type_select) { ?>
<option <?php if($asset_type_select == $asset_type) { echo "selected"; } ?>><?php echo $asset_type_select; ?></option>
<?php } ?>
</select>
</div>
@ -65,7 +65,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
</div>
<input type="text" class="form-control" name="make" placeholder="Manufacturer" value="<?php echo $client_asset_make; ?>" required>
<input type="text" class="form-control" name="make" placeholder="Manufacturer" value="<?php echo $asset_make; ?>" required>
</div>
</div>
@ -75,7 +75,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
</div>
<input type="text" class="form-control" name="model" placeholder="Model Number" value="<?php echo $client_asset_model; ?>" required>
<input type="text" class="form-control" name="model" placeholder="Model Number" value="<?php echo $asset_model; ?>" required>
</div>
</div>
@ -85,13 +85,13 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-barcode"></i></span>
</div>
<input type="text" class="form-control" name="serial" placeholder="Serial number" value="<?php echo $client_asset_serial; ?>" required>
<input type="text" class="form-control" name="serial" placeholder="Serial number" value="<?php echo $asset_serial; ?>" required>
</div>
</div>
</div>
<div class="tab-pane fade" id="pills-assignment<?php echo $client_asset_id; ?>" role="tabpanel" aria-labelledby="pills-assignment-tab<?php echo $client_asset_id; ?>">
<div class="tab-pane fade" id="pills-assignment<?php echo $asset_id; ?>" role="tabpanel" aria-labelledby="pills-assignment-tab<?php echo $asset_id; ?>">
<div class="form-group">
<label>Location</label>
@ -103,12 +103,12 @@
<option value="">- Location -</option>
<?php
$sql_client_locations = mysqli_query($mysqli,"SELECT * FROM client_locations WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql_client_locations)){
$location_id = $row['client_location_id'];
$location_name = $row['client_location_name'];
$sql_locations = mysqli_query($mysqli,"SELECT * FROM locations WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql_locations)){
$location_id_select = $row['location_id'];
$location_name_select = $row['location_name'];
?>
<option <?php if($client_location_id == $location_id){ echo "selected"; } ?> value="<?php echo $location_id; ?>"><?php echo $location_name; ?></option>
<option <?php if($location_id == $location_id_select){ echo "selected"; } ?> value="<?php echo $location_id_select; ?>"><?php echo $location_name_select; ?></option>
<?php
}
@ -127,12 +127,12 @@
<option value="">- Contact -</option>
<?php
$sql_client_contacts = mysqli_query($mysqli,"SELECT * FROM client_contacts WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql_client_contacts)){
$contact_id = $row['client_contact_id'];
$contact_name = $row['client_contact_name'];
$sql_contacts = mysqli_query($mysqli,"SELECT * FROM contacts WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql_contacts)){
$contact_id_select = $row['contact_id'];
$contact_name_select = $row['contact_name'];
?>
<option <?php if($client_contact_id == $contact_id){ echo "selected"; } ?> value="<?php echo $contact_id; ?>"><?php echo $contact_name; ?></option>
<option <?php if($contact_id == $contact_id_select){ echo "selected"; } ?> value="<?php echo $contact_id_select; ?>"><?php echo $contact_name_select; ?></option>
<?php
}
@ -142,7 +142,7 @@
</div>
</div>
<div class="tab-pane fade" id="pills-purchase<?php echo $client_asset_id; ?>" role="tabpanel" aria-labelledby="pills-purchase-tab<?php echo $client_asset_id; ?>">
<div class="tab-pane fade" id="pills-purchase<?php echo $asset_id; ?>" role="tabpanel" aria-labelledby="pills-purchase-tab<?php echo $asset_id; ?>">
<div class="form-group">
<label>Vendor</label>
@ -154,12 +154,12 @@
<option value="">- Vendor -</option>
<?php
$sql_client_vendors = mysqli_query($mysqli,"SELECT * FROM client_vendors WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql_client_vendors)){
$vendor_id = $row['client_vendor_id'];
$vendor_name = $row['client_vendor_name'];
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql_vendors)){
$vendor_id_select = $row['vendor_id'];
$vendor_name_select = $row['vendor_name'];
?>
<option <?php if($client_vendor_id == $vendor_id){ echo "selected"; } ?> value="<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></option>
<option <?php if($vendor_id == $vendor_id_select){ echo "selected"; } ?> value="<?php echo $vendor_id_select; ?>"><?php echo $vendor_name_select; ?></option>
<?php
}
@ -174,7 +174,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-shopping-cart"></i></span>
</div>
<input type="date" class="form-control" name="purchase_date" value="<?php echo $client_asset_purchase_date; ?>">
<input type="date" class="form-control" name="purchase_date" value="<?php echo $asset_purchase_date; ?>">
</div>
</div>
@ -184,20 +184,20 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
</div>
<input type="date" class="form-control" name="warranty_expire" value="<?php echo $client_asset_warranty_expire; ?>">
<input type="date" class="form-control" name="warranty_expire" value="<?php echo $asset_warranty_expire; ?>">
</div>
</div>
</div>
<div class="tab-pane fade" id="pills-login<?php echo $client_asset_id; ?>" role="tabpanel" aria-labelledby="pills-login-tab<?php echo $client_asset_id; ?>">
<div class="tab-pane fade" id="pills-login<?php echo $asset_id; ?>" role="tabpanel" aria-labelledby="pills-login-tab<?php echo $asset_id; ?>">
<div class="form-group">
<label>Username</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
</div>
<input type="text" class="form-control" name="username" placeholder="Username" value="<?php echo $client_login_username; ?>">
<input type="text" class="form-control" name="username" placeholder="Username" value="<?php echo $login_username; ?>">
</div>
</div>
<div class="form-group">
@ -206,7 +206,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-lock"></i></span>
</div>
<input type="text" class="form-control" name="password" placeholder="Password" value="<?php echo $client_login_password; ?>">
<input type="text" class="form-control" name="password" placeholder="Password" value="<?php echo $login_password; ?>">
</div>
</div>
@ -216,7 +216,7 @@
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="edit_client_asset" class="btn btn-primary">Save</button>
<button type="submit" name="edit_asset" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -2,7 +2,7 @@
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-calendar mr-2"></i>Edit Event</h5>
<h5 class="modal-title text-white"><i class="fa fa-fw fa-calendar mr-2"></i><?php echo $calendar_event_title; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>

View File

@ -2,7 +2,7 @@
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-list mr-2"></i>Modify Category</h5>
<h5 class="modal-title text-white"><i class="fa fa-fw fa-list mr-2"></i><?php echo $category_name; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
@ -16,14 +16,14 @@
<div class="form-group">
<label>Type</label>
<select class="form-control" name="type" required>
<?php foreach($category_types_array as $category_type2) { ?>
<option <?php if($category_type == $category_type2) { echo "selected"; } ?>><?php echo $category_type2; ?></option>
<?php foreach($category_types_array as $category_type_select) { ?>
<option <?php if($category_type == $category_type_select) { echo "selected"; } ?>><?php echo $category_type_select; ?></option>
<?php } ?>
</select>
</div>
<div class="form-group">
<label>Color</label>
<input type="color" class="form-control" name="color" value="<?php echo $category_color; ?>">
<input type="color" class="form-control col-md-2" name="color" value="<?php echo $category_color; ?>">
</div>
</div>
<div class="modal-footer bg-white">

View File

@ -1,70 +1,177 @@
<div class="modal" id="editClientModal<?php echo $client_id; ?>" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-user-edit mr-2"></i>Edit <?php echo $client_name; ?></h5>
<div class="modal-header text-white">
<h5 class="modal-title"><i class="fa fa-fw fa-user-edit mr-2"></i><?php echo $client_name; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<div class="modal-body bg-white">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>" >
<div class="form-group row">
<label class="col-sm-2 col-form-label">Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="name" value="<?php echo $client_name; ?>" required>
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab<?php echo $client_id; ?>" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="pills-basic-tab<?php echo $client_id; ?>" data-toggle="pill" href="#pills-basic<?php echo $client_id; ?>" role="tab" aria-controls="pills-basic<?php echo $client_id; ?>" aria-selected="true">Basic</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-address-tab<?php echo $client_id; ?>" data-toggle="pill" href="#pills-address<?php echo $client_id; ?>" role="tab" aria-controls="pills-address<?php echo $client_id; ?>" aria-selected="false">Address</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-contact-tab<?php echo $client_id; ?>" data-toggle="pill" href="#pills-contact<?php echo $client_id; ?>" role="tab" aria-controls="pills-contact<?php echo $client_id; ?>" aria-selected="false">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-more-tab<?php echo $client_id; ?>" data-toggle="pill" href="#pills-more<?php echo $client_id; ?>" role="tab" aria-controls="pills-more<?php echo $client_id; ?>" aria-selected="false">More</a>
</li>
</ul>
<hr>
<div class="tab-content" id="pills-tabContent<?php echo $client_id; ?>">
<div class="tab-pane fade show active" id="pills-basic<?php echo $client_id; ?>" role="tabpanel" aria-labelledby="pills-basic-tab<?php echo $client_id; ?>">
<div class="form-group">
<label>Name</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
</div>
<input type="text" class="form-control" name="name" placeholder="Name or Company" value="<?php echo $client_name; ?>" required>
</div>
</div>
<div class="form-group">
<label>Type</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-list"></i></span>
</div>
<select class="form-control" name="type" required>
<option value="">- Type -</option>
<?php foreach($client_types_array as $client_type_select) { ?>
<option <?php if($client_type_select == $client_type) { echo "selected"; } ?>><?php echo $client_type_select; ?></option>
<?php } ?>
</select>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Phone</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="phone" data-inputmask="'mask': '999-999-9999'" value="<?php echo $client_phone; ?>" required>
<div class="tab-pane fade" id="pills-address<?php echo $client_id; ?>" role="tabpanel" aria-labelledby="pills-address-tab<?php echo $client_id; ?>">
<div class="form-group">
<label>Address</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-map-marker-alt"></i></span>
</div>
<input type="text" class="form-control" name="address" placeholder="Address" value="<?php echo $client_address; ?>">
</div>
</div>
<div class="form-group">
<label>City</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-city"></i></span>
</div>
<input type="text" class="form-control" name="city" placeholder="City" value="<?php echo $client_city; ?>" required>
</div>
</div>
<div class="form-group">
<label>State</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-flag"></i></span>
</div>
<select class="form-control" name="state">
<option value="">- State -</option>
<?php foreach($states_array as $state_abbr => $state_name) { ?>
<option <?php if($client_state == $state_abbr) { echo "selected"; } ?> value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-group">
<label>Zip</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fab fa-fw fa-usps"></i></span>
</div>
<input type="text" class="form-control" name="zip" placeholder="Zip" value="<?php echo $client_zip; ?>">
</div>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Email</label>
<div class="col-sm-10">
<input type="email" class="form-control" name="email" value="<?php echo $client_email; ?>" required>
<div class="tab-pane fade" id="pills-contact<?php echo $client_id; ?>" role="tabpanel" aria-labelledby="pills-contact-tab<?php echo $client_id; ?>">
<div class="form-group">
<label>Phone</label>
<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="phone" placeholder="Phone Number" value="<?php echo $client_phone; ?>">
</div>
</div>
<div class="form-group">
<label>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" value="<?php echo $client_email; ?>">
</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="Web Address" value="<?php echo $client_website; ?>">
</div>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Website</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="website" value="<?php echo $client_website; ?>">
<div class="tab-pane fade" id="pills-more<?php echo $client_id; ?>" role="tabpanel" aria-labelledby="pills-more-tab<?php echo $client_id; ?>">
<div class="form-group">
<label>Hours</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-clock"></i></span>
</div>
<input type="text" class="form-control" name="hours" placeholder="Hours of operation" value="<?php echo $client_hours; ?>">
</div>
</div>
<div class="form-group">
<label>Invoice Net Terms</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
</div>
<select class="form-control" name="net_terms">
<option value="">- Net Terms -</option>
<?php foreach($net_terms_array as $net_term_value => $net_term_name) { ?>
<option <?php if($net_term_value == $client_net_term) { echo "selected"; } ?> value="<?php echo $net_term_value; ?>"><?php echo $net_term_name; ?></option>
<?php } ?>
</select>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Address</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="address" value="<?php echo $client_address; ?>" required>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">City</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="city" value="<?php echo $client_city; ?>" required>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">State</label>
<div class="col-sm-10">
<select class="form-control" name="state" required>
<option value="">- State -</option>
<?php
foreach($states_array as $state_abbr => $state_name){
?>
<option <?php if($client_state == $state_abbr) { echo "selected"; } ?> value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Zip</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="zip" value="<?php echo $client_zip; ?>" required>
</div>
</div>
</div>
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>

View File

@ -1,49 +0,0 @@
<div class="modal" id="editClientVendorModal<?php echo $client_vendor_id; ?>" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-building mr-2"></i>Edit Vendor</h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="client_vendor_id" value="<?php echo $client_vendor_id; ?>">
<div class="modal-body bg-white">
<div class="form-group">
<label>Vendor Name</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-building"></i></span>
</div>
<input type="text" class="form-control" name="name" placeholder="Name of the vendor" value="<?php echo $client_vendor_name; ?>" required>
</div>
</div>
<div class="form-group">
<label>Description</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-comment"></i></span>
</div>
<input type="text" class="form-control" name="description" placeholder="Description of the Vendor" value="<?php echo $client_vendor_description; ?>"required>
</div>
</div>
<div class="form-group">
<label>Account Number</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-barcode"></i></span>
</div>
<input type="text" class="form-control" name="account_number" placeholder="Account number" value="<?php echo $client_vendor_account_number; ?>">
</div>
</div>
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="edit_client_vendor" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div>
</div>

View File

@ -1,23 +1,23 @@
<div class="modal" id="editClientContactModal<?php echo $client_contact_id; ?>" tabindex="-1">
<div class="modal" id="editContactModal<?php echo $contact_id; ?>" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-user-edit mr-2"></i>Edit Contact</h5>
<h5 class="modal-title text-white"><i class="fa fa-fw fa-user-edit mr-2"></i><?php echo $contact_name; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="client_contact_id" value="<?php echo $client_contact_id; ?>">
<input type="hidden" name="contact_id" value="<?php echo $contact_id; ?>">
<div class="modal-body bg-white">
<center><img class="img-fluid rounded-circle" src="<?php echo $client_contact_photo; ?>" height="256" width="256"></center>
<center><img class="img-fluid rounded-circle" src="<?php echo $contact_photo; ?>" height="256" width="256"></center>
<div class="form-group">
<label>Name</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-user"></i></span>
</div>
<input type="text" class="form-control" name="name" placeholder="Full Name" value="<?php echo $client_contact_name; ?>" required>
<input type="text" class="form-control" name="name" placeholder="Full Name" value="<?php echo $contact_name; ?>" required>
</div>
</div>
@ -27,7 +27,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-id-badge"></i></span>
</div>
<input type="text" class="form-control" name="title" placeholder="Title" value="<?php echo $client_contact_title; ?>" required>
<input type="text" class="form-control" name="title" placeholder="Title" value="<?php echo $contact_title; ?>" required>
</div>
</div>
@ -37,7 +37,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-phone"></i></span>
</div>
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'" value="<?php echo $client_contact_phone; ?>" required>
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'" value="<?php echo $contact_phone; ?>" required>
</div>
</div>
@ -47,13 +47,13 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-envelope"></i></span>
</div>
<input type="email" class="form-control" name="email" placeholder="Email Address" value="<?php echo $client_contact_email; ?>" required>
<input type="email" class="form-control" name="email" placeholder="Email Address" value="<?php echo $contact_email; ?>" required>
</div>
</div>
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="edit_client_contact" class="btn btn-primary">Save</button>
<button type="submit" name="edit_contact" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -1,4 +1,4 @@
<div class="modal" id="editClientDomainModal<?php echo $client_domain_id; ?>" tabindex="-1">
<div class="modal" id="editDomainModal<?php echo $domain_id; ?>" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
@ -8,7 +8,7 @@
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="client_domain_id" value="<?php echo $client_domain_id; ?>">
<input type="hidden" name="domain_id" value="<?php echo $domain_id; ?>">
<div class="modal-body bg-white">
<div class="form-group">
<label>Domain Name</label>
@ -16,7 +16,7 @@
<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="name" placeholder="Domain name exmaple.com" value="<?php echo $client_domain_name; ?>" required>
<input type="text" class="form-control" name="name" placeholder="Domain name exmaple.com" value="<?php echo $domain_name; ?>" required>
</div>
</div>
@ -30,12 +30,12 @@
<option value="">- Vendor -</option>
<?php
$sql_vendors1 = mysqli_query($mysqli,"SELECT * FROM client_vendors WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql_vendors1)){
$client_vendor_id = $row['client_vendor_id'];
$client_vendor_name = $row['client_vendor_name'];
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql_vendors)){
$vendor_id_select = $row['vendor_id'];
$vendor_name_select = $row['vendor_name'];
?>
<option <?php if($client_domain_registrar == $client_vendor_id) { echo "selected"; } ?> value="<?php echo $client_vendor_id; ?>"><?php echo $client_vendor_name; ?></option>
<option <?php if($domain_registrar == $vendor_id_select) { echo "selected"; } ?> value="<?php echo $vendor_id_select; ?>"><?php echo $vendor_name_select; ?></option>
<?php
}
@ -54,12 +54,12 @@
<option value="">- Vendor -</option>
<?php
$sql_vendors2 = mysqli_query($mysqli,"SELECT * FROM client_vendors WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql_vendors2)){
$client_vendor_id = $row['client_vendor_id'];
$client_vendor_name = $row['client_vendor_name'];
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE client_id = $client_id");
while($row = mysqli_fetch_array($sql_vendors)){
$vendor_id_select = $row['vendor_id'];
$vendor_name_select = $row['vendor_name'];
?>
<option <?php if($client_domain_webhost == $client_vendor_id){ echo "selected"; } ?> value="<?php echo $client_vendor_id; ?>"><?php echo $client_vendor_name; ?></option>
<option <?php if($domain_webhost == $vendor_id_select){ echo "selected"; } ?> value="<?php echo $vendor_id_select; ?>"><?php echo $vendor_name_select; ?></option>
<?php
}
@ -74,14 +74,14 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
</div>
<input type="date" class="form-control" name="expire" value="<?php echo $client_domain_expire; ?>" required>
<input type="date" class="form-control" name="expire" value="<?php echo $domain_expire; ?>" required>
</div>
</div>
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="edit_client_domain" class="btn btn-primary">Save</button>
<button type="submit" name="edit_domain" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -1,21 +1,21 @@
<div class="modal" id="editExpenseModal<?php echo $expense_id; ?>" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title"><i class="fa fa-edit"></i> Modify expense</h5>
<button type="button" class="close" data-dismiss="modal">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-edit"></i></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<div class="modal-body">
<div class="modal-body bg-white">
<input type="hidden" name="expense_id" value="<?php echo $expense_id; ?>">
<div class="form-row">
<div class="form-group col-md">
<label>Date</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
</div>
<input type="date" class="form-control" name="date" value="<?php echo $expense_date; ?>" required>
</div>
@ -24,7 +24,7 @@
<label>Amount</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-dollar-sign"></i></span>
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
</div>
<input type="number" class="form-control" step="0.01" name="amount" value="<?php echo $expense_amount; ?>" required>
</div>
@ -33,7 +33,7 @@
<label>Account</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-university"></i></span>
<span class="input-group-text"><i class="fa fa-fw fa-piggy-bank"></i></span>
</div>
<select class="form-control" name="account" required>
<?php
@ -68,7 +68,7 @@
<label>Vendor</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-briefcase"></i></span>
<span class="input-group-text"><i class="fa fa-fw fa-building"></i></span>
</div>
<select class="form-control" name="vendor" required>
<?php
@ -90,7 +90,7 @@
<label>Category</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-file"></i></span>
<span class="input-group-text"><i class="fa fa-fw fa-list"></i></span>
</div>
<select class="form-control" name="category" required>
<?php
@ -115,14 +115,19 @@
</div>
<div class="form-group">
<label>Reference</label>
<input type="text" class="form-control" name="reference" value="<?php echo $expense_reference; ?>">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-file-alt"></i></span>
</div>
<input type="text" class="form-control" name="reference" placeholder="Enter a reference" value="<?php echo $expense_reference; ?>">
</div>
</div>
<div class="form-group">
<label>Receipt</label>
<input type="file" class="form-control-file" name="file">
</div>
</div>
<div class="modal-footer">
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="edit_expense" class="btn btn-primary">Save</button>
</div>

View File

@ -1,22 +1,22 @@
<div class="modal" id="editInvoiceModal<?php echo $invoice_id; ?>" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title"><i class="fa fa-file"></i> Edit INV-<?php echo $invoice_number; ?></h5>
<button type="button" class="close" data-dismiss="modal">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-file mr-2"></i>INV-<?php echo $invoice_number; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="invoice_id" value="<?php echo $invoice_id; ?>">
<div class="modal-body">
<div class="modal-body bg-white">
<div class="form-group">
<label>Invoice Date</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
</div>
<input type="date" class="form-control" name="date" value="<?php echo $invoice_date; ?>" required>
</div>
@ -26,7 +26,7 @@
<label>Payment Due</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
<span class="input-group-text"><i class="fa fa-fw fa-calendar-alt"></i></span>
</div>
<input type="date" class="form-control" name="due" value="<?php echo $invoice_due; ?>" required>
</div>
@ -36,7 +36,7 @@
<label>Income Category</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-tag"></i></span>
<span class="input-group-text"><i class="fa fa-fw fa-list"></i></span>
</div>
<select class="form-control" name="category" required>
<option value="">- Category -</option>
@ -56,7 +56,7 @@
</div>
</div>
</div>
<div class="modal-footer">
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="edit_invoice" class="btn btn-primary">Save</button>
</div>

View File

@ -1,14 +1,14 @@
<div class="modal" id="editClientLocationModal<?php echo $client_location_id; ?>" tabindex="-1">
<div class="modal" id="editLocationModal<?php echo $location_id; ?>" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-map-marker-alt mr-2"></i>Edit Location</h5>
<h5 class="modal-title text-white"><i class="fa fa-fw fa-map-marker-alt mr-2"></i><?php echo $location_name; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="client_location_id" value="<?php echo $client_location_id; ?>">
<input type="hidden" name="location_id" value="<?php echo $location_id; ?>">
<div class="modal-body bg-white">
<div class="form-group">
<label>Location Name</label>
@ -16,7 +16,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-map-marker"></i></span>
</div>
<input type="text" class="form-control" name="name" placeholder="Name of location" value="<?php echo $client_location_name; ?>" required>
<input type="text" class="form-control" name="name" placeholder="Name of location" value="<?php echo $location_name; ?>" required>
</div>
</div>
<div class="form-group">
@ -25,25 +25,40 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-map-marker-alt"></i></span>
</div>
<input type="text" class="form-control" name="address" placeholder="Address" value="<?php echo $client_location_address; ?>" required>
<input type="text" class="form-control" name="address" placeholder="Address" value="<?php echo $location_address; ?>" required>
</div>
</div>
<div class="form-group">
<label>City</label>
<input type="text" class="form-control" name="city" placeholder="City" value="<?php echo $client_location_city; ?>" required>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-city"></i></span>
</div>
<input type="text" class="form-control" name="city" placeholder="City" value="<?php echo $location_city; ?>" required>
</div>
</div>
<div class="form-group">
<label>State</label>
<select class="form-control" name="state" required>
<?php foreach($states_array as $state_abbr => $state_name) { ?>
<option <?php if($client_location_state == $state_abbr) { echo "selected"; } ?> value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
<?php } ?>
</select>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-flag"></i></span>
</div>
<select class="form-control" name="state" required>
<?php foreach($states_array as $state_abbr => $state_name) { ?>
<option <?php if($location_state == $state_abbr) { echo "selected"; } ?> value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-group">
<label>Zip</label>
<input type="text" class="form-control" name="zip" placeholder="Zip" value="<?php echo $client_location_zip; ?>" required>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fab fa-fw fa-usps"></i></span>
</div>
<input type="text" class="form-control" name="zip" placeholder="Zip" value="<?php echo $location_zip; ?>" required>
</div>
</div>
<div class="form-group">
<label>Phone</label>
@ -51,7 +66,7 @@
<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" data-inputmask="'mask': '999-999-9999'" value="<?php echo $client_location_phone; ?>" required>
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'" value="<?php echo $location_phone; ?>" required>
</div>
</div>
@ -61,14 +76,14 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-clock"></i></span>
</div>
<input type="text" class="form-control" name="hours" placeholder="Hours of operation" value="<?php echo $client_location_hours; ?>">
<input type="text" class="form-control" name="hours" placeholder="Hours of operation" value="<?php echo $location_hours; ?>">
</div>
</div>
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="edit_client_location" class="btn btn-primary">Save</button>
<button type="submit" name="edit_location" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -1,14 +1,14 @@
<div class="modal" id="editClientLoginModal<?php echo $client_login_id; ?>" tabindex="-1">
<div class="modal" id="editLoginModal<?php echo $login_id; ?>" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-lock mr-2"></i>Edit Login</h5>
<h5 class="modal-title text-white"><i class="fa fa-fw fa-lock mr-2"></i><?php echo $login_description; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="client_login_id" value="<?php echo $client_login_id; ?>">
<input type="hidden" name="login_id" value="<?php echo $login_id; ?>">
<div class="modal-body bg-white">
<div class="form-group">
<label>Description</label>
@ -16,7 +16,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-info-circle"></i></span>
</div>
<input type="text" class="form-control" name="description" value="<?php echo $client_login_description; ?>" required>
<input type="text" class="form-control" name="description" value="<?php echo $login_description; ?>" required>
</div>
</div>
<div class="form-group">
@ -25,7 +25,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-link"></i></span>
</div>
<input type="text" class="form-control" name="web_link" placeholder="Please include http://" value="<?php echo $client_login_web_link; ?>">
<input type="text" class="form-control" name="web_link" placeholder="Please include http://" value="<?php echo $login_web_link; ?>">
</div>
</div>
<div class="form-group">
@ -34,7 +34,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-user"></i></span>
</div>
<input type="text" class="form-control" name="username" value="<?php echo $client_login_username; ?>" required>
<input type="text" class="form-control" name="username" value="<?php echo $login_username; ?>" required>
</div>
</div>
<div class="form-group">
@ -43,13 +43,13 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lock"></i></span>
</div>
<input type="text" class="form-control" name="password" value="<?php echo $client_login_password; ?>" required>
<input type="text" class="form-control" name="password" value="<?php echo $login_password; ?>" required>
</div>
</div>
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="edit_client_login" class="btn btn-primary">Save</button>
<button type="submit" name="edit_login" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -1,14 +1,14 @@
<div class="modal" id="editClientNetworkModal<?php echo $client_network_id; ?>" tabindex="-1">
<div class="modal" id="editNetworkModal<?php echo $network_id; ?>" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-network-wired mr-2"></i>Edit Network</h5>
<h5 class="modal-title text-white"><i class="fa fa-fw fa-network-wired mr-2"></i><?php echo $network_name; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="client_network_id" value="<?php echo $client_network_id; ?>">
<input type="hidden" name="network_id" value="<?php echo $network_id; ?>">
<div class="modal-body bg-white">
<div class="form-group">
<label>Name</label>
@ -16,7 +16,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-ethernet"></i></span>
</div>
<input type="text" class="form-control" name="name" placeholder="Network name (VLAN, WAN, LAN2 etc)" value="<?php echo $client_network_name; ?>" required>
<input type="text" class="form-control" name="name" placeholder="Network name (VLAN, WAN, LAN2 etc)" value="<?php echo $network_name; ?>" required>
</div>
</div>
@ -26,7 +26,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-network-wired"></i></span>
</div>
<input type="text" class="form-control" name="network" placeholder="Network ex 192.168.1.0/24" value="<?php echo $client_network; ?>" required>
<input type="text" class="form-control" name="network" placeholder="Network ex 192.168.1.0/24" value="<?php echo $network; ?>" required>
</div>
</div>
@ -36,7 +36,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-route"></i></span>
</div>
<input type="text" class="form-control" name="gateway" placeholder="ex 192.168.1.1" value="<?php echo $client_network_gateway; ?>" required>
<input type="text" class="form-control" name="gateway" placeholder="ex 192.168.1.1" value="<?php echo $network_gateway; ?>" required>
</div>
</div>
@ -46,13 +46,13 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-server"></i></span>
</div>
<input type="text" class="form-control" name="dhcp_range" placeholder="ex 192.168.1.11-199" value="<?php echo $client_network_dhcp_range; ?>">
<input type="text" class="form-control" name="dhcp_range" placeholder="ex 192.168.1.11-199" value="<?php echo $network_dhcp_range; ?>">
</div>
</div>
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="edit_client_network" class="btn btn-primary">Save</button>
<button type="submit" name="edit_network" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -1,27 +1,27 @@
<div class="modal" id="editClientNoteModal<?php echo $client_note_id; ?>" tabindex="-1">
<div class="modal" id="editNoteModal<?php echo $note_id; ?>" tabindex="-1">
<div class="modal-dialog modal-xl">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-edit mr-2"></i>Edit Note</h5>
<h5 class="modal-title text-white"><i class="fa fa-fw fa-edit mr-2"></i><?php echo $note_subject; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="client_note_id" value="<?php echo $client_note_id; ?>">
<input type="hidden" name="note_id" value="<?php echo $note_id; ?>">
<div class="modal-body bg-white">
<div class="form-group">
<label>Subject</label>
<input type="text" class="form-control" name="subject" value="<?php echo $client_note_subject; ?>" required>
<input type="text" class="form-control" name="subject" value="<?php echo $note_subject; ?>" required>
</div>
<div class="form-group">
<label>Note</label>
<textarea rows="8" class="form-control" id="editClientNote" name="note"><?php echo $client_note_body; ?></textarea>
<textarea rows="8" class="form-control" id="editClientNote" name="note"><?php echo $note_body; ?></textarea>
</div>
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="edit_client_note" class="btn btn-primary">Save</button>
<button type="submit" name="edit_note" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -2,7 +2,7 @@
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-box mr-2"></i>Edit Product</h5>
<h5 class="modal-title text-white"><i class="fa fa-fw fa-box mr-2"></i><?php echo $product_name; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>

View File

@ -1,14 +1,14 @@
<div class="modal" id="editClientApplicationModal<?php echo $client_application_id; ?>" tabindex="-1">
<div class="modal" id="editSoftwareModal<?php echo $software_id; ?>" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-rocket mr-2"></i>Edit Application</h5>
<h5 class="modal-title text-white"><i class="fa fa-fw fa-rocket mr-2"></i><?php echo $software_name; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="client_application_id" value="<?php echo $client_application_id; ?>">
<input type="hidden" name="software_id" value="<?php echo $software_id; ?>">
<div class="modal-body bg-white">
<div class="form-group">
@ -17,7 +17,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-cube"></i></span>
</div>
<input type="text" class="form-control" name="name" placeholder="Application name" value="<?php echo $client_application_name; ?>" required>
<input type="text" class="form-control" name="name" placeholder="Software name" value="<?php echo $software_name; ?>" required>
</div>
</div>
@ -28,8 +28,8 @@
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
</div>
<select class="form-control" name="type" required>
<?php foreach($application_types_array as $application_type2) { ?>
<option <?php if($client_application_type == $application_type2) { echo "selected"; } ?>><?php echo $application_type2; ?></option>
<?php foreach($software_types_array as $software_type_select) { ?>
<option <?php if($software_type == $software_type_select) { echo "selected"; } ?>><?php echo $software_type_select; ?></option>
<?php } ?>
</select>
</div>
@ -41,14 +41,14 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
</div>
<input type="text" class="form-control" name="license" placeholder="License key" value="<?php echo $client_application_license; ?>" required>
<input type="text" class="form-control" name="license" placeholder="License key" value="<?php echo $software_license; ?>" required>
</div>
</div>
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="edit_client_application" class="btn btn-primary">Save</button>
<button type="submit" name="edit_software" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -2,7 +2,7 @@
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
<h5 class="modal-title"><i class="fa fa-fw fa-tag mr-2"></i>Edit Ticket # <?php echo $ticket_id; ?></h5>
<h5 class="modal-title"><i class="fa fa-fw fa-tag mr-2"></i>Ticket # <?php echo $ticket_id; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>

View File

@ -1,4 +1,4 @@
<div class="modal" id="editMileageModal<?php echo $mileage_id; ?>" tabindex="-1">
<div class="modal" id="editTripModal<?php echo $mileage_id; ?>" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
@ -9,7 +9,7 @@
</div>
<form action="post.php" method="post" autocomplete="off">
<div class="modal-body bg-white">
<input type="hidden" name="mileage_id" value="<?php echo $mileage_id; ?>">
<input type="hidden" name="trip_id" value="<?php echo $trip_id; ?>">
<div class="form-row">
<div class="form-group col-7">
<label>Date</label>
@ -17,7 +17,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
</div>
<input type="date" class="form-control" name="date" value="<?php echo $mileage_date; ?>" required>
<input type="date" class="form-control" name="date" value="<?php echo $trip_date; ?>" required>
</div>
</div>
<div class="form-group col-5">
@ -26,7 +26,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-bicycle"></i></span>
</div>
<input type="number" class="form-control" name="miles" value="<?php echo $mileage_miles; ?>" required>
<input type="number" class="form-control" name="miles" value="<?php echo $trip_miles; ?>" required>
</div>
</div>
</div>
@ -36,7 +36,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-map-marker-alt"></i></span>
</div>
<input type="text" class="form-control" name="starting_location" value="<?php echo $mileage_starting_location; ?>" required>
<input type="text" class="form-control" name="starting_location" value="<?php echo $trip_starting_location; ?>" required>
</div>
</div>
<div class="form-group">
@ -44,17 +44,17 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-arrow-right"></i></span>
</div>
<input type="text" class="form-control" name="destination" value="<?php echo $mileage_destination; ?>" required>
<input type="text" class="form-control" name="destination" value="<?php echo $trip_destination; ?>" required>
</div>
</div>
<div class="form-group">
<label>Purpose</label>
<textarea rows="4" class="form-control" name="purpose" required><?php echo $mileage_purpose; ?></textarea>
<textarea rows="4" class="form-control" name="purpose" required><?php echo $trip_purpose; ?></textarea>
</div>
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="edit_mileage" class="btn btn-primary">Save</button>
<button type="submit" name="edit_trip" class="btn btn-primary">Save</button>
</div>
</form>
</div>

View File

@ -2,7 +2,7 @@
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-user-edit mr-2"></i>Edit User</h5>
<h5 class="modal-title text-white"><i class="fa fa-fw fa-user-edit mr-2"></i><?php echo $name; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>

View File

@ -1,8 +1,8 @@
<div class="modal" id="editVendorModal<?php echo $vendor_id; ?>" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-building mr-2"></i>Edit Vendor</h5>
<div class="modal-header text-white">
<h5 class="modal-title"><i class="fa fa-fw fa-building mr-2"></i><?php echo $vendor_name; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
@ -10,55 +10,142 @@
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="vendor_id" value="<?php echo $vendor_id; ?>">
<div class="modal-body bg-white">
<div class="form-group">
<label>Name</label>
<input type="text" class="form-control" name="name" value="<?php echo "$vendor_name"; ?>" required>
</div>
<div class="form-group">
<label>Description</label>
<input type="text" class="form-control" name="description" value="<?php echo $vendor_description; ?>">
</div>
<div class="form-group">
<label>Address</label>
<input type="text" class="form-control" name="address" value="<?php echo $vendor_address; ?>">
</div>
<div class="form-row">
<div class="form-group col">
<label>City</label>
<input type="text" class="form-control" name="city" value="<?php echo $vendor_city; ?>">
</div>
<div class="form-group col">
<label>State</label>
<select class="form-control" name="state">
<?php foreach($states_array as $state_abbr => $state_name) { ?>
<option <?php if($vendor_state == $state_abbr){ echo "selected"; } ?> value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
<?php } ?>
</select>
</div>
<div class="form-group col">
<label>Zip</label>
<input type="text" class="form-control" name="zip" value="<?php echo $vendor_zip; ?>">
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label>Phone</label>
<input type="text" class="form-control" name="phone" value="<?php echo $vendor_phone; ?>">
</div>
<div class="form-group col">
<label>Email</label>
<input type="email" class="form-control" name="email" value="<?php echo $vendor_email; ?>">
</div>
<div class="form-group col">
<label>Website</label>
<input type="text" class="form-control" name="website" value="<?php echo $vendor_website; ?>">
</div>
</div>
<div class="form-group">
<label>Account Number</label>
<input type="text" class="form-control" name="account_number" value="<?php echo $vendor_account_number; ?>">
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab<?php echo $vendor_id; ?>" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="pills-basic-tab<?php echo $vendor_id; ?>" data-toggle="pill" href="#pills-basic<?php echo $vendor_id; ?>" role="tab" aria-controls="pills-basic<?php echo $vendor_id; ?>" aria-selected="true">Basic</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-address-tab<?php echo $vendor_id; ?>" data-toggle="pill" href="#pills-address<?php echo $vendor_id; ?>" role="tab" aria-controls="pills-address<?php echo $vendor_id; ?>" aria-selected="false">Address</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-contact-tab<?php echo $vendor_id; ?>" data-toggle="pill" href="#pills-contact<?php echo $vendor_id; ?>" role="tab" aria-controls="pills-contact<?php echo $vendor_id; ?>" aria-selected="false">Contact</a>
</li>
</ul>
<hr>
<div class="tab-content" id="pills-tabContent<?php echo $vendor_id; ?>">
<div class="tab-pane fade show active" id="pills-basic<?php echo $vendor_id; ?>" role="tabpanel" aria-labelledby="pills-basic-tab<?php echo $vendor_id; ?>">
<div class="form-group">
<label>Name</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-building"></i></span>
</div>
<input type="text" class="form-control" name="name" placeholder="Name" value="<?php echo "$vendor_name"; ?>" required>
</div>
</div>
<div class="form-group">
<label>Description</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-angle-right"></i></span>
</div>
<input type="text" class="form-control" name="description" placeholder="Description" value="<?php echo $vendor_description; ?>">
</div>
</div>
<div class="form-group">
<label>Account Number</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-fingerprint"></i></span>
</div>
<input type="text" class="form-control" name="account_number" placeholder="Account number" value="<?php echo $vendor_account_number; ?>">
</div>
</div>
</div>
<div class="tab-pane fade" id="pills-address<?php echo $vendor_id; ?>" role="tabpanel" aria-labelledby="pills-address-tab<?php echo $vendor_id; ?>">
<div class="form-group">
<label>Address</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-map-marker-alt"></i></span>
</div>
<input type="text" class="form-control" name="address"placeholder="Street address" value="<?php echo $vendor_address; ?>">
</div>
</div>
<div class="form-group">
<label>City</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-city"></i></span>
</div>
<input type="text" class="form-control" name="city" placeholder="City" value="<?php echo $vendor_city; ?>">
</div>
</div>
<div class="form-group">
<label>State</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-flag"></i></span>
</div>
<select class="form-control" name="state">
<option value="">- State -</option>
<?php foreach($states_array as $state_abbr => $state_name) { ?>
<option <?php if($vendor_state == $state_abbr){ echo "selected"; } ?> value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-group">
<label>Zip</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fab fa-fw fa-usps"></i></span>
</div>
<input type="text" class="form-control" name="zip" placeholder="Zip code" value="<?php echo $vendor_zip; ?>">
</div>
</div>
</div>
<div class="tab-pane fade" id="pills-contact<?php echo $vendor_id; ?>" role="tabpanel" aria-labelledby="pills-contact-tab<?php echo $vendor_id; ?>">
<div class="form-group">
<label>Phone</label>
<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="phone" placeholder="Phone number" value="<?php echo $vendor_phone; ?>">
</div>
</div>
<div class="form-group">
<label>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" value="<?php echo $vendor_email; ?>">
</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="Website include http://" value="<?php echo $vendor_website; ?>">
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>

View File

@ -9,7 +9,7 @@ if(isset($_GET['query'])){
$sql_clients = mysqli_query($mysqli,"SELECT * FROM clients WHERE client_name LIKE '%$query%' ORDER BY client_id DESC LIMIT 5");
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE vendor_name LIKE '%$query%' ORDER BY vendor_id DESC LIMIT 5");
$sql_products = mysqli_query($mysqli,"SELECT * FROM products WHERE product_name LIKE '%$query%' ORDER BY product_id DESC LIMIT 5");
$sql_client_logins = mysqli_query($mysqli,"SELECT * FROM client_logins WHERE client_login_description LIKE '%$query%' ORDER BY client_login_id DESC LIMIT 5");
$sql_logins = mysqli_query($mysqli,"SELECT * FROM logins WHERE login_description LIKE '%$query%' ORDER BY login_id DESC LIMIT 5");
?>
@ -148,15 +148,15 @@ if(isset($_GET['query'])){
<tbody>
<?php
while($row = mysqli_fetch_array($sql_client_logins)){
$client_login_description = $row['client_login_description'];
$client_login_username = $row['client_login_username'];
$client_login_password = $row['client_login_password'];
while($row = mysqli_fetch_array($sql_logins)){
$login_description = $row['$login_description'];
$login_username = $row['$login_username'];
$login_password = $row['$login_password'];
?>
<tr>
<td><?php echo $client_login_description; ?></td>
<td><?php echo $client_login_username; ?></td>
<td><?php echo $client_login_password; ?></td>
<td><?php echo $login_description; ?></td>
<td><?php echo $login_username; ?></td>
<td><?php echo $login_password; ?></td>
</tr>

View File

@ -154,7 +154,7 @@ if(isset($_GET['invoice_id'])){
</div>
</div>
<?php $sql4 = mysqli_query($mysqli,"SELECT * FROM invoice_items WHERE invoice_id = $invoice_id ORDER BY invoice_item_id ASC"); ?>
<?php $sql_invoice_items = mysqli_query($mysqli,"SELECT * FROM invoice_items WHERE invoice_id = $invoice_id ORDER BY item_id ASC"); ?>
<div class="row mb-4">
<div class="col-md-12">
@ -178,28 +178,28 @@ if(isset($_GET['invoice_id'])){
<tbody>
<?php
while($row = mysqli_fetch_array($sql4)){
$invoice_item_id = $row['invoice_item_id'];
$invoice_item_name = $row['invoice_item_name'];
$invoice_item_description = $row['invoice_item_description'];
$invoice_item_quantity = $row['invoice_item_quantity'];
$invoice_item_price = $row['invoice_item_price'];
$invoice_item_subtotal = $row['invoice_item_price'];
$invoice_item_tax = $row['invoice_item_tax'];
$invoice_item_total = $row['invoice_item_total'];
$total_tax = $invoice_item_tax + $total_tax;
$sub_total = $invoice_item_price * $invoice_item_quantity + $sub_total;
while($row = mysqli_fetch_array($sql_invoice_items)){
$item_id = $row['item_id'];
$item_name = $row['item_name'];
$item_description = $row['item_description'];
$item_quantity = $row['item_quantity'];
$item_price = $row['item_price'];
$item_subtotal = $row['item_price'];
$item_tax = $row['item_tax'];
$item_total = $row['item_total'];
$total_tax = $item_tax + $total_tax;
$sub_total = $item_price * $item_quantity + $sub_total;
?>
<tr>
<td class="text-center d-print-none"><a class="btn btn-sm btn-danger" href="post.php?delete_invoice_item=<?php echo $invoice_item_id; ?>"><i class="fa fa-trash"></i></a></td>
<td><?php echo $invoice_item_name; ?></td>
<td><?php echo $invoice_item_description; ?></td>
<td class="text-right text-monospace">$<?php echo number_format($invoice_item_price,2); ?></td>
<td class="text-center text-monospace"><?php echo $invoice_item_quantity; ?></td>
<td class="text-right text-monospace">$<?php echo number_format($invoice_item_tax,2); ?></td>
<td class="text-right text-monospace">$<?php echo number_format($invoice_item_total,2); ?></td>
<td class="text-center d-print-none"><a class="btn btn-sm btn-danger" href="post.php?delete_invoice_item=<?php echo $item_id; ?>"><i class="fa fa-trash"></i></a></td>
<td><?php echo $item_name; ?></td>
<td><?php echo $item_description; ?></td>
<td class="text-right text-monospace">$<?php echo number_format($item_price,2); ?></td>
<td class="text-center text-monospace"><?php echo $item_quantity; ?></td>
<td class="text-right text-monospace">$<?php echo number_format($item_tax,2); ?></td>
<td class="text-right text-monospace">$<?php echo number_format($item_total,2); ?></td>
</tr>
<?php

1734
post.php

File diff suppressed because it is too large Load Diff

View File

@ -123,7 +123,7 @@ if(isset($_GET['quote_id'])){
</div>
</div>
<?php $sql4 = mysqli_query($mysqli,"SELECT * FROM invoice_items WHERE quote_id = $quote_id ORDER BY invoice_item_id ASC"); ?>
<?php $sql_items = mysqli_query($mysqli,"SELECT * FROM invoice_items WHERE quote_id = $quote_id ORDER BY item_id ASC"); ?>
<div class="row mb-4">
<div class="col-md-12">
@ -147,28 +147,28 @@ if(isset($_GET['quote_id'])){
<tbody>
<?php
while($row = mysqli_fetch_array($sql4)){
$invoice_item_id = $row['invoice_item_id'];
$invoice_item_name = $row['invoice_item_name'];
$invoice_item_description = $row['invoice_item_description'];
$invoice_item_quantity = $row['invoice_item_quantity'];
$invoice_item_price = $row['invoice_item_price'];
$invoice_item_subtotal = $row['invoice_item_price'];
$invoice_item_tax = $row['invoice_item_tax'];
$invoice_item_total = $row['invoice_item_total'];
$total_tax = $invoice_item_tax + $invoice_tax;
$sub_total = $invoice_item_price * $invoice_item_quantity + $sub_total;
while($row = mysqli_fetch_array($sql_items)){
$item_id = $row['item_id'];
$item_name = $row['item_name'];
$item_description = $row['item_description'];
$item_quantity = $row['item_quantity'];
$item_price = $row['item_price'];
$item_subtotal = $row['item_price'];
$item_tax = $row['item_tax'];
$item_total = $row['item_total'];
$total_tax = $item_tax + $invoice_tax;
$sub_total = $item_price * $item_quantity + $sub_total;
?>
<tr>
<td class="text-center d-print-none"><a class="btn btn-danger btn-sm" href="post.php?delete_quote_item=<?php echo $invoice_item_id; ?>"><i class="fa fa-trash"></i></a></td>
<td><?php echo $invoice_item_name; ?></td>
<td><?php echo $invoice_item_description; ?></td>
<td class="text-right">$<?php echo number_format($invoice_item_price,2); ?></td>
<td class="text-center"><?php echo $invoice_item_quantity; ?></td>
<td class="text-right">$<?php echo number_format($invoice_item_tax,2); ?></td>
<td class="text-right">$<?php echo number_format($invoice_item_total,2); ?></td>
<td class="text-center d-print-none"><a class="btn btn-danger btn-sm" href="post.php?delete_quote_item=<?php echo $item_id; ?>"><i class="fa fa-trash"></i></a></td>
<td><?php echo $item_name; ?></td>
<td><?php echo $item_description; ?></td>
<td class="text-right">$<?php echo number_format($item_price,2); ?></td>
<td class="text-center"><?php echo $item_quantity; ?></td>
<td class="text-right">$<?php echo number_format($item_tax,2); ?></td>
<td class="text-right">$<?php echo number_format($item_total,2); ?></td>
</tr>
<?php
@ -246,7 +246,7 @@ if(isset($_GET['quote_id'])){
History
</div>
<div class="card-body">
<table class="table">s
<table class="table">
<thead>
<tr>
<th>Date</th>

View File

@ -2,16 +2,16 @@
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM recurring_invoices, invoices, clients
$sql = mysqli_query($mysqli,"SELECT * FROM recurring, invoices, clients
WHERE invoices.client_id = clients.client_id
AND invoices.invoice_id = recurring_invoices.invoice_id
ORDER BY recurring_invoices.recurring_invoice_id DESC");
AND invoices.invoice_id = recurring.invoice_id
ORDER BY recurring.recurring_id DESC");
?>
<div class="card mb-3">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-copy mr-2"></i>Recurring Invoices</h6>
<button type="button" class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addRecurringInvoiceModal"><i class="fas fa-plus"></i></button>
<button type="button" class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addRecurringModal"><i class="fas fa-plus"></i></button>
</div>
<div class="card-body">
<div class="table-responsive">
@ -31,19 +31,19 @@
<?php
while($row = mysqli_fetch_array($sql)){
$recurring_invoice_id = $row['recurring_invoice_id'];
$recurring_invoice_frequency = $row['recurring_invoice_frequency'];
$recurring_invoice_status = $row['recurring_invoice_status'];
$recurring_invoice_start_date = $row['recurring_invoice_start_date'];
$recurring_invoice_last_sent = $row['recurring_invoice_last_sent'];
if($recurring_invoice_last_sent == 0){
$recurring_invoice_last_sent = "-";
$recurring_id = $row['recurring_id'];
$recurring_frequency = $row['recurring_frequency'];
$recurring_status = $row['recurring_status'];
$recurring_start_date = $row['recurring_start_date'];
$recurring_last_sent = $row['recurring_last_sent'];
if($recurring_last_sent == 0){
$recurring_last_sent = "-";
}
$recurring_invoice_next_date = $row['recurring_invoice_next_date'];
$recurring_next_date = $row['recurring_next_date'];
$client_id = $row['client_id'];
$client_name = $row['client_name'];
$invoice_id = $row['invoice_id'];
if($recurring_invoice_status == 1){
if($recurring_status == 1){
$status = "Active";
$status_badge_color = "success";
}else{
@ -55,11 +55,11 @@
?>
<tr>
<td><?php echo ucwords($recurring_invoice_frequency); ?>ly</td>
<td><?php echo ucwords($recurring_frequency); ?>ly</td>
<td><a href="client.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a></td>
<td><?php echo $recurring_invoice_start_date; ?></td>
<td><?php echo $recurring_invoice_last_sent; ?></td>
<td><?php echo $recurring_invoice_next_date; ?></td>
<td><?php echo $recurring_start_date; ?></td>
<td><?php echo $recurring_last_sent; ?></td>
<td><?php echo $recurring_next_date; ?></td>
<td>
<span class="p-2 badge badge-<?php echo $status_badge_color; ?>">
<?php echo $status; ?>
@ -72,11 +72,11 @@
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="recurring_invoice.php?recurring_invoice_id=<?php echo $recurring_invoice_id; ?>">Edit</a>
<?php if($recurring_invoice_status == 1){ ?>
<a class="dropdown-item" href="post.php?recurring_deactivate=<?php echo $recurring_invoice_id; ?>">Deactivate</a>
<a class="dropdown-item" href="recurring_invoice.php?recurring_id=<?php echo $recurring_id; ?>">Edit</a>
<?php if($recurring_status == 1){ ?>
<a class="dropdown-item" href="post.php?recurring_deactivate=<?php echo $recurring_id; ?>">Deactivate</a>
<?php }else{ ?>
<a class="dropdown-item" href="post.php?recurring_activate=<?php echo $recurring_invoice_id; ?>">Activate</a>
<a class="dropdown-item" href="post.php?recurring_activate=<?php echo $recurring_id; ?>">Activate</a>
<?php } ?>
<a class="dropdown-item" href="post.php?delete_invoice=<?php echo $invoice_id; ?>">Delete</a>
</div>
@ -94,6 +94,6 @@
</div>
</div>
<?php include("add_recurring_invoice_modal.php"); ?>
<?php include("add_recurring_modal.php"); ?>
<?php include("footer.php");

View File

@ -2,23 +2,23 @@
<?php
if(isset($_GET['recurring_invoice_id'])){
if(isset($_GET['recurring_id'])){
$recurring_invoice_id = intval($_GET['recurring_invoice_id']);
$recurring_id = intval($_GET['recurring_id']);
$sql = mysqli_query($mysqli,"SELECT * FROM invoices, clients, recurring_invoices
$sql = mysqli_query($mysqli,"SELECT * FROM invoices, clients, recurring
WHERE invoices.client_id = clients.client_id
AND invoices.invoice_id = recurring_invoices.invoice_id
AND recurring_invoices.recurring_invoice_id = $recurring_invoice_id"
AND invoices.invoice_id = recurring.invoice_id
AND recurring.recurring_id = $recurring_id"
);
$row = mysqli_fetch_array($sql);
$recurring_invoice_id = $row['recurring_invoice_id'];
$recurring_invoice_frequency = $row['recurring_invoice_frequency'];
$recurring_invoice_status = $row['recurring_invoice_status'];
$recurring_invoice_start_date = $row['recurring_invoice_start_date'];
$recurring_invoice_last_sent = $row['recurring_invoice_last_sent'];
$recurring_invoice_next_date = $row['recurring_invoice_next_date'];
$recurring_id = $row['recurring_id'];
$recurring_frequency = $row['recurring_frequency'];
$recurring_status = $row['recurring_status'];
$recurring_start_date = $row['recurring_start_date'];
$recurring_last_sent = $row['recurring_last_sent'];
$recurring_next_date = $row['recurring_next_date'];
$invoice_id = $row['invoice_id'];
$invoice_status = $row['invoice_status'];
$invoice_amount = $row['invoice_amount'];
@ -36,7 +36,9 @@ if(isset($_GET['recurring_invoice_id'])){
$client_phone = substr($row['client_phone'],0,3)."-".substr($row['client_phone'],3,3)."-".substr($row['client_phone'],6,4);
}
$client_website = $row['client_website'];
if($recurring_invoice_status == 1){
$client_net_terms = $row['client_net_terms'];
if($recurring_status == 1){
$status = "Active";
$status_badge_color = "success";
}else{
@ -44,8 +46,6 @@ if(isset($_GET['recurring_invoice_id'])){
$status_badge_color = "secondary";
}
$sql_invoice_history = mysqli_query($mysqli,"SELECT * FROM invoice_history WHERE invoice_id = $invoice_id ORDER BY invoice_history_id ASC");
$sql_payments = mysqli_query($mysqli,"SELECT * FROM payments, accounts WHERE payments.account_id = accounts.account_id AND payments.invoice_id = $invoice_id ORDER BY payments.payment_id DESC");
@ -63,7 +63,7 @@ if(isset($_GET['recurring_invoice_id'])){
<li class="breadcrumb-item">
<a href="recurring.php"> Recurring Invoices</a>
</li>
<li class="breadcrumb-item active"><?php echo $recurring_invoice_id; ?></li>
<li class="breadcrumb-item active"><?php echo $recurring_id; ?></li>
<span class="ml-3 p-2 badge badge-<?php echo $status_badge_color; ?>"><?php echo $status; ?></span>
</ol>
@ -76,10 +76,10 @@ if(isset($_GET['recurring_invoice_id'])){
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editInvoiceModal">Edit</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editInvoiceNoteModal">Note</a>
<?php if($recurring_invoice_status == 1){ ?>
<a class="dropdown-item" href="post.php?recurring_deactivate=<?php echo $recurring_invoice_id; ?>">Deactivate</a>
<?php if($recurring_status == 1){ ?>
<a class="dropdown-item" href="post.php?recurring_deactivate=<?php echo $recurring_id; ?>">Deactivate</a>
<?php }else{ ?>
<a class="dropdown-item" href="post.php?recurring_activate=<?php echo $recurring_invoice_id; ?>">Activate</a>
<a class="dropdown-item" href="post.php?recurring_activate=<?php echo $recurring_id; ?>">Activate</a>
<?php } ?>
<a class="dropdown-item" href="#">Delete</a>
</div>
@ -127,18 +127,18 @@ if(isset($_GET['recurring_invoice_id'])){
</div>
<div class="card-body">
<ul class="list-unstyled">
<li class="mb-1"><strong>Frequency:</strong> <div class="float-right"><?php echo $recurring_invoice_frequency; ?></div></li>
<li class="mb-1"><strong>Start Date:</strong> <div class="float-right"><?php echo $recurring_invoice_start_date; ?></div></li>
<li class="mb-1"><strong>Next Date:</strong> <div class="float-right"><?php echo $recurring_invoice_next_date; ?></div></li>
<li class="mb-1"><strong>Last Sent:</strong> <div class="float-right"><?php echo $recurring_invoice_last_sent; ?></div></li>
<li class="mb-1"><strong>Net Terms:</strong> <div class="float-right">30 Day</div></li>
<li class="mb-1"><strong>Frequency:</strong> <div class="float-right"><?php echo ucwords($recurring_frequency); ?>ly</div></li>
<li class="mb-1"><strong>Start Date:</strong> <div class="float-right"><?php echo $recurring_start_date; ?></div></li>
<li class="mb-1"><strong>Next Date:</strong> <div class="float-right"><?php echo $recurring_next_date; ?></div></li>
<li class="mb-1"><strong>Last Sent:</strong> <div class="float-right"><?php echo $recurring_last_sent; ?></div></li>
<li class="mb-1"><strong>Net Terms:</strong> <div class="float-right"><?php echo $client_net_terms; ?> Day</div></li>
</ul>
</div>
</div>
</div>
</div>
<?php $sql4 = mysqli_query($mysqli,"SELECT * FROM invoice_items WHERE invoice_id = $invoice_id ORDER BY invoice_item_id ASC"); ?>
<?php $sql_items = mysqli_query($mysqli,"SELECT * FROM invoice_items WHERE invoice_id = $invoice_id ORDER BY item_id ASC"); ?>
<div class="row mb-4">
<div class="col-md-12">
@ -162,28 +162,28 @@ if(isset($_GET['recurring_invoice_id'])){
<tbody>
<?php
while($row = mysqli_fetch_array($sql4)){
$invoice_item_id = $row['invoice_item_id'];
$invoice_item_name = $row['invoice_item_name'];
$invoice_item_description = $row['invoice_item_description'];
$invoice_item_quantity = $row['invoice_item_quantity'];
$invoice_item_price = $row['invoice_item_price'];
$invoice_item_subtotal = $row['invoice_item_price'];
$invoice_item_tax = $row['invoice_item_tax'];
$invoice_item_total = $row['invoice_item_total'];
$total_tax = $invoice_item_tax + $total_tax;
$sub_total = $invoice_item_price * $invoice_item_quantity + $sub_total;
while($row = mysqli_fetch_array($sql_items)){
$item_id = $row['item_id'];
$item_name = $row['item_name'];
$item_description = $row['item_description'];
$item_quantity = $row['item_quantity'];
$item_price = $row['item_price'];
$item_subtotal = $row['item_price'];
$item_tax = $row['item_tax'];
$item_total = $row['item_total'];
$total_tax = $item_tax + $total_tax;
$sub_total = $item_price * $item_quantity + $sub_total;
?>
<tr>
<td class="text-center d-print-none"><a class="btn btn-danger btn-sm" href="post.php?delete_invoice_item=<?php echo $invoice_item_id; ?>"><i class="fa fa-trash"></i></a></td>
<td><?php echo $invoice_item_name; ?></td>
<td><?php echo $invoice_item_description; ?></td>
<td class="text-right">$<?php echo number_format($invoice_item_price,2); ?></td>
<td class="text-center"><?php echo $invoice_item_quantity; ?></td>
<td class="text-right">$<?php echo number_format($invoice_item_tax,2); ?></td>
<td class="text-right">$<?php echo number_format($invoice_item_total,2); ?></td>
<td class="text-center d-print-none"><a class="btn btn-danger btn-sm" href="post.php?delete_invoice_item=<?php echo $item_id; ?>"><i class="fa fa-trash"></i></a></td>
<td><?php echo $item_name; ?></td>
<td><?php echo $item_description; ?></td>
<td class="text-right">$<?php echo number_format($item_price,2); ?></td>
<td class="text-center"><?php echo $item_quantity; ?></td>
<td class="text-right">$<?php echo number_format($item_tax,2); ?></td>
<td class="text-right">$<?php echo number_format($item_total,2); ?></td>
</tr>
<?php

View File

@ -80,10 +80,10 @@
<span>Transfers</span>
</a>
</li>
<li class="nav-item <?php if(basename($_SERVER["REQUEST_URI"]) == "mileage.php") { echo "active"; } ?>">
<a class="nav-link" href="mileage.php">
<li class="nav-item <?php if(basename($_SERVER["REQUEST_URI"]) == "trips.php") { echo "active"; } ?>">
<a class="nav-link" href="trips.php">
<i class="fas fa-fw fa-bicycle mx-2"></i>
<span>Mileage</span>
<span>Trips</span>
</a>
</li>
<li class="nav-item dropdown">

View File

@ -1,12 +1,12 @@
<?php include("header.php"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM mileage ORDER BY mileage_id DESC"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM trips ORDER BY trip_id DESC"); ?>
<div class="card mb-3">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-bicycle mr-2"></i>Mileage</h6>
<button type="button" class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addMileageModal"><i class="fas fa-plus"></i></button>
<h6 class="float-left mt-1"><i class="fa fa-fw fa-bicycle mr-2"></i>Trips</h6>
<button type="button" class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addTripModal"><i class="fas fa-plus"></i></button>
</div>
<div class="card-body">
<div class="table-responsive">
@ -25,35 +25,35 @@
<?php
while($row = mysqli_fetch_array($sql)){
$mileage_id = $row['mileage_id'];
$mileage_date = $row['mileage_date'];
$mileage_purpose = $row['mileage_purpose'];
$mileage_starting_location = $row['mileage_starting_location'];
$mileage_destination = $row['mileage_destination'];
$mileage_miles = $row['mileage_miles'];
$trip_id = $row['trip_id'];
$trip_date = $row['trip_date'];
$trip_purpose = $row['trip_purpose'];
$trip_starting_location = $row['trip_starting_location'];
$trip_destination = $row['trip_destination'];
$trip_miles = $row['trip_miles'];
?>
<tr>
<td><?php echo $mileage_date; ?></td>
<td><?php echo $mileage_purpose; ?></td>
<td><?php echo $mileage_starting_location; ?></td>
<td><?php echo $mileage_destination; ?></td>
<td><?php echo $mileage_miles; ?></td>
<td><?php echo $trip_date; ?></td>
<td><?php echo $trip_purpose; ?></td>
<td><?php echo $trip_starting_location; ?></td>
<td><?php echo $trip_destination; ?></td>
<td><?php echo $trip_miles; ?></td>
<td>
<div class="dropdown dropleft text-center">
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editMileageModal<?php echo $mileage_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_mileage=<?php echo $mileage_id; ?>">Delete</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTripModal<?php echo $mileage_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_trip=<?php echo $trip_id; ?>">Delete</a>
</div>
</div>
</td>
</tr>
<?php
include("edit_mileage_modal.php");
include("edit_trip_modal.php");
}
?>
@ -63,6 +63,6 @@
</div>
</div>
<?php include("add_mileage_modal.php"); ?>
<?php include("add_trip_modal.php"); ?>
<?php include("footer.php");

View File

@ -1,6 +1,6 @@
<?php include("header.php"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM vendors ORDER BY vendor_name ASC"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM vendors WHERE client_id = 0 ORDER BY vendor_name ASC"); ?>
<div class="card mb-3">

View File

@ -1,4 +1,4 @@
<div class="modal" id="viewClientFileModal<?php echo $file_id; ?>" tabindex="-1">
<div class="modal" id="viewFileModal<?php echo $file_id; ?>" tabindex="-1">
<div class="modal-dialog modal-xl ">
<div class="modal-content bg-dark">
<div class="modal-header">

View File

@ -1,8 +1,8 @@
<div class="modal" id="viewClientNoteModal<?php echo $client_note_id; ?>" tabindex="-1">
<div class="modal" id="viewNoteModal<?php echo $note_id; ?>" tabindex="-1">
<div class="modal-dialog modal-xl">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-edit mr-2"></i><?php echo $client_note_subject; ?></h5>
<h5 class="modal-title text-white"><i class="fa fa-fw fa-edit mr-2"></i><?php echo $note_subject; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
@ -10,7 +10,7 @@
<div class="modal-body bg-white">
<?php
$Parsedown = new Parsedown();
echo $Parsedown->text("$client_note_body");
echo $Parsedown->text("$note_body");
?>
</div>
</div>