Delete unused test files

This commit is contained in:
johnnyq 2022-02-22 01:52:33 -05:00
parent 2b639ecb65
commit 950cbee979
14 changed files with 0 additions and 1555 deletions

View File

@ -1,62 +0,0 @@
<?php include("header.php"); ?>
<div id='calendar'></div>
<?php include("footer.php"); ?>
<script>
document.addEventListener('DOMContentLoaded', function() {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
plugins: [ 'bootstrap', 'dayGrid', 'timeGrid', 'list' ],
themeSystem: 'bootstrap',
defaultView: 'dayGridMonth',
header: {
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth'
},
events: [
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM invoices, clients WHERE invoices.client_id = clients.client_id AND invoices.company_id = $session_company_id");
while($row = mysqli_fetch_array($sql)){
$invoice_id = $row['invoice_id'];
$invoice_number = $row['invoice_number'];
$invoice_due = $row['invoice_due'];
$invoice_amount = $row['invoice_amount'];
$client_name = addslashes($row['client_name']);
echo "{ id: '$invoice_id', title: '$invoice_number - $client_name', start: '$invoice_due', color: 'red'},";
}
$sql = mysqli_query($mysqli,"SELECT * FROM domains WHERE company_id = $session_company_id");
while($row = mysqli_fetch_array($sql)){
$domain_id = $row['domain_id'];
$domain = $row['domain_name'];
$domain_expire = $row['domain_expire'];
$event_end = $row['event_end'];
echo "{ id: '$domain_id', title: '$domain', start: '$domain_expire', color: 'blue'},";
}
$sql = mysqli_query($mysqli,"SELECT * FROM recurring, clients, categories WHERE recurring.client_id = clients.client_id AND recurring.category_id = categories.category_id AND recurring.company_id = $session_company_id");
while($row = mysqli_fetch_array($sql)){
$recurring_id = $row['recurring_id'];
$recurring_next_date = $row['recurring_next_date'];
$recurring_amount = $row['recurring_amount'];
$category_name = $row['category_name'];
$client_name = addslashes($row['client_name']);
echo "{ id: '$recurring_id', title: '$category_name - $$recurring_amount', start: '$recurring_next_date', color: 'green'},";
}
?>
],
});
calendar.render();
});
</script>

View File

@ -1,141 +0,0 @@
<?php
//
// //Rebuild URL
//
//$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
//
////Paging
//if(isset($_GET['p'])){
// $p = intval($_GET['p']);
// $record_from = (($p)-1)*$_SESSION['records_per_page'];
// $record_to = $_SESSION['records_per_page'];
//}else{
// $record_from = 0;
// $record_to = $_SESSION['records_per_page'];
// $p = 1;
//}
//
//if(isset($_GET['q'])){
// $q = mysqli_real_escape_string($mysqli,$_GET['q']);
//}else{
// $q = "";
//}
//
//if(!empty($_GET['sb'])){
// $sb = mysqli_real_escape_string($mysqli,$_GET['sb']);
//}else{
// $sb = "invoice_date";
//}
//
//if(isset($_GET['o'])){
// if($_GET['o'] == 'ASC'){
// $o = "ASC";
// $disp = "DESC";
// }else{
// $o = "DESC";
// $disp = "ASC";
// }
//}else{
// $o = "DESC";
// $disp = "ASC";
//}
//
//
//$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM invoices
// WHERE client_id = $client_id
// AND (invoice_number LIKE '%$q%')
// 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];
//$total_pages = ceil($total_found_rows / 10);
//
//?>
<!---->
<!--<div class="card">-->
<!-- <div class="card-header bg-dark text-white">-->
<!-- <h6 class="float-left mt-1"><i class="fa fa-credit-card"></i> Payments</h6>-->
<!-- </div>-->
<!-- <div class="card-body">-->
<!-- <form autocomplete="off">-->
<!-- <input type="hidden" name="client_id" value="--><?php //echo $client_id; ?><!--">-->
<!-- <input type="hidden" name="tab" value="--><?php //echo $_GET['tab']; ?><!--">-->
<!-- <div class="input-group">-->
<!-- <input type="search" class="form-control " name="q" value="--><?php //if(isset($q)){echo stripslashes($q);} ?><!--" placeholder="Search --><?php //echo ucwords($_GET['tab']); ?><!--">-->
<!-- <div class="input-group-append">-->
<!-- <button class="btn btn-secondary"><i class="fa fa-search"></i></button>-->
<!-- </div>-->
<!-- </div>-->
<!-- </form>-->
<!-- <hr>-->
<!-- <div class="table-responsive">-->
<!-- <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-secondary" href="?--><?php //echo $url_query_strings_sb; ?><!--&sb=invoice_date&o=--><?php //echo $disp; ?><!--">Date</a></th>-->
<!-- <th><a class="text-secondary" href="?--><?php //echo $url_query_strings_sb; ?><!--&sb=invoice_due&o=--><?php //echo $disp; ?><!--">Due</a></th>-->
<!-- <th><a class="text-secondary" href="?--><?php //echo $url_query_strings_sb; ?><!--&sb=invoice_number&o=--><?php //echo $disp; ?><!--">Invoice</a></th>-->
<!-- <th class="text-right"><a class="text-secondary" href="?--><?php //echo $url_query_strings_sb; ?><!--&sb=invoice_amount&o=--><?php //echo $disp; ?><!--">Invoice Amount</a></th>-->
<!-- </tr>-->
<!-- </thead>-->
<!-- <tbody>-->
<!-- --><?php
//
// while($row = mysqli_fetch_array($sql)){
// $invoice_id = $row['invoice_id'];
// $invoice_number = $row['invoice_number'];
// $invoice_status = $row['invoice_status'];
// $invoice_amount = $row['invoice_amount'];
// $invoice_date = $row['invoice_date'];
// $invoice_due = $row['invoice_due'];
//
// ?>
<!-- <tr>-->
<!-- <td><a href="invoice.php?invoice_id=--><?php //echo $invoice_id; ?><!--">--><?php //echo $invoice_date; ?><!--</a></td>-->
<!-- <td>--><?php //echo $invoice_due; ?><!--</td>-->
<!-- <td><a href="invoice.php?invoice_id=--><?php //echo $invoice_id; ?><!--">--><?php //echo $invoice_number; ?><!--</a></td>-->
<!-- <td class="text-right text-monospace">$--><?php //echo number_format($invoice_amount,2); ?><!--</td>-->
<!-- </tr>-->
<!---->
<!-- <tr> -->
<!-- <th>Date Recieved</th>-->
<!-- <th>Payment Method</th>-->
<!-- <th>Payment Reference</th>-->
<!-- <th>Payment Amount</a></th>-->
<!-- </tr>-->
<!---->
<!---->
<!-- --><?php
//
// $sql = mysqli_query($mysqli,"SELECT * FROM payments WHERE invoice_id = $invoice_id ORDER BY payment_date DESC");
//
// while($row = mysqli_fetch_array($sql)){
// $payment_id = $row['payment_id'];
// $payment_method = $row['payment_method'];
// $payment_reference = $row['payment_reference'];
// $payment_amount = $row['payment_amount'];
// $payment_date = $row['payment_date'];
//
// ?>
<!---->
<!-- <tr>-->
<!-- <td>--><?php //echo $payment_date; ?><!--</td>-->
<!-- <td>--><?php //echo $payment_method; ?><!--</td>-->
<!-- <td>--><?php //echo $payment_reference; ?><!--</td>-->
<!-- <td class="text-right text-monospace">$--><?php //echo number_format($payment_amount,2); ?><!--</td>-->
<!-- </tr>-->
<!---->
<!-- --><?php
//
// }
//
// ?>
<!---->
<!-- </tbody>-->
<!-- </table>-->
<!---->
<!-- --><?php //include("pagination.php"); ?>
<!-- -->
<!-- </div>-->
<!-- </div>-->
<!--</div>-->

