mirror of https://github.com/itflow-org/itflow
Fixed date error in cron.php regarding past due invoices
This commit is contained in:
parent
709f88e1ee
commit
eddb065833
7
cron.php
7
cron.php
|
|
@ -10,7 +10,7 @@ $domainAlertArray = [1, 14, 30, 90];
|
|||
|
||||
foreach ($domainAlertArray as $day) {
|
||||
|
||||
//Get Domains Expiring within 1 days
|
||||
//Get Domains Expiring
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM domains, clients
|
||||
WHERE domains.client_id = clients.client_id
|
||||
AND domain_expire = CURDATE() + INTERVAL $day DAY
|
||||
|
|
@ -24,7 +24,7 @@ foreach ($domainAlertArray as $day) {
|
|||
$client_id = $row['client_id'];
|
||||
$client_name = $row['client_name'];
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Domain', alert_message = 'Domain $domain_name will expire $day Days on $domain_expire', alert_date = CURDATE()");
|
||||
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Domain', alert_message = 'Domain $domain_name will expire in $day Days on $domain_expire', alert_date = CURDATE()");
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -38,11 +38,10 @@ foreach ($invoiceAlertArray as $day) {
|
|||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM invoices, clients
|
||||
WHERE invoices.client_id = clients.client_id
|
||||
AND invoices.invoice_number > 0
|
||||
AND invoices.invoice_status NOT LIKE 'Draft'
|
||||
AND invoices.invoice_status NOT LIKE 'Paid'
|
||||
AND invoices.invoice_status NOT LIKE 'Cancelled'
|
||||
AND invoices.invoice_due = CURDATE() + INTERVAL $day DAY
|
||||
AND DATE_ADD(invoices.invoice_due, INTERVAL $day DAY) = CURDATE()
|
||||
ORDER BY invoices.invoice_number DESC"
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -42,12 +42,17 @@
|
|||
<?php include("top_nav.php"); ?>
|
||||
|
||||
<div id="wrapper">
|
||||
|
||||
<?php
|
||||
if(basename(parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH)) == "client.php" or basename(parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH)) == "client_print.php"){
|
||||
|
||||
if(basename(parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH)) == "client.php"){
|
||||
include("client_side_nav.php");
|
||||
}elseif(basename(parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH)) == "client_print.php"){
|
||||
|
||||
}else{
|
||||
include("side_nav.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div id="content-wrapper">
|
||||
|
|
|
|||
8
post.php
8
post.php
|
|
@ -241,14 +241,6 @@ if(isset($_POST['add_client'])){
|
|||
|
||||
$client_id = mysqli_insert_id($mysqli);
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO contacts SET contact_name = '$name', contact_title = 'Main Contact', contact_phone = '$phone', contact_email = '$email', contact_created_at = NOW(), client_id = $client_id");
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO locations SET location_name = 'Main', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_phone = '$phone', location_created_at = NOW(), client_id = $client_id");
|
||||
|
||||
if(!empty($_POST['website'])) {
|
||||
mysqli_query($mysqli,"INSERT INTO domains SET domain_name = '$website', domain_created_at = NOW(), client_id = $client_id");
|
||||
}
|
||||
|
||||
mkdir("uploads/clients/$client_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Client added";
|
||||
|
|
|
|||
Loading…
Reference in New Issue