Skip to content

Commit

Permalink
THESIS REVISED 2.0
Browse files Browse the repository at this point in the history
Database Easy to modify
  • Loading branch information
mashwishi committed Jun 6, 2022
1 parent b907ae0 commit 846067c
Show file tree
Hide file tree
Showing 43 changed files with 58 additions and 55 deletions.
3 changes: 2 additions & 1 deletion admin/appeal/data/getInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

$ReportID = isset($_POST["ReportID"]) ? $_POST["ReportID"] : '';

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../../mysqli_conn.php';

$output = '';

$query = "
Expand Down
2 changes: 1 addition & 1 deletion admin/appeal/data/stats.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
session_start();

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../../mysqli_conn.php';
$output = '';

$aquery = "SELECT COUNT(report_status) AS Recovered FROM user_reports WHERE report_status = 2";
Expand Down
4 changes: 1 addition & 3 deletions admin/appeal/fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
error_reporting(0);
session_start();

$database_username ='root';
$database_password = '';
$connect = new PDO( 'mysql:host=localhost;dbname=proteksyon.ml', $database_username, $database_password );
include '../../pdo_conn.php';

/*function get_total_row($connect)
{
Expand Down
2 changes: 1 addition & 1 deletion admin/establishment/data/getSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

$establishment_id = isset($_POST["EstablishmentID"]) ? $_POST["EstablishmentID"] : '';

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../../mysqli_conn.php';
$output = '';

$query = "
Expand Down
4 changes: 1 addition & 3 deletions admin/establishment/fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
error_reporting(0);
session_start();

$database_username ='root';
$database_password = '';
$connect = new PDO( 'mysql:host=localhost;dbname=proteksyon.ml', $database_username, $database_password );
include '../../pdo_conn.php';

/*function get_total_row($connect)
{
Expand Down
2 changes: 1 addition & 1 deletion admin/fetch/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

$user_id = $_SESSION['admin_user_id'];

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';


Expand Down
2 changes: 1 addition & 1 deletion admin/fetch/recent_establishment.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
session_start();

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$aquery = "SELECT * FROM establishment_tb ORDER BY establishment_id DESC LIMIT 5;";
Expand Down
2 changes: 1 addition & 1 deletion admin/fetch/recent_users.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
session_start();

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$query = "
Expand Down
2 changes: 1 addition & 1 deletion admin/fetch/stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
session_start();


$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$aquery = "SELECT COUNT(user_id) AS TotalUsers FROM users_tb";
Expand Down
2 changes: 1 addition & 1 deletion admin/requests/data/getInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

$RequestID = isset($_POST["RequestID"]) ? $_POST["RequestID"] : '';

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../../mysqli_conn.php';
$output = '';

$query = "
Expand Down
4 changes: 1 addition & 3 deletions admin/requests/fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
error_reporting(0);
session_start();

$database_username ='root';
$database_password = '';
$connect = new PDO( 'mysql:host=localhost;dbname=proteksyon.ml', $database_username, $database_password );
include '../../pdo_conn.php';

/*function get_total_row($connect)
{
Expand Down
2 changes: 1 addition & 1 deletion admin/users/data/getSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

$UUID = isset($_POST["UUID"]) ? $_POST["UUID"] : '';

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../../mysqli_conn.php';
$output = '';

$query = "SELECT * FROM users_tb WHERE user_uuid = '$UUID'";
Expand Down
4 changes: 1 addition & 3 deletions admin/users/fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
error_reporting(0);
session_start();

$database_username ='root';
$database_password = '';
$connect = new PDO( 'mysql:host=localhost;dbname=proteksyon.ml', $database_username, $database_password );
include '../../pdo_conn.php';

/*function get_total_row($connect)
{
Expand Down
2 changes: 1 addition & 1 deletion admin/verification/data/getSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

$UUID = isset($_POST["UUID"]) ? $_POST["UUID"] : '';

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../../mysqli_conn.php';
$output = '';

//Health Center
Expand Down
4 changes: 1 addition & 3 deletions admin/verification/fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

$user_uuid = $_SESSION['admin_user_uuid'];

$database_username ='root';
$database_password = '';
$connect = new PDO( 'mysql:host=localhost;dbname=proteksyon.ml', $database_username, $database_password );
include '../../pdo_conn.php';



Expand Down
2 changes: 1 addition & 1 deletion establishment/fetch/close.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

$establishment_id = $_SESSION['establishment_id'];

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$query = "SELECT * FROM establishment_tb where establishment_id = '$establishment_id'";
Expand Down
2 changes: 1 addition & 1 deletion establishment/fetch/dateRange.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

$establishment_id = $_SESSION['establishment_id'];

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';

if(isset($_POST["from_date"], $_POST["to_date"])) {
$userData = "";
Expand Down
2 changes: 1 addition & 1 deletion establishment/fetch/fetch_cp.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

if($newPass == $confirmPass){

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$query = "
Expand Down
2 changes: 1 addition & 1 deletion establishment/fetch/office.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

$establishment_id = $_SESSION['establishment_id'];

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';


Expand Down
2 changes: 1 addition & 1 deletion establishment/fetch/open.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

$establishment_id = $_SESSION['establishment_id'];

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$query = "SELECT * FROM establishment_tb where establishment_id = '$establishment_id'";
Expand Down
2 changes: 1 addition & 1 deletion establishment/fetch/recent_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

$establishment_id = $_SESSION['establishment_id'];

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$query = "
Expand Down
2 changes: 1 addition & 1 deletion establishment/fetch/settings/getReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

$UUID = isset($_POST["UUID"]) ? $_POST["UUID"] : '';

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../../mysqli_conn.php';
$output = '';

$query = "SELECT user_id, user_first_name, user_middle_name, user_last_name FROM users_tb WHERE user_uuid = '$UUID'";
Expand Down
2 changes: 1 addition & 1 deletion establishment/fetch/settings/getSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

$establishment_id = $_SESSION['establishment_id'];

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../../mysqli_conn.php';
$output = '';

$query = "
Expand Down
2 changes: 1 addition & 1 deletion establishment/fetch/stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

$establishment_id = $_SESSION['establishment_id'];

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$aquery = "SELECT COUNT(user_id) AS TotalTimein FROM logs_tb where establishment_id = $establishment_id";
Expand Down
2 changes: 1 addition & 1 deletion establishment/fetch/user_activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

$establishment_id = $_SESSION['establishment_id'];

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$query = "
Expand Down
5 changes: 5 additions & 0 deletions mysqli_conn.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");

?>
7 changes: 7 additions & 0 deletions pdo_conn.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

$database_username ='root';
$database_password = '';
$connect = new PDO( 'mysql:host=localhost;dbname=proteksyon.ml', $database_username, $database_password );

?>
10 changes: 5 additions & 5 deletions proteksyon.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 06, 2022 at 10:24 AM
-- Generation Time: Jun 06, 2022 at 10:55 AM
-- Server version: 10.4.24-MariaDB
-- PHP Version: 7.4.29

Expand Down Expand Up @@ -163,7 +163,7 @@ CREATE TABLE `users_tb` (

INSERT INTO `users_tb` (`user_id`, `user_uuid`, `user_email`, `user_password`, `user_contactno`, `user_avatar`, `user_first_name`, `user_middle_name`, `user_last_name`, `user_birthday`, `user_gender`, `user_country`, `user_zipcode`, `user_city`, `user_address`, `user_card_front`, `user_card_back`, `user_vaccine`, `user_dose`, `user_status`, `user_verification`, `user_type`, `forgot_password`) VALUES
(1, '0x5f1775f86786759dc51083bc233bf5f9', '[email protected]', '827ccb0eea8a706c4c34a16891f84e7b', 639093902913, 'male.jpg', 'Mathew Agustin', 'Ordoñez', 'Bella', '07/04/2000', 'Male', 'Philippines', '4114', 'Dasmarinas', 'Abraham st. Phase 1 Dexterville Classic, Brgy. Sabang', 'sample.jpg', 'sample.jpg', 'BioNTech, Pfizer', 'Second Dose', 1, 1, 1, NULL),
(2, '0x52c9f2d2ba7c166497b743eb834349aa', '[email protected]', '827ccb0eea8a706c4c34a16891f84e7b', 69000000000, 'female.jpg', 'Charneen', 'Valdez', 'Salve', '29/07/1998', 'Female', 'Philippines', '4114', 'Dasmarinas City', 'Abraham st. Phase 1 Dexterville Classic, Brgy. Sabang', 'sample.jpg', 'sample.jpg', 'Moderna', 'Second Dose', 0, 1, 0, NULL),
(2, '0x52c9f2d2ba7c166497b743eb834349aa', '[email protected]', '827ccb0eea8a706c4c34a16891f84e7b', 69000000000, 'female.jpg', 'Charneen', 'Valdez', 'Salve', '29/07/1998', 'Female', 'Philippines', '4114', 'Dasmarinas City', 'Abraham st. Phase 1 Dexterville Classic, Brgy. Sabang', 'sample.jpg', 'sample.jpg', 'Moderna', 'Second Dose', 1, 1, 0, NULL),
(10, '0xfe55db489b52d47ec3325c0f450e0282', '[email protected]', '7ff402f0aa51495dfe96d911d4a5e105', 639291393358, 'male.jpg', 'JOHN ', 'MICHAEL', 'DENISA', '1999-04-28', 'Male', 'Philippines', '4104', 'Imus Cavite', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit', 'sample.jpg', 'sample.jpg', 'BioNTech, Pfizer', 'Booster Dose', 1, 1, 1, NULL),
(24, '0xee41537471f42056682483ad5d9f0b84', '[email protected]', '89914cbcf7c5c37fea3ee736e5f8892f', 9752112120, 'male.jpg', 'Patrick Reiner ', 'Ancuelo', 'Faeldonea', '1999-05-05', 'Male', 'Philippines', '4103', 'Imus City', 'Blk 61 Lot 22 A boron St. Ph4 golden city', 'sample.jpg', 'sample.jpg', 'Moderna', 'Second Dose', 1, 0, 1, NULL),
(27, '0x185320cda7e0c6b599f51a32e404baaf', '[email protected]', '827ccb0eea8a706c4c34a16891f84e7b', 9998982891, 'male.jpg', 'Demo', 'User', 'Account', '2012-05-24', 'Male', 'Philippines', '4114', 'Dasmarinas', 'BX LX Phase X Dexterville Classic, Sabang', 'sample.jpg', 'sample.jpg', 'BioNTech, Pfizer', 'Booster Dose', 1, 1, 0, NULL),
Expand Down Expand Up @@ -244,19 +244,19 @@ ALTER TABLE `user_reports`
-- AUTO_INCREMENT for table `establishment_tb`
--
ALTER TABLE `establishment_tb`
MODIFY `establishment_id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
MODIFY `establishment_id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;

--
-- AUTO_INCREMENT for table `logs_tb`
--
ALTER TABLE `logs_tb`
MODIFY `logs_id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
MODIFY `logs_id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;

--
-- AUTO_INCREMENT for table `request_tb`
--
ALTER TABLE `request_tb`
MODIFY `request_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
MODIFY `request_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `status_tb`
Expand Down
2 changes: 1 addition & 1 deletion scanner/fetch/establishment_fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
session_start();

$establishment_id = $_SESSION['establishment_id'];
$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$query = "SELECT establishment_name FROM establishment_tb where establishment_id = $establishment_id";
Expand Down
2 changes: 1 addition & 1 deletion scanner/fetch/log_fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

$establishment_id = $_SESSION['establishment_id'];

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$query = "
Expand Down
2 changes: 1 addition & 1 deletion scanner/fetch/popup_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

$UUID = isset($_POST["UUID"]) ? $_POST["UUID"] : '';

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$query = "SELECT * FROM users_tb where user_uuid = '$UUID'";
Expand Down
2 changes: 1 addition & 1 deletion scanner/fetch/time_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

$establishment_id = $_SESSION['establishment_id'];

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$query = "SELECT * FROM users_tb where user_uuid = '$UUID'";
Expand Down
2 changes: 1 addition & 1 deletion user/fetch/card_fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
session_start();

$user_id = $_SESSION['user_id'];
$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$query = "SELECT * FROM users_tb where user_id = $user_id";
Expand Down
2 changes: 1 addition & 1 deletion user/fetch/check_account.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../mysqli_conn.php';
$output = '';

$query = "SELECT * FROM users_tb where user_id = $user_id";
Expand Down
2 changes: 1 addition & 1 deletion user/fetch/fetch_cp.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

if($newPass == $confirmPass){

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$query = "
Expand Down
2 changes: 1 addition & 1 deletion user/fetch/logs_fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

$user_id = $_SESSION['user_id'];

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$query = "
Expand Down
2 changes: 1 addition & 1 deletion user/fetch/status_fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

$user_id = $_SESSION['user_id'];

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';
$query = "SELECT * FROM establishment_tb";
$result = mysqli_query($connect, $query);
Expand Down
2 changes: 1 addition & 1 deletion user/fetch/user_fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
session_start();

$user_id = $_SESSION['user_id'];
$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$aquery = "SELECT * FROM users_tb where user_id = $user_id";
Expand Down
2 changes: 1 addition & 1 deletion user/settings/changePassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

if(!empty($oldPass) || !empty($newPass) || !empty($confirmPass)){

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$query = "
Expand Down
2 changes: 1 addition & 1 deletion user/settings/getAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

$user_id = $_SESSION['user_id'];

$connect = mysqli_connect("localhost", "root", "", "proteksyon.ml");
include '../../mysqli_conn.php';
$output = '';

$query = "
Expand Down
Loading

0 comments on commit 846067c

Please sign in to comment.