';
diff --git a/src/PropertyAssign.php b/src/PropertyAssign.php
index f30d096516..66fa8beeec 100644
--- a/src/PropertyAssign.php
+++ b/src/PropertyAssign.php
@@ -82,7 +82,7 @@ function UpdateProperty($iRecordID, $sValue, $iPropertyID, $sAction)
$sSQL = "SELECT * FROM record2property_r2p WHERE r2p_record_ID = $iRecordID AND r2p_pro_ID = $iPropertyID";
$rsExistingTest = RunQuery($sSQL);
- if (mysqli_num_rows($rsExistingTest) == 0) {
+ if (mysqli_num_rows($rsExistingTest) === 0) {
$sSQL = "INSERT INTO record2property_r2p (r2p_record_ID,r2p_pro_ID,r2p_Value) VALUES ($iRecordID,$iPropertyID,'$sValue')";
RunQuery($sSQL);
}
diff --git a/src/QuerySQL.php b/src/QuerySQL.php
index d3f2fc4c06..f29de9d51d 100644
--- a/src/QuerySQL.php
+++ b/src/QuerySQL.php
@@ -156,7 +156,7 @@ function RunFreeQuery(string $sSQL, &$rsQueryResults)
echo '
';
if ($aHiddenFormField && count($aHiddenFormField) > 0) { // TODO Don't post to CartView.php
-?>
+ ?>
@@ -165,7 +165,7 @@ function RunFreeQuery(string $sSQL, &$rsQueryResults)
-' . gettext('Return to Query Menu') . '';
diff --git a/src/QueryView.php b/src/QueryView.php
index c51c1c511a..62cd34938f 100644
--- a/src/QueryView.php
+++ b/src/QueryView.php
@@ -31,7 +31,7 @@
$rsParameters = RunQuery($sSQL);
// If the form was submitted or there are no parameters, run the query
-if (isset($_POST['Submit']) || mysqli_num_rows($rsParameters) == 0) {
+if (isset($_POST['Submit']) || mysqli_num_rows($rsParameters) === 0) {
//Check that all validation rules were followed
ValidateInput();
diff --git a/src/ReminderReport.php b/src/ReminderReport.php
index 6a567e16b3..6c4c03f509 100644
--- a/src/ReminderReport.php
+++ b/src/ReminderReport.php
@@ -32,7 +32,7 @@
-
+
diff --git a/src/Reports/ConfirmReport.php b/src/Reports/ConfirmReport.php
index 3b33e47cd0..bbadf7efa9 100644
--- a/src/Reports/ConfirmReport.php
+++ b/src/Reports/ConfirmReport.php
@@ -42,9 +42,7 @@ public function startNewPage(Family $family): float
$this->writeAt(SystemConfig::getValue('leftX'), $curY, $blurb);
- $curY += 2 * SystemConfig::getValue('incrementY');
-
- return $curY;
+ return $curY + 2 * SystemConfig::getValue('incrementY');
}
public function finishPage($curY): void
diff --git a/src/Reports/ConfirmReportEmail.php b/src/Reports/ConfirmReportEmail.php
index 06173d276b..408f0da742 100644
--- a/src/Reports/ConfirmReportEmail.php
+++ b/src/Reports/ConfirmReportEmail.php
@@ -30,9 +30,8 @@ public function startNewPage($fam_ID, $fam_Name, $fam_Address1, $fam_Address2, s
$curY += 2 * SystemConfig::getValue('incrementY');
$blurb = SystemConfig::getValue('sConfirm1');
$this->writeAt(SystemConfig::getValue('leftX'), $curY, $blurb);
- $curY += 2 * SystemConfig::getValue('incrementY');
- return $curY;
+ return $curY + 2 * SystemConfig::getValue('incrementY');
}
public function finishPage($curY): void
diff --git a/src/Reports/EnvelopeReport.php b/src/Reports/EnvelopeReport.php
index cfb62db7f9..94f2d27430 100644
--- a/src/Reports/EnvelopeReport.php
+++ b/src/Reports/EnvelopeReport.php
@@ -84,7 +84,7 @@ public function sGetFamilyString(Family $family): string
}
// Number of lines is only for the $text parameter
- public function addRecord($text, $numlines): void
+ public function addRecord($text, int $numlines): void
{
// Add an extra blank line after record
$numlines++;
@@ -105,7 +105,6 @@ public function addRecord($text, $numlines): void
$families = FamilyQuery::Create()->orderByEnvelope()->filterByEnvelope(0, 'Criteria::GREATER_THAN')->find();
foreach ($families as $family) {
- $OutStr = '';
$OutStr = $pdf->sGetFamilyString($family);
// Count the number of lines in the output string
diff --git a/src/Reports/FamilyPledgeSummary.php b/src/Reports/FamilyPledgeSummary.php
index a6b372c1ed..f6c06f15f3 100644
--- a/src/Reports/FamilyPledgeSummary.php
+++ b/src/Reports/FamilyPledgeSummary.php
@@ -95,7 +95,7 @@
foreach ($_POST['family'] as $famID) {
$fam[$count++] = InputUtils::legacyFilterInput($famID, 'int');
}
- if ($count == 1) {
+ if ($count === 1) {
if ($fam[0]) {
$sSQL .= " AND fam_ID='$fam[0]' ";
}
@@ -117,7 +117,7 @@
foreach ($_POST['funds'] as $fundID) {
$fund[$fundCount++] = InputUtils::legacyFilterInput($fundID, 'int');
}
- if ($fundCount == 1) {
+ if ($fundCount === 1) {
if ($fund[0]) {
$sSQLFundCriteria .= " AND plg_fundID='$fund[0]' ";
}
@@ -132,7 +132,7 @@
// Make the string describing the fund filter
if ($fundCount > 0) {
- if ($fundCount == 1) {
+ if ($fundCount === 1) {
if ($fund[0] == gettext('All Funds')) {
$fundOnlyString = gettext(' for all funds');
} else {
@@ -222,7 +222,7 @@ public function __construct()
$temp = "SELECT plg_plgID FROM pledge_plg
WHERE plg_FamID='$fam_ID' AND plg_PledgeOrPayment='Pledge' AND plg_FYID=$iFYID" . $sSQLFundCriteria;
$rsPledgeCheck = RunQuery($temp);
- if (mysqli_num_rows($rsPledgeCheck) == 0) {
+ if (mysqli_num_rows($rsPledgeCheck) === 0) {
continue;
}
}
@@ -235,7 +235,7 @@ public function __construct()
$rsPledges = RunQuery($sSQL);
// If there is no pledge or a payment go to next family
- if (mysqli_num_rows($rsPledges) == 0) {
+ if (mysqli_num_rows($rsPledges) === 0) {
continue;
}
@@ -269,8 +269,7 @@ public function __construct()
$totalAmountPledges = 0;
- if (mysqli_num_rows($rsPledges) == 0) {
- } else {
+ if (mysqli_num_rows($rsPledges) != 0) {
$totalAmount = 0;
$cnt = 0;
while ($aRow = mysqli_fetch_array($rsPledges)) {
@@ -296,8 +295,7 @@ public function __construct()
$rsPledges = RunQuery($sSQL);
$totalAmountPayments = 0;
- if (mysqli_num_rows($rsPledges) == 0) {
- } else {
+ if (mysqli_num_rows($rsPledges) != 0) {
$totalAmount = 0;
$cnt = 0;
while ($aRow = mysqli_fetch_array($rsPledges)) {
diff --git a/src/Reports/FundRaiserStatement.php b/src/Reports/FundRaiserStatement.php
index 0977aee919..d11c9f1237 100644
--- a/src/Reports/FundRaiserStatement.php
+++ b/src/Reports/FundRaiserStatement.php
@@ -42,9 +42,8 @@ public function __construct()
public function startNewPage($fam_ID, $fam_Name, $fam_Address1, $fam_Address2, string $fam_City, string $fam_State, string $fam_Zip, $fam_Country): float
{
global $letterhead;
- $curY = $this->startLetterPage($fam_ID, $fam_Name, $fam_Address1, $fam_Address2, $fam_City, $fam_State, $fam_Zip, $fam_Country, $letterhead);
- return $curY;
+ return $this->startLetterPage($fam_ID, $fam_Name, $fam_Address1, $fam_Address2, $fam_City, $fam_State, $fam_Zip, $fam_Country, $letterhead);
}
public function finishPage($curY): void
diff --git a/src/Reports/PDFLabel.php b/src/Reports/PDFLabel.php
index 24b580aafb..f3e1a63dc0 100644
--- a/src/Reports/PDFLabel.php
+++ b/src/Reports/PDFLabel.php
@@ -25,7 +25,7 @@ function GroupBySalutation(string $famID, $aAdultRole, $aChildRole)
$sSQL = 'SELECT * FROM family_fam WHERE fam_ID=' . $famID;
$rsFamInfo = RunQuery($sSQL);
- if (mysqli_num_rows($rsFamInfo) == 0) {
+ if (mysqli_num_rows($rsFamInfo) === 0) {
return 'Invalid Family' . $famID;
}
@@ -533,16 +533,14 @@ function ZipBundleSort(array $inLabels)
unset($Zips);
$n = count($inLabels);
$zc = $n;
- if ($zc > 0) {
- $NoteText = ['Note' => '******* Presort MIXED ADC '];
- $NameText = ['Name' => '** ' . $zc . ' Addresses in Bundle *'];
- $AddressText = ['Address' => '** ' . $nTotalLabels . ' Total Addresses *'];
- $CityText = ['City' => '******* Presort MIXED ADC '];
- $outList[] = array_merge($NoteText, $NameText, $AddressText, $CityText);
- for ($i = 0; $i < $n; $i++) {
- $outList[] = array_merge($inLabels[$i], $NoteText);
- $nmadc++;
- }
+ $NoteText = ['Note' => '******* Presort MIXED ADC '];
+ $NameText = ['Name' => '** ' . $zc . ' Addresses in Bundle *'];
+ $AddressText = ['Address' => '** ' . $nTotalLabels . ' Total Addresses *'];
+ $CityText = ['City' => '******* Presort MIXED ADC '];
+ $outList[] = array_merge($NoteText, $NameText, $AddressText, $CityText);
+ for ($i = 0; $i < $n; $i++) {
+ $outList[] = array_merge($inLabels[$i], $NoteText);
+ $nmadc++;
}
if (count($outList) > 0) {
@@ -656,7 +654,7 @@ function GenerateLabels(&$pdf, $mode, $iBulkMailPresort, $bToParents, $bOnlyComp
// Now sort the label list by presort bundle definitions
$zipLabels = ZipBundleSort($sLabelList);
if ($iBulkMailPresort == 2) {
- foreach ($zipLabels as $i => $sLT) {
+ foreach ($zipLabels as $sLT) {
$pdf->addPdfLabel(sprintf(
"%s\n%s\n%s\n%s, %s %s",
$sLT['Note'],
@@ -668,7 +666,7 @@ function GenerateLabels(&$pdf, $mode, $iBulkMailPresort, $bToParents, $bOnlyComp
));
}
} else {
- foreach ($zipLabels as $i => $sLT) {
+ foreach ($zipLabels as $sLT) {
$pdf->addPdfLabel(sprintf(
"%s\n%s\n%s, %s %s",
$sLT['Name'],
@@ -680,7 +678,7 @@ function GenerateLabels(&$pdf, $mode, $iBulkMailPresort, $bToParents, $bOnlyComp
}
}
} else {
- foreach ($sLabelList as $i => $sLT) {
+ foreach ($sLabelList as $sLT) {
$pdf->addPdfLabel(sprintf(
"%s\n%s\n%s, %s %s",
$sLT['Name'],
@@ -787,7 +785,7 @@ function GenerateLabels(&$pdf, $mode, $iBulkMailPresort, $bToParents, $bOnlyComp
$sCSVOutput .= '"' . InputUtils::translateSpecialCharset('Greeting') . '"' . $delimiter . '"' . InputUtils::translateSpecialCharset('Name') . '"' . $delimiter . '"' . InputUtils::translateSpecialCharset('Address') . '"' . $delimiter . '"' . InputUtils::translateSpecialCharset('City') . '"' . $delimiter . '"' . InputUtils::translateSpecialCharset('State') . '"' . $delimiter . '"' . InputUtils::translateSpecialCharset('Zip') . '"' . "\n";
- foreach ($aLabelList as $i => $sLT) {
+ foreach ($aLabelList as $sLT) {
if ($iBulkCode) {
$sCSVOutput .= '"' . $sLT['Note'] . '"' . $delimiter;
}
diff --git a/src/Reports/PhotoBook.php b/src/Reports/PhotoBook.php
index 376f8e6fc0..2645b5b661 100644
--- a/src/Reports/PhotoBook.php
+++ b/src/Reports/PhotoBook.php
@@ -20,7 +20,7 @@
class PdfPhotoBook extends ChurchInfoReport
{
private $group;
- private $FYIDString;
+ private string $FYIDString;
private ?int $currentX = null;
private ?int $currentY = null;
private int $pageMarginL = 15;
diff --git a/src/Reports/PledgeSummary.php b/src/Reports/PledgeSummary.php
index ae1a383652..6abd8d29c4 100644
--- a/src/Reports/PledgeSummary.php
+++ b/src/Reports/PledgeSummary.php
@@ -23,7 +23,7 @@
$_SESSION['idefaultFY'] = $iFYID;
// If CSVAdminOnly option is enabled and user is not admin, redirect to the menu.
-if (!AuthenticationManager::getCurrentUser()->isAdmin() && SystemConfig::getValue('bCSVAdminOnly') && $output != 'pdf') {
+if (!AuthenticationManager::getCurrentUser()->isAdmin() && SystemConfig::getValue('bCSVAdminOnly') && $output !== 'pdf') {
RedirectUtils::redirect('v2/dashboard');
}
@@ -58,10 +58,12 @@
// Filter by Fund
if (!empty($_POST['funds'])) {
$count = 0;
+ $fund = [];
+
foreach ($_POST['funds'] as $fundID) {
$fund[$count++] = InputUtils::legacyFilterInput($fundID, 'int');
}
- if ($count == 1) {
+ if ($count === 1) {
if ($fund[0]) {
$sSQL .= " AND plg_fundID='$fund[0]' ";
}
@@ -110,7 +112,6 @@ public function __construct()
$paidThisFam = [];
$pledgeThisFam = [];
$totRows = mysqli_num_rows($rsPledges);
- $thisRow = 0;
$fundName = '';
$plg_famID = 0;
@@ -125,7 +126,7 @@ public function __construct()
$fundName = 'Unassigned';
}
- if ($plg_famID != $curFam || $thisRow == $totRows) {
+ if ($thisRow === $totRows) {
// Switching families. Post the results for the previous family and initialize for the new family
mysqli_data_seek($rsFunds, 0);
while ($row = mysqli_fetch_array($rsFunds)) {
diff --git a/src/Reports/ReminderReport.php b/src/Reports/ReminderReport.php
index 42250d6da6..868e67c6cf 100644
--- a/src/Reports/ReminderReport.php
+++ b/src/Reports/ReminderReport.php
@@ -181,15 +181,14 @@ public function __construct()
$this->SetAutoPageBreak(false);
}
- public function startNewPage($fam_ID, $fam_Name, $fam_Address1, $fam_Address2, string $fam_City, string $fam_State, string $fam_Zip, $fam_Country, string $fundOnlyString, $iFYID): float
+ public function startNewPage($fam_ID, $fam_Name, $fam_Address1, $fam_Address2, string $fam_City, string $fam_State, string $fam_Zip, $fam_Country, string $fundOnlyString, int $iFYID): float
{
$curY = $this->startLetterPage($fam_ID, $fam_Name, $fam_Address1, $fam_Address2, $fam_City, $fam_State, $fam_Zip, $fam_Country);
$curY += 2 * SystemConfig::getValue('incrementY');
$blurb = SystemConfig::getValue('sReminder1') . MakeFYString($iFYID) . $fundOnlyString . '.';
$this->writeAt(SystemConfig::getValue('leftX'), $curY, $blurb);
- $curY += 2 * SystemConfig::getValue('incrementY');
- return $curY;
+ return $curY + 2 * SystemConfig::getValue('incrementY');
}
public function finishPage($curY): void
@@ -213,7 +212,7 @@ public function finishPage($curY): void
$temp = "SELECT plg_plgID FROM pledge_plg
WHERE plg_FamID='$fam_ID' AND plg_PledgeOrPayment='Pledge' AND plg_FYID=$iFYID" . $sSQLFundCriteria;
$rsPledgeCheck = RunQuery($temp);
- if (mysqli_num_rows($rsPledgeCheck) == 0) {
+ if (mysqli_num_rows($rsPledgeCheck) === 0) {
continue;
}
}
@@ -226,7 +225,7 @@ public function finishPage($curY): void
$rsPledges = RunQuery($sSQL);
// If there is no pledge or a payment go to next family
- if (mysqli_num_rows($rsPledges) == 0) {
+ if (mysqli_num_rows($rsPledges) === 0) {
continue;
}
@@ -282,7 +281,7 @@ public function finishPage($curY): void
$summaryIntervalY = 4;
- if (mysqli_num_rows($rsPledges) == 0) {
+ if (mysqli_num_rows($rsPledges) === 0) {
$curY += $summaryIntervalY;
$noPledgeString = SystemConfig::getValue('sReminderNoPledge') . '(' . $fundOnlyString . ')';
$pdf->writeAt($summaryDateX, $curY, $noPledgeString);
@@ -349,7 +348,7 @@ public function finishPage($curY): void
$totalAmountPayments = 0;
$fundPaymentTotal = [];
- if (mysqli_num_rows($rsPledges) == 0) {
+ if (mysqli_num_rows($rsPledges) === 0) {
$curY += $summaryIntervalY;
$pdf->writeAt($summaryDateX, $curY, SystemConfig::getValue('sReminderNoPayments'));
$curY += 2 * $summaryIntervalY;
diff --git a/src/Reports/TaxReport.php b/src/Reports/TaxReport.php
index 115bba09b1..ed58016b15 100644
--- a/src/Reports/TaxReport.php
+++ b/src/Reports/TaxReport.php
@@ -197,9 +197,8 @@ public function startNewPage($fam_ID, $fam_Name, $fam_Address1, $fam_Address2, s
}
$blurb = SystemConfig::getValue('sTaxReport1') . ' ' . $DateString . '.';
$this->writeAt(SystemConfig::getValue('leftX'), $curY, $blurb);
- $curY += 2 * SystemConfig::getValue('incrementY');
- return $curY;
+ return $curY + 2 * SystemConfig::getValue('incrementY');
}
public function finishPage($curY, $fam_ID, $fam_Name, $fam_Address1, $fam_Address2, string $fam_City, string $fam_State, string $fam_Zip, $fam_Country): void
diff --git a/src/Reports/VotingMembers.php b/src/Reports/VotingMembers.php
index 6b8784c1d8..65c486b011 100644
--- a/src/Reports/VotingMembers.php
+++ b/src/Reports/VotingMembers.php
@@ -85,7 +85,7 @@ public function __construct()
$rsFamilyMembers = RunQuery($sSQL);
- if (mysqli_num_rows($rsFamilyMembers) == 0) {
+ if (mysqli_num_rows($rsFamilyMembers) === 0) {
$curY += 5;
}
diff --git a/src/Reports/ZeroGivers.php b/src/Reports/ZeroGivers.php
index de1b56ec50..64eb8d5d69 100644
--- a/src/Reports/ZeroGivers.php
+++ b/src/Reports/ZeroGivers.php
@@ -89,9 +89,8 @@ public function startNewPage($fam_ID, $fam_Name, $fam_Address1, $fam_Address2, s
$blurb = SystemConfig::getValue('sTaxReport1') . ' ' . $DateString . ' ' . SystemConfig::getValue('sZeroGivers');
$this->writeAt(SystemConfig::getValue('leftX'), $curY, $blurb);
- $curY += 30 * SystemConfig::getValue('incrementY');
- return $curY;
+ return $curY + 30 * SystemConfig::getValue('incrementY');
}
public function finishPage($curY, $fam_ID, $fam_Name, $fam_Address1, $fam_Address2, $fam_City, $fam_State, $fam_Zip, $fam_Country): void
diff --git a/src/SelectDelete.php b/src/SelectDelete.php
index 34254790d5..9c2b570791 100644
--- a/src/SelectDelete.php
+++ b/src/SelectDelete.php
@@ -249,34 +249,34 @@
= $plg_DateLastEdited ?>
= $EnteredFirstName . ' ' . $EnteredLastName ?>
- ';
- } else {
- // No Donations from family. Normal delete confirmation
- echo $DonationMessage;
- echo "
" . gettext('Please confirm deletion of this family record:') . ' ';
- echo gettext('Note: This will also delete all Notes associated with this Family record.');
- echo gettext('(this action cannot be undone)') . '
';
+ } else {
+ // No Donations from family. Normal delete confirmation
+ echo $DonationMessage;
+ echo "
" . gettext('Please confirm deletion of this family record:') . ' ';
+ echo gettext('Note: This will also delete all Notes associated with this Family record.');
+ echo gettext('(this action cannot be undone)') . '