Skip to content

Commit 19b955a

Browse files
committed
Version 1.1.1 correcion de errores, se agrego purchase
1 parent 9bc6150 commit 19b955a

17 files changed

+289
-68
lines changed

index.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<meta http-equiv="X-UA-Compatible" content="ie=edge">
1010
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
1111
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
12+
<!-- <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css"> -->
1213
<link rel="stylesheet" href="node_modules/@fortawesome/fontawesome-free/css/all.css">
1314
<link rel="stylesheet" href="libs/css/fonts.css">
1415
<link rel="stylesheet" href="libs/css/index.css">
@@ -17,9 +18,10 @@
1718
<body background="src/assets/background_index.png" width="50%">
1819
<nav class="navbar navbar-expand-sm bg-dark navbar-dark sticky-top">
1920
<a class="navbar-brand" href="#">VideoGame Center</a>
20-
<ul class="navbar-nav" style="position: relative; left: 70%;">
21+
<ul class="navbar-nav" style="position: relative; left: 50%;">
2122
<li class="nav-item">
22-
<button class="btn btn-outline-primary " onclick="logout()" id="btnLogin">Logout</button>;
23+
<button class="btn btn-outline-warning" onclick="purchases()" id="btnPurchases">My Purchase</button>
24+
<button class="btn btn-outline-primary " onclick="logout()" id="btnLogin">Logout</button>
2325
</li>
2426
</ul>
2527
</nav>
@@ -71,16 +73,19 @@
7173
?>
7274
<br>
7375
<footer>
74-
<p id="footer_text"><a href="login-adm.html" style="color: white; ">Admin Log</a> | VideoGame Center | A project by: Miguel Angel Quezada Galván < CUCEI/> Seminario de Solución de problemas de Bases de Datos. version: 0.0.1</p>
76+
<p id="footer_text"><a href="login-adm.html" style="color: white; ">Admin Log</a> | VideoGame Center | A project by: Miguel Angel Quezada Galván < CUCEI/> Seminario de Solución de problemas de Bases de Datos. version: 1.1.1</p>
7577
</footer>
7678
</body>
7779
<script>
7880
function logout(){
7981
alert("You have closed session");
8082
this.location.href = "logout.php";
8183
}
84+
function purchases(){
85+
this.location.href = "purchases.php";
86+
}
8287
</script>
8388
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
84-
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
89+
<script src="libs/js/jquery-3.3.1.min.js"></script>
8590
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
8691
</html>

libs/js/jquery-3.3.1.min.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

login-adm.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</form>
3939
</div>
4040
<footer>
41-
<p id="footer_text">VideoGame Center | A project by: Miguel Angel Quezada Galván < CUCEI/> Seminario de Solución de problemas de Bases de Datos. version: 1.0.0</p>
41+
<p id="footer_text">VideoGame Center | A project by: Miguel Angel Quezada Galván < CUCEI/> Seminario de Solución de problemas de Bases de Datos. version: 1.1.1</p>
4242
</footer>
4343
</body>
4444
<script src="node_modules/materialize-css/dist/js/materialize.min.js"></script>

