Skip to content

Commit

Permalink
minute minute changes
Browse files Browse the repository at this point in the history
  • Loading branch information
GwakoSyprose committed Dec 16, 2019
1 parent b576115 commit 72061d7
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 18 deletions.
2 changes: 1 addition & 1 deletion includes/fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
';
}
$status_query = "SELECT * FROM notifications WHERE status=0";
$status_query = "SELECT * FROM notifications WHERE status=0 ORDER BY notificationID";
$result_query = mysqli_query($link, $status_query);
$count = mysqli_num_rows($result_query);
$data = array(
Expand Down
3 changes: 3 additions & 0 deletions includes/head.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
<link rel="stylesheet" type="text/css" href="../pages/styles/table.css">
<link rel="stylesheet" type="text/css" href="../pages/styles/update.css">
<link rel="stylesheet" type="text/css" href="../pages/styles/modal.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/js/standalone/selectize.min.js" integrity="sha256-+C0A5Ilqmu4QcSPxrlGpaZxJ04VjsRjKu+G82kl5UJk=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.bootstrap3.min.css" integrity="sha256-ze/OEYGcFbPRmvCnrSeKbRTtjG4vGLHXgOqsyLFTRjg=" crossorigin="anonymous" />

<!-- scripts -->
<script type="text/javascript" src="../js/jquery/jquery.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion includes/navbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="dropdown-menu dropdown-menu-small not-menu" aria-labelledby="dropdownMenuLink">


<a class="dropdown-item notification__all text-center" href="#"> View all Notifications </a>
<a class="dropdown-item notification__all text-center" href="../pages/notifications.php"> View all Notifications </a>
</div>
</li>
<li class="nav-item dropdown">
Expand Down
6 changes: 3 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
if ($resultCheck == 0) {
echo '<div class="alert alert-danger alert-dismissable" id="flash-msg">
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
<h4><i class="icon fa fa-times"></i>That National ID does not exist!</h4>
<h4><i class="icon fa fa-times"></i>The service number you have entered does not exist!</h4>
</div>';
} else {
if($row = mysqli_fetch_assoc($result)) {
Expand Down Expand Up @@ -146,7 +146,7 @@ function getStations(val) {
<div class="modal-dialog modal-login">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Sign In</h4>
<h4 class="modal-title">Log In</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
</div>
<div class="modal-body">
Expand All @@ -157,7 +157,7 @@ function getStations(val) {
</div> -->
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
<input type="text" class="form-control" name="userID" placeholder="National ID" required="required">
<input type="text" class="form-control" name="userID" placeholder="Service Number" required="required">
</div>
</div>
<div class="form-group">
Expand Down
8 changes: 7 additions & 1 deletion loc.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@

$_SESSION['lat']=$lat;
$_SESSION['lng']=$lng;
?>
?>






8 changes: 4 additions & 4 deletions pages/addnewuser.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
$lname = mysqli_real_escape_string($link, $_POST['lname']);
$password = mysqli_real_escape_string($link, $_POST['password']);
$rank = mysqli_real_escape_string($link, $_POST['rank']);
$station = mysqli_real_escape_string($link, $_POST['station']);
$station = mysqli_real_escape_string($link, $_POST['station']);
$date = mysqli_real_escape_string($link, $_POST['regDate']);
$email = mysqli_real_escape_string($link, $_POST['email']);
$email = mysqli_real_escape_string($link, $_POST['email']);



Expand Down Expand Up @@ -80,7 +80,7 @@
<div class="main-content-container container-fluid px-4">
<!-- Page Header -->
<div class="page-header row no-gutters py-4">
<div class="col-12 col-sm-4 text-center text-sm-left mb-0">
<div class="col-12 col-sm-12 text-center text-sm-left mb-0">
<span class="text-uppercase page-subtitle">Overview</span>
<h3 class="page-title">Traffic Officers Registration Form</h3>
</div>
Expand All @@ -101,7 +101,7 @@
<form action="addnewuser.php" method="post">
<div class="form-row">
<div class="form-group col-md-12">
<label for="ID">National ID</label>
<label for="ID">Service Number</label>
<input type="number" class="form-control" name="userID" placeholder="National ID" required> </div>
<div class="form-group col-md-12">
<label for="Name">First Name</label>
Expand Down
Binary file added pages/images/bell.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pages/images/nots.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pages/images/saga.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions pages/notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
$station = $_SESSION['stationID'];
$id =$_SESSION['userID'];

$generalquery=mysqli_query($link, "SELECT * FROM notifications");
$generalquery=mysqli_query($link, "SELECT * FROM notifications ORDER BY notificationID");
$result = mysqli_fetch_assoc($generalquery);
$getdate = $result['date'];

$query=mysqli_query($link, "SELECT notifications.notificationID,notifications.numPlate,notifications.description,
notifications.phone,notifications.status,reports.reportID FROM notifications
LEFT OUTER JOIN reports ON notifications.notificationID = reports.notificationID WHERE notifications.regionID='$region' AND notifications.stationID='$station'");
LEFT OUTER JOIN reports ON notifications.notificationID = reports.notificationID WHERE notifications.regionID='$region' AND notifications.stationID='$station' ORDER BY notificationID");



Expand Down Expand Up @@ -88,7 +88,7 @@

<div class="blog-comments__item d-flex p-3">
<div class="blog-comments__avatar mr-3">
<img src="images/avatars/1.jpg" alt="User avatar" /> </div>
<img src="images/saga.jpg" alt="User avatar" /> </div>
<div class="blog-comments__content">
<div class="blog-comments__meta text-muted">
<a class="text-secondary" href="#">Incident report on</a> vehicle number.
Expand Down
56 changes: 52 additions & 4 deletions pages/recordoffence.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@
$numplate = mysqli_real_escape_string($link, $_POST['numplate']);
$description = mysqli_real_escape_string($link, $_POST['description']);

//Error Handlers
//Check for empty fields

// if(empty($offense) || empty($numplate) || empty($description)
// ){

// header("Location: recordoffence.php?recordoffence=empty");
// exit();

// }

$cou = count($_POST['offense']);
$sql = "INSERT INTO offences(offenceType,description,driverID) VALUES ";
$comma = "";
Expand All @@ -29,6 +40,7 @@
}
if ($link->multi_query($sql) === TRUE) {


// record incident
$date = date('Y-m-d');
$days = 90;
Expand All @@ -54,6 +66,7 @@
//updates the status to suspended if condition is met
$sql4 = "UPDATE drivers SET status = '1' WHERE offenceCount > '12'";
if(mysqli_query($link, $sql4)){
//inserts into the suspended_licences
$sql5 = "INSERT INTO suspended_licences(driverID, suspendedDate, activatedDate)
VALUES ('$id', '$date', DATE_ADD(suspendedDate, INTERVAL 90 DAY))";
mysqli_query($link, $sql5);
Expand All @@ -67,20 +80,31 @@
} else {
echo "Error updating record: " . $link->error;
}


echo"<script>";
echo"Swal.fire({
position: 'top-end',
icon: 'success',
title: 'Your password has been changed',
showConfirmButton: false,
timer: 3000
})";
echo"</script>";
header("Location: viewdriver.php?pid=$id; &success=1");


}

}
}




} else {
echo "Error: ". $link->error;
}