View File

@ -1,250 +0,0 @@
<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-dark-primary d-print-none">
<!-- Sidebar -->
<div class="sidebar">
<!-- Sidebar Menu -->
<nav class="mt-2">
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
<li class="nav-item">
<a href="clients.php" class="nav-link">
<i class="nav-icon fas fa-arrow-left"></i>
<p>Back to Client</p>
</a>
</li>
<li class="nav-header">CLIENT</li>
<li class="nav-item">
<a href="?client_id=<?php echo $client_id; ?>&tab=contacts" class="nav-link <?php if($_GET['tab'] == "contacts") { echo "active"; } ?>">
<i class="nav-icon fas fa-users"></i>
<p>
Contacts
<?php
if($num_contacts > 0){ ?>
<span class="right badge badge-light"><?php echo $num_contacts; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="?client_id=<?php echo $client_id; ?>&tab=locations" class="nav-link <?php if($_GET['tab'] == "locations") { echo "active"; } ?>">
<i class="nav-icon fas fa-map-marker-alt"></i>
<p>
Locations
<?php
if($num_locations > 0){ ?>
<span class="right badge badge-light"><?php echo $num_locations; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-header">ASSETS</li>
<li class="nav-item">
<a href="?client_id=<?php echo $client_id; ?>&tab=assets" class="nav-link <?php if($_GET['tab'] == "assets") { echo "active"; } ?>">
<i class="nav-icon fas fa-laptop"></i>
<p>
Assets
<?php
if($num_assets > 0){ ?>
<span class="right badge badge-light"><?php echo $num_assets; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="?client_id=<?php echo $client_id; ?>&tab=software" class="nav-link <?php if($_GET['tab'] == "software") { echo "active"; } ?>">
<i class="nav-icon fas fa-rocket"></i>
<p>
Software
<?php
if($num_software > 0){ ?>
<span class="right badge badge-light"><?php echo $num_software; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="?client_id=<?php echo $client_id; ?>&tab=logins" class="nav-link <?php if($_GET['tab'] == "logins") { echo "active"; } ?>">
<i class="nav-icon fas fa-key"></i>
<p>
Logins
<?php
if($num_logins > 0){ ?>
<span class="right badge badge-light"><?php echo $num_logins; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="?client_id=<?php echo $client_id; ?>&tab=networks" class="nav-link <?php if($_GET['tab'] == "networks") { echo "active"; } ?>">
<i class="nav-icon fas fa-network-wired"></i>
<p>
Networks
<?php
if($num_networks > 0){ ?>
<span class="right badge badge-light"><?php echo $num_networks; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="?client_id=<?php echo $client_id; ?>&tab=domains" class="nav-link <?php if($_GET['tab'] == "domains") { echo "active"; } ?>">
<i class="nav-icon fas fa-globe"></i>
<p>
Domains
<?php
if($num_domains > 0){ ?>
<span class="right badge badge-light"><?php echo $num_domains; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-header">SUPPORT</li>
<li class="nav-item">
<a href="?client_id=<?php echo $client_id; ?>&tab=tickets" class="nav-link <?php if($_GET['tab'] == "tickets") { echo "active"; } ?>">
<i class="nav-icon fas fa-tags"></i>
<p>
Tickets
<?php
if($num_tickets > 0){ ?>
<span class="right badge badge-light"><?php echo $num_tickets; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="?client_id=<?php echo $client_id; ?>&tab=vendors" class="nav-link <?php if($_GET['tab'] == "vendors") { echo "active"; } ?>">
<i class="nav-icon fas fa-building"></i>
<p>
Vendors
<?php
if($num_vendors > 0){ ?>
<span class="right badge badge-light"><?php echo $num_vendors; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="?client_id=<?php echo $client_id; ?>&tab=events" class="nav-link <?php if($_GET['tab'] == "events") { echo "active"; } ?>">
<i class="nav-icon fas fa-calendar"></i>
<p>
Events
<?php
if($num_events > 0){ ?>
<span class="right badge badge-light"><?php echo $num_events; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="?client_id=<?php echo $client_id; ?>&tab=files" class="nav-link <?php if($_GET['tab'] == "files") { echo "active"; } ?>">
<i class="nav-icon fas fa-paperclip"></i>
<p>
Files
<?php
if($num_files > 0){ ?>
<span class="right badge badge-light"><?php echo $num_files; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="?client_id=<?php echo $client_id; ?>&tab=notes" class="nav-link <?php if($_GET['tab'] == "notes") { echo "active"; } ?>">
<i class="nav-icon fas fa-edit"></i>
<p>
Notes
<?php
if($num_notes > 0){ ?>
<span class="right badge badge-light"><?php echo $num_notes; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-header">SALES AND ACCOUNTING</li>
<li class="nav-item">
<a href="?client_id=<?php echo $client_id; ?>&tab=invoices" class="nav-link <?php if($_GET['tab'] == "invoices") { echo "active"; } ?>">
<i class="nav-icon fas fa-file"></i>
<p>
Invoices
<?php
if($num_invoices > 0){ ?>
<span class="right badge badge-light"><?php echo $num_invoices; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="?client_id=<?php echo $client_id; ?>&tab=recurring" class="nav-link <?php if($_GET['tab'] == "recurring") { echo "active"; } ?>">
<i class="nav-icon fas fa-copy"></i>
<p>
Recurring
<?php
if($num_recurring > 0){ ?>
<span class="right badge badge-light"><?php echo $num_recurring; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="?client_id=<?php echo $client_id; ?>&tab=quotes" class="nav-link <?php if($_GET['tab'] == "quotes") { echo "active"; } ?>">
<i class="nav-icon fas fa-file"></i>
<p>
Quotes
<?php
if($num_quotes > 0){ ?>
<span class="right badge badge-light"><?php echo $num_quotes; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="?client_id=<?php echo $client_id; ?>&tab=payments" class="nav-link <?php if($_GET['tab'] == "payments") { echo "active"; } ?>">
<i class="nav-icon fas fa-credit-card"></i>
<p>
Payments
<?php
if($num_payments > 0){ ?>
<span class="right badge badge-light"><?php echo $num_payments; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="?client_id=<?php echo $client_id; ?>&tab=trips" class="nav-link <?php if($_GET['tab'] == "trips") { echo "active"; } ?>">
<i class="nav-icon fas fa-route"></i>
<p>
Trips
<?php
if($num_trips > 0){ ?>
<span class="right badge badge-light"><?php echo $num_trips; ?></span>
<?php } ?>
</p>
</a>
</li>
</ul>
</nav>
<!-- /.sidebar-menu -->
</div>
<!-- /.sidebar -->
</aside>

View File

@ -1,183 +0,0 @@
<?php include("header.php");
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
//Paging
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*$_SESSION['records_per_page'];
$record_to = $_SESSION['records_per_page'];
}else{
$record_from = 0;
$record_to = $_SESSION['records_per_page'];
$p = 1;
}
if(isset($_GET['q'])){
$q = mysqli_real_escape_string($mysqli,$_GET['q']);
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = mysqli_real_escape_string($mysqli,$_GET['sb']);
}else{
$sb = "contact_name";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "ASC";
$disp = "DESC";
}
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM contacts, clients WHERE contacts.client_id = clients.client_id AND contacts.company_id = $session_company_id AND (contact_name LIKE '%$q%') 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];
$total_pages = ceil($total_found_rows / 10);
?>
<div class="card">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-users mr-2"></i>Contacts</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addContactModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<input type="hidden" name="tab" value="<?php echo $_GET['tab']; ?>">
<div class="input-group">
<input type="search" class="form-control " name="q" value="<?php if(isset($q)){echo stripslashes($q);} ?>" placeholder="Search Contacts">
<div class="input-group-append">
<button class="btn btn-secondary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark <?php if($num_rows[0] == 0){ echo "d-none"; } ?>">
<tr>
<th class="text-center"><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=contact_name&o=<?php echo $disp; ?>">Name</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=client_name&o=<?php echo $disp; ?>">Client</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=contact_title&o=<?php echo $disp; ?>">Title</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=contact_email&o=<?php echo $disp; ?>">Email</a></th>
<th>Phone</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
<?php
while($row = mysqli_fetch_array($sql)){
$contact_id = $row['contact_id'];
$contact_name = $row['contact_name'];
$contact_title = $row['contact_title'];
$contact_phone = $row['contact_phone'];
if(strlen($contact_phone)>2){
$contact_phone = substr($row['contact_phone'],0,3)."-".substr($row['contact_phone'],3,3)."-".substr($row['contact_phone'],6,4);
}
$contact_extension = $row['contact_extension '];
$contact_mobile = $row['contact_mobile'];
if(strlen($contact_mobile)>2){
$contact_mobile = substr($row['contact_mobile'],0,3)."-".substr($row['contact_mobile'],3,3)."-".substr($row['contact_mobile'],6,4);
}
$contact_email = $row['contact_email'];
$contact_photo = $row['contact_photo'];
$contact_initials = initials($contact_name);
$client_id = $row['client_id'];
$client_name = $row['client_name'];
$contact_notes = $row['contact_notes'];
?>
<tr>
<td class="text-center">
<a class="text-dark" href="#" data-toggle="modal" data-target="#editContactModal<?php echo $contact_id; ?>">
<?php if(!empty($contact_photo)){ ?>
<img height="48" width="48" class="img-fluid rounded-circle" src="<?php echo $contact_photo; ?>">
<?php }else{ ?>
<span class="fa-stack fa-2x">
<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>
<br>
<?php } ?>
<div class="text-secondary"><?php echo $contact_name; ?></div>
</a>
</td>
<td><?php echo $client_name; ?></td>
<td><?php echo $contact_title; ?></td>
<td><a href="mailto:<?php echo $contact_email; ?>"><?php echo $contact_email; ?></a></td>
<td>
<?php
if(!empty($contact_phone)){
?>
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $contact_phone; ?> <?php echo $contact_extension; ?>
<br>
<?php
}
?>
<?php
if(!empty($contact_mobile)){
?>
<i class="fa fa-fw fa-mobile-alt text-secondary mr-2 mb-2"></i><?php echo $contact_mobile; ?>
<br>
<?php
}
?>
</td>
<td>
<div class="dropdown dropleft text-center">
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown">
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editContactModal<?php echo $contact_id; ?>">Edit</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="post.php?archive_contact=<?php echo $contact_id; ?>">Archive</a>
<a class="dropdown-item" href="post.php?delete_contact=<?php echo $contact_id; ?>">Delete</a>
</div>
</div>
<?php include("edit_contact_modal.php"); ?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>
<?php
include("add_contact_modal.php");
include("footer.php");
?>

View File

@ -1,17 +0,0 @@
<div class="modal" id="deleteConfirmModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-trash mr-2"></i><?php echo basename($file_name); ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<center>
<h3>Are You sure you want to Delete?</h3>
</center>
</div>
</div>
</div>

View File

@ -1,142 +0,0 @@
<?php include("header.php");
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
//Paging
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*$_SESSION['records_per_page'];
$record_to = $_SESSION['records_per_page'];
}else{
$record_from = 0;
$record_to = $_SESSION['records_per_page'];
$p = 1;
}
if(isset($_GET['q'])){
$q = mysqli_real_escape_string($mysqli,$_GET['q']);
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = mysqli_real_escape_string($mysqli,$_GET['sb']);
}else{
$sb = "domain_id";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "ASC";
$disp = "DESC";
}
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM domains, clients
WHERE domains.client_id = clients.client_id AND domains.company_id = $session_company_id AND (domain_name LIKE '%$q%')
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];
$total_pages = ceil($total_found_rows / 10);
?>
<div class="card">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-globe"></i> Domains</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addDomainModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<div class="input-group">
<input type="search" class="form-control " name="q" value="<?php if(isset($q)){echo stripslashes($q);} ?>" placeholder="Search Domains">
<div class="input-group-append">
<button class="btn btn-secondary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<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-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=domain_name&o=<?php echo $disp; ?>">Domain</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=client_name&o=<?php echo $disp; ?>">Client</a></th>
<th>Registrar</th>
<th>WebHost</th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=domain_expire&o=<?php echo $disp; ?>">Expire</a></th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
<?php
while($row = mysqli_fetch_array($sql)){
$domain_id = $row['domain_id'];
$domain_name = $row['domain_name'];
$domain_registrar = $row['domain_registrar'];
$domain_webhost = $row['domain_webhost'];
$domain_expire = $row['domain_expire'];
$domain_created_at = $row['domain_created_at'];
$client_id = $row['client_id'];
$client_name = $row['client_name'];
$sql_domain_registrar = mysqli_query($mysqli,"SELECT vendor_name FROM vendors WHERE vendor_id = $domain_registrar");
$row = mysqli_fetch_array($sql_domain_registrar);
$domain_registrar_name = $row['vendor_name'];
$sql_domain_webhost = mysqli_query($mysqli,"SELECT vendor_name FROM vendors WHERE vendor_id = $domain_webhost");
$row = mysqli_fetch_array($sql_domain_webhost);
$domain_webhost_name = $row['vendor_name'];
?>
<tr>
<td><a class="text-dark" href="#" data-toggle="modal" data-target="#editDomainModal<?php echo $domain_id; ?>"><?php echo $domain_name; ?></a></td>
<td><?php echo $client_name; ?></td>
<td><?php echo $domain_registrar_name; ?></td>
<td><?php echo $domain_webhost_name; ?></td>
<td><?php echo $domain_expire; ?></td>
<td>
<div class="dropdown dropleft text-center">
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editDomainModal<?php echo $domain_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_domain=<?php echo $domain_id; ?>">Delete</a>
</div>
</div>
<?php include("edit_domain_modal.php"); ?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<?php include("pagination.php"); ?>
</div>
</div>
<?php
include("add_domain_modal.php");
include("footer.php");
?>

View File

@ -1,47 +0,0 @@
<?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;
}
?>

View File

@ -1,30 +0,0 @@
<?php include("inc_all.php"); ?>
<div class="row justify-content-md-center">
<div class="col-md-5">
<div class="card mt-5">
<div class="card-body bg-light text-center">
<h2 class="mb-3">Hey! Wheres the party?</h2>
<i class="far fa-fw fa-4x fa-frown-open mb-3"></i>
<h4 class="mb-4">why not invite someone over?</h4>
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#addClientModal"><i class="fas fa-fw fa-plus"></i></button>
</div>
</div>
</div>
</div>
<div class="row justify-content-md-center">
<div class="col-md-5">
<div class="card mt-5">
<div class="card-body bg-light text-center">
<h2 class="mb-3">We don't know where we're going?</h2>
<i class="far fa-fw fa-4x fa-frown-open mb-3"></i>
<h4 class="mb-4">why not invite someone over?</h4>
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#addClientModal"><i class="fas fa-fw fa-plus"></i></button>
</div>
</div>
</div>
</div>
<?php include("add_client_modal.php"); ?>
<?php include("footer.php"); ?>

View File

@ -1,377 +0,0 @@
<?php include("header.php"); ?>
<?php
if(isset($_GET['year'])){
$year = intval($_GET['year']);
}else{
$year = date('Y');
}
$sql_categories_income = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND company_id = $session_company_id ORDER BY category_name ASC");
$sql_categories_expense = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Expense' AND company_id = $session_company_id ORDER BY category_name ASC");
?>
<h3 class="text-center mb-3">Profit & Loss <?php echo $year; ?> <?php echo $config_company_name; ?></h3>
<table class="table table-sm">
<thead>
<tr>
<th></th>
<th class="text-right">Jan-Mar</th>
<th class="text-right">Apr-Jun</th>
<th class="text-right">Jul-Sep</th>
<th class="text-right">Oct-Dec</th>
<th class="text-right">Total</th>
</tr>
<tr>
<th><br><br>Income</th>
<th colspan="5"></th>
</tr>
</thead>
<tbody>
<?php
while($row = mysqli_fetch_array($sql_categories_income)){
$category_id = $row['category_id'];
$category_name = $row['category_name'];
?>
<tr>
<td><?php echo $category_name; ?></td>
<?php
for($month = 1; $month<=3; $month++) {
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS payment_amount_for_month FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND invoices.category_id = $category_id AND YEAR(payment_date) = $year AND MONTH(payment_date) = $month");
$row = mysqli_fetch_array($sql_payments);
$payment_amount_for_month = $row['payment_amount_for_month'];
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenues.category_id = $category_id AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month");
$row = mysqli_fetch_array($sql_revenues);
$revenue_amount_for_month = $row['revenue_amount_for_month'];
$payment_amount_for_month = $payment_amount_for_month + $revenue_amount_for_month;
$payment_amount_for_quarter_one = $payment_amount_for_quarter_one + $payment_amount_for_month;
}
?>
<td class="text-right text-monospace">$<?php echo number_format($payment_amount_for_quarter_one,2); ?></td>
<?php
for($month = 4; $month<=6; $month++) {
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS payment_amount_for_month FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND invoices.category_id = $category_id AND YEAR(payment_date) = $year AND MONTH(payment_date) = $month");
$row = mysqli_fetch_array($sql_payments);
$payment_amount_for_month = $row['payment_amount_for_month'];
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenues.category_id = $category_id AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month");
$row = mysqli_fetch_array($sql_revenues);
$revenue_amount_for_month = $row['revenue_amount_for_month'];
$payment_amount_for_month = $payment_amount_for_month + $revenue_amount_for_month;
$payment_amount_for_quarter_two = $payment_amount_for_quarter_two + $payment_amount_for_month;
}
?>
<td class="text-right text-monospace">$<?php echo number_format($payment_amount_for_quarter_two,2); ?></td>
<?php
for($month = 7; $month<=9; $month++) {
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS payment_amount_for_month FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND invoices.category_id = $category_id AND YEAR(payment_date) = $year AND MONTH(payment_date) = $month");
$row = mysqli_fetch_array($sql_payments);
$payment_amount_for_month = $row['payment_amount_for_month'];
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenues.category_id = $category_id AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month");
$row = mysqli_fetch_array($sql_revenues);
$revenue_amount_for_month = $row['revenue_amount_for_month'];
$payment_amount_for_month = $payment_amount_for_month + $revenue_amount_for_month;
$payment_amount_for_quarter_three = $payment_amount_for_quarter_three + $payment_amount_for_month;
}
?>
<td class="text-right text-monospace">$<?php echo number_format($payment_amount_for_quarter_three,2); ?></td>
<?php
for($month = 10; $month<=12; $month++) {
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS payment_amount_for_month FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND invoices.category_id = $category_id AND YEAR(payment_date) = $year AND MONTH(payment_date) = $month");
$row = mysqli_fetch_array($sql_payments);
$payment_amount_for_month = $row['payment_amount_for_month'];
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenues.category_id = $category_id AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month");
$row = mysqli_fetch_array($sql_revenues);
$revenue_amount_for_month = $row['revenue_amount_for_month'];
$payment_amount_for_month = $payment_amount_for_month + $revenue_amount_for_month;
$payment_amount_for_quarter_four = $payment_amount_for_quarter_four + $payment_amount_for_month;
}
$total_payments_for_all_four_quarters = $payment_amount_for_quarter_one + $payment_amount_for_quarter_two + $payment_amount_for_quarter_three + $payment_amount_for_quarter_four;
?>
<td class="text-right text-monospace">$<?php echo number_format($payment_amount_for_quarter_four,2); ?></td>
<td class="text-right text-monospace">$<?php echo number_format($total_payments_for_all_four_quarters,2); ?></td>
</tr>
<?php
$payment_amount_for_quarter_one = 0;
$payment_amount_for_quarter_two = 0;
$payment_amount_for_quarter_three = 0;
$payment_amount_for_quarter_four = 0;
$total_payment_for_all_months = 0;
}
?>
<tr>
<th>Gross Profit</th>
<?php
for($month = 1; $month<=3; $month++) {
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS payment_total_amount_for_month FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND YEAR(payment_date) = $year AND MONTH(payment_date) = $month AND payments.company_id = $session_company_id");
$row = mysqli_fetch_array($sql_payments);
$payment_total_amount_for_month = $row['payment_total_amount_for_month'];
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_total_amount_for_month FROM revenues WHERE category_id > 0 AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month AND revenues.company_id = $session_company_id");
$row = mysqli_fetch_array($sql_revenues);
$revenue_total_amount_for_month = $row['revenue_total_amount_for_month'];
$payment_total_amount_for_month = $payment_total_amount_for_month + $revenue_total_amount_for_month;
$payment_total_amount_for_quarter_one = $payment_total_amount_for_quarter_one + $payment_total_amount_for_month;
}
?>
<th class="text-right text-monospace">$<?php echo number_format($payment_total_amount_for_quarter_one,2); ?></th>
<?php
for($month = 4; $month<=6; $month++) {
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS payment_total_amount_for_month FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND YEAR(payment_date) = $year AND MONTH(payment_date) = $month AND payments.company_id = $session_company_id");
$row = mysqli_fetch_array($sql_payments);
$payment_total_amount_for_month = $row['payment_total_amount_for_month'];
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_total_amount_for_month FROM revenues WHERE category_id > 0 AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month AND revenues.company_id = $session_company_id");
$row = mysqli_fetch_array($sql_revenues);
$revenue_total_amount_for_month = $row['revenue_total_amount_for_month'];
$payment_total_amount_for_month = $payment_total_amount_for_month + $revenue_total_amount_for_month;
$payment_total_amount_for_quarter_two = $payment_total_amount_for_quarter_two + $payment_total_amount_for_month;
}
?>
<th class="text-right text-monospace">$<?php echo number_format($payment_total_amount_for_quarter_two,2); ?></th>
<?php
for($month = 7; $month<=9; $month++) {
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS payment_total_amount_for_month FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND YEAR(payment_date) = $year AND MONTH(payment_date) = $month AND payments.company_id = $session_company_id");
$row = mysqli_fetch_array($sql_payments);
$payment_total_amount_for_month = $row['payment_total_amount_for_month'];
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_total_amount_for_month FROM revenues WHERE category_id > 0 AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month AND revenues.company_id = $session_company_id");
$row = mysqli_fetch_array($sql_revenues);
$revenue_total_amount_for_month = $row['revenue_total_amount_for_month'];
$payment_total_amount_for_month = $payment_total_amount_for_month + $revenue_total_amount_for_month;
$payment_total_amount_for_quarter_three = $payment_total_amount_for_quarter_three + $payment_total_amount_for_month;
}
?>
<th class="text-right text-monospace">$<?php echo number_format($payment_total_amount_for_quarter_three,2); ?></th>
<?php
for($month = 10; $month<=12; $month++) {
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS payment_total_amount_for_month FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND YEAR(payment_date) = $year AND MONTH(payment_date) = $month AND payments.company_id = $session_company_id");
$row = mysqli_fetch_array($sql_payments);
$payment_total_amount_for_month = $row['payment_total_amount_for_month'];
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_total_amount_for_month FROM revenues WHERE category_id > 0 AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month AND revenues.company_id = $session_company_id");
$row = mysqli_fetch_array($sql_revenues);
$revenue_total_amount_for_month = $row['revenue_total_amount_for_month'];
$payment_total_amount_for_month = $payment_total_amount_for_month + $revenue_total_amount_for_month;
$payment_total_amount_for_quarter_four = $payment_total_amount_for_quarter_four + $payment_total_amount_for_month;
}
$total_payments_for_all_four_quarters = $payment_total_amount_for_quarter_one + $payment_total_amount_for_quarter_two + $payment_total_amount_for_quarter_three + $payment_total_amount_for_quarter_four;
?>
<th class="text-right text-monospace">$<?php echo number_format($payment_total_amount_for_quarter_four,2); ?></th>
<th class="text-right text-monospace">$<?php echo number_format($total_payments_for_all_four_quarters,2); ?></th>
</tr>
<tr>
<th><br><br>Expenses</th>
<th colspan="5"></th>
</tr>
<?php
while($row = mysqli_fetch_array($sql_categories_expense)){
$category_id = $row['category_id'];
$category_name = $row['category_name'];
?>
<tr>
<td><?php echo $category_name; ?></td>
<?php
for($month = 1; $month<=3; $month++) {
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_amount_for_month FROM expenses WHERE category_id = $category_id AND YEAR(expense_date) = $year AND MONTH(expense_date) = $month");
$row = mysqli_fetch_array($sql_expenses);
$expense_amount_for_quarter_one = $expense_amount_for_quarter_one + $row['expense_amount_for_month'];
}
?>
<td class="text-right text-monospace">$<?php echo number_format($expense_amount_for_quarter_one,2); ?></td>
<?php
for($month = 4; $month<=6; $month++) {
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_amount_for_month FROM expenses WHERE category_id = $category_id AND YEAR(expense_date) = $year AND MONTH(expense_date) = $month");
$row = mysqli_fetch_array($sql_expenses);
$expense_amount_for_quarter_two = $expense_amount_for_quarter_two + $row['expense_amount_for_month'];
}
?>
<td class="text-right text-monospace">$<?php echo number_format($expense_amount_for_quarter_two,2); ?></td>
<?php
for($month = 7; $month<=9; $month++) {
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_amount_for_month FROM expenses WHERE category_id = $category_id AND YEAR(expense_date) = $year AND MONTH(expense_date) = $month");
$row = mysqli_fetch_array($sql_expenses);
$expense_amount_for_quarter_three = $expense_amount_for_quarter_three + $row['expense_amount_for_month'];
}
?>
<td class="text-right text-monospace">$<?php echo number_format($expense_amount_for_quarter_three,2); ?></td>
<?php
for($month = 10; $month<=12; $month++) {
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_amount_for_month FROM expenses WHERE category_id = $category_id AND YEAR(expense_date) = $year AND MONTH(expense_date) = $month");
$row = mysqli_fetch_array($sql_expenses);
$expense_amount_for_quarter_four = $expense_amount_for_quarter_four + $row['expense_amount_for_month'];
}
$total_expenses_for_all_four_quarters = $expense_amount_for_quarter_one + $expense_amount_for_quarter_two + $expense_amount_for_quarter_three + $expense_amount_for_quarter_four;
?>
<td class="text-right text-monospace">$<?php echo number_format($expense_amount_for_quarter_four,2); ?></td>
<td class="text-right text-monospace">$<?php echo number_format($total_expenses_for_all_four_quarters,2); ?></td>
</tr>
<?php
$expense_amount_for_quarter_one = 0;
$expense_amount_for_quarter_two = 0;
$expense_amount_for_quarter_three = 0;
$expense_amount_for_quarter_four = 0;
$total_expense_for_all_months = 0;
}
?>
<tr>
<th>Total Expenses<br><br><br></th>
<?php
for($month = 1; $month<=3; $month++) {
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_total_amount_for_month FROM expenses WHERE category_id > 0 AND YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND vendor_id > 0 AND company_id = $session_company_id");
$row = mysqli_fetch_array($sql_expenses);
$expense_total_amount_for_quarter_one = $expense_total_amount_for_quarter_one + $row['expense_total_amount_for_month'];
}
?>
<th class="text-right text-monospace">$<?php echo number_format($expense_total_amount_for_quarter_one,2); ?></th>
<?php
for($month = 4; $month<=6; $month++) {
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_total_amount_for_month FROM expenses WHERE category_id > 0 AND YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND vendor_id > 0 AND company_id = $session_company_id");
$row = mysqli_fetch_array($sql_expenses);
$expense_total_amount_for_quarter_two = $expense_total_amount_for_quarter_two + $row['expense_total_amount_for_month'];
}
?>
<th class="text-right text-monospace">$<?php echo number_format($expense_total_amount_for_quarter_two,2); ?></th>
<?php
for($month = 7; $month<=9; $month++) {
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_total_amount_for_month FROM expenses WHERE category_id > 0 AND YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND vendor_id > 0 AND company_id = $session_company_id");
$row = mysqli_fetch_array($sql_expenses);
$expense_total_amount_for_quarter_three = $expense_total_amount_for_quarter_three + $row['expense_total_amount_for_month'];
}
?>
<th class="text-right text-monospace">$<?php echo number_format($expense_total_amount_for_quarter_three,2); ?></th>
<?php
for($month = 10; $month<=12; $month++) {
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_total_amount_for_month FROM expenses WHERE category_id > 0 AND YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND vendor_id > 0 AND company_id = $session_company_id");
$row = mysqli_fetch_array($sql_expenses);
$expense_total_amount_for_quarter_four = $expense_total_amount_for_quarter_four + $row['expense_total_amount_for_month'];
}
$total_expenses_for_all_four_quarters = $expense_total_amount_for_quarter_one + $expense_total_amount_for_quarter_two + $expense_total_amount_for_quarter_three + $expense_total_amount_for_quarter_four;
?>
<th class="text-right text-monospace">$<?php echo number_format($expense_total_amount_for_quarter_four,2); ?></th>
<th class="text-right text-monospace">$<?php echo number_format($total_expenses_for_all_four_quarters,2); ?></th>
</tr>
<tr>
<?php
$net_profit_quarter_one = $payment_total_amount_for_quarter_one - $expense_total_amount_for_quarter_one;
$net_profit_quarter_two = $payment_total_amount_for_quarter_two - $expense_total_amount_for_quarter_two;
$net_profit_quarter_three = $payment_total_amount_for_quarter_three - $expense_total_amount_for_quarter_three;
$net_profit_quarter_four = $payment_total_amount_for_quarter_four - $expense_total_amount_for_quarter_four;
$net_profit_year = $total_payments_for_all_four_quarters - $total_expenses_for_all_four_quarters;
?>
<th>Net Profit</th>
<th class="text-right text-monospace">$<?php echo number_format($net_profit_quarter_one,2); ?></th>
<th class="text-right text-monospace">$<?php echo number_format($net_profit_quarter_two,2); ?></th>
<th class="text-right text-monospace">$<?php echo number_format($net_profit_quarter_three,2); ?></th>
<th class="text-right text-monospace">$<?php echo number_format($net_profit_quarter_four,2); ?></th>
<th class="text-right text-monospace">$<?php echo number_format($net_profit_year,2); ?></th>
</tr>
</tbody>
</table>
<?php include("footer.php");

View File

@ -1,140 +0,0 @@
<?php include("header.php"); ?>
<?php
if(isset($_GET['year'])){
$year = intval($_GET['year']);
}else{
$year = date('Y');
}
$sql_payment_years = mysqli_query($mysqli,"SELECT DISTINCT YEAR(invoice_date) AS payment_year FROM invoices UNION SELECT DISTINCT YEAR(revenue_date) AS payment_year FROM revenues ORDER BY payment_year DESC");
$sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND company_id = $session_company_id ORDER BY category_name ASC");
?>
<div class="card">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-coins mr-2"></i>Income Summary</h6>
<button type="button" class="btn btn-primary btn-sm float-right d-print-none" onclick="window.print();"><i class="fas fa-fw fa-print"></i> Print</button>
</div>
<div class="card-body">
<form class="mb-3">
<select onchange="this.form.submit()" class="form-control" name="year">
<?php
while($row = mysqli_fetch_array($sql_payment_years)){
$payment_year = $row['payment_year'];
?>
<option <?php if($year == $payment_year){ ?> selected <?php } ?> > <?php echo $payment_year; ?></option>
<?php
}
?>
</select>
</form>
<div class="table-responsive">
<table class="table table-striped table-sm">
<thead class="text-dark">
<tr>
<th>Category</th>
<th class="text-right">January</th>
<th class="text-right">February</th>
<th class="text-right">March</th>
<th class="text-right">April</th>
<th class="text-right">May</th>
<th class="text-right">June</th>
<th class="text-right">July</th>
<th class="text-right">August</th>
<th class="text-right">September</th>
<th class="text-right">October</th>
<th class="text-right">November</th>
<th class="text-right">December</th>
<th class="text-right">Total</th>
</tr>
</thead>
<tbody>
<?php
while($row = mysqli_fetch_array($sql_categories)){
$category_id = $row['category_id'];
$category_name = $row['category_name'];
?>
<tr>
<td><?php echo $category_name; ?></td>
<?php
for($month = 1; $month<=12; $month++) {
//Payments to Invoices
$sql_payments = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS payment_amount_for_month FROM invoices WHERE invoices.category_id = $category_id AND YEAR(invoice_date) = $year AND MONTH(invoice_date) = $month");
$row = mysqli_fetch_array($sql_payments);
$payment_amount_for_month = $row['payment_amount_for_month'];
//Revenues
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenues.category_id = $category_id AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month");
$row = mysqli_fetch_array($sql_revenues);
$revenues_amount_for_month = $row['revenue_amount_for_month'];
$payment_amount_for_month = $payment_amount_for_month + $revenues_amount_for_month;
$total_payment_for_all_months = $payment_amount_for_month + $total_payment_for_all_months;
?>
<td class="text-right text-monospace">$<?php echo number_format($payment_amount_for_month,2); ?></td>
<?php
}
?>
<td class="text-right text-monospace">$<?php echo number_format($total_payment_for_all_months,2); ?></td>
</tr>
<?php
$total_payment_for_all_months = 0;
}
?>
<tr>
<th>Total</th>
<?php
for($month = 1; $month<=12; $month++) {
$sql_payments = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS payment_total_amount_for_month FROM invoices WHERE YEAR(invoice_date) = $year AND MONTH(invoice_date) = $month AND invoices.company_id = $session_company_id");
$row = mysqli_fetch_array($sql_payments);
$payment_total_amount_for_month = $row['payment_total_amount_for_month'];
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE category_id > 0 AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month AND revenues.company_id = $session_company_id");
$row = mysqli_fetch_array($sql_revenues);
$revenues_total_amount_for_month = $row['revenue_amount_for_month'];
$payment_total_amount_for_month = $payment_total_amount_for_month + $revenues_total_amount_for_month;
$total_payment_for_all_months = $payment_total_amount_for_month + $total_payment_for_all_months;
?>
<th class="text-right text-monospace">$<?php echo number_format($payment_total_amount_for_month,2); ?></th>
<?php
}
?>
<th class="text-right text-monospace">$<?php echo number_format($total_payment_for_all_months,2); ?></th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<?php include("footer.php");

View File

@ -1,4 +0,0 @@
<?php include("header.php"); ?>
<h1>Content</h1>
<input type="text" data-inputmask="'alias': 'ip'" data-mask>
<?php include("footer.php"); ?>

View File

@ -1,80 +0,0 @@
<?php
function hotp (string $algo, string $key, int $count, int $length = 6)
{
// hmac $count as uint64 (big endian) with binary $key
$hmac = hash_hmac($algo, pack("J", $count), $key, TRUE);
// get least significant nibble of our $hmac, yielding $offset values 0..15
$offset = unpack("C", $hmac, strlen($hmac)-1)[1] & 0x0F;
// extract a uint32 (big endian) from our $hmac, and mask the most significant bit (the sign bit)
$number = unpack("N", $hmac, $offset)[1] & 0x7FFFFFFF;
// return token based on $number in $length decimal digits, padded with leading zeros
return str_pad($number % (10 ** $length), $length, "0", STR_PAD_LEFT);
}
function totp (string $algo, string $key, int $unixtime, int $interval = 30, int $length = 6)
{
return hotp($algo, $key, intdiv($unixtime, $interval), $length);
}
function hotp_token_ok (string $token, string $algo, string $key, int $count, int $window = 10, int $length = 6)
{
$ok = FALSE;
for ($i = -$window; $i <= $window; $i++)
{
$ok |= hash_equals(hotp($algo, $key, ($count + $i), $length), $token);
}
return $ok;
}
function totp_token_ok (string $token, string $algo, string $key, int $unixtime, int $window = 300, int $interval = 30, int $length = 6)
{
return hotp_token_ok($algo, $key, $token, intdiv($unixtime, $interval), intdiv($window, $interval), $length);
}
function key32gen()
{
$chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$chars .= "234567";
while (1) {
$key = '';
srand((double) microtime() * 1000000);
for ($i = 0; $i < 32; $i++) {
$key .= substr($chars, (rand() % (strlen($chars))), 1);
}
break;
}
return $key;
}
$unixtimestamp = time();
//$unixtimestamp = "1638664893";
//$secretkey = key32gen();
$secretkey = "";
echo "Unix Time is: $unixtimestamp<br>";
echo "secret Key is: $secretkey<br>";
$test = totp("sha1","$secretkey","$unixtimestamp",30,6);
echo "<br>code is: $test";
?>

View File

@ -1,12 +0,0 @@
<?php
require_once("rfc6238.php");
$secretkey = "";
$gen = TokenAuth6238::getTokenCode($secretkey,$rangein30s = 3);
echo $gen;
?>

View File

@ -1,70 +0,0 @@
<?php include("header.php"); ?>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM payments, invoices, clients, accounts
WHERE invoices.client_id = clients.client_id
AND payments.invoice_id = invoices.invoice_id
AND payments.account_id = accounts.account_id
AND payments.company_id = $session_company_id
ORDER BY payments.payment_id DESC");
?>
<div class="card mb-3">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-credit-card"></i> Payments</h6>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>Date</th>
<th>Description</th>
<th>Payment Method</th>
<th class="text-right">Debit</th>
<th class="text-right">Credit</th>
<th class="text-right">Balance</th>
</tr>
</thead>
<tbody>
<?php
while($row = mysqli_fetch_array($sql)){
$invoice_id = $row['invoice_id'];
$invoice_number = $row['invoice_number'];
$invoice_status = $row['invoice_status'];
$payment_date = $row['payment_date'];
$payment_method = $row['payment_method'];
$payment_amount = $row['payment_amount'];
$client_id = $row['client_id'];
$client_name = $row['client_name'];
$account_name = $row['account_name'];
?>
<tr>
<td><?php echo $payment_date; ?></td>
<td><a href="invoice.php?invoice_id=<?php echo $invoice_id; ?>">INV-<?php echo $invoice_number; ?></a></td>
<td><a href="client.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a></td>
<td class="text-right text-monospace">$<?php echo number_format($payment_amount,2); ?></td>
<td><?php echo $account_name; ?></td>
<td><?php echo $payment_method; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div>
</div>
<?php include("footer.php");