Pull in changes

This commit is contained in:
2019-03-10 18:51:52 -06:00
parent b4dcd506fc
commit 55f736e5a1
6 changed files with 134 additions and 90 deletions

View File

@@ -98,95 +98,135 @@ else
}
}
else
{
try
if ($_SERVER['REQUEST_METHOD'] == 'GET')
{
if (isset($_GET['class_id']))
try
{
/*
* Get with class_id, show class details/signup
*/
$classID = (int) cleanInput($_GET['class_id']);
$classDiv = $doc->createElement('div');
$classDiv->setAttribute('class', 'FloatLeft50Div');
$dbh = returnDatabaseHandel();
$sth = $dbh->prepare($statement249);
if ($sth->execute(array($classID)))
if (isset($_GET['class_id']))
{
$count = 0;
while ($row = $sth->fetch(PDO::FETCH_ASSOC))
/*
* Get with class_id, show class details/signup
*/
$classID = (int) cleanInput($_GET['class_id']);
$classDiv = $doc->createElement('div');
$classDiv->setAttribute('class', 'FloatLeft50Div');
$dbh = returnDatabaseHandel();
$sth = $dbh->prepare($statement249);
if ($sth->execute(array($classID)))
{
$count = 0;
while ($row = $sth->fetch(PDO::FETCH_ASSOC))
{
$count++;
$h3 = $doc->createElement('h3');
$h3->appendChild($doc->createTextNode("Class Number " . $row['id']));
$classDiv->appendChild($h3);
//$classDiv->appendChild($doc->createElement('br'));
$h3 = $doc->createElement('h3');
$h3->appendChild($doc->createTextNode($row['name']));
$classDiv->appendChild($h3);
$h5 = $doc->createElement('h5');
$h5->appendChild($doc->createTextNode("Cost: " . money_format('%i', $row['cost'])));
$classDiv->appendChild($h5);
$h5 = $doc->createElement('h5');
$h5->appendChild($doc->createTextNode("Starting at: " . $row['start_datetime']));
$classDiv->appendChild($h5);
$p = $doc->createElement('p');
$p->appendChild($doc->createTextNode($row['description']));
$classDiv->appendChild($p);
/*
* Register, deregister?
*/
$form = createForm($doc, "classes.php");
$input = createHiddenInput($doc, 'class_id', (string)$row['id']);
/* $input = $doc->createElement('input');
$input->setAttribute('type', 'hidden');
$input->setAttribute('name', 'class_id');
$input->setAttribute('value', $row['id']); */
$form->appendChild($input);
$status = returnMemberStatusForClass($classID, $_SESSION['MemberID']);
if ($status === "Confirmed" || $status === "Registered")
{
$input = createSubmitInput($doc, 'withdraw', $text0020);
/* $input = $doc->createElement('input');
$input->setAttribute('type', 'submit');
$input->setAttribute('name', 'withdraw');
$input->setAttribute('value', 'Withdraw');*/
$form->appendChild($input);
}
else
{
$input = createSubmitInput($doc, 'register', $text0021);
/* $input = $doc->createElement('input');
$input->setAttribute('type', 'submit');
$input->setAttribute('name', 'register');
$input->setAttribute('value', 'Register'); */
$form->appendChild($input);
}
$classDiv->appendChild($form);
}
}
if ($count == 1)
$body->appendChild($classDiv);
else
$body->appendChild(generateTrainingTable($doc, 'classes.php'));
}
else
if (isset($_GET['course_id']))
{
$count++;
$h3 = $doc->createElement('h3');
$h3->appendChild($doc->createTextNode("Class Number " . $row['id']));
$classDiv->appendChild($h3);
//$classDiv->appendChild($doc->createElement('br'));
$h3 = $doc->createElement('h3');
$h3->appendChild($doc->createTextNode($row['name']));
$classDiv->appendChild($h3);
$h5 = $doc->createElement('h5');
$h5->appendChild($doc->createTextNode("Cost: " . money_format('%i', $row['cost'])));
$classDiv->appendChild($h5);
$h5 = $doc->createElement('h5');
$h5->appendChild($doc->createTextNode("Starting at: " . $row['start_datetime']));
$classDiv->appendChild($h5);
$p = $doc->createElement('p');
$p->appendChild($doc->createTextNode($row['description']));
$classDiv->appendChild($p);
/*
* Register, deregister?
* Get with no class_id, display table
*/
$form = createForm($doc, "classes.php");
$input = createHiddenInput($doc, 'class_id', (string)$row['id']);
/* $input = $doc->createElement('input');
$input->setAttribute('type', 'hidden');
$input->setAttribute('name', 'class_id');
$input->setAttribute('value', $row['id']); */
$form->appendChild($input);
$courseID = (int) cleanInput($_GET['course_id']);
$courseDiv = createDiv($doc, 'FloatLeft50Div');
$status = returnMemberStatusForClass($classID, $_SESSION['MemberID']);
if ($status === "Confirmed" || $status === "Registered")
$dbh = returnDatabaseHandel();
$sth = $dbh->prepare($statement289);
if ($sth->execute(array($courseID)))
{
$input = createSubmitInput($doc, 'withdraw', $text0020);
/* $input = $doc->createElement('input');
$input->setAttribute('type', 'submit');
$input->setAttribute('name', 'withdraw');
$input->setAttribute('value', 'Withdraw');*/
$form->appendChild($input);
$count = 0;
while ($row = $sth->fetch(PDO::FETCH_ASSOC))
{
$count++;
//print ("bonk");
$h3 = $doc->createElement('h3');
$h3->appendChild($doc->createTextNode("Course ID: " . $row['id']));
$courseDiv->appendChild($h3);
//$body->appendChild(generateTrainingTable($doc, 'classes.php'));
$h3 = $doc->createElement('h3');
$h3->appendChild($doc->createTextNode("Course Title: " . $row['name']));
$courseDiv->appendChild($h3);
$h3 = $doc->createElement('h3');
$h3->appendChild($doc->createTextNode("Course Description: " . $row['description']));
$courseDiv->appendChild($h3);
}
}
else
{
$input = createSubmitInput($doc, 'register', $text0021);
/* $input = $doc->createElement('input');
$input->setAttribute('type', 'submit');
$input->setAttribute('name', 'register');
$input->setAttribute('value', 'Register'); */
$form->appendChild($input);
}
$classDiv->appendChild($form);
$body->appendChild($courseDiv);
}
}
if ($count == 1)
$body->appendChild($classDiv);
else
$body->appendChild(generateTrainingTable($doc, 'classes.php'));
else
{
/*
* Get with no class_id, display table
*/
$body->appendChild(generateTrainingTable($doc, 'classes.php'));
}
}
else
catch (Exception $e)
{
/*
* Get with no class_id, display table
*/
$body->appendChild(generateTrainingTable($doc, 'classes.php'));
}
}
catch (Exception $e)
{
$body->appendChild(generateTrainingTable($doc, 'classes.php'));
}
}
$body->appendChild(generateFooter($doc));
if ($prettyPretty)