updated boolean and interger to php8.5 standard

This commit is contained in:
2026-09-07 17:59:50 -04:00
parent 1a643d7935
commit c17b611cc6
12 changed files with 492 additions and 21 deletions
+1 -1
View File
@@ -289,7 +289,7 @@ class Alerts extends Base {
$recordset = $statement->fetch(PDO::FETCH_ASSOC); $recordset = $statement->fetch(PDO::FETCH_ASSOC);
$count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0; $count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination // Pagination
+1 -1
View File
@@ -583,7 +583,7 @@ class Base {
public function getZipcode($zip_code = 0) { public function getZipcode($zip_code = 0) {
$zip_code = filter_input(INPUT_POST, "zip_code", FILTER_SANITIZE_NUMBER_INT) ?: 0; $zip_code = filter_input(INPUT_POST, "zip_code", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$zip_code = (integer) substr((string) $zip_code, 0, 5); $zip_code = (int) substr((string) $zip_code, 0, 5);
$zipCodeDetail = null; $zipCodeDetail = null;
+470
View File
@@ -0,0 +1,470 @@
<?php
// ====================
// Business Facts Class
// ====================
class BusinessFacts extends Base {
// Variables
private $current_user_id = "";
private $current_user_name = "";
private $current_user_email = "";
private $pagination_size = 20;
private $pagination_page = 1;
// =================
// Class Constructor
// =================
public function __construct() {
set_error_handler(array($this, "displayError"));
date_default_timezone_set(self::TIMEZONE);
$this->current_user_id = $_SESSION[self::USER_ID] ?? "";
$this->current_user_name = $_SESSION[self::USER_NAME] ?? "";
$this->current_user_email = $_SESSION[self::USER_EMAIL] ?? "";
$this->pagination_page = $_SESSION[self::PAGINATION_PAGE] ?? 1;
}
// =====================
// Manage Business Facts
// =====================
public function manageBusinessFacts() {
$businessfacts = $this->getBusinessFactsPage();
$popovers = (new Popovers())->getPopovers();
$XML = $this->mergeXML($businessfacts, "<XML/>");
$XML = $this->mergeXML($popovers, $XML);
$content = $this->applyXSL($XML, $this->getXSL("manageBusinessFacts"));
$this->displayContent($content);
}
// =====================
// Business Fact Summary
// =====================
public function businessfactSummary() {
$businessfact_serial = filter_input(INPUT_POST, "businessfact_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact = $this->getBusinessFact($businessfact_serial);
if ($businessfact->count() == 0) {
$this->logError("Invalid Business Fact ({$businessfact_serial}). " . __METHOD__);
}
$businessfactemployees = $this->getBusinessFactEmployees($businessfact_serial);
$businessfactmaterials = $this->getBusinessFactMaterials($businessfact_serial);
$businessfactnotes = $this->getBusinessFactNotes($businessfact_serial);
$attachments = (new Attachments())->getAttachments("BusinessFacts", $businessfact_serial);
$XML = $this->mergeXML($businessfact, "<XML/>");
$XML = $this->mergeXML($businessfactemployees, $XML);
$XML = $this->mergeXML($businessfactmaterials, $XML);
$XML = $this->mergeXML($businessfactnotes, $XML);
$XML = $this->mergeXML($attachments, $XML);
$content = $this->applyXSL($XML, $this->getXSL("businessfactSummary"));
$this->displayContent($content);
}
// ===============
// Add Business Fact
// ===============
public function addBusinessFact() {
$step = filter_input(INPUT_POST, "step") ?: "prompt";
switch ($step) {
case "prompt":
$constants = $this->getConstants();
$dropdowns = (new Dropdowns())->getDropdowns();
$counties = (new Counties())->getCounties();
$cities = (new Cities())->getCities();
$XML = $this->mergeXML($dropdowns, "<XML/>");
$XML = $this->mergeXML($counties, $XML);
$XML = $this->mergeXML($cities, $XML);
$XML = $this->mergeXML($constants, $XML);
$content = $this->applyXSL($XML, $this->getXSL("addBusinessFact"));
$this->displayContent($content);
break;
case "add":
$businessfact_business_number = filter_input(INPUT_POST, "businessfact_business_number") ?: "";
$businessfact_project_name = filter_input(INPUT_POST, "businessfact_project_name") ?: "";
$businessfact_parcel_number = filter_input(INPUT_POST, "businessfact_parcel_number") ?: "";
$businessfact_project_type = filter_input(INPUT_POST, "businessfact_project_type", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact_business_date = filter_input(INPUT_POST, "businessfact_business_date") ?: "";
$businessfact_county_code = filter_input(INPUT_POST, "businessfact_county_code", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact_subdivision = filter_input(INPUT_POST, "businessfact_subdivision") ?: "";
$businessfact_project_address = filter_input(INPUT_POST, "businessfact_project_address") ?: "";
$businessfact_project_city = filter_input(INPUT_POST, "businessfact_project_city") ?: "";
$businessfact_project_state = filter_input(INPUT_POST, "businessfact_project_state") ?: "";
$businessfact_project_zipcode = filter_input(INPUT_POST, "businessfact_project_zipcode", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact_size = filter_input(INPUT_POST, "businessfact_size", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact_value = filter_input(INPUT_POST, "businessfact_value", FILTER_VALIDATE_FLOAT) ?: 0.00;
$businessfact_work_type = filter_input(INPUT_POST, "businessfact_work_type", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact_building_type = filter_input(INPUT_POST, "businessfact_building_type", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact_lotblock = filter_input(INPUT_POST, "businessfact_lotblock", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact_districtlandlot = filter_input(INPUT_POST, "businessfact_districtlandlot", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact_units = filter_input(INPUT_POST, "businessfact_units", FILTER_SANITIZE_NUMBER_INT) ?: 0;
// Format Dates
$businessfact_business_date = ($businessfact_business_date == "") ? null : date("Y-m-d", strtotime($businessfact_business_date));
$businessfact_subdivision = (new Subdivisions())->getSubdivisionByName($businessfact_subdivision)->subdivision_serial;
$SQL = "insert into businessfacts
( businessfact_business_number,
businessfact_project_name,
businessfact_parcel_number,
businessfact_project_type,
businessfact_business_date,
businessfact_county_code,
businessfact_subdivision,
businessfact_project_address,
businessfact_project_city,
businessfact_project_state,
businessfact_project_zipcode,
businessfact_size,
businessfact_value,
businessfact_work_type,
businessfact_building_type,
businessfact_lotblock,
businessfact_districtlandlot,
businessfact_units,
businessfact_created,
businessfact_created_user )
values ( :businessfact_business_number,
:businessfact_project_name,
:businessfact_parcel_number,
:businessfact_project_type,
:businessfact_business_date,
:businessfact_county_code,
:businessfact_subdivision,
:businessfact_project_address,
:businessfact_project_city,
:businessfact_project_state,
:businessfact_project_zipcode,
:businessfact_size,
:businessfact_value,
:businessfact_work_type,
:businessfact_building_type,
:businessfact_lotblock,
:businessfact_districtlandlot,
:businessfact_units,
:businessfact_created,
:businessfact_created_user )";
$connection = $this->connect();
$statement = $connection->prepare($SQL);
$statement->bindValue(":businessfact_business_number", $businessfact_business_number);
$statement->bindValue(":businessfact_project_name", $businessfact_project_name);
$statement->bindValue(":businessfact_parcel_number", $businessfact_parcel_number);
$statement->bindValue(":businessfact_project_type", $businessfact_project_type);
$statement->bindValue(":businessfact_business_date", $businessfact_business_date);
$statement->bindValue(":businessfact_county_code", $businessfact_county_code);
$statement->bindValue(":businessfact_subdivision", $businessfact_subdivision);
$statement->bindValue(":businessfact_project_address", $businessfact_project_address);
$statement->bindValue(":businessfact_project_city", $businessfact_project_city);
$statement->bindValue(":businessfact_project_state", $businessfact_project_state);
$statement->bindValue(":businessfact_project_zipcode", $businessfact_project_zipcode);
$statement->bindValue(":businessfact_size", $businessfact_size);
$statement->bindValue(":businessfact_value", $businessfact_value);
$statement->bindValue(":businessfact_work_type", $businessfact_work_type);
$statement->bindValue(":businessfact_building_type", $businessfact_building_type);
$statement->bindValue(":businessfact_lotblock", $businessfact_lotblock);
$statement->bindValue(":businessfact_districtlandlot", $businessfact_districtlandlot);
$statement->bindValue(":businessfact_units", $businessfact_units);
$statement->bindValue(":businessfact_created", $this->getTimestamp());
$statement->bindValue(":businessfact_created_user", $this->current_user_name);
$statement->execute();
break;
default:
$this->displayHome();
}
}
// ================
// Edit Business Fact
// ================
public function editBusinessFact() {
$step = filter_input(INPUT_POST, "step") ?: "prompt";
switch ($step) {
case "prompt":
$businessfact_serial = filter_input(INPUT_POST, "businessfact_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact = $this->getBusinessFact($businessfact_serial);
if ($businessfact->count() == 0) {
$this->logError("Invalid Business Fact ({$businessfact_serial}). " . __METHOD__);
}
$constants = $this->getConstants();
$dropdowns = (new Dropdowns())->getDropdowns();
$counties = (new Counties())->getCounties();
$cities = (new Cities())->getCities();
$XML = $this->mergeXML($businessfact, "<XML/>");
$XML = $this->mergeXML($dropdowns, $XML);
$XML = $this->mergeXML($counties, $XML);
$XML = $this->mergeXML($cities, $XML);
$XML = $this->mergeXML($constants, $XML);
$content = $this->applyXSL($XML, $this->getXSL("editBusinessFact"));
$this->displayContent($content);
break;
case "update":
$businessfact_serial = filter_input(INPUT_POST, "businessfact_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact_requestor = filter_input(INPUT_POST, "businessfact_requestor") ?: "";
$businessfact_requestor_address = filter_input(INPUT_POST, "businessfact_requestor_address") ?: "";
$businessfact_requestor_phone = filter_input(INPUT_POST, "businessfact_requestor_phone") ?: "";
$businessfact_requestor_email = filter_input(INPUT_POST, "businessfact_requestor_email") ?: "";
$businessfact_requestor_callback = filter_input(INPUT_POST, "businessfact_requestor_callback", FILTER_VALIDATE_BOOLEAN) ?: false;
$businessfact_worktype = filter_input(INPUT_POST, "businessfact_worktype", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact_priority = filter_input(INPUT_POST, "businessfact_priority", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact_facility = filter_input(INPUT_POST, "businessfact_facility", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact_department = filter_input(INPUT_POST, "businessfact_department", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact_employee = filter_input(INPUT_POST, "businessfact_employee", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact_status = filter_input(INPUT_POST, "businessfact_status", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact_fema = filter_input(INPUT_POST, "businessfact_fema", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$businessfact_location = filter_input(INPUT_POST, "businessfact_location") ?: "";
$businessfact_description = filter_input(INPUT_POST, "businessfact_description") ?: "";
$businessfact_completed = filter_input(INPUT_POST, "businessfact_completed") ?: "";
// Format Dates
$businessfact_completed = ($businessfact_completed == "") ? null : date("Y-m-d", strtotime($businessfact_completed));
// Convert 0 to null for Foreign Keys
$businessfact_worktype = ($businessfact_worktype !== 0) ? $businessfact_worktype : null;
$businessfact_priority = ($businessfact_priority !== 0) ? $businessfact_priority : null;
$businessfact_facility = ($businessfact_facility !== 0) ? $businessfact_facility : null;
$businessfact_department = ($businessfact_department !== 0) ? $businessfact_department : null;
$businessfact_employee = ($businessfact_employee !== 0) ? $businessfact_employee : null;
$businessfact_status = ($businessfact_status !== 0) ? $businessfact_status : null;
$businessfact_fema = ($businessfact_fema !== 0) ? $businessfact_fema : null;
// Verify the Business Fact
$businessfact = $this->getBusinessFact($businessfact_serial);
if ($businessfact->count() == 0) {
$this->logError("Invalid Business Fact ({$businessfact_serial}). " . __METHOD__);
}
// Update the Business Fact
$SQL = "update businessfacts
set businessfact_requestor = :businessfact_requestor,
businessfact_requestor_address = :businessfact_requestor_address,
businessfact_requestor_phone = :businessfact_requestor_phone,
businessfact_requestor_email = :businessfact_requestor_email,
businessfact_requestor_callback = :businessfact_requestor_callback,
businessfact_worktype = :businessfact_worktype,
businessfact_priority = :businessfact_priority,
businessfact_facility = :businessfact_facility,
businessfact_department = :businessfact_department,
businessfact_employee = :businessfact_employee,
businessfact_status = :businessfact_status,
businessfact_fema = :businessfact_fema,
businessfact_location = :businessfact_location,
businessfact_description = :businessfact_description,
businessfact_completed = :businessfact_completed,
businessfact_origin = :businessfact_origin
where businessfact_serial = :businessfact_serial";
$statement = $this->connect()->prepare($SQL);
$statement->bindValue(":businessfact_serial", $businessfact_serial);
$statement->bindValue(":businessfact_requestor", $businessfact_requestor);
$statement->bindValue(":businessfact_requestor_address", $businessfact_requestor_address);
$statement->bindValue(":businessfact_requestor_phone", $businessfact_requestor_phone);
$statement->bindValue(":businessfact_requestor_email", $businessfact_requestor_email);
$statement->bindValue(":businessfact_requestor_callback", $businessfact_requestor_callback, PDO::PARAM_BOOL);
$statement->bindValue(":businessfact_worktype", $businessfact_worktype);
$statement->bindValue(":businessfact_priority", $businessfact_priority);
$statement->bindValue(":businessfact_facility", $businessfact_facility);
$statement->bindValue(":businessfact_department", $businessfact_department);
$statement->bindValue(":businessfact_employee", $businessfact_employee);
$statement->bindValue(":businessfact_status", $businessfact_status);
$statement->bindValue(":businessfact_fema", $businessfact_fema);
$statement->bindValue(":businessfact_location", $businessfact_location);
$statement->bindValue(":businessfact_description", $businessfact_description);
$statement->bindValue(":businessfact_completed", $businessfact_completed);
$statement->bindValue(":businessfact_origin", $this->current_user_name);
$statement->execute();
break;
default:
$this->displayHome();
}
}
// ===========================
// Return a Business Fact Object
// ===========================
public function getBusinessFact($businessfact_serial = 0) {
$SQL = "select view_businessfacts.*
from view_businessfacts
where businessfact_serial = {$businessfact_serial}";
return $this->getTable("businessfacts", $SQL);
}
// =================================
// Return a Business Facts Page Object
// =================================
public function getBusinessFactsPage() {
// Find Criteria
$find_businessfact = filter_input(INPUT_POST, "find_businessfact") ?: "";
$businessfact_released = filter_input(INPUT_POST, "businessfact_released") ?: "true";
$this->pagination_size = filter_input(INPUT_POST, "businessfacts_per_page", FILTER_SANITIZE_NUMBER_INT) ?: $this->pagination_size;
$businessfacts_order_by = filter_input(INPUT_POST, "businessfacts_order_by") ?: "";
$businessfacts_order_direction = filter_input(INPUT_POST, "businessfacts_order_direction") ?: "";
if ($businessfacts_order_by === "") {
$orderby = "businessfact_entry_date asc";
} else {
$orderby = $businessfacts_order_by . " " . $businessfacts_order_direction;
}
$find_businessfact = $this->sanitizeString($find_businessfact);
$businessfact_released = ($businessfact_released == "true") ? 1 : 0;
$find_words = implode("|", explode(" ", $find_businessfact));
// Record Count
$connection = $this->connect();
$SQL = "select count(*) as count
from view_businessfacts
where (businessfact_business_number regexp :businessfact_business_number
or businessfact_project_name regexp :businessfact_project_name
or businessfact_business_date regexp :businessfact_business_date
or businessfact_entry_date regexp :businessfact_entry_date
or businessfact_project_address regexp :businessfact_project_address )
and businessfact_released = {$businessfact_released} ";
$statement = $connection->prepare($SQL);
$statement->bindValue(":businessfact_business_number", $find_words);
$statement->bindValue(":businessfact_project_name", $find_words);
$statement->bindValue(":businessfact_business_date", $find_words);
$statement->bindValue(":businessfact_entry_date", $find_words);
$statement->bindValue(":businessfact_project_address", $find_words);
$statement->execute();
$recordset = $statement->fetch(PDO::FETCH_ASSOC);
$count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination
$pagination = filter_input(INPUT_POST, "pagination") ?: "";
switch ($pagination) {
case "first" : $this->pagination_page = 1;
break;
case "previous" : $this->pagination_page = max(($this->pagination_page - 1), 1);
break;
case "next" : $this->pagination_page = ($this->pagination_page + 1);
break;
case "last" : $this->pagination_page = ($count / $this->pagination_size);
break;
}
$offset = (($this->pagination_page * $this->pagination_size) - $this->pagination_size);
$start = ($offset + 1);
$end = min($count, (($start + $this->pagination_size) - 1));
// Data
$SQL = "select view_businessfacts.*
from view_businessfacts
where (businessfact_business_number regexp :businessfact_business_number
or businessfact_project_name regexp :businessfact_project_name
or businessfact_business_date regexp :businessfact_business_date
or businessfact_entry_date regexp :businessfact_entry_date
or businessfact_project_address regexp :businessfact_project_address )
and businessfact_released = {$businessfact_released}
order by {$orderby}
limit {$this->pagination_size}
offset {$offset}";
$statement = $connection->prepare($SQL);
$statement->bindValue(":businessfact_business_number", $find_words);
$statement->bindValue(":businessfact_project_name", $find_words);
$statement->bindValue(":businessfact_business_date", $find_words);
$statement->bindValue(":businessfact_entry_date", $find_words);
$statement->bindValue(":businessfact_project_address", $find_words);
$statement->execute();
$businessfacts = $this->getTableXML("businessfacts", $statement);
// Insert Pagination Attributes
$businessfacts->addAttribute("count", $count);
$businessfacts->addAttribute("start", $start);
$businessfacts->addAttribute("end", $end);
$businessfacts->addAttribute("page", $this->pagination_page);
$_SESSION[self::PAGINATION_PAGE] = $this->pagination_page;
return $businessfacts;
}
}
?>
+2 -2
View File
@@ -341,7 +341,7 @@ class Dropdowns extends Base {
public function dropdowntypeActive() { public function dropdowntypeActive() {
$dropdowntype_serial = (integer) filter_input(INPUT_POST, "dropdowntype_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0; $dropdowntype_serial = (int) filter_input(INPUT_POST, "dropdowntype_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$SQL = "select dropdown_serial $SQL = "select dropdown_serial
from view_dropdowns from view_dropdowns
@@ -587,7 +587,7 @@ class Dropdowns extends Base {
$recordset = $statement->fetch(PDO::FETCH_ASSOC); $recordset = $statement->fetch(PDO::FETCH_ASSOC);
$count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0; $count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination // Pagination
+1 -1
View File
@@ -100,7 +100,7 @@ class Journal extends Base {
$recordset = $statement->fetch(PDO::FETCH_ASSOC); $recordset = $statement->fetch(PDO::FETCH_ASSOC);
$count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0; $count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination // Pagination
+1 -1
View File
@@ -253,7 +253,7 @@ class Popovers extends Base {
$recordset = $statement->fetch(PDO::FETCH_ASSOC); $recordset = $statement->fetch(PDO::FETCH_ASSOC);
$count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0; $count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination // Pagination
+3 -3
View File
@@ -215,7 +215,7 @@ class Reports extends Base {
$reports = $this->getTable("reports", $SQL); $reports = $this->getTable("reports", $SQL);
return (integer) ($reports->record->report_serial ?? 0); return (int) ($reports->record->report_serial ?? 0);
} }
// ======================= // =======================
@@ -268,7 +268,7 @@ class Reports extends Base {
$recordset = $statement->fetch(PDO::FETCH_ASSOC); $recordset = $statement->fetch(PDO::FETCH_ASSOC);
$count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0; $count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination // Pagination
@@ -357,7 +357,7 @@ class Reports extends Base {
$recordset = $statement->fetch(PDO::FETCH_ASSOC); $recordset = $statement->fetch(PDO::FETCH_ASSOC);
$count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0; $count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination // Pagination
+2 -2
View File
@@ -63,7 +63,7 @@ class SignIn extends Base {
die(); die();
} }
if ((integer) $user->record->user_active === 0) { if ((int) $user->record->user_active === 0) {
echo $this->applyXSL("", $this->getXSL("signIn"), $XSLParms); echo $this->applyXSL("", $this->getXSL("signIn"), $XSLParms);
die(); die();
} }
@@ -79,7 +79,7 @@ class SignIn extends Base {
session_regenerate_id(true); session_regenerate_id(true);
$_SESSION[self::USER_AUTHENTICATED] = true; $_SESSION[self::USER_AUTHENTICATED] = true;
$_SESSION[self::USER_SERIAL] = (integer) $user->record->user_serial; $_SESSION[self::USER_SERIAL] = (int) $user->record->user_serial;
$_SESSION[self::USER_ID] = (string) $user->record->user_id; $_SESSION[self::USER_ID] = (string) $user->record->user_id;
$_SESSION[self::USER_NAME] = (string) $user->record->user_name; $_SESSION[self::USER_NAME] = (string) $user->record->user_name;
$_SESSION[self::USER_EMAIL] = (string) $user->record->user_email; $_SESSION[self::USER_EMAIL] = (string) $user->record->user_email;
+1 -1
View File
@@ -310,7 +310,7 @@ class Statuses extends Base {
$recordset = $statement->fetch(PDO::FETCH_ASSOC); $recordset = $statement->fetch(PDO::FETCH_ASSOC);
$count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0; $count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination // Pagination
+3 -3
View File
@@ -52,7 +52,7 @@ class Subscriptions extends Base {
public function goToSubscription($subscription_serial = 0) { public function goToSubscription($subscription_serial = 0) {
$subscription_serial = (integer) filter_input(INPUT_POST, "subscription_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0; $subscription_serial = (int) filter_input(INPUT_POST, "subscription_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$subscription = $this->getSubscription($subscription_serial); $subscription = $this->getSubscription($subscription_serial);
@@ -226,7 +226,7 @@ class Subscriptions extends Base {
case "prompt": case "prompt":
$subscription_serial = (integer) filter_input(INPUT_POST, "subscription_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0; $subscription_serial = (int) filter_input(INPUT_POST, "subscription_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$subscription = $this->getSubscription($subscription_serial); $subscription = $this->getSubscription($subscription_serial);
@@ -529,7 +529,7 @@ class Subscriptions extends Base {
$recordset = $statement->fetch(PDO::FETCH_ASSOC); $recordset = $statement->fetch(PDO::FETCH_ASSOC);
$count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0; $count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination // Pagination
+6 -6
View File
@@ -111,8 +111,8 @@ class Users extends Base {
$user_random_password = $this->generateRandomPassword(); $user_random_password = $this->generateRandomPassword();
$user_temp_password = password_hash($user_random_password, PASSWORD_DEFAULT); $user_temp_password = password_hash($user_random_password, PASSWORD_DEFAULT);
$user_change_password = (boolean) true; $user_change_password = (bool) true;
$user_active = (boolean) true; $user_active = (bool) true;
// Add the User // Add the User
@@ -202,7 +202,7 @@ class Users extends Base {
case "prompt": case "prompt":
$user_serial = (integer) filter_input(INPUT_POST, "user_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0; $user_serial = (int) filter_input(INPUT_POST, "user_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$user = $this->getUser($user_serial); $user = $this->getUser($user_serial);
@@ -305,7 +305,7 @@ class Users extends Base {
$users = $this->getUserByUserId($user_id); $users = $this->getUserByUserId($user_id);
return ($users->count() === 0) ? 0 : (integer) $users->record->user_serial; return ($users->count() === 0) ? 0 : (int) $users->record->user_serial;
} }
// ===================== // =====================
@@ -354,7 +354,7 @@ class Users extends Base {
$recordset = $statement->fetch(PDO::FETCH_ASSOC); $recordset = $statement->fetch(PDO::FETCH_ASSOC);
$count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0; $count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination // Pagination
@@ -469,7 +469,7 @@ class Users extends Base {
public function userActive() { public function userActive() {
$user_serial = (integer) filter_input(INPUT_POST, "user_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0; $user_serial = (int) filter_input(INPUT_POST, "user_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$SQL = "select request_serial $SQL = "select request_serial
from requests from requests
+1
View File
@@ -1,3 +1,4 @@
// ============ // ============
// Content Page // Content Page
// ============ // ============