mirror of https://github.com/itflow-org/itflow
Replaced old notification with new appNotify in all the Guest_ PHP Scripts
This commit is contained in:
parent
53724c3012
commit
a5cd1e1f1a
|
|
@ -1,15 +1,13 @@
|
|||
<?php
|
||||
|
||||
require_once "config.php";
|
||||
require_once "functions.php";
|
||||
|
||||
session_start();
|
||||
|
||||
// Set Timezone
|
||||
require_once "inc_set_timezone.php";
|
||||
|
||||
require_once "functions.php";
|
||||
|
||||
|
||||
session_start();
|
||||
|
||||
$ip = sanitizeInput(getIP());
|
||||
$user_agent = sanitizeInput($_SERVER['HTTP_USER_AGENT']);
|
||||
$os = sanitizeInput(getOS($user_agent));
|
||||
|
|
|
|||
|
|
@ -282,7 +282,8 @@ if (isset($_GET['invoice_id'], $_GET['url_key']) && !isset($_GET['payment_intent
|
|||
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Paid', history_description = 'Payment added - $ip - $os - $browser', history_invoice_id = $invoice_id");
|
||||
|
||||
// Notify
|
||||
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Invoice Paid', notification = 'Invoice $invoice_prefix$invoice_number has been paid by $client_name - $ip - $os - $browser', notification_action = 'invoice.php?invoice_id=$invoice_id', notification_client_id = $pi_client_id");
|
||||
appNotify("Invoice Paid", "Invoice $invoice_prefix$invoice_number has been paid by $client_name - $ip - $os - $browser", "invoice.php?invoice_id=$invoice_id", $pi_client_id);
|
||||
|
||||
customAction('invoice_pay', $invoice_id);
|
||||
|
||||
// Logging
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
<?php
|
||||
|
||||
require_once "config.php";
|
||||
require_once "inc_set_timezone.php";
|
||||
require_once "functions.php";
|
||||
|
||||
session_start();
|
||||
|
||||
require_once "inc_set_timezone.php"; // Must be included after session_start to work
|
||||
|
||||
if (isset($_GET['accept_quote'], $_GET['url_key'])) {
|
||||
$quote_id = intval($_GET['accept_quote']);
|
||||
$url_key = sanitizeInput($_GET['url_key']);
|
||||
|
|
@ -23,7 +24,8 @@ if (isset($_GET['accept_quote'], $_GET['url_key'])) {
|
|||
mysqli_query($mysqli, "UPDATE quotes SET quote_status = 'Accepted' WHERE quote_id = $quote_id");
|
||||
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Accepted', history_description = 'Client accepted Quote!', history_quote_id = $quote_id");
|
||||
// Notification
|
||||
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Quote Accepted', notification = 'Quote $quote_prefix$quote_number has been accepted by $client_name', notification_action = 'quote.php?quote_id=$quote_id', notification_client_id = $client_id, notification_entity_id = $quote_id");
|
||||
appNotify("Quote Accepted", "Quote $quote_prefix$quote_number has been accepted by $client_name", "quote.php?quote_id=$quote_id", $client_id);
|
||||
|
||||
|
||||
customAction('quote_accept', $quote_id);
|
||||
$_SESSION['alert_message'] = "Quote Accepted";
|
||||
|
|
@ -50,7 +52,7 @@ if (isset($_GET['decline_quote'], $_GET['url_key'])) {
|
|||
mysqli_query($mysqli, "UPDATE quotes SET quote_status = 'Declined' WHERE quote_id = $quote_id");
|
||||
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Declined', history_description = 'Client declined Quote!', history_quote_id = $quote_id");
|
||||
// Notification
|
||||
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Quote Declined', notification = 'Quote $quote_prefix$quote_number has been declined by $client_name', notification_action = 'quote.php?quote_id=$quote_id', notification_client_id = $client_id, notification_entity_id = $quote_id");
|
||||
appNotify("Quote Declined", "Quote $quote_prefix$quote_number has been declined by $client_name", "quote.php?quote_id=$quote_id", $client_id);
|
||||
|
||||
customAction('quote_decline', $quote_id);
|
||||
$_SESSION['alert_type'] = "danger";
|
||||
|
|
@ -116,7 +118,7 @@ if (isset($_GET['add_ticket_feedback'], $_GET['url_key'])) {
|
|||
mysqli_query($mysqli, "UPDATE tickets SET ticket_feedback = '$feedback' WHERE ticket_id = $ticket_id AND ticket_url_key = '$url_key'");
|
||||
// Notify on bad feedback
|
||||
if ($feedback == "Bad") {
|
||||
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Feedback', notification = 'Guest rated ticket ID $ticket_id as bad'");
|
||||
appNotify("Feedback", "Guest rated ticket ID $ticket_id as bad");
|
||||
}
|
||||
|
||||
$_SESSION['alert_message'] = "Feedback recorded - thank you";
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ $client_id = intval($row['item_client_id']);
|
|||
$item_type_sql_escaped = sanitizeInput($row['item_type']);
|
||||
$item_recipient_sql_escaped = sanitizeInput($row['item_recipient']);
|
||||
|
||||
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Share Viewed', notification = '$item_type_sql_escaped has been viewed by $item_recipient_sql_escaped', notification_action = 'client_overview.php?client_id=$client_id', notification_client_id = $client_id, notification_entity_id = $item_id");
|
||||
appNotify("Share Viewed", "$item_type_sql_escaped has been viewed by $item_recipient_sql_escaped", "client_overview.php?client_id=$client_id", $client_id);
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,8 @@ if ($quote_status == 'Sent') {
|
|||
mysqli_query($mysqli, "INSERT INTO history SET history_status = '$quote_status', history_description = 'Quote viewed - $ip - $os - $browser', history_quote_id = $quote_id");
|
||||
|
||||
if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Viewed") {
|
||||
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Quote Viewed', notification = 'Quote $quote_prefix$quote_number has been viewed by $client_name_escaped - $ip - $os - $browser', notification_action = 'quote.php?quote_id=$quote_id', notification_client_id = $client_id, notification_entity_id = $quote_id");
|
||||
|
||||
appNotify("Quote Viewed", "Quote $quote_prefix$quote_number has been viewed by $client_name_escaped - $ip - $os - $browser", "quote.php?quote_id=$quote_id", $client_id);
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue