Removed Records per page as a setting and added it as session variable define at 10 by default when logged in DB Structure Updated

This commit is contained in:
johnny@pittpc.com
2021-02-10 13:40:28 -05:00
parent 45fea53441
commit 66f9e2b10f
45 changed files with 133 additions and 132 deletions

View File

@@ -18,9 +18,7 @@ use PHPMailer\PHPMailer\Exception;
if(isset($_POST['change_records_per_page'])){
$records_per_page = intval($_POST['change_records_per_page']);
mysqli_query($mysqli,"UPDATE settings SET config_records_per_page = $records_per_page WHERE company_id = $session_company_id");
$_SESSION['records_per_page'] = intval($_POST['change_records_per_page']);
header("Location: " . $_SERVER["HTTP_REFERER"]);
@@ -255,7 +253,7 @@ if(isset($_POST['add_company'])){
}
mysqli_query($mysqli,"INSERT INTO settings SET company_id = $company_id, config_invoice_prefix = 'INV-', config_invoice_next_number = 1, config_recurring_prefix = 'REC-', config_recurring_next_number = 1, config_invoice_overdue_reminders = '1,3,7', config_quote_prefix = 'QUO-', config_quote_next_number = 1, config_api_key = '$config_api_key', config_recurring_auto_send_invoice = 1, config_default_net_terms = 7, config_records_per_page = 10, config_send_invoice_reminders = 0, config_enable_cron = 0, config_ticket_next_number = 1, config_base_url = '$config_base_url'");
mysqli_query($mysqli,"INSERT INTO settings SET company_id = $company_id, config_invoice_prefix = 'INV-', config_invoice_next_number = 1, config_recurring_prefix = 'REC-', config_recurring_next_number = 1, config_invoice_overdue_reminders = '1,3,7', config_quote_prefix = 'QUO-', config_quote_next_number = 1, config_api_key = '$config_api_key', config_recurring_auto_send_invoice = 1, config_default_net_terms = 7, config_send_invoice_reminders = 0, config_enable_cron = 0, config_ticket_next_number = 1, config_base_url = '$config_base_url'");
//logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Company', log_action = 'Create', log_description = '$name', log_created_at = NOW()");