?>
Expand Down Expand Up @@ -139,7 +163,31 @@

<div class="form-group">
<label for="comment"><b>Number Plate</b></label>
<input type="text" class="form-control" placeholder="KAP-506Z" name="numplate" required>
<select name="type" class="form-control" id="select-state" placeholder="Pick a state..." required>
<option disabled selected>Select Vehicle Number</option>
<?php
require_once('../includes/connection.php');

$sql = "SELECT * FROM vehicles;";
$result = $link->query($sql);

if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo '<option value="'.$row["vehicleID"].'" >'.$row["regNo"].'</option>';
}
} else {

}
?>
</select>
<!-- <script type="text/javascript">
$(document).ready(function () {
$('#select-state').selectize({
sortField: 'text'
});
});
</script> -->
</div>
<script type="text/javascript">
$(document).ready(function() {
Expand All @@ -157,7 +205,7 @@
<textarea class="form-control" rows="5" name="description" required></textarea>
</div>
<button type="submit" class="btn btn-outline-info" name="submit"
href="#" data-toggle="modal" data-target="#logoutModal">Submit</button>
>Submit</button>



Expand Down
1 change: 1 addition & 0 deletions pages/userprofile.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
})";
echo"</script>";


}
$sql=mysqli_query($link,"SELECT * FROM users WHERE userID= $id");
$result=mysqli_fetch_assoc($sql);
Expand Down
2 changes: 1 addition & 1 deletion reset-password.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<div class="validation"></div>
</div>

<div class="text-center"><button type="submit" id="notSubmit" name="reset-request-submit" class="btn btn-primary btn-lg">Receive new password by email</button>
<div class="text-center"><button type="submit" id="notSubmit" name="reset-request-submit" class="btn btn-primary btn-lg">Receive password reset link by email</button>
</div>

</form>
Expand Down

0 comments on commit 72061d7

Please sign in to comment.