Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce phpcs and conform to psr12 #6600

Merged
merged 17 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 8 additions & 7 deletions src/AddDonors.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*******************************************************************************
*
* filename : AddDonors.php
Expand All @@ -19,33 +20,33 @@

$linkBack = '';
if (array_key_exists('linkBack', $_GET)) {
InputUtils::LegacyFilterInput($_GET['linkBack']);
InputUtils::legacyFilterInput($_GET['linkBack']);
}
$iFundRaiserID = InputUtils::LegacyFilterInput($_GET['FundRaiserID']);
$iFundRaiserID = InputUtils::legacyFilterInput($_GET['FundRaiserID']);

if ($linkBack == '') {
$linkBack = "PaddleNumList.php?FundRaiserID=$iFundRaiserID";
}

if ($iFundRaiserID > 0) {
// Get the current fund raiser record
$sSQL = 'SELECT * from fundraiser_fr WHERE fr_ID = '.$iFundRaiserID;
$sSQL = 'SELECT * from fundraiser_fr WHERE fr_ID = ' . $iFundRaiserID;
$rsFRR = RunQuery($sSQL);
extract(mysqli_fetch_array($rsFRR));
// Set current fundraiser
$_SESSION['iCurrentFundraiser'] = $iFundRaiserID;
} else {
RedirectUtils::Redirect($linkBack);
RedirectUtils::redirect($linkBack);
}

// Get all the people listed as donors for this fundraiser
$sSQL = "SELECT a.per_id as donorID FROM donateditem_di
LEFT JOIN person_per a ON di_donor_ID=a.per_ID
WHERE di_FR_ID = '".$iFundRaiserID."' ORDER BY a.per_id";
WHERE di_FR_ID = '" . $iFundRaiserID . "' ORDER BY a.per_id";
$rsDonors = RunQuery($sSQL);

$extraPaddleNum = 1;
$sSQL = "SELECT MAX(pn_NUM) AS pn_max FROM paddlenum_pn WHERE pn_FR_ID = '".$iFundRaiserID."'";
$sSQL = "SELECT MAX(pn_NUM) AS pn_max FROM paddlenum_pn WHERE pn_FR_ID = '" . $iFundRaiserID . "'";
$rsMaxPaddle = RunQuery($sSQL);
if (mysqli_num_rows($rsMaxPaddle) > 0) {
$oneRow = mysqli_fetch_array($rsMaxPaddle);
Expand All @@ -67,4 +68,4 @@
$extraPaddleNum = $extraPaddleNum + 1;
}
}
RedirectUtils::Redirect($linkBack);
RedirectUtils::redirect($linkBack);
9 changes: 5 additions & 4 deletions src/BackupDatabase.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*******************************************************************************
*
* filename : BackupDatabase.php
Expand All @@ -20,8 +21,8 @@

// Security: User must be an Admin to access this page.
// Otherwise, re-direct them to the main menu.
if (!AuthenticationManager::GetCurrentUser()->isAdmin()) {
RedirectUtils::Redirect('Menu.php');
if (!AuthenticationManager::getCurrentUser()->isAdmin()) {
RedirectUtils::redirect('Menu.php');
exit;
}

Expand Down Expand Up @@ -53,8 +54,8 @@
<?= gettext('Re-type Password') ?>:<input type="password" name="pw2">
<BR><span id="passworderror" style="color: red"></span><BR><BR>

<input type="button" class="btn btn-primary" id="doBackup" <?= 'value="'.gettext('Generate Backup').'"' ?>>
<input type="button" class="btn btn-primary" id="doRemoteBackup" <?= 'value="'.gettext('Generate and Ship Backup to External Storage').'"' ?>>
<input type="button" class="btn btn-primary" id="doBackup" <?= 'value="' . gettext('Generate Backup') . '"' ?>>
<input type="button" class="btn btn-primary" id="doRemoteBackup" <?= 'value="' . gettext('Generate and Ship Backup to External Storage') . '"' ?>>

</form>
</div>
Expand Down
99 changes: 50 additions & 49 deletions src/BatchWinnerEntry.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*******************************************************************************
*
* filename : BatchWinnerEntry.php
Expand All @@ -15,8 +16,8 @@
use ChurchCRM\Utils\InputUtils;
use ChurchCRM\Utils\RedirectUtils;

$linkBack = InputUtils::LegacyFilterInput($_GET['linkBack']);
$iCurrentFundraiser = InputUtils::LegacyFilterInput($_GET['CurrentFundraiser']);
$linkBack = InputUtils::legacyFilterInput($_GET['linkBack']);
$iCurrentFundraiser = InputUtils::legacyFilterInput($_GET['CurrentFundraiser']);

if ($iCurrentFundraiser) {
$_SESSION['iCurrentFundraiser'] = $iCurrentFundraiser;
Expand All @@ -26,7 +27,7 @@

// Get the current fundraiser data
if ($iCurrentFundraiser) {
$sSQL = 'SELECT * from fundraiser_fr WHERE fr_ID = '.$iCurrentFundraiser;
$sSQL = 'SELECT * from fundraiser_fr WHERE fr_ID = ' . $iCurrentFundraiser;
$rsDeposit = RunQuery($sSQL);
extract(mysqli_fetch_array($rsDeposit));
}
Expand All @@ -45,13 +46,13 @@
RunQuery($sSQL);
}
}
RedirectUtils::Redirect($linkBack);
RedirectUtils::redirect($linkBack);
}

