Pull in changes

This commit is contained in:
Tanner Collin 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 else
{ if ($_SERVER['REQUEST_METHOD'] == 'GET')
try
{ {
if (isset($_GET['class_id'])) try
{ {
/* if (isset($_GET['class_id']))
* 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)) * 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"); $courseID = (int) cleanInput($_GET['course_id']);
$input = createHiddenInput($doc, 'class_id', (string)$row['id']); $courseDiv = createDiv($doc, 'FloatLeft50Div');
/* $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']); $dbh = returnDatabaseHandel();
$sth = $dbh->prepare($statement289);
if ($sth->execute(array($courseID)))
{
$count = 0;
while ($row = $sth->fetch(PDO::FETCH_ASSOC))
{
$count++;
//print ("bonk");
if ($status === "Confirmed" || $status === "Registered") $h3 = $doc->createElement('h3');
{ $h3->appendChild($doc->createTextNode("Course ID: " . $row['id']));
$input = createSubmitInput($doc, 'withdraw', $text0020); $courseDiv->appendChild($h3);
/* $input = $doc->createElement('input'); //$body->appendChild(generateTrainingTable($doc, 'classes.php'));
$input->setAttribute('type', 'submit');
$input->setAttribute('name', 'withdraw'); $h3 = $doc->createElement('h3');
$input->setAttribute('value', 'Withdraw');*/ $h3->appendChild($doc->createTextNode("Course Title: " . $row['name']));
$form->appendChild($input); $courseDiv->appendChild($h3);
$h3 = $doc->createElement('h3');
$h3->appendChild($doc->createTextNode("Course Description: " . $row['description']));
$courseDiv->appendChild($h3);
}
} }
else $body->appendChild($courseDiv);
{
$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);
} }
} else
if ($count == 1) {
$body->appendChild($classDiv); /*
else * Get with no class_id, display table
$body->appendChild(generateTrainingTable($doc, 'classes.php')); */
$body->appendChild(generateTrainingTable($doc, 'classes.php'));
}
} }
else catch (Exception $e)
{ {
/*
* Get with no class_id, display table
*/
$body->appendChild(generateTrainingTable($doc, 'classes.php')); $body->appendChild(generateTrainingTable($doc, 'classes.php'));
} }
} }
catch (Exception $e)
{
$body->appendChild(generateTrainingTable($doc, 'classes.php'));
}
}
$body->appendChild(generateFooter($doc)); $body->appendChild(generateFooter($doc));
if ($prettyPretty) if ($prettyPretty)

View File

@ -330,13 +330,8 @@ else
$editorDiv->setAttribute('class', 'sticky'); $editorDiv->setAttribute('class', 'sticky');
$form = $doc->createElement('form'); $form = $doc->createElement('form');
$form->setAttribute('action', 'courseEditor.php'); $form->setAttribute('action', 'courseEditor.php');
$form->setAttribute('method', 'post'); $form->setAttribute('method', 'POST');
$input = $doc->createElement('input'); $form->setAttribute('enctype', 'multipart/form-data');
$input->setAttribute('type', 'hidden');
$input->setAttribute('value', 'Add');
$input->setAttribute('name', 'action');
$input->setAttribute('readonly', 'readonly');
$form->appendChild($input);
$label = $doc->createElement('H3'); $label = $doc->createElement('H3');
$label->appendChild($doc->createTextNode("Add New Course")); $label->appendChild($doc->createTextNode("Add New Course"));
$form->appendChild($label); $form->appendChild($label);
@ -347,7 +342,7 @@ else
$fieldSet->appendChild($fieldSetDiv); $fieldSet->appendChild($fieldSetDiv);
$label = $doc->createElement('label', 'Course ID:'); $label = $doc->createElement('label', 'Course ID:');
$label->setAttribute('for', 'id$'); $label->setAttribute('for', 'id');
$label->setAttribute('class', 'CourseEditorInputLabel'); $label->setAttribute('class', 'CourseEditorInputLabel');
$fieldSetDiv->appendChild($label); $fieldSetDiv->appendChild($label);
$input = $doc->createElement('input'); $input = $doc->createElement('input');
@ -369,6 +364,7 @@ else
$input->setAttribute('name', 'name'); $input->setAttribute('name', 'name');
$input->setAttribute('autocomplete', 'off'); $input->setAttribute('autocomplete', 'off');
$input->setAttribute('required', 'required'); $input->setAttribute('required', 'required');
$fieldSetDiv->appendChild($input); $fieldSetDiv->appendChild($input);
$label = $doc->createElement('br'); $label = $doc->createElement('br');
$fieldSetDiv->appendChild($label); $fieldSetDiv->appendChild($label);
@ -413,6 +409,13 @@ else
$input = $doc->createElement('input'); $input = $doc->createElement('input');
$input->setAttribute('type', 'submit'); $input->setAttribute('type', 'submit');
$form->appendChild($input); $form->appendChild($input);
$input = $doc->createElement('input');
$input->setAttribute('type', 'hidden');
$input->setAttribute('value', 'Add');
$input->setAttribute('name', 'action');
$input->setAttribute('readonly', 'readonly');
$form->appendChild($input);
$editorDiv->appendChild($form); $editorDiv->appendChild($form);
//$bodyDiv->appendChild($editorDiv); //$bodyDiv->appendChild($editorDiv);
$body->appendChild($editorDiv); // Needs to be in the body for sticky $body->appendChild($editorDiv); // Needs to be in the body for sticky