login-user.html

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<meta http-equiv="X-UA-Compatible" content="ie=edge">
77
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
8-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
8+
<link rel="stylesheet" href="node_modules/materialize-css/dist/css/materialize.min.css">
99
<link rel="stylesheet" href="node_modules/@fortawesome/fontawesome-free/css/all.css">
1010
<link rel="stylesheet" href="libs/css/fonts.css">
1111
<link rel="stylesheet" href="libs/css/login-user.css">
@@ -33,11 +33,11 @@
3333
<i class="material-icons right">input</i>
3434
</button>
3535
</form>
36-
<p id="forgotPass">Forgot your password? <b>Just Reset Your Password<button data-target="resetModal" class="btn modal-trigger"> Here</button></p>
36+
<p id="forgotPass">Forgot your password? <b>Just Reset Your Password <button data-target="resetModal" class="btn modal-trigger" id="btn-Reset" style="background-color: rgba(137, 43, 226, 0.411);">Here</button></p>
3737
</div>
3838
<div id="resetModal" class="modal">
3939
<div class="modal-content">
40-
<h4>Reset Password</h4>
40+
<h4 style="border-bottom: 1px solid white;">Reset Password</h4>
4141
<form action="php/restorePasswordUser.php" method="POST" class="col s12" id="formUpdateUserPass" autocomplete="off">
4242
<div class="row">
4343
<div class="input-field col s6">
@@ -51,17 +51,19 @@ <h4>Reset Password</h4>
5151
<label for="password">Type your new Password</label>
5252
</div>
5353
</div>
54-
<button class="btn waves-effect waves-light" type="submit" name="action" id="btn-reset">Reset Password
55-
<i class="material-icons right">input</i>
56-
</button>
54+
<div style="text-align: center;">
55+
<button class="btn waves-effect waves-light" type="submit" name="action" id="btn-reset" style="background-color: rgba(43, 55, 226, 0.411);">Reset Password
56+
<i class="material-icons right">input</i>
57+
</button>
58+
</div>
5759
</form>
5860
</div>
5961
<div class="modal-footer">
6062
<a href="#!" class="modal-close waves-effect waves-red btn-flat">Cancel</a>
6163
</div>
6264
</div>
6365
<footer>
64-
<p id="footer_text">VideoGame Center | A project by: Miguel Angel Quezada Galván < CUCEI/> Seminario de Solución de problemas de Bases de Datos. version: 1.0.0</p>
66+
<p id="footer_text">VideoGame Center | A project by: Miguel Angel Quezada Galván < CUCEI/> Seminario de Solución de problemas de Bases de Datos. version: 1.1.1</p>
6567
</footer>
6668
</body>
6769
<script type="text/javascript">
@@ -72,6 +74,6 @@ <h4>Reset Password</h4>
7274
}
7375
</script>
7476
<!-- <script src="libs/js/user.js"></script> -->
75-
<script src="https://code.jquery.com/jquery-3.3.1.min.js" type="text/javascript"></script>
76-
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
77+
<script src="libs/js/jquery-3.3.1.min.js"></script>
78+
<script src="node_modules/materialize-css/dist/js/materialize.min.js"></script>
7779
</html>

package-lock.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"homepage": "https://github.com/AngelQuezada/VideoGameCenter#readme",
1919
"dependencies": {
2020
"@fortawesome/fontawesome-free": "^5.3.1",
21+
"bootstrap": "^4.0.0-alpha.6",
2122
"bulma-start": "0.0.2",
2223
"materialize-css": "^1.0.0-rc.2"
2324
},

php/Entity/Administrator.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ public static function createAdmin($name,$lastName,$maidenName,$username,$passwo
5959
$result = $db->queryBuilder($sql);
6060
$db->closeConnection();
6161
unset($db);
62-
header("Location: http://localhost/VideoGameCenter/src/pages/manage-adm.php");
62+
echo '<script language="javascript">';
63+
echo 'window.alert("The Administrator has been created successfuly!")';
64+
echo '</script>';
65+
header("Refresh:0; url=http://localhost/VideoGameCenter/src/pages/manage-adm.php");
6366
}
6467

