Skip to content

Commit

Permalink
Stopped dialog text from displaying a page by using display: none
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbillings committed Dec 3, 2017
1 parent 3e86f39 commit 7d0c473
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 31 deletions.
6 changes: 3 additions & 3 deletions createColleague.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function mysql_fix_string($conn, $string) {
if (empty($_POST['form']['fname'] && $_POST['form']['sname'] && $_POST['form']['number'] &&
$_POST['form']['section'] && $_POST['form']['hours'] ))
{
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>Please enter all details</p>
</div>';

Expand Down Expand Up @@ -153,7 +153,7 @@ function checkForExisting($number){
$rows = $result->num_rows;

if ($rows > 0) {
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>Colleague number already exists</p>
</div>';
return true;
Expand All @@ -173,7 +173,7 @@ function insertColleague($number, $fname, $sname, $fSection, $hours){
. "VALUES ('$number', '$fname', '$sname', '$fSection', '$hours')";

if ($conn->query($sql) === TRUE) {
echo '<div id="dialog" title="Success">
echo '<div style="display: none" id="dialog" title="Success">
<p></p>
<p>Colleague details successfully added.</p>
</div>';
Expand Down
12 changes: 7 additions & 5 deletions createRota.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
$_POST['form'][$a]['wedStart'] || $_POST['form'][$a]['thuStart'] || $_POST['form'][$a]['friStart'] ||
$_POST['form'][$a]['satStart']))
{
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>No Shifts Entered</p>
</div>';
}
Expand Down Expand Up @@ -106,9 +106,7 @@
insertShift($week, $number, $dayDate, $start, $finish);
}

echo '<div id="dialog" title="Success">
<p>New Rota/s created successfully</p>
</div>';

}

}
Expand Down Expand Up @@ -310,7 +308,11 @@ function insertShift($week, $number, $dayDate, $start, $finish){
. "VALUES (NULL, '$week', $number, '$dayDate', $start, $finish)";

if ($conn->query($sql) === TRUE) {
//echo "New record created successfully";

echo '<div style="display: none" id="dialog" title="Success">
<p>New Rota/s created successfully</p>
</div>';

} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
Expand Down
6 changes: 3 additions & 3 deletions deleteColleague.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function mysql_fix_string($conn, $string) {
$delete = "DELETE FROM employee WHERE employee.employee_id = $number";

if ($conn->query($delete) === TRUE) {
echo '<div id="dialog" title="Success">
echo '<div style="display: none" id="dialog" title="Success">
<p>Colleague details successfully Deleted.</p>
</div>';
} else {
Expand Down Expand Up @@ -127,7 +127,7 @@ function getAllColleagues($section) {
}

if (!$_SESSION['executedColView'] && !$_SESSION['startColView']){
echo '<div id="dialog" title="Colleague Records">
echo '<div style="display: none" id="dialog" title="Colleague Records">
<p>No colleague records for selected section</p>
</div>';
$section = $_SESSION['sectionChoose'];
Expand All @@ -137,7 +137,7 @@ function getAllColleagues($section) {

}
else if (!$_SESSION['startColView']) {
echo '<div id="dialog" title="Colleague Records">
echo '<div style="display: none" id="dialog" title="Colleague Records">
<p>No colleague records for selected section</p>
</div>';
$section= $_SESSION['sectionChoose'];
Expand Down
8 changes: 4 additions & 4 deletions deleteRota.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
$_SESSION['sectionChoose'] = "Grocery";
}
if ($_SESSION['executeAmount'] > 2){
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>No colleague records for selected section, please create colleague details first</p>
</div>';
}
Expand Down Expand Up @@ -48,7 +48,7 @@
. "AND schedule.Week_ending = '$weekEnding'";

if ($conn->query($delete) === TRUE) {
echo '<div id="dialog" title="Success">
echo '<div style="display: none" id="dialog" title="Success">
<p>Rota details successfully Deleted.</p>
</div>';
} else {
Expand Down Expand Up @@ -250,7 +250,7 @@ function getAllRotas($weekEnding, $section) {
}

if (!$_SESSION['executeDelete'] && !$_SESSION['startDelete']){
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>No rotas for selected week/section</p>
</div>';
$weekEnding = $_SESSION['weekEnding'];
Expand All @@ -260,7 +260,7 @@ function getAllRotas($weekEnding, $section) {
getAllRotas($weekEnding, $section);
}
else if (!$_SESSION['startDelete']) {
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>No rotas for selected week/section</p>
</div>';
$weekEnding = $_SESSION['weekEnding'];
Expand Down
8 changes: 4 additions & 4 deletions editColleague.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
$_SESSION['sectionChoose'] = "Grocery";
}
if ($_SESSION['executeEditAmount'] > 2){
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>No colleague records for selected section, please create colleague details first</p>
</div>';
}
Expand Down Expand Up @@ -82,7 +82,7 @@ function mysql_fix_string($conn, $string) {
}

if ($_SESSION['editRecords']) {
echo '<div id="dialog" title="Success">
echo '<div style="display: none" id="dialog" title="Success">
<p>Rota/s successfully changed</p>
</div>';
}
Expand Down Expand Up @@ -174,7 +174,7 @@ function getAllColleagues($section) {
}

if (!$_SESSION['executedColView'] && !$_SESSION['startColView']){
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>No colleague records for selected section</p>
</div>';
$section = $_SESSION['sectionChoose'];
Expand All @@ -184,7 +184,7 @@ function getAllColleagues($section) {

}
else if (!$_SESSION['startColView']) {
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>No colleague records for selected section</p>
</div>';
$section= $_SESSION['sectionChoose'];
Expand Down
4 changes: 2 additions & 2 deletions editRota.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
$_POST['form'][$a]['wedStart'] || $_POST['form'][$a]['thuStart'] || $_POST['form'][$a]['friStart'] ||
$_POST['form'][$a]['satStart']))
{
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>No shifts entered</p>
</div>';
}
Expand Down Expand Up @@ -120,7 +120,7 @@
insertShift($week, $number, $dayDate, $start, $finish);
}

echo '<div id="dialog" title="Success">
echo '<div style="display: none" id="dialog" title="Success">
<p>Rotas Successfully changed</p>
</div>';

Expand Down
6 changes: 3 additions & 3 deletions login_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$pass = mysql_entities_fix_string($conn, $_POST['password']);

if ($number == "" || $pass == ""){
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>Please input both username and password</p>
</div>';
}
Expand All @@ -40,7 +40,7 @@
$row = $result->fetch_array(MYSQLI_ASSOC);

if ($result->num_rows == 0){
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>Invalid username/ password</p>
</div>';
}
Expand Down Expand Up @@ -79,7 +79,7 @@
exit;
}
else{
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>Invalid username/ password</p>
</div>';
}
Expand Down
2 changes: 1 addition & 1 deletion register.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
. "WHERE employee.employee_id='$number'";

if ($conn->query($sql) === TRUE) {
echo '<div id="dialog" title="Success">
echo '<div style="display: none" id="dialog" title="Success">
<p>Password updated successfully</p>
<p>You can now login with your new password</p>
</div>';
Expand Down
4 changes: 2 additions & 2 deletions userProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ function getRota($colNumber, $weekEnding) {
else {

if (!$_SESSION['executed'] && !$_SESSION['start']){
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>No Rota for selected week</p>
</div>';
$weekEnding = $_SESSION['weekEnding'];
Expand All @@ -255,7 +255,7 @@ function getRota($colNumber, $weekEnding) {

}
else if (!$_SESSION['start']) {
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>No Rota for selected week</p>
</div>';
$weekEnding = $_SESSION['weekEnding'];
Expand Down
6 changes: 3 additions & 3 deletions viewColleague.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
$_SESSION['sectionChoose'] = "Grocery";
}
if ($_SESSION['executeViewAmount'] > 2){
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>No colleague records for selected section, please create colleague details first</p>
</div>';
}
Expand Down Expand Up @@ -105,7 +105,7 @@ function getAllColleagues($section) {
}

if (!$_SESSION['executedColView'] && !$_SESSION['startColView']){
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>No colleague records for selected section</p>
</div>';
$section = $_SESSION['sectionChoose'];
Expand All @@ -115,7 +115,7 @@ function getAllColleagues($section) {

}
else if (!$_SESSION['startColView']) {
echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>No colleague records for selected section</p>
</div>';
$section= $_SESSION['sectionChoose'];
Expand Down
2 changes: 1 addition & 1 deletion viewRota.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ function getAllRotas($weekEnding, $section) {
}
else {

echo '<div id="dialog" title="Error">
echo '<div style="display: none" id="dialog" title="Error">
<p>No rotas for selected week/section</p>
</div>';
$_SESSION['executedAdmin'] = true;
Expand Down

0 comments on commit 7d0c473

Please sign in to comment.