mirror of https://github.com/itflow-org/itflow
Lots of updates, modal design updates, added notes to many tables, added contact relation to location, moved next_date as primary sorted in recurring, updated database tables, few fixes for transfers and other small bug fixes
This commit is contained in:
parent
1471543f65
commit
da9cad0723
|
|
@ -80,6 +80,7 @@
|
|||
$account_id = $row['account_id'];
|
||||
$account_name = $row['account_name'];
|
||||
$opening_balance = $row['opening_balance'];
|
||||
$account_notes = $row['account_notes'];
|
||||
|
||||
$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);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Account Name <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
|
|
@ -18,6 +19,7 @@
|
|||
<input type="text" class="form-control" name="name" placeholder="Account name" required autofocus>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Opening Balance</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -27,6 +29,12 @@
|
|||
<input type="number" class="form-control" step="0.01" min="0" name="opening_balance" placeholder="Opening Balance" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Notes</label>
|
||||
<textarea class="form-control" rows="5" name="notes"></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="pills-basic-tab" data-toggle="pill" href="#pills-basic">Basic</a>
|
||||
<a class="nav-link active" id="pills-details-tab" data-toggle="pill" href="#pills-details">Details</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-address-tab" data-toggle="pill" href="#pills-address">Address</a>
|
||||
|
|
@ -23,13 +23,16 @@
|
|||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-more-tab" data-toggle="pill" href="#pills-more">More</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-notes-tab" data-toggle="pill" href="#pills-notes">Notes</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="tab-content" id="pills-tabContent">
|
||||
|
||||
<div class="tab-pane fade show active" id="pills-basic">
|
||||
<div class="tab-pane fade show active" id="pills-details">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Name <strong class="text-danger">*</strong></label>
|
||||
|
|
@ -51,6 +54,27 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<label>Phone</label>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'" data-mask>
|
||||
</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="url" class="form-control" name="website" placeholder="ex. https://google.com">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-address">
|
||||
|
|
@ -130,14 +154,15 @@
|
|||
<input type="text" class="form-control" name="extension" placeholder="Extension">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<label>Mobile</label>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Mobile</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-mobile-alt"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="mobile" placeholder="Mobile Number" data-inputmask="'mask': '999-999-9999'">
|
||||
<input type="text" class="form-control" name="mobile" placeholder="Mobile Number" data-inputmask="'mask': '999-999-9999'" data-mask>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -155,16 +180,6 @@
|
|||
|
||||
<div class="tab-pane fade" id="pills-more">
|
||||
|
||||
<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">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Hours</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -188,9 +203,34 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Company Size</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-users"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="company_size">
|
||||
<option>1 - 3</option>
|
||||
<option>4 - 10</option>
|
||||
<option>11 - 50</option>
|
||||
<option>51 - 100</option>
|
||||
<option>101 - 500</option>
|
||||
<option>500+</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane fade" id="pills-notes">
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="8" name="notes"></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
|
|
|
|||
|
|
@ -9,67 +9,104 @@
|
|||
</div>
|
||||
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
<div class="form-group">
|
||||
<label>Name <strong class="text-danger">*</strong></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="Full Name" required autofocus>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="pills-details-tab" data-toggle="pill" href="#pills-details">Details</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-photo-tab" data-toggle="pill" href="#pills-photo">Photo</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-notes-tab" data-toggle="pill" href="#pills-notes">Notes</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="tab-content" id="pills-tabContent">
|
||||
|
||||
<div class="tab-pane fade show active" id="pills-details">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Title <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-id-badge"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="title" placeholder="Title" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label>Phone</label>
|
||||
<div class="form-row">
|
||||
<div class="col-8">
|
||||
<div class="form-group">
|
||||
<label>Name <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'" data-mask>
|
||||
<input type="text" class="form-control" name="name" placeholder="Full Name" required autofocus>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<input type="text" class="form-control" name="extension" placeholder="Extension">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Mobile</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-mobile-alt"></i></span>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Title</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-id-badge"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="title" placeholder="Title">
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="mobile" placeholder="Mobile Phone Number" data-inputmask="'mask': '999-999-9999'">
|
||||
</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>
|
||||
|
||||
<label>Phone</label>
|
||||
<div class="form-row">
|
||||
<div class="col-8">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'" data-mask>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<input type="text" class="form-control" name="extension" placeholder="Extension">
|
||||
</div>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="email" placeholder="Email Address">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Mobile</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-mobile-alt"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="mobile" placeholder="Mobile Phone Number" data-inputmask="'mask': '999-999-9999'">
|
||||
</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">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-photo">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Photo</label>
|
||||
<input type="file" class="form-control-file" name="file">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-notes">
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="8" name="notes"></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Photo</label>
|
||||
<input type="file" class="form-control-file" name="file">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
|
|
|
|||
|
|
@ -7,81 +7,159 @@
|
|||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
<div class="form-group">
|
||||
<label>Location Name <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<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" required autofocus>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Address <strong class="text-danger">*</strong></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" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>City <strong class="text-danger">*</strong></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" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>State <strong class="text-danger">*</strong></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 select2" 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 <strong class="text-danger">*</strong></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" required data-inputmask="'mask': '99999'">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Phone <strong class="text-danger">*</strong></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" data-inputmask="'mask': '999-999-9999'" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="pills-details-tab" data-toggle="pill" href="#pills-details">Details</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-address-tab" data-toggle="pill" href="#pills-address">Address</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-contact-tab" data-toggle="pill" href="#pills-contact">Contact</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-photo-tab" data-toggle="pill" href="#pills-photo">Photo</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-notes-tab" data-toggle="pill" href="#pills-notes">Notes</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="tab-content" id="pills-tabContent">
|
||||
|
||||
<div class="tab-pane fade show active" id="pills-details">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Location Name <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<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" required autofocus>
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="hours" placeholder="Hours of operation">
|
||||
|
||||
<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" data-inputmask="'mask': '999-999-9999'">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-address">
|
||||
|
||||
<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">
|
||||
</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">
|
||||
</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 select2" 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>
|
||||
<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" data-inputmask="'mask': '99999'">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-contact">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Contact</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>
|
||||
<select class="form-control" name="contact">
|
||||
<option value="">- Contact -</option>
|
||||
<?php
|
||||
|
||||
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM contacts WHERE client_id = $client_id");
|
||||
while($row = mysqli_fetch_array($sql_vendors)){
|
||||
$contact_id = $row['contact_id'];
|
||||
$contact_name = $row['contact_name'];
|
||||
?>
|
||||
<option value="<?php echo $contact_id; ?>"><?php echo $contact_name; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-photo">
|
||||
|
||||
<div class="form-group">
|
||||
<input type="file" class="form-control-file" name="file">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-notes">
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="8" name="notes"></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -9,105 +9,134 @@
|
|||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<div class="modal-body bg-white">
|
||||
<div class="form-row">
|
||||
<div class="form-group col">
|
||||
<label>Date <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
||||
|
||||
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="pills-details-tab" data-toggle="pill" href="#pills-details">Details</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-notes-tab" data-toggle="pill" href="#pills-notes">Notes</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="tab-content" id="pills-tabContent">
|
||||
|
||||
<div class="tab-pane fade show active" id="pills-details">
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col">
|
||||
<label>Date <strong class="text-danger">*</strong></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>
|
||||
<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 <strong class="text-danger">*</strong></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 class="form-group col">
|
||||
<label>Amount <strong class="text-danger">*</strong></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" name="amount" placeholder="Amount to transfer" required autofocus>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Transfer <strong class="text-danger">*</strong></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 select2" name="account_from" required>
|
||||
<option value="">- Account From -</option>
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id");
|
||||
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_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS total_revenues FROM revenues WHERE account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$total_revenues = $row['total_revenues'];
|
||||
|
||||
$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_revenues - $total_expenses;
|
||||
|
||||
?>
|
||||
<option <?php if($config_default_transfer_from_account == $account_id){ echo "selected"; } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-arrow-right"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="account_to" required>
|
||||
<option value="">- Account To -</option>
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id");
|
||||
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_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS total_revenues FROM revenues WHERE account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$total_revenues = $row['total_revenues'];
|
||||
|
||||
$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_revenues - $total_expenses;
|
||||
|
||||
?>
|
||||
<option <?php if($config_default_transfer_to_account == $account_id){ echo "selected"; } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<input type="number" class="form-control" step="0.01" min="0" name="amount" placeholder="Amount to transfer" required autofocus>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Transfer <strong class="text-danger">*</strong></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 select2" name="account_from" required>
|
||||
<option value="">- Account From -</option>
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id");
|
||||
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_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS total_revenues FROM revenues WHERE account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$total_revenues = $row['total_revenues'];
|
||||
|
||||
$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_revenues - $total_expenses;
|
||||
|
||||
?>
|
||||
<option <?php if($config_default_transfer_from_account == $account_id){ echo "selected"; } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-arrow-right"></i></span>
|
||||
<div class="tab-pane fade" id="pills-notes">
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="8" name="notes"></textarea>
|
||||
</div>
|
||||
<select class="form-control select2" name="account_to" required>
|
||||
<option value="">- Account To -</option>
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id");
|
||||
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_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS total_revenues FROM revenues WHERE account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$total_revenues = $row['total_revenues'];
|
||||
|
||||
$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_revenues - $total_expenses;
|
||||
|
||||
?>
|
||||
<option <?php if($config_default_transfer_to_account == $account_id){ echo "selected"; } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</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_transfer" class="btn btn-primary">Save</button>
|
||||
|
|
|
|||
|
|
@ -11,15 +11,18 @@
|
|||
<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">
|
||||
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="pills-basic-tab" data-toggle="pill" href="#pills-basic" role="tab" aria-controls="pills-basic" aria-selected="true">Basic</a>
|
||||
<a class="nav-link active" id="pills-details-tab" data-toggle="pill" href="#pills-details">Details</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-address-tab" data-toggle="pill" href="#pills-address" role="tab" aria-controls="pills-address" aria-selected="false">Address</a>
|
||||
<a class="nav-link" id="pills-address-tab" data-toggle="pill" href="#pills-address">Address</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<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>
|
||||
<a class="nav-link" id="pills-contact-tab" data-toggle="pill" href="#pills-contact">Contact</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-notes-tab" data-toggle="pill" href="#pills-notes">Notes</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
@ -27,7 +30,7 @@
|
|||
|
||||
<div class="tab-content" id="pills-tabContent">
|
||||
|
||||
<div class="tab-pane fade show active" id="pills-basic" role="tabpanel" aria-labelledby="pills-basic-tab">
|
||||
<div class="tab-pane fade show active" id="pills-details">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Name <strong class="text-danger">*</strong></label>
|
||||
|
|
@ -61,7 +64,7 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-address" role="tabpanel" aria-labelledby="pills-address-tab">
|
||||
<div class="tab-pane fade" id="pills-address">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Address</label>
|
||||
|
|
@ -110,7 +113,7 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-contact" role="tabpanel" aria-labelledby="pills-contact-tab">
|
||||
<div class="tab-pane fade" id="pills-contact">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Contact Name</label>
|
||||
|
|
@ -161,6 +164,14 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-notes">
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="8" name="notes"></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
27
alerts.php
27
alerts.php
|
|
@ -1,22 +1,16 @@
|
|||
<?php include("header.php"); ?>
|
||||
|
||||
<?php
|
||||
if($_GET['status'] == "archived"){
|
||||
$where_clause = "IS NOT NULL";
|
||||
}else{
|
||||
$where_clause = "IS NULL";
|
||||
}
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM alerts WHERE alert_ack_date IS NULL AND company_id = $session_company_id ORDER BY alert_id DESC");
|
||||
|
||||
?>
|
||||
|
||||
<?php $sql = mysqli_query($mysqli,"SELECT * FROM alerts WHERE alert_ack_date $where_clause AND company_id = $session_company_id ORDER BY alert_id DESC"); ?>
|
||||
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<div class="card-header bg-dark text-white">
|
||||
<h6 class="float-left mt-1"><i class="fa fa-exclamation-triangle"></i> Alerts</h6>
|
||||
<a href="?status=new" class="btn btn-primary btn-sm badge-pill float-right">New</a>
|
||||
<a href="?status=archived" class="btn btn-primary btn-sm badge-pill float-right mr-2">Archived</a>
|
||||
<a href="post.php?ack_all_alerts" class="btn btn-success btn-sm badge-pill float-right mr-2"> <i class="fa fa-check"></i> Acknowledge All</a>
|
||||
<a href="alerts_archived.php" class="btn btn-secondary btn-sm badge-pill float-right mr-2">Archived</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
|
|
@ -37,20 +31,13 @@ if($_GET['status'] == "archived"){
|
|||
$alert_type = $row['alert_type'];
|
||||
$alert_message = $row['alert_message'];
|
||||
$alert_date = $row['alert_date'];
|
||||
$alert_ack_date = $row['alert_ack_date'];
|
||||
|
||||
?>
|
||||
<tr class="row-danger">
|
||||
<td><?php echo $alert_date; ?></td>
|
||||
<td><?php echo $alert_type; ?></td>
|
||||
<td><?php echo $alert_message; ?></td>
|
||||
<td class="text-center">
|
||||
<?php if($alert_ack_date == 0){ ?>
|
||||
<a class="btn btn-success btn-sm" href="post.php?alert_ack=<?php echo $alert_id; ?>"><i class="fa fa-check"></i></a>
|
||||
<?php }else{ ?>
|
||||
<?php echo $alert_ack_date; ?>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td class="text-center"><a class="btn btn-success btn-sm" href="post.php?alert_ack=<?php echo $alert_id; ?>"><i class="fa fa-check"></a></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
|
|
|||
|
|
@ -0,0 +1,144 @@
|
|||
<?php include("header.php");
|
||||
|
||||
//Paging
|
||||
if(isset($_GET['p'])){
|
||||
$p = intval($_GET['p']);
|
||||
$record_from = (($p)-1)*10;
|
||||
$record_to = 10;
|
||||
}else{
|
||||
$record_from = 0;
|
||||
$record_to = 10;
|
||||
$p = 1;
|
||||
}
|
||||
|
||||
//Custom Query Filter
|
||||
if(isset($_GET['q'])){
|
||||
$q = mysqli_real_escape_string($mysqli,$_GET['q']);
|
||||
}else{
|
||||
$q = "";
|
||||
}
|
||||
|
||||
//Column Filter
|
||||
if(!empty($_GET['sb'])){
|
||||
$sb = mysqli_real_escape_string($mysqli,$_GET['sb']);
|
||||
}else{
|
||||
$sb = "alert_date";
|
||||
}
|
||||
|
||||
//Column Order Filter
|
||||
if(isset($_GET['o'])){
|
||||
if($_GET['o'] == 'ASC'){
|
||||
$o = "ASC";
|
||||
$disp = "DESC";
|
||||
}else{
|
||||
$o = "DESC";
|
||||
$disp = "ASC";
|
||||
}
|
||||
}else{
|
||||
$o = "ASC";
|
||||
$disp = "DESC";
|
||||
}
|
||||
|
||||
//Date From and Date To Filter
|
||||
if(!empty($_GET['dtf'])){
|
||||
$dtf = $_GET['dtf'];
|
||||
$dtt = $_GET['dtt'];
|
||||
}else{
|
||||
$dtf = "0000-00-00";
|
||||
$dtt = "9999-00-00";
|
||||
}
|
||||
|
||||
//Rebuild URL
|
||||
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM alerts WHERE (alert_type LIKE '%$q%' OR alert_message LIKE '%$q%') AND DATE(alert_date) BETWEEN '$dtf' AND '$dtt' AND company_id = $session_company_id AND alert_ack_date IS NOT NULL ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header bg-dark text-white">
|
||||
<h6 class="float-left mt-1"><i class="fa fa-fw fa-exclamation-triangle mr-2"></i>Archived Alerts</h6>
|
||||
<a href="post.php?ack_all_alerts" class="btn btn-success btn-sm badge-pill float-right mr-2"> <i class="fa fa-check"></i> Acknowledge All</a>
|
||||
<?php if($num_new_alerts > 0){ ?>
|
||||
<a href="new_alerts.php" class="btn btn-info btn-sm badge-pill float-right mr-2">New</a>
|
||||
<?php } ?>
|
||||
<a href="archive_alerts.php" class="btn btn-secondary btn-sm badge-pill float-right mr-2">Archived</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form class="mb-4" autocomplete="off">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control" name="q" value="<?php if(isset($q)){echo stripslashes($q);} ?>" placeholder="Search Alerts">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<button class="btn btn-primary float-right" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse mt-3 <?php if(!empty($_GET['dtf'])){ echo "show"; } ?>" id="advancedFilter">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Date From</label>
|
||||
<input type="date" class="form-control" name="dtf" value="<?php echo $dtf; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Date To</label>
|
||||
<input type="date" class="form-control" name="dtt" value="<?php echo $dtt; ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead class="<?php if($num_rows[0] == 0){ echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=alert_date&o=<?php echo $disp; ?>">Alert Date <i class="fa fa-sort-numeric<?php if($disp=='ASC'){ echo "-up"; }else{ echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=alert_type&o=<?php echo $disp; ?>">Type <i class="fa fa-sort-alpha<?php if($disp=='ASC'){ echo "-up"; }else{ echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=alert_message&o=<?php echo $disp; ?>">Alert <i class="fa fa-sort-alpha<?php if($disp=='ASC'){ echo "-up"; }else{ echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=alert_ack_date&o=<?php echo $disp; ?>">Ack Date <i class="fa fa-sort-numeric<?php if($disp=='ASC'){ echo "-up"; }else{ echo "-down"; }?>"></i></a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$alert_id = $row['alert_id'];
|
||||
$alert_date = $row['alert_date'];
|
||||
$alert_type = $row['alert_type'];
|
||||
$alert_message = $row['alert_message'];
|
||||
$alert_ack_date = $row['alert_ack_date'];
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $alert_date; ?></td>
|
||||
<td><?php echo $alert_type; ?></td>
|
||||
<td><?php echo $alert_message; ?></td>
|
||||
<td><?php echo $alert_ack_date; ?></td>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="mr-3">
|
||||
<?php include("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("footer.php");
|
||||
|
|
@ -95,6 +95,7 @@ $total_pages = ceil($total_found_rows / 10);
|
|||
$contact_email = $row['contact_email'];
|
||||
$contact_photo = $row['contact_photo'];
|
||||
$contact_initials = initials($contact_name);
|
||||
$contact_notes = $row['contact_notes'];
|
||||
|
||||
?>
|
||||
<tr>
|
||||
|
|
|
|||
|
|
@ -96,10 +96,14 @@ $total_pages = ceil($total_found_rows / 10);
|
|||
if(empty($location_hours)){
|
||||
$location_hours = '-';
|
||||
}
|
||||
$location_photo = $row['location_photo'];
|
||||
$location_notes = $row['location_notes'];
|
||||
$location_primary = $row['location_primary'];
|
||||
$contact_id = $row['contact_id'];
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><a class="text-dark" href="#" data-toggle="modal" data-target="#editLocationModal<?php echo $location_id; ?>"><?php echo $location_name; ?></a></td>
|
||||
<td><i class="fa fa-fw fa-map-marker-alt text-secondary"></i> <a class="text-dark" href="#" data-toggle="modal" data-target="#editLocationModal<?php echo $location_id; ?>"><?php echo $location_name; ?></a></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><?php echo $location_hours; ?></td>
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ $total_pages = ceil($total_found_rows / 10);
|
|||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<i class="fa fa-fw fa-key text-secondary"></i>
|
||||
<a class="text-dark" href="#" data-toggle="modal" data-target="#editLoginModal<?php echo $login_id; ?>"><?php echo $login_name; ?></a>
|
||||
<br>
|
||||
<small class="text-secondary"><?php echo $login_uri; ?></small>
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ $total_pages = ceil($total_found_rows / 10);
|
|||
}
|
||||
$vendor_email = $row['vendor_email'];
|
||||
$vendor_website = $row['vendor_website'];
|
||||
$vendor_notes = $row['vendor_notes'];
|
||||
|
||||
$sql2 = mysqli_query($mysqli,"SELECT * FROM client_logins WHERE vendor_id = $vendor_id");
|
||||
$row = mysqli_fetch_array($sql2);
|
||||
|
|
@ -108,6 +109,7 @@ $total_pages = ceil($total_found_rows / 10);
|
|||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<i class="fa fa-fw fa-building text-secondary"></i>
|
||||
<a class="text-dark" href="#" data-toggle="modal" data-target="#editVendorModal<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></a>
|
||||
<?php
|
||||
if(!empty($vendor_account_number)){
|
||||
|
|
|
|||
|
|
@ -134,6 +134,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
$client_website = $row['client_website'];
|
||||
$client_net_terms = $row['client_net_terms'];
|
||||
$client_hours = $row['client_hours'];
|
||||
$client_company_size = $row['client_company_size'];
|
||||
$client_notes = $row['client_notes'];
|
||||
|
||||
//Add up all the payments for the invoice and get the total amount paid to the invoice
|
||||
$sql_invoice_amounts = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS invoice_amounts FROM invoices WHERE client_id = $client_id AND invoice_status NOT LIKE 'Draft' AND invoice_status NOT LIKE 'Cancelled' ");
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ $total_pages = ceil($total_found_rows / 10);
|
|||
$contact_initials = initials($contact_name);
|
||||
$client_id = $row['client_id'];
|
||||
$client_name = $row['client_name'];
|
||||
$contact_notes = $row['contact_notes'];
|
||||
|
||||
|
||||
?>
|
||||
|
|
|
|||
2
cron.php
2
cron.php
|
|
@ -66,7 +66,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
|
||||
//PAST DUE INVOICE ALERTS
|
||||
//$invoiceAlertArray = [$config_invoice_overdue_reminders];
|
||||
$invoiceAlertArray = [30,60,90,120,150];
|
||||
$invoiceAlertArray = [30,60,90,120,150,180,210,240,270,300];
|
||||
|
||||
foreach($invoiceAlertArray as $day){
|
||||
|
||||
|
|
|
|||
14
db.sql
14
db.sql
|
|
@ -26,6 +26,7 @@ CREATE TABLE `accounts` (
|
|||
`account_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`account_name` varchar(200) NOT NULL,
|
||||
`opening_balance` decimal(15,2) NOT NULL DEFAULT 0.00,
|
||||
`account_notes` text DEFAULT NULL,
|
||||
`account_created_at` datetime NOT NULL,
|
||||
`account_updated_at` datetime DEFAULT NULL,
|
||||
`company_id` int(11) NOT NULL,
|
||||
|
|
@ -143,6 +144,8 @@ CREATE TABLE `clients` (
|
|||
`client_website` varchar(200) DEFAULT NULL,
|
||||
`client_net_terms` int(10) NOT NULL,
|
||||
`client_hours` varchar(200) DEFAULT NULL,
|
||||
`client_company_size` varchar(200) DEFAULT NULL,
|
||||
`client_notes` text DEFAULT NULL,
|
||||
`client_created_at` datetime NOT NULL,
|
||||
`client_updated_at` datetime DEFAULT NULL,
|
||||
`company_id` int(11) NOT NULL,
|
||||
|
|
@ -182,8 +185,9 @@ CREATE TABLE `contacts` (
|
|||
`contact_extension` varchar(200) DEFAULT NULL,
|
||||
`contact_mobile` varchar(200) DEFAULT 'NULL',
|
||||
`contact_primary` tinyint(1) DEFAULT NULL,
|
||||
`contact_recieve_invoices` tinyint(1) DEFAULT NULL,
|
||||
`contact_billing` tinyint(1) DEFAULT NULL,
|
||||
`contact_photo` varchar(200) DEFAULT NULL,
|
||||
`contact_notes` text DEFAULT NULL,
|
||||
`contact_created_at` datetime NOT NULL,
|
||||
`contact_updated_at` datetime DEFAULT NULL,
|
||||
`location_id` int(11) DEFAULT NULL,
|
||||
|
|
@ -370,8 +374,12 @@ CREATE TABLE `locations` (
|
|||
`location_zip` varchar(200) DEFAULT NULL,
|
||||
`location_phone` varchar(200) DEFAULT NULL,
|
||||
`location_hours` varchar(200) DEFAULT NULL,
|
||||
`location_photo` varchar(200) DEFAULT NULL,
|
||||
`location_notes` text DEFAULT NULL,
|
||||
`location_primary` tinyint(1) DEFAULT NULL,
|
||||
`location_created_at` datetime NOT NULL,
|
||||
`location_updated_at` datetime DEFAULT NULL,
|
||||
`contact_id` int(11) DEFAULT NULL,
|
||||
`client_id` int(11) NOT NULL,
|
||||
`company_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`location_id`)
|
||||
|
|
@ -715,6 +723,7 @@ DROP TABLE IF EXISTS `transfers`;
|
|||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `transfers` (
|
||||
`transfer_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`transfer_notes` text DEFAULT NULL,
|
||||
`transfer_created_at` datetime NOT NULL,
|
||||
`transfer_updated_at` datetime DEFAULT NULL,
|
||||
`expense_id` int(11) NOT NULL,
|
||||
|
|
@ -803,6 +812,7 @@ CREATE TABLE `vendors` (
|
|||
`vendor_email` varchar(200) DEFAULT NULL,
|
||||
`vendor_website` varchar(200) DEFAULT NULL,
|
||||
`vendor_account_number` varchar(200) DEFAULT NULL,
|
||||
`vendor_notes` text DEFAULT NULL,
|
||||
`vendor_created_at` datetime NOT NULL,
|
||||
`vendor_updated_at` datetime DEFAULT NULL,
|
||||
`client_id` int(11) NOT NULL,
|
||||
|
|
@ -820,4 +830,4 @@ CREATE TABLE `vendors` (
|
|||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2020-01-28 9:47:23
|
||||
-- Dump completed on 2020-02-02 1:06:01
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="account_id" value="<?php echo $account_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Account Name <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
|
|
@ -19,6 +20,12 @@
|
|||
<input type="text" class="form-control" name="name" value="<?php echo $account_name; ?>" placeholder="Account name" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Notes</label>
|
||||
<textarea class="form-control" rows="5" name="notes"><?php echo $account_notes; ?></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="delete_acount" class="btn btn-outline-danger mr-auto">Delete</button>
|
||||
|
|
|
|||
|
|
@ -13,16 +13,19 @@
|
|||
|
||||
<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>
|
||||
<a class="nav-link active" id="pills-details-tab<?php echo $client_id; ?>" data-toggle="pill" href="#pills-details<?php echo $client_id; ?>">Details</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>
|
||||
<a class="nav-link" id="pills-address-tab<?php echo $client_id; ?>" data-toggle="pill" href="#pills-address<?php echo $client_id; ?>">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>
|
||||
<a class="nav-link" id="pills-contact-tab<?php echo $client_id; ?>" data-toggle="pill" href="#pills-contact<?php echo $client_id; ?>">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>
|
||||
<a class="nav-link" id="pills-more-tab<?php echo $client_id; ?>" data-toggle="pill" href="#pills-more<?php echo $client_id; ?>">More</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-notes-tab<?php echo $client_id; ?>" data-toggle="pill" href="#pills-notes<?php echo $client_id; ?>">Notes</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
@ -30,7 +33,7 @@
|
|||
|
||||
<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="tab-pane fade show active" id="pills-details<?php echo $client_id; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Name <strong class="text-danger">*</strong></label>
|
||||
|
|
@ -52,9 +55,29 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<label>Phone</label>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'" value="<?php echo $client_phone; ?>">
|
||||
</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="url" class="form-control" name="website" placeholder="ex. https://google.com" value="<?php echo $client_website; ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<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="tab-pane fade" id="pills-address<?php echo $client_id; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Address</label>
|
||||
|
|
@ -103,7 +126,7 @@
|
|||
|
||||
</div>
|
||||
|
||||
<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="tab-pane fade" id="pills-contact<?php echo $client_id; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Primary Contact</label>
|
||||
|
|
@ -123,7 +146,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_phone; ?>">
|
||||
<input type="text" class="form-control" name="phone" placeholder="Phone Number" value="<?php echo $client_phone; ?>" data-inputmask="'mask': '999-999-9999'" data-mask>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -154,17 +177,7 @@
|
|||
|
||||
</div>
|
||||
|
||||
<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>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 class="tab-pane fade" id="pills-more<?php echo $client_id; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Hours</label>
|
||||
|
|
@ -190,6 +203,31 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Company Size</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-users"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="company_size">
|
||||
<option <?php if($client_company_size == "1 - 3"){ echo "selected"; } ?>>1 - 3</option>
|
||||
<option <?php if($client_company_size == "4 - 10"){ echo "selected"; } ?>>4 - 10</option>
|
||||
<option <?php if($client_company_size == "11 - 50"){ echo "selected"; } ?>>11 - 50</option>
|
||||
<option <?php if($client_company_size == "51 - 100"){ echo "selected"; } ?>>51 - 100</option>
|
||||
<option <?php if($client_company_size == "101 - 500"){ echo "selected"; } ?>>101 - 500</option>
|
||||
<option <?php if($client_company_size == "500+"){ echo "selected"; } ?>>500+</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-notes<?php echo $client_id; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="8" name="notes"><?php echo $client_notes; ?></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -11,77 +11,115 @@
|
|||
<input type="hidden" name="contact_id" value="<?php echo $contact_id; ?>">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<input type="hidden" name="current_avatar_path" value="<?php echo $contact_photo; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
<center>
|
||||
<?php if(!empty($contact_photo)){ ?>
|
||||
<img class="img-fluid rounded-circle" src="<?php echo $contact_photo; ?>" height="256" width="256">
|
||||
<?php }else{ ?>
|
||||
<span class="fa-stack fa-4x">
|
||||
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
|
||||
<span class="fa fa-stack-1x text-white"><?php echo $contact_initials; ?></span>
|
||||
</span>
|
||||
<?php } ?>
|
||||
</center>
|
||||
<div class="form-group">
|
||||
<label>Name <strong class="text-danger">*</strong></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 $contact_name; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Title <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<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 $contact_title; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="pills-details-tab<?php echo $contact_id; ?>" data-toggle="pill" href="#pills-details<?php echo $contact_id; ?>">Details</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-photo-tab<?php echo $contact_id; ?>" data-toggle="pill" href="#pills-photo<?php echo $contact_id; ?>">Photo</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-notes-tab<?php echo $contact_id; ?>" data-toggle="pill" href="#pills-notes<?php echo $contact_id; ?>">Notes</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="tab-content" id="pills-tabContent<?php echo $contact_id; ?>">
|
||||
|
||||
<div class="tab-pane fade show active" id="pills-details<?php echo $contact_id; ?>">
|
||||
|
||||
<label>Phone</label>
|
||||
<div class="form-row">
|
||||
<div class="col-8">
|
||||
<div class="form-group">
|
||||
<label>Name <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
|
||||
<span class="input-group-text"><i class="fa fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'" value="<?php echo $contact_phone; ?>">
|
||||
<input type="text" class="form-control" name="name" placeholder="Full Name" value="<?php echo $contact_name; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Title</label>
|
||||
<div class="input-group">
|
||||
<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 $contact_title; ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label>Phone</label>
|
||||
<div class="form-row">
|
||||
<div class="col-8">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'" value="<?php echo $contact_phone; ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<input type="text" class="form-control" name="extension" placeholder="Extension" value="<?php echo $contact_extension; ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Mobile</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-mobile-alt"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="mobile" placeholder="Mobile Phone Number" data-inputmask="'mask': '999-999-9999'" value="<?php echo $contact_mobile; ?>">
|
||||
</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-envelope"></i></span>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="email" placeholder="Email Address" value="<?php echo $contact_email; ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<input type="text" class="form-control" name="extension" placeholder="Extension" value="<?php echo $contact_extension; ?>">
|
||||
|
||||
<div class="tab-pane fade" id="pills-photo<?php echo $contact_id; ?>">
|
||||
|
||||
<center>
|
||||
<?php if(!empty($contact_photo)){ ?>
|
||||
<img class="img-fluid rounded-circle" src="<?php echo $contact_photo; ?>" height="256" width="256">
|
||||
<?php }else{ ?>
|
||||
<span class="fa-stack fa-4x">
|
||||
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
|
||||
<span class="fa fa-stack-1x text-white"><?php echo $contact_initials; ?></span>
|
||||
</span>
|
||||
<?php } ?>
|
||||
</center>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Photo</label>
|
||||
<input type="file" class="form-control-file" name="file">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-notes<?php echo $contact_id; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="8" name="notes"><?php echo $contact_notes; ?></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Mobile</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-mobile-alt"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="mobile" placeholder="Mobile Phone Number" data-inputmask="'mask': '999-999-9999'" value="<?php echo $contact_mobile; ?>">
|
||||
</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-envelope"></i></span>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="email" placeholder="Email Address" value="<?php echo $contact_email; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Photo</label>
|
||||
<input type="file" class="form-control-file" name="file">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
|
|
|
|||
|
|
@ -7,77 +7,205 @@
|
|||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
|
||||
<input type="hidden" name="location_id" value="<?php echo $location_id; ?>">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<input type="hidden" name="current_file_path" value="<?php echo $location_photo; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
<div class="form-group">
|
||||
<label>Location Name <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<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 $location_name; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Address <strong class="text-danger">*</strong></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 $location_address; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>City <strong class="text-danger">*</strong></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 $location_city; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>State <strong class="text-danger">*</strong></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 select2" 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 <strong class="text-danger">*</strong></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 $location_zip; ?>" required data-inputmask="'mask': '99999'">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Phone <strong class="text-danger">*</strong></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" data-inputmask="'mask': '999-999-9999'" value="<?php echo $location_phone; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab<?php echo $location_id; ?>">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="pills-details-tab<?php echo $location_id; ?>" data-toggle="pill" href="#pills-details<?php echo $location_id; ?>">Details</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-address-tab<?php echo $location_id; ?>" data-toggle="pill" href="#pills-address<?php echo $location_id; ?>">Address</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-contact-tab<?php echo $location_id; ?>" data-toggle="pill" href="#pills-contact<?php echo $location_id; ?>">Contact</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-photo-tab<?php echo $location_id; ?>" data-toggle="pill" href="#pills-photo<?php echo $location_id; ?>">Photo</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-notes-tab<?php echo $location_id; ?>" data-toggle="pill" href="#pills-notes<?php echo $location_id; ?>">Notes</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="tab-content" id="pills-tabContent<?php echo $location_id; ?>">
|
||||
|
||||
<div class="tab-pane fade show active" id="pills-details<?php echo $location_id; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Location Name <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<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 $location_name; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="hours" placeholder="Hours of operation" value="<?php echo $location_hours; ?>">
|
||||
|
||||
<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" data-inputmask="'mask': '999-999-9999'" value="<?php echo $location_phone; ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-address<?php echo $location_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 $location_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 $location_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 select2" name="state">
|
||||
<?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>
|
||||
<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; ?>" data-inputmask="'mask': '99999'">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-contact<?php echo $location_id; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Contact</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>
|
||||
<select class="form-control" name="contact">
|
||||
<option value="">- Contact -</option>
|
||||
<?php
|
||||
|
||||
$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($contact_id == $contact_id_select){ echo "selected"; } ?> value="<?php echo $contact_id_select; ?>"><?php echo $contact_name_select; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label>Phone</label>
|
||||
<div class="form-row">
|
||||
<div class="col-8">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'" value="<?php echo $contact_phone; ?>" disabled>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<input type="text" class="form-control" name="extension" placeholder="Extension" value="<?php echo $contact_extension; ?>" disabled>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Mobile</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-mobile-alt"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="mobile" placeholder="Mobile Phone Number" data-inputmask="'mask': '999-999-9999'" value="<?php echo $contact_mobile; ?>" disabled>
|
||||
</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-envelope"></i></span>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="email" placeholder="Email Address" value="<?php echo $contact_email; ?>" disabled>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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 $location_hours; ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-photo<?php echo $location_id; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<center>
|
||||
<?php if(!empty($location_photo)){ ?>
|
||||
<img class="img-fluid rounded-circle" src="<?php echo $location_photo; ?>" height="256" width="256">
|
||||
<?php } ?>
|
||||
</center>
|
||||
|
||||
<input type="file" class="form-control-file" name="file">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-notes<?php echo $location_id; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="8" name="notes"><?php echo $location_notes; ?></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -12,103 +12,131 @@
|
|||
<input type="hidden" name="transfer_id" value="<?php echo $transfer_id; ?>">
|
||||
<input type="hidden" name="expense_id" value="<?php echo $expense_id; ?>">
|
||||
<input type="hidden" name="revenue_id" value="<?php echo $revenue_id; ?>">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-sm">
|
||||
<label>Date <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
||||
|
||||
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab<?php echo $transfer_id; ?>">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="pills-details-tab<?php echo $transfer_id; ?>" data-toggle="pill" href="#pills-details<?php echo $transfer_id; ?>">Details</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-notes-tab<?php echo $transfer_id; ?>" data-toggle="pill" href="#pills-notes<?php echo $transfer_id; ?>">Notes</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" id="pills-tabContent<?php echo $transfer_id; ?>">
|
||||
|
||||
<div class="tab-pane fade show active" id="pills-details<?php echo $transfer_id; ?>">
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-sm">
|
||||
<label>Date <strong class="text-danger">*</strong></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 $transfer_date; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
<input type="date" class="form-control" name="date" value="<?php echo $transfer_date; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-sm">
|
||||
<label>Amount <strong class="text-danger">*</strong></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 class="form-group col-sm">
|
||||
<label>Amount <strong class="text-danger">*</strong></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" name="amount" placeholder="Amount to transfer" value="<?php echo $transfer_amount; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
<input type="number" class="form-control" step="0.01" min="0" name="amount" placeholder="Amount to transfer" value="<?php echo $transfer_amount; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Transfer <strong class="text-danger">*</strong></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 select2" name="account_from" required>
|
||||
<?php
|
||||
|
||||
$sql_accounts = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id");
|
||||
while($row = mysqli_fetch_array($sql_accounts)){
|
||||
$account_id_select = $row['account_id'];
|
||||
$account_name_select = $row['account_name'];
|
||||
$opening_balance = $row['opening_balance'];
|
||||
<div class="form-group">
|
||||
<label>Transfer <strong class="text-danger">*</strong></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 select2" name="account_from" required>
|
||||
<?php
|
||||
|
||||
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS total_payments FROM payments WHERE account_id = $account_id_select");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$total_payments = $row['total_payments'];
|
||||
$sql_accounts = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id");
|
||||
while($row = mysqli_fetch_array($sql_accounts)){
|
||||
$account_id_select = $row['account_id'];
|
||||
$account_name_select = $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_select");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$total_payments = $row['total_payments'];
|
||||
|
||||
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS total_revenues FROM revenues WHERE account_id = $account_id_select");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$total_revenues = $row['total_revenues'];
|
||||
|
||||
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE account_id = $account_id_select");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$total_expenses = $row['total_expenses'];
|
||||
|
||||
$balance = $opening_balance + $total_payments + $total_revenues - $total_expenses;
|
||||
|
||||
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS total_revenues FROM revenues WHERE account_id = $account_id_select");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$total_revenues = $row['total_revenues'];
|
||||
|
||||
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE account_id = $account_id_select");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$total_expenses = $row['total_expenses'];
|
||||
|
||||
$balance = $opening_balance + $total_payments + $total_revenues - $total_expenses;
|
||||
|
||||
?>
|
||||
<option <?php if($transfer_account_from == $account_id_select){ ?> selected <?php } ?> value="<?php echo $account_id_select; ?>"><?php echo $account_name_select; ?> [$<?php echo number_format($balance,2); ?>]</option>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-arrow-right"></i></span>
|
||||
?>
|
||||
<option <?php if($transfer_account_from == $account_id_select){ ?> selected <?php } ?> value="<?php echo $account_id_select; ?>"><?php echo $account_name_select; ?> [$<?php echo number_format($balance,2); ?>]</option>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<select class="form-control select2" name="account_to" required>
|
||||
<?php
|
||||
|
||||
$sql2 = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id");
|
||||
while($row = mysqli_fetch_array($sql2)){
|
||||
$account_id2 = $row['account_id'];
|
||||
$account_name = $row['account_name'];
|
||||
$opening_balance = $row['opening_balance'];
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-arrow-right"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="account_to" required>
|
||||
<?php
|
||||
|
||||
$sql2 = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id");
|
||||
while($row = mysqli_fetch_array($sql2)){
|
||||
$account_id2 = $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_id2");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$total_payments = $row['total_payments'];
|
||||
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS total_payments FROM payments WHERE account_id = $account_id2");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$total_payments = $row['total_payments'];
|
||||
|
||||
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS total_revenues FROM revenues WHERE account_id = $account_id2");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$total_revenues = $row['total_revenues'];
|
||||
|
||||
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE account_id = $account_id2");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$total_expenses = $row['total_expenses'];
|
||||
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS total_revenues FROM revenues WHERE account_id = $account_id2");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$total_revenues = $row['total_revenues'];
|
||||
|
||||
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE account_id = $account_id2");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$total_expenses = $row['total_expenses'];
|
||||
|
||||
$balance = $opening_balance + $total_payments + $total_revenues - $total_expenses;
|
||||
$balance = $opening_balance + $total_payments + $total_revenues - $total_expenses;
|
||||
|
||||
?>
|
||||
<option <?php if($transfer_account_to == $account_id2){ ?> selected <?php } ?> value="<?php echo $account_id2; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
?>
|
||||
<option <?php if($transfer_account_to == $account_id2){ ?> selected <?php } ?> value="<?php echo $account_id2; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-notes<?php echo $transfer_id; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="8" name="notes"><?php echo $transfer_notes; ?></textarea>
|
||||
</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="edit_transfer" class="btn btn-primary">Save</button>
|
||||
|
|
|
|||
|
|
@ -11,15 +11,18 @@
|
|||
<input type="hidden" name="vendor_id" value="<?php echo $vendor_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab<?php echo $vendor_id; ?>" role="tablist">
|
||||
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab<?php echo $vendor_id; ?>">
|
||||
<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>
|
||||
<a class="nav-link active" id="pills-details-tab<?php echo $vendor_id; ?>" data-toggle="pill" href="#pills-details<?php echo $vendor_id; ?>">Details</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>
|
||||
<a class="nav-link" id="pills-address-tab<?php echo $vendor_id; ?>" data-toggle="pill" href="#pills-address<?php echo $vendor_id; ?>">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>
|
||||
<a class="nav-link" id="pills-contact-tab<?php echo $vendor_id; ?>" data-toggle="pill" href="#pills-contact<?php echo $vendor_id; ?>">Contact</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pills-notes-tab<?php echo $vendor_id; ?>" data-toggle="pill" href="#pills-notes<?php echo $vendor_id; ?>">Notes</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
@ -27,7 +30,7 @@
|
|||
|
||||
<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="tab-pane fade show active" id="pills-details<?php echo $vendor_id; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Name <strong class="text-danger">*</strong></label>
|
||||
|
|
@ -110,7 +113,7 @@
|
|||
|
||||
</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="tab-pane fade" id="pills-contact<?php echo $vendor_id; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Contact Name</label>
|
||||
|
|
@ -161,6 +164,14 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-notes<?php echo $vendor_id; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="8" name="notes"><?php echo $vendor_notes; ?></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
header("Content-Type: application/xls");
|
||||
header("Content-Disposition: attachment; filename=excel.xls");
|
||||
header("Pragma: no-cache");
|
||||
header("Expires: 0");
|
||||
|
||||
require_once 'conn.php';
|
||||
|
||||
$output = "";
|
||||
|
||||
if(ISSET($_POST['export'])){
|
||||
$output .="
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Firstname</th>
|
||||
<th>Lastname</th>
|
||||
<th>Address</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
";
|
||||
|
||||
$query = mysqli_query($conn, "SELECT * FROM `member`") or die(mysqli_errno());
|
||||
while($fetch = mysqli_fetch_array($query)){
|
||||
|
||||
$output .= "
|
||||
<tr>
|
||||
<td>".$fetch['mem_id']."</td>
|
||||
<td>".$fetch['firstname']."</td>
|
||||
<td>".$fetch['lastname']."</td>
|
||||
<td>".$fetch['address']."</td>
|
||||
</tr>
|
||||
";
|
||||
}
|
||||
|
||||
$output .="
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
";
|
||||
|
||||
echo $output;
|
||||
}
|
||||
|
||||
?>
|
||||
98
post.php
98
post.php
|
|
@ -487,15 +487,32 @@ if(isset($_POST['add_client'])){
|
|||
$website = strip_tags(mysqli_real_escape_string($mysqli,$_POST['website']));
|
||||
$net_terms = intval($_POST['net_terms']);
|
||||
$hours = strip_tags(mysqli_real_escape_string($mysqli,$_POST['hours']));
|
||||
$company_size = strip_tags(mysqli_real_escape_string($mysqli,$_POST['company_size']));
|
||||
$notes = strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO clients SET client_name = '$name', client_type = '$type', client_address = '$address', client_city = '$city', client_state = '$state', client_zip = '$zip', client_contact = '$contact', client_phone = '$phone', client_extension = '$extension', client_mobile = '$mobile', client_email = '$email', client_website = '$website', client_net_terms = $net_terms, client_hours = '$hours', client_created_at = NOW(), company_id = $session_company_id");
|
||||
mysqli_query($mysqli,"INSERT INTO clients SET client_name = '$name', client_type = '$type', client_address = '$address', client_city = '$city', client_state = '$state', client_zip = '$zip', client_contact = '$contact', client_phone = '$phone', client_extension = '$extension', client_mobile = '$mobile', client_email = '$email', client_website = '$website', client_net_terms = $net_terms, client_hours = '$hours', client_company_size = '$company_size', client_notes = '$notes', client_created_at = NOW(), company_id = $session_company_id");
|
||||
|
||||
$client_id = mysqli_insert_id($mysqli);
|
||||
|
||||
//Should be created when files are uploaded
|
||||
mkdir("uploads/clients/$session_company_id/$client_id");
|
||||
if(!file_exists("uploads/clients/$session_company_id/$client_id")) {
|
||||
mkdir("uploads/clients/$session_company_id/$client_id");
|
||||
}
|
||||
|
||||
//Logging
|
||||
//Add Primary Contact
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO contacts SET contact_name = '$contact', contact_title = 'Main Contact', contact_phone = '$phone', contact_extension = '$extension', contact_mobile = '$mobile', contact_email = '$email', contact_primary = 1, contact_billing = 1, contact_created_at = NOW(), client_id = $client_id, company_id = $session_company_id");
|
||||
|
||||
//Log Add Primary Contact
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Contact', log_action = 'Created', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
||||
|
||||
//Add Primary Location
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO locations SET location_name = 'Main Location', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_phone = '$phone', location_hours = '$hours', location_primary = 1, location_created_at = NOW(), client_id = $client_id, company_id = $session_company_id");
|
||||
|
||||
//Log Add Primary Location
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Location', log_action = 'Created', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
||||
|
||||
//Log Add Client
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Client', log_action = 'Created', log_description = '$name', log_created_at = NOW(), client_id = $client_id, company_id = $session_company_id, user_id = $session_user_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Client added";
|
||||
|
|
@ -523,8 +540,10 @@ if(isset($_POST['edit_client'])){
|
|||
$website = strip_tags(mysqli_real_escape_string($mysqli,$_POST['website']));
|
||||
$net_terms = intval($_POST['net_terms']);
|
||||
$hours = strip_tags(mysqli_real_escape_string($mysqli,$_POST['hours']));
|
||||
$company_size = strip_tags(mysqli_real_escape_string($mysqli,$_POST['company_size']));
|
||||
$notes = strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE clients SET client_name = '$name', client_type = '$type', client_address = '$address', client_city = '$city', client_state = '$state', client_zip = '$zip', client_contact = '$contact', client_phone = '$phone', client_extension = '$extension', client_mobile = '$mobile', client_email = '$email', client_website = '$website', client_net_terms = $net_terms, client_hours = '$hours', client_updated_at = NOW() WHERE client_id = $client_id AND company_id = $session_company_id");
|
||||
mysqli_query($mysqli,"UPDATE clients SET client_name = '$name', client_type = '$type', client_address = '$address', client_city = '$city', client_state = '$state', client_zip = '$zip', client_contact = '$contact', client_phone = '$phone', client_extension = '$extension', client_mobile = '$mobile', client_email = '$email', client_website = '$website', client_net_terms = $net_terms, client_hours = '$hours', client_company_size = '$company_size', client_notes = '$notes', client_updated_at = NOW() WHERE client_id = $client_id AND company_id = $session_company_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Client', log_action = 'Modified', log_description = '$name', log_created_at = NOW(), client_id = $client_id, company_id = $session_company_id, user_id = $session_user_id");
|
||||
|
|
@ -806,8 +825,9 @@ if(isset($_POST['add_vendor'])){
|
|||
$extension = strip_tags(mysqli_real_escape_string($mysqli,$_POST['extension']));
|
||||
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
|
||||
$website = strip_tags(mysqli_real_escape_string($mysqli,$_POST['website']));
|
||||
$notes = strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO vendors SET vendor_name = '$name', vendor_description = '$description', vendor_address = '$address', vendor_city = '$city', vendor_state = '$state', vendor_zip = '$zip', vendor_contact_name = '$contact_name', vendor_phone = '$phone', vendor_extension = '$extension', vendor_email = '$email', vendor_website = '$website', vendor_account_number = '$account_number', vendor_created_at = NOW(), client_id = $client_id, company_id = $session_company_id");
|
||||
mysqli_query($mysqli,"INSERT INTO vendors SET vendor_name = '$name', vendor_description = '$description', vendor_address = '$address', vendor_city = '$city', vendor_state = '$state', vendor_zip = '$zip', vendor_contact_name = '$contact_name', vendor_phone = '$phone', vendor_extension = '$extension', vendor_email = '$email', vendor_website = '$website', vendor_account_number = '$account_number', vendor_notes = '$notes', vendor_created_at = NOW(), client_id = $client_id, company_id = $session_company_id");
|
||||
|
||||
$vendor_id = mysqli_insert_id($mysqli);
|
||||
|
||||
|
|
@ -836,8 +856,9 @@ if(isset($_POST['edit_vendor'])){
|
|||
$extension = strip_tags(mysqli_real_escape_string($mysqli,$_POST['extension']));
|
||||
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
|
||||
$website = strip_tags(mysqli_real_escape_string($mysqli,$_POST['website']));
|
||||
$notes = strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE vendors SET vendor_name = '$name', vendor_description = '$description', vendor_address = '$address', vendor_city = '$city', vendor_state = '$state', vendor_zip = '$zip', vendor_contact_name = '$contact_name', vendor_phone = '$phone', vendor_extension = '$extension', vendor_email = '$email', vendor_website = '$website', vendor_account_number = '$account_number', vendor_updated_at = NOW() WHERE vendor_id = $vendor_id AND company_id = $session_company_id");
|
||||
mysqli_query($mysqli,"UPDATE vendors SET vendor_name = '$name', vendor_description = '$description', vendor_address = '$address', vendor_city = '$city', vendor_state = '$state', vendor_zip = '$zip', vendor_contact_name = '$contact_name', vendor_phone = '$phone', vendor_extension = '$extension', vendor_email = '$email', vendor_website = '$website', vendor_account_number = '$account_number', vendor_notes = '$notes', vendor_updated_at = NOW() WHERE vendor_id = $vendor_id AND company_id = $session_company_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Vendor', log_action = 'Modified', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
||||
|
|
@ -973,9 +994,10 @@ if(isset($_GET['delete_trip'])){
|
|||
if(isset($_POST['add_account'])){
|
||||
|
||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
||||
$opening_balance = $_POST['opening_balance'];
|
||||
$opening_balance = floatval($_POST['opening_balance']);
|
||||
$notes = strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO accounts SET account_name = '$name', opening_balance = '$opening_balance', account_created_at = NOW(), company_id = $session_company_id");
|
||||
mysqli_query($mysqli,"INSERT INTO accounts SET account_name = '$name', opening_balance = '$opening_balance', account_notes = '$account_notes', account_created_at = NOW(), company_id = $session_company_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Account', log_action = 'Created', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
||||
|
|
@ -990,8 +1012,9 @@ if(isset($_POST['edit_account'])){
|
|||
|
||||
$account_id = intval($_POST['account_id']);
|
||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
||||
$notes = strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE accounts SET account_name = '$name', account_updated_at = NOW() WHERE account_id = $account_id AND company_id = $session_company_id");
|
||||
mysqli_query($mysqli,"UPDATE accounts SET account_name = '$name', account_notes = '$notes', account_updated_at = NOW() WHERE account_id = $account_id AND company_id = $session_company_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Account', log_action = 'Modified', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
||||
|
|
@ -1083,21 +1106,22 @@ if(isset($_GET['alert_ack'])){
|
|||
|
||||
if(isset($_GET['ack_all_alerts'])){
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM alerts WHERE company_id = $session_company_id ORDER BY alert_id DESC");
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM alerts WHERE company_id = $session_company_id AND alert_ack_date IS NULL");
|
||||
|
||||
$num_alerts = mysqli_num_rows($sql);
|
||||
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$alert_id = $row['alert_id'];
|
||||
$alert_ack_date = $row['alert_ack_date'];
|
||||
|
||||
if($alert_ack_date = 0 ){
|
||||
mysqli_query($mysqli,"UPDATE alerts SET alert_ack_date = CURDATE() WHERE alert_id = $alert_id AND company_id = $session_company_id");
|
||||
}
|
||||
mysqli_query($mysqli,"UPDATE alerts SET alert_ack_date = CURDATE() WHERE alert_id = $alert_id");
|
||||
|
||||
}
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Alerts', log_action = 'Modifed', log_description = 'Acknowledged all alerts', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Alerts Acknowledged";
|
||||
$_SESSION['alert_message'] = "$num_alerts Alerts Acknowledged";
|
||||
|
||||
header("Location: alerts.php");
|
||||
|
||||
|
|
@ -1189,6 +1213,7 @@ if(isset($_POST['add_transfer'])){
|
|||
$amount = floatval($_POST['amount']);
|
||||
$account_from = intval($_POST['account_from']);
|
||||
$account_to = intval($_POST['account_to']);
|
||||
$notes = strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO expenses SET expense_date = '$date', expense_amount = '$amount', vendor_id = 0, category_id = 0, account_id = $account_from, expense_created_at = NOW(), company_id = $session_company_id");
|
||||
$expense_id = mysqli_insert_id($mysqli);
|
||||
|
|
@ -1196,7 +1221,7 @@ if(isset($_POST['add_transfer'])){
|
|||
mysqli_query($mysqli,"INSERT INTO revenues SET revenue_date = '$date', revenue_amount = '$amount', account_id = $account_to, category_id = 0, revenue_created_at = NOW(), company_id = $session_company_id");
|
||||
$revenue_id = mysqli_insert_id($mysqli);
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO transfers SET expense_id = $expense_id, revenue_id = $revenue_id, transfer_created_at = NOW(), company_id = $session_company_id");
|
||||
mysqli_query($mysqli,"INSERT INTO transfers SET expense_id = $expense_id, revenue_id = $revenue_id, transfer_notes = '$notes', transfer_created_at = NOW(), company_id = $session_company_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Transfer', log_action = 'Created', log_description = '$date - $amount', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
||||
|
|
@ -1216,12 +1241,13 @@ if(isset($_POST['edit_transfer'])){
|
|||
$amount = floatval($_POST['amount']);
|
||||
$account_from = intval($_POST['account_from']);
|
||||
$account_to = intval($_POST['account_to']);
|
||||
$notes = strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE expenses SET expense_date = '$date', expense_amount = '$amount', account_id = $account_from, expense_updated_at = NOW() WHERE expense_id = $expense_id AND company_id = $session_company_id");
|
||||
|
||||
mysqli_query($mysqli,"UPDATE revenues SET revenue_date = '$date', revenue_amount = '$amount', account_id = $account_to, revenue_updated_at = NOW() WHERE revenue_id = $revenue_id AND company_id = $session_company_id");
|
||||
|
||||
mysqli_query($mysqli,"UPDATE transfers SET transfer_date = '$date', transfer_amount = '$amount', transfer_account_from = $account_from, transfer_account_to = $account_to, transfer_updated_at = NOW() WHERE transfer_id = $transfer_id AND company_id = $session_company_id");
|
||||
mysqli_query($mysqli,"UPDATE transfers SET transfer_notes = '$notes', transfer_updated_at = NOW() WHERE transfer_id = $transfer_id AND company_id = $session_company_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Transfer', log_action = 'Modifed', log_description = '$date - $amount', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
||||
|
|
@ -2771,6 +2797,7 @@ if(isset($_POST['add_contact'])){
|
|||
$mobile = strip_tags(mysqli_real_escape_string($mysqli,$_POST['mobile']));
|
||||
$mobile = preg_replace("/[^0-9]/", '',$mobile);
|
||||
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
|
||||
$notes = strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes']));
|
||||
|
||||
if(!file_exists("uploads/clients/$session_company_id/$client_id")) {
|
||||
mkdir("uploads/clients/$session_company_id/$client_id");
|
||||
|
|
@ -2783,7 +2810,7 @@ if(isset($_POST['add_contact'])){
|
|||
move_uploaded_file($_FILES['file']['tmp_name'], $path);
|
||||
}
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_extension = '$extension', contact_mobile = '$mobile', contact_email = '$email', contact_photo = '$path', contact_created_at = NOW(), client_id = $client_id, company_id = $session_company_id");
|
||||
mysqli_query($mysqli,"INSERT INTO contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_extension = '$extension', contact_mobile = '$mobile', contact_email = '$email', contact_photo = '$path', contact_notes = '$notes', contact_created_at = NOW(), client_id = $client_id, company_id = $session_company_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Contact', log_action = 'Created', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
||||
|
|
@ -2806,6 +2833,7 @@ if(isset($_POST['edit_contact'])){
|
|||
$mobile = strip_tags(mysqli_real_escape_string($mysqli,$_POST['mobile']));
|
||||
$mobile = preg_replace("/[^0-9]/", '',$mobile);
|
||||
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
|
||||
$notes = strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes']));
|
||||
|
||||
$path = strip_tags(mysqli_real_escape_string($mysqli,$_POST['current_avatar_path']));
|
||||
|
||||
|
|
@ -2820,7 +2848,7 @@ if(isset($_POST['edit_contact'])){
|
|||
move_uploaded_file($_FILES['file']['tmp_name'], $path);
|
||||
}
|
||||
|
||||
mysqli_query($mysqli,"UPDATE contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_extension = '$extension', contact_mobile = '$mobile', contact_email = '$email', contact_photo = '$path', contact_updated_at = NOW() WHERE contact_id = $contact_id AND company_id = $session_company_id");
|
||||
mysqli_query($mysqli,"UPDATE contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_extension = '$extension', contact_mobile = '$mobile', contact_email = '$email', contact_photo = '$path', contact_notes = '$notes', contact_updated_at = NOW() WHERE contact_id = $contact_id AND company_id = $session_company_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Contact', log_action = 'Modified', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
||||
|
|
@ -2856,8 +2884,21 @@ if(isset($_POST['add_location'])){
|
|||
$phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['phone']));
|
||||
$phone = preg_replace("/[^0-9]/", '',$phone);
|
||||
$hours = strip_tags(mysqli_real_escape_string($mysqli,$_POST['hours']));
|
||||
$notes = strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes']));
|
||||
$contact = intval($_POST['contact']);
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO locations SET location_name = '$name', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_phone = '$phone', location_hours = '$hours', location_created_at = NOW(), client_id = $client_id, company_id = $session_company_id");
|
||||
if(!file_exists("uploads/clients/$session_company_id/$client_id")) {
|
||||
mkdir("uploads/clients/$session_company_id/$client_id");
|
||||
}
|
||||
|
||||
if($_FILES['file']['tmp_name']!='') {
|
||||
$path = "uploads/clients/$session_company_id/$client_id/";
|
||||
$path = $path . time() . basename( $_FILES['file']['name']);
|
||||
$file_name = basename($path);
|
||||
move_uploaded_file($_FILES['file']['tmp_name'], $path);
|
||||
}
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO locations SET location_name = '$name', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_phone = '$phone', location_hours = '$hours', location_photo = '$path', location_notes = '$notes', contact_id = $contact, location_created_at = NOW(), client_id = $client_id, company_id = $session_company_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Location', log_action = 'Created', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
||||
|
|
@ -2879,8 +2920,23 @@ if(isset($_POST['edit_location'])){
|
|||
$phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['phone']));
|
||||
$phone = preg_replace("/[^0-9]/", '',$phone);
|
||||
$hours = strip_tags(mysqli_real_escape_string($mysqli,$_POST['hours']));
|
||||
$notes = strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes']));
|
||||
$contact = intval($_POST['contact']);
|
||||
|
||||
mysqli_query($mysqli,"UPDATE locations SET location_name = '$name', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_phone = '$phone', location_hours = '$hours', location_updated_at = NOW() WHERE location_id = $location_id AND company_id = $session_company_id");
|
||||
$path = strip_tags(mysqli_real_escape_string($mysqli,$_POST['current_file_path']));
|
||||
|
||||
if(!file_exists("uploads/clients/$session_company_id/$client_id")) {
|
||||
mkdir("uploads/clients/$session_company_id/$client_id");
|
||||
}
|
||||
|
||||
if($_FILES['file']['tmp_name']!='') {
|
||||
$path = "uploads/clients/$session_company_id/$client_id/";
|
||||
$path = $path . time() . basename( $_FILES['file']['name']);
|
||||
$file_name = basename($path);
|
||||
move_uploaded_file($_FILES['file']['tmp_name'], $path);
|
||||
}
|
||||
|
||||
mysqli_query($mysqli,"UPDATE locations SET location_name = '$name', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_phone = '$phone', location_hours = '$hours', location_photo = '$path', location_notes = '$notes', contact_id = $contact, location_updated_at = NOW() WHERE location_id = $location_id AND company_id = $session_company_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Location', log_action = 'Modified', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
if(!empty($_GET['sb'])){
|
||||
$sb = mysqli_real_escape_string($mysqli,$_GET['sb']);
|
||||
}else{
|
||||
$sb = "recurring_id";
|
||||
$sb = "recurring_next_date";
|
||||
}
|
||||
|
||||
if(isset($_GET['o'])){
|
||||
|
|
@ -35,8 +35,8 @@
|
|||
$disp = "ASC";
|
||||
}
|
||||
}else{
|
||||
$o = "DESC";
|
||||
$disp = "ASC";
|
||||
$o = "ASC";
|
||||
$disp = "DESC";
|
||||
}
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM recurring, clients, categories
|
||||
|
|
@ -71,11 +71,12 @@
|
|||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if($num_rows[0] == 0){ echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_next_date&o=<?php echo $disp; ?>">Next Date</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_frequency&o=<?php echo $disp; ?>">Frequency</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=client_name&o=<?php echo $disp; ?>">Client</a></th>
|
||||
<th class="text-right"><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_amount&o=<?php echo $disp; ?>">Amount</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_last_sent&o=<?php echo $disp; ?>">Last Sent</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_next_date&o=<?php echo $disp; ?>">Next Date</a></th>
|
||||
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=category_name&o=<?php echo $disp; ?>">Category</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_status&o=<?php echo $disp; ?>">Status</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
|
|
@ -109,11 +110,11 @@
|
|||
?>
|
||||
|
||||
<tr>
|
||||
<td><a href="recurring_invoice.php?recurring_id=<?php echo $recurring_id; ?>"><?php echo ucwords($recurring_frequency); ?>ly</a></td>
|
||||
<td><a href="recurring_invoice.php?recurring_id=<?php echo $recurring_id; ?>"><?php echo $recurring_next_date; ?></a></td>
|
||||
<td><?php echo ucwords($recurring_frequency); ?>ly</td>
|
||||
<td><a href="client.php?client_id=<?php echo $client_id; ?>&tab=recurring"><?php echo $client_name; ?></a></td>
|
||||
<td class="text-right text-monospace">$<?php echo number_format($recurring_amount,2); ?></td>
|
||||
<td><?php echo $recurring_last_sent; ?></td>
|
||||
<td><?php echo $recurring_next_date; ?></td>
|
||||
<td><?php echo $category_name; ?></td>
|
||||
<td>
|
||||
<span class="p-2 badge badge-<?php echo $status_badge_color; ?>">
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
}
|
||||
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS expenses.expense_date AS transfer_date, expenses.expense_amount AS transfer_amount, expenses.account_id AS transfer_account_from, revenues.account_id AS transfer_account_to, transfers.expense_id, transfers.revenue_id , transfers.transfer_id FROM transfers, expenses, revenues WHERE transfers.expense_id = expenses.expense_id AND transfers.revenue_id = revenues.revenue_id AND transfers.company_id = $session_company_id ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS expenses.expense_date AS transfer_date, expenses.expense_amount AS transfer_amount, expenses.account_id AS transfer_account_from, revenues.account_id AS transfer_account_to, transfers.expense_id, transfers.revenue_id , transfers.transfer_id, transfers.transfer_notes AS transfer_notes FROM transfers, expenses, revenues WHERE transfers.expense_id = expenses.expense_id AND transfers.revenue_id = revenues.revenue_id AND transfers.company_id = $session_company_id ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
$total_found_rows = $num_rows[0];
|
||||
|
|
@ -83,9 +83,10 @@ $total_pages = ceil($total_found_rows / 10);
|
|||
$transfer_account_from = $row['transfer_account_from'];
|
||||
$transfer_account_to = $row['transfer_account_to'];
|
||||
$transfer_amount = $row['transfer_amount'];
|
||||
$transfer_notes = $row['transfer_notes'];
|
||||
$expense_id = $row['expense_id'];
|
||||
$revenue_id = $row['revenue_id'];
|
||||
|
||||
|
||||
$sql2 = mysqli_query($mysqli,"SELECT * FROM accounts WHERE account_id = $transfer_account_from");
|
||||
$row = mysqli_fetch_array($sql2);
|
||||
$account_name_from = $row['account_name'];
|
||||
|
|
|
|||
|
|
@ -100,6 +100,8 @@
|
|||
$vendor_extension = $row['vendor_extension'];
|
||||
$vendor_email = $row['vendor_email'];
|
||||
$vendor_website = $row['vendor_website'];
|
||||
$vendor_notes = $row['vendor_notes']
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
|
|
|
|||
Loading…
Reference in New Issue