Updated application to use bool and int instead of boolean and integer. Also added an order by to the getSubscriptionCounties function

This commit is contained in:
2026-09-05 09:39:26 -04:00
parent 55081a11cf
commit 6401534c90
19 changed files with 39 additions and 35 deletions
+1 -1
View File
@@ -289,7 +289,7 @@ class Alerts extends Base {
$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
+1 -1
View File
@@ -645,7 +645,7 @@ class Base {
$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;
+1 -1
View File
@@ -308,7 +308,7 @@ class Cities extends Base {
$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
+9 -5
View File
@@ -251,7 +251,8 @@ class Counties extends Base {
public function getCounties() {
$SQL = "select view_counties.*
from view_counties";
from view_counties
order by view_counties.county_name";
return $this->getTable("counties", $SQL);
}
@@ -264,7 +265,8 @@ class Counties extends Base {
$SQL = "select view_counties.*
from view_counties
where view_counties.county_area = '{$area}'";
where view_counties.county_area = '{$area}'
order by view_counties.county_name";
return $this->getTable("counties", $SQL);
}
@@ -277,7 +279,8 @@ class Counties extends Base {
$SQL = "select view_counties.*
from view_counties
where view_counties.county_name = '{$county_name}'";
where view_counties.county_name = '{$county_name}'
order by view_counties.county_name";
return $this->getTable("counties", $SQL);
}
@@ -311,7 +314,7 @@ class Counties extends Base {
$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
@@ -387,7 +390,8 @@ class Counties extends Base {
$SQL = "select view_subscriptioncounties.*
from view_subscriptioncounties
where view_subscriptioncounties.subscriptioncounty_subscription = '{$subscription_serial}'";
where view_subscriptioncounties.subscriptioncounty_subscription = '{$subscription_serial}'
order by view_subscriptioncounties.subscriptioncounties_county_name_verbose";
return $this->getTable("subscriptioncounties", $SQL);
}
+2 -2
View File
@@ -341,7 +341,7 @@ class Dropdowns extends Base {
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
from view_dropdowns
@@ -587,7 +587,7 @@ class Dropdowns extends Base {
$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
+1 -1
View File
@@ -149,7 +149,7 @@ class Export extends Base {
$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
+1 -1
View File
@@ -100,7 +100,7 @@ class Journal extends Base {
$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
+1 -1
View File
@@ -253,7 +253,7 @@ class Popovers extends Base {
$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
+1 -1
View File
@@ -308,7 +308,7 @@ class ProjectTypes extends Base {
$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
+3 -3
View File
@@ -215,7 +215,7 @@ class Reports extends Base {
$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);
$count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0;
$count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination
@@ -357,7 +357,7 @@ class Reports extends Base {
$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
+1 -1
View File
@@ -279,7 +279,7 @@ class SICCodes extends Base {
$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
+1 -1
View File
@@ -310,7 +310,7 @@ class Statuses extends Base {
$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
+4 -4
View File
@@ -35,8 +35,8 @@ class Subscriptions extends Base {
public function goToSubscription() {
$subscription_serial = (integer) filter_input(INPUT_POST, "subscription_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$usersubscription_serial = (integer) filter_input(INPUT_POST, "usersubscription_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$subscription_serial = (int) filter_input(INPUT_POST, "subscription_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$usersubscription_serial = (int) filter_input(INPUT_POST, "usersubscription_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$subscription = $this->getSubscription($subscription_serial);
@@ -227,7 +227,7 @@ class Subscriptions extends Base {
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);
@@ -841,7 +841,7 @@ class Subscriptions extends Base {
$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
+6 -6
View File
@@ -113,8 +113,8 @@ class Users extends Base {
$user_random_password = $this->generateRandomPassword();
$user_temp_password = password_hash($user_random_password, PASSWORD_DEFAULT);
$user_change_password = (boolean) true;
$user_active = (boolean) true;
$user_change_password = (bool) true;
$user_active = (bool) true;
// Add the User
@@ -204,7 +204,7 @@ class Users extends Base {
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);
@@ -310,7 +310,7 @@ class Users extends Base {
$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;
}
// =====================
@@ -359,7 +359,7 @@ class Users extends Base {
$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
@@ -517,7 +517,7 @@ class Users extends Base {
if (password_verify($user_password, $stored_hashed_password)) {
$_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_NAME] = (string) $user->record->user_name;
$_SESSION[self::USER_EMAIL] = (string) $user->record->user_email;