View File

@ -266,7 +266,7 @@ td.padLeftAndRight {
top: 5; top: 5;
width: 45%; width: 45%;
/* float: right; */ /* float: right; */
background-color: cyan; /* background-color: ; */
border: 2px solid blue; border: 2px solid blue;
} }
@ -391,9 +391,9 @@ td.padLeftAndRight {
//left: 5; //left: 5;
width: 45%; width: 45%;
//float: right; //float: right;
background-color: green; //background-color: green;
border: 2px solid blue; border: 2px solid blue;
z-index: -5; //z-index: -5;
} }

View File

@ -103,8 +103,8 @@ the class.
EOD; EOD;
$text7100 = 'This page was generated on '; $text7100 = 'This page was generated on ';
$text7101 = ' by software '; $text7101 = ' by software ';
$text7102 = 'licened'; $text7102 = 'licenced';
$text7103 = ' by The Deerfoot Irregualrs and is CopyRight of '; $text7103 = ' by The Deerfoot Irregualrs and is Copyright of ';
$text7104 = '.'; $text7104 = '.';

View File

@ -146,11 +146,10 @@ else
$body->appendChild(generateSelectedMenuBar($doc, 0)); $body->appendChild(generateSelectedMenuBar($doc, 0));
$myClassesDiv = createDiv($doc, NULL, 'ClassTableDiv'); $myClassesDiv = createDiv($doc, NULL, 'ClassTableDiv');
$tableTitle = $doc->createElement('H3'); $tableTitle = $doc->createElement('H3');
$tableTitle->appendChild($doc->createTextNode("Classes I'm Teaching")); $tableTitle->appendChild($doc->createTextNode("Classes I'm Teaching"));
$myClassesDiv->appendChild($tableTitle); $myClassesDiv->appendChild($tableTitle);
$myClassesDiv->appendChild(generateTrainingTable($doc, NULL, $sort_order, $sort_field, '', NULL, $_SESSION['MemberID'])); $myClassesDiv->appendChild(generateTrainingTable($doc, 'classes.php', $sort_order, $sort_field, '', NULL, $_SESSION['MemberID']));
$newClassDiv = createDiv($doc, 'NewClassDiv'); $newClassDiv = createDiv($doc, 'NewClassDiv');
$form = createForm($doc, 'training.php'); $form = createForm($doc, 'training.php');
@ -184,7 +183,8 @@ else
$fieldSet->appendChild(createSubmitInput($doc, 'addClass', 'Add A Class')); $fieldSet->appendChild(createSubmitInput($doc, 'addClass', 'Add A Class'));
$form->appendChild($fieldSet); $form->appendChild($fieldSet);
$newClassDiv->appendChild($form); $newClassDiv->appendChild($form);
$myClassesDiv->appendChild($newClassDiv); //$myClassesDiv->appendChild($newClassDiv);
$body->appendChild($newClassDiv);
$body->appendChild($myClassesDiv); $body->appendChild($myClassesDiv);

View File

@ -94,7 +94,8 @@ else
$tableTitle->appendChild($doc->createTextNode("Current Course Schedule")); $tableTitle->appendChild($doc->createTextNode("Current Course Schedule"));
$myClassesDiv->appendChild($tableTitle); $myClassesDiv->appendChild($tableTitle);
$myClassesDiv->appendChild(generateTrainingTable($doc, 'userCourses.php')); //$myClassesDiv->appendChild(generateTrainingTable($doc, 'userCourses.php'));
$myClassesDiv->appendChild(generateTrainingTable($doc, 'classes.php'));
$body->appendChild($myClassesDiv); $body->appendChild($myClassesDiv);