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

Apply fixes from StyleCI #2131

Merged
merged 1 commit into from
Mar 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 32 additions & 34 deletions src/Checkin.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
use ChurchCRM\dto\SystemURLs;
use ChurchCRM\dto\SystemConfig;


$EventID = 0;
$CheckoutOrDelete = false;
$event = null;
Expand All @@ -47,10 +46,10 @@
$CheckoutOrDelete = true;
}

if(isset($_POST['child-id'])) {
if (isset($_POST['child-id'])) {
$iChildID = FilterInput($_POST['child-id'], 'int');
}
if(isset($_POST['adult-id'])) {
if (isset($_POST['adult-id'])) {
$iAdultID = FilterInput($_POST['adult-id'], 'int');
}

Expand All @@ -63,7 +62,7 @@
->filterByInActive(1, Criteria::NOT_EQUAL)
->find();

if($EventID > 0) {
if ($EventID > 0) {
//get Event Details
$event = EventQuery::Create()
->findOneById($EventID);
Expand Down Expand Up @@ -94,13 +93,13 @@
<option value="<?= $EventID; ?>"
disabled <?= ($EventID == 0) ? " Selected='selected'" : "" ?> ><?= gettext('Select event') ?></option>
<?php foreach ($activeEvents as $event) {
?>
?>
<option
value="<?= $event->getId(); ?>" <?= ($EventID == $event->getId()) ? " Selected='selected'" : "" ?> >
<?= $event->getTitle(); ?></option>
<?php

}
}
?>
</select>
</div>
Expand Down Expand Up @@ -185,24 +184,24 @@ class="col-sm-2 control-label"><?= gettext('Adult Name(Optional)') ?></label>
</form> <!-- end AddAttendees form -->

<?php

}

// Checkin/Checkout Section update db
if (isset($_POST['EventID']) && isset($_POST['child-id']) && (isset($_POST['CheckIn']) || isset($_POST['CheckOut']) || isset($_POST['Delete']))) {
//Fields -> event_id, person_id, checkin_date, checkin_id, checkout_date, checkout_id
if (isset($_POST['CheckIn']) && $iChildID > 0 ) {

if (isset($_POST['CheckIn']) && $iChildID > 0) {
$attendee = EventAttendQuery::create()
->filterByEventId($EventID)
->findOneByPersonId($iChildID);
if($attendee)
{ ?>
if ($attendee) {
?>
<script>
$('#errorcallout').text('<?= gettext("Person has been already checked in for this event") ?>').fadeIn();
</script>
<?php
} else {

} else {
$attendee = new EventAttend();
$attendee->setEventId($EventID);
$attendee->setPersonId($iChildID);
Expand Down Expand Up @@ -234,7 +233,6 @@ class="col-sm-2 control-label"><?= gettext('Adult Name(Optional)') ?></label>
->filterByEventId($EventID)
->findOneByPersonId($iChildID)
->delete();

}
}

Expand All @@ -244,7 +242,6 @@ class="col-sm-2 control-label"><?= gettext('Adult Name(Optional)') ?></label>
if (isset($_POST['EventID']) && isset($_POST['child-id']) &&
(isset($_POST['CheckOutBtn']) || isset($_POST['DeleteBtn']))
) {

$iChildID = FilterInput($_POST['child-id'], 'int');

$formTitle = (isset($_POST['CheckOutBtn']) ? gettext("CheckOut Person") : gettext("Delete Checkin in Entry")); ?>
Expand Down Expand Up @@ -293,14 +290,15 @@ class="col-sm-2 control-label"><?= gettext('Adult Name(Optional)') ?></label>
</div>
<?php

} else { // DeleteBtn ?>
} else { // DeleteBtn?>
<div class="form-group">
<input type="submit" class="btn btn-danger"
value="<?= gettext('Delete') ?>" name="Delete">
<input type="submit" class="btn btn-default" value="<?= gettext('Cancel') ?>"
name="DeleteCancel">
</div>
<?php

} ?>
</div>
</div>
Expand All @@ -309,6 +307,7 @@ class="col-sm-2 control-label"><?= gettext('Adult Name(Optional)') ?></label>
</div>
</form>
<?php

}
//End checkout
//**********************************************************************************************************
Expand Down Expand Up @@ -337,31 +336,28 @@ class="col-sm-2 control-label"><?= gettext('Adult Name(Optional)') ?></label>
->filterByEventId($EventID)
->find();

foreach ($eventAttendees as $per) {
//Get Person who is checked in
foreach ($eventAttendees as $per) {
//Get Person who is checked in
$checkedInPerson = PersonQuery::create()
->findOneById($per->getPersonId());

$sPerson = $checkedInPerson->getFullName();
$sPerson = $checkedInPerson->getFullName();

//Get Person who checked person in
$sCheckinby = "";
if ($per->getCheckinId()) {
$checkedInBy = PersonQuery::create()
if ($per->getCheckinId()) {
$checkedInBy = PersonQuery::create()
->findOneById($per->getCheckinId());
$sCheckinby = $checkedInBy->getFullName();
}
$sCheckinby = $checkedInBy->getFullName();
}

//Get Person who checked person out
$sCheckoutby = "";
if ($per->getCheckoutId()) {
$checkedOutBy = PersonQuery::create()
if ($per->getCheckoutId()) {
$checkedOutBy = PersonQuery::create()
->findOneById($per->getCheckoutId());
$sCheckoutby = $checkedOutBy->getFullName();

}

?>
$sCheckoutby = $checkedOutBy->getFullName();
} ?>
<tr>
<td><img data-name="<?= $sPerson; ?>"
data-src="<?= SystemURLs::getRootPath() . '/api/persons/' . $per->getPersonId() . '/thumbnail' ?>"
Expand All @@ -377,24 +373,27 @@ class="direct-chat-img initials-image">&nbsp
<input type="hidden" name="child-id" value="<?= $per->getPersonId() ?>">
<input type="hidden" name="EventID" value="<?= $EventID ?>">
<?php
if (!$per->getCheckoutDate()) { ?>
if (!$per->getCheckoutDate()) {
?>
<input class="btn btn-primary btn-sm" type="submit" name="CheckOutBtn"
value="<?= gettext('CheckOut') ?>">
<input class="btn btn-danger btn-xs" type="submit" name="DeleteBtn"
value="<?= gettext('Delete') ?>">

<?php

} else { ?>
} else {
?>
<i class="fa fa-check-circle"></i>
<?php

} ?>
</form>
</td>
</tr>
<?php

} ?>
} ?>
</tbody>
</table>
</div>
Expand Down Expand Up @@ -477,13 +476,13 @@ function SetPersonHtml(element, perArr) {

function loadPerson($iPersonID)
{
if ($iPersonID == 0) {
if ($iPersonID == 0) {
echo "";
}
$person = PersonQuery::create()
->findOneById($iPersonID);
$familyRole="(";
if($person->getFamId()) {
if ($person->getFamId()) {
if ($person->getFamilyRole()) {
$familyRole .= $person->getFamilyRoleName();
} else {
Expand All @@ -502,6 +501,5 @@ function loadPerson($iPersonID)
'<img data-name="' . $person->getFullName() . '" data-src="' . SystemURLs::getRootPath() . '/api/persons/' . $iPersonID . '/thumbnail" ' .
'class="initials-image profile-user-img img-responsive img-circle"> </div>';
echo $html;

}
?>