// Get Items for the drop-down
$sDonatedItemsSQL = "SELECT di_ID, di_Item, di_title, di_multibuy
FROM donateditem_di
WHERE di_FR_ID = '".$iCurrentFundraiser."' ORDER BY SUBSTR(di_Item,1,1), CONVERT(SUBSTR(di_Item,2,3),SIGNED)";
WHERE di_FR_ID = '" . $iCurrentFundraiser . "' ORDER BY SUBSTR(di_Item,1,1), CONVERT(SUBSTR(di_Item,2,3),SIGNED)";
$rsDonatedItems = RunQuery($sDonatedItemsSQL);

//Get Paddles for the drop-down
Expand All @@ -60,63 +61,63 @@
a.per_LastName AS buyerLastName
FROM paddlenum_pn
LEFT JOIN person_per a on a.per_ID=pn_per_ID
WHERE pn_fr_ID='.$iCurrentFundraiser.' ORDER BY pn_Num';
WHERE pn_fr_ID=' . $iCurrentFundraiser . ' ORDER BY pn_Num';
$rsPaddles = RunQuery($sPaddleSQL);

require 'Include/Header.php';

?>
<div class="card card-body">
<form method="post" action="BatchWinnerEntry.php?<?= 'CurrentFundraiser='.'&linkBack='.$linkBack ?>" name="BatchWinnerEntry">
<form method="post" action="BatchWinnerEntry.php?<?= 'CurrentFundraiser=' . '&linkBack=' . $linkBack ?>" name="BatchWinnerEntry">
<div class="table-responsive">
<table class="table" cellpadding="2" align="center">
<tr>
<td class="LabelColumn"><?= gettext('Item') ?></td>
<td class="LabelColumn"><?= gettext('Winner') ?></td>
<td class="LabelColumn"><?= gettext('Price') ?></td>
</tr>
<tr>
<td class="LabelColumn"><?= gettext('Item') ?></td>
<td class="LabelColumn"><?= gettext('Winner') ?></td>
<td class="LabelColumn"><?= gettext('Price') ?></td>
</tr>
<?php
for ($row = 0; $row < 10; $row += 1) {
echo '<tr>';
echo '<td>';
echo '<select name="Item'.$row."\">\n";
echo '<option value="0" selected>'.gettext('Unassigned')."</option>\n";

mysqli_data_seek($rsDonatedItems, 0);
while ($itemArr = mysqli_fetch_array($rsDonatedItems)) {
extract($itemArr);
echo '<option value="'.$di_ID.'">'.$di_Item.' '.$di_title."</option>\n";
}
echo "</select>\n";
echo '</td>';
for ($row = 0; $row < 10; $row += 1) {
echo '<tr>';
echo '<td>';
echo '<select name="Item' . $row . "\">\n";
echo '<option value="0" selected>' . gettext('Unassigned') . "</option>\n";

mysqli_data_seek($rsDonatedItems, 0);
while ($itemArr = mysqli_fetch_array($rsDonatedItems)) {
extract($itemArr);
echo '<option value="' . $di_ID . '">' . $di_Item . ' ' . $di_title . "</option>\n";
}
echo "</select>\n";
echo '</td>';

echo '<td>';
echo '<select name="Paddle'.$row."\">\n";
echo '<option value="0" selected>'.gettext('Unassigned')."</option>\n";
echo '<td>';
echo '<select name="Paddle' . $row . "\">\n";
echo '<option value="0" selected>' . gettext('Unassigned') . "</option>\n";

mysqli_data_seek($rsPaddles, 0);
while ($paddleArr = mysqli_fetch_array($rsPaddles)) {
extract($paddleArr);
echo '<option value="'.$pn_per_ID.'">'.$pn_Num.' '.$buyerFirstName.' '.$buyerLastName."</option>\n";
}
echo "</select>\n";
echo '</td>';

echo "<td class=\"TextColumn\"><input type=\"text\" name=\"SellPrice$row\" id=\"SellPrice\"$row value=\"\"></td>\n";
echo '</tr>';
mysqli_data_seek($rsPaddles, 0);
while ($paddleArr = mysqli_fetch_array($rsPaddles)) {
extract($paddleArr);
echo '<option value="' . $pn_per_ID . '">' . $pn_Num . ' ' . $buyerFirstName . ' ' . $buyerLastName . "</option>\n";
}
echo "</select>\n";
echo '</td>';

echo "<td class=\"TextColumn\"><input type=\"text\" name=\"SellPrice$row\" id=\"SellPrice\"$row value=\"\"></td>\n";
echo '</tr>';
}
?>
<tr>
<td colspan="2" align="center">
<input type="submit" class="btn btn-primary" value="<?= gettext('Enter Winners') ?>" name="EnterWinners">
<input type="button" class="btn btn-default" value="<?= gettext('Cancel') ?>" name="Cancel" onclick="javascript:document.location='<?php if (strlen($linkBack) > 0) {
echo $linkBack;
} else {
echo 'Menu.php';
} ?>';">
</td>
</tr>
</table>
<tr>
<td colspan="2" align="center">
<input type="submit" class="btn btn-primary" value="<?= gettext('Enter Winners') ?>" name="EnterWinners">
<input type="button" class="btn btn-default" value="<?= gettext('Cancel') ?>" name="Cancel" onclick="javascript:document.location='<?php if (strlen($linkBack) > 0) {
echo $linkBack;
} else {
echo 'Menu.php';
} ?>';">
</td>
</tr>
</table>
</div>
</form>
</div>
Expand Down
Loading