Skip to content

Commit

Permalink
BETA-4.0.0
Browse files Browse the repository at this point in the history
Admin Module:
User - 60%
Providers - 60%
Requests - 60%
Reports - 60%
Settings - 0%
  • Loading branch information
mashwishi committed Apr 8, 2022
1 parent bdedac3 commit a66d91d
Show file tree
Hide file tree
Showing 50 changed files with 2,198 additions and 594 deletions.
61 changes: 0 additions & 61 deletions admin/fetch/dateRange.php

This file was deleted.

122 changes: 122 additions & 0 deletions admin/fetch/filter_users.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?php
error_reporting(0);
session_start();

$searchinput = $_POST["searchinput"];
$userstatus = $_POST["userstatus"];

//Table Page - User List

// connect to database
$con = mysqli_connect('localhost','root','');
mysqli_select_db($con, 'proteksyon');

// retrieve selected results from database and display them on page
if($userstatus != '' && $searchinput != ''){
$sql ='
SELECT users_tb.user_first_name, users_tb.user_middle_name, users_tb.user_last_name, users_tb.user_email,
users_tb.user_contactno, users_tb.user_verification, users_tb.user_uuid, users_tb.user_avatar, users_tb.user_status
FROM users_tb
WHERE
user_email LIKE "%'.$searchinput.'%"
AND user_status = '.$userstatus.'';
}
else if($userstatus != '' && $searchinput == ''){
$sql ='
SELECT users_tb.user_first_name, users_tb.user_middle_name, users_tb.user_last_name, users_tb.user_email,
users_tb.user_contactno, users_tb.user_verification, users_tb.user_uuid, users_tb.user_avatar, users_tb.user_status
FROM users_tb
WHERE user_status = '.$userstatus.'';
}
else if($searchinput != '' && $userstatus == ''){
$sql ='
SELECT users_tb.user_first_name, users_tb.user_middle_name, users_tb.user_last_name, users_tb.user_email,
users_tb.user_contactno, users_tb.user_verification, users_tb.user_uuid, users_tb.user_avatar, users_tb.user_status
FROM users_tb
WHERE user_email LIKE "%'.$searchinput.'%"';
}
else if($userstatus == '' && $searchinput == ''){
echo "<script> location.href='/admin/users'; </script>";
exit;
}
else{
echo "<script> location.href='/admin/users'; </script>";
exit;
}

$result = mysqli_query($con, $sql);

$output = '';

$output.= '
<table>
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Contact No.</th>
<th>Status</th>
<th>Option</th>
</tr>
</thead>
<tbody>';
if(mysqli_num_rows($result) > 0){
while($row = mysqli_fetch_array($result)) {

switch ($row['user_status']) {
case 0:
$statusoutput = '<p>Pending</p>';
break;
case 1:
$statusoutput = '<p>Approved</p>';
break;
case 2:
$statusoutput = '<p>Banned</p>';
break;
}

if($row["user_verification"] === '1'){
$output.= '
<tr>
<td>
<img width="5%" src="../user/user_data/user_avatar/'.$row["user_avatar"].'">
<p>'. $row['user_first_name'] . ' ' . $row['user_last_name'] .' <i class="fas fa-check-circle" style="color: #1EF0F0" alt="verified-card"></i></p>
</td>
<td>'. $row['user_email'] .'</td>
<td>'. $row['user_contactno'] .'</td>
<td>'. $statusoutput .'</td>
<td><a class="status completed" style="border: none; outline: none;" href="/admin/userOption?userUUID='. $row['user_uuid'] .'">Modify</a></td>
</tr>
';
}else{
$output.= '
<tr>
<td>
<img width="5%" src="../user/user_data/user_avatar/'.$row["user_avatar"].'">
<p>'. $row['user_first_name'] . ' ' . $row['user_last_name'] .' </p>
</td>
<td>'. $row['user_email'] .'</td>
<td>'. $row['user_contactno'] .'</td>
<td>'. $statusoutput .'</td>
<td><a class="status completed" style="border: none; outline: none;" href="/admin/userOption?userUUID='. $row['user_uuid'] .'">Modify</a></td>
</tr>
';
}
}
}
else{
$output.= '
<tr>
<td colspan="5" style="text-align: center;">No user found.</th>
</tr>
';
}


$output.= '
</tbody>
</table>
';

echo $output;
?>
53 changes: 0 additions & 53 deletions admin/fetch/settings/changeInfo.php

This file was deleted.

77 changes: 0 additions & 77 deletions admin/fetch/settings/getReport.php

This file was deleted.

Loading

0 comments on commit a66d91d

Please sign in to comment.