6568
public static function delegateAdmin($id,$isAdmin){
@@ -69,7 +72,10 @@ public static function delegateAdmin($id,$isAdmin){
6972
$result = $db->queryBuilder($sql);
7073
$db->closeConnection();
7174
unset($db);
72-
header("Location: http://localhost/VideoGameCenter/src/pages/manage-adm.php");
75+
echo '<script language="javascript">';
76+
echo 'window.alert("The Admin has been modified successfuly")';
77+
echo '</script>';
78+
header("Refresh:0; url=http://localhost/VideoGameCenter/src/pages/manage-adm.php");
7379
}
7480
public static function loginAdmin($username,$password){
7581
$pass = SHA1($password);
@@ -85,11 +91,15 @@ public static function loginAdmin($username,$password){
8591
if($result == 1){
8692
session_start();
8793
$_SESSION["id"]=$id;
88-
echo "<script>alert('You are now Log in');</script>";
89-
header("Location: http://localhost/VideoGameCenter/src/pages/dashboard.php");
94+
echo '<script language="javascript">';
95+
echo 'window.alert("Your are now Log in")';
96+
echo '</script>';
97+
header("Refresh:0; url=http://localhost/VideoGameCenter/src/pages/dashboard.php");
9098
}else{
91-
echo "<script>alert('User or password are invalid!');</script>";
92-
header("Location: http://localhost/VideoGameCenter/login-adm.html");
99+
echo '<script language="javascript">';
100+
echo 'window.alert("User or Password are invalid!")';
101+
echo '</script>';
102+
header("Refresh:0; url=http://localhost/VideoGameCenter/login-adm.html");
93103
}
94104
}
95105
}

php/Entity/branchoffice.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ public static function createBranchOffice($branchoffice_name,$address){
3434
echo "<script>alert('BO has been created successfuly!');</script>";
3535
$db->closeConnection();
3636
unset($db);
37-
header("Location: http://localhost/VideoGameCenter/src/pages/manage-bo.php");
37+
echo '<script language="javascript">';
38+
echo 'window.alert("The Branch Office has been created successfuly!")';
39+
echo '</script>';
40+
header("Refresh:0; url=http://localhost/VideoGameCenter/src/pages/manage-bo.php");
3841
}
3942
}

php/Entity/provider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ public static function createProvider($company_name,$RFC,$address){
5353
$result = $db->queryBuilder($sql);
5454
$db->closeConnection();
5555
unset($db);
56-
header("Location: http://localhost/VideoGameCenter/src/pages/manage-provider.php");
56+
echo '<script language="javascript">';
57+
echo 'window.alert("The provider has been created successfuly!")';
58+
echo '</script>';
59+
header("Refresh:0; url=http://localhost/VideoGameCenter/src/pages/manage-provider.php");
5760
}
5861
}

php/Entity/status.php

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ public function updateStatus($id,$status){
4747
$result = $db->queryBuilder($sql);
4848
$db->closeConnection();
4949
unset($db);
50-
header("Location: http://localhost/VideoGameCenter/src/pages/manage-status.php");
50+
echo '<script language="javascript">';
51+
echo 'window.alert("The purchase has been completed")';
52+
echo '</script>';
53+
header("Refresh:0; url=http://localhost/VideoGameCenter/src/pages/manage-status.php");
5154
}
5255
//Obtener cantidad de status
5356
public function quantityStatus(){
@@ -67,4 +70,30 @@ public function createStatus($id_ticket,$date_ticket,$status){
6770
$db->closeConnection();
6871
unset($db);
6972
}
73+
//Mostrar status del usuario activo
74+
public static function showStatusOfUser(){
75+
$db = new sqlConnection();
76+
$id=$_SESSION['id_user'];
77+
$sql = 'SELECT date_ticket,status FROM status';
78+
$sql .= " WHERE id_user = '".$id."'";
79+
$data = $db->queryBuilder($sql);
80+
echo "<table class='table table-striped table-dark'>
81+
<thead>
82+
<tr class='bg-danger'>
83+
<th>Date Ticket</th>
84+
<th>Status</th>
85+
</tr>
86+
</thead>";
87+
while($row = mysqli_fetch_array($data)){
88+
echo "<tbody>";
89+
echo "<td>".$row['date_ticket']. "</td>";
90+
echo "<td>".$row['status']. "</td>";
91+
echo "</tr>";
92+
echo "</form>";
93+
}
94+
echo "</tbody>";
95+
echo "</table>";
96+
$db->closeConnection();
97+
unset($db);
98+
}
7099
}

0 commit comments

Comments
 (0)