Repository navigation
Expand file tree
/
Copy pathcuenta-admin.php
More file actions
126 lines (118 loc) · 4.56 KB
/
Copy pathcuenta-admin.php
File metadata and controls
126 lines (118 loc) · 4.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="navbar.css">
<link rel="stylesheet" href="info.css">
<link rel="stylesheet" href="cuentaheader.css">
<link rel="stylesheet" href="perfil.css">
<link rel="stylesheet" href="admin.css">
<link rel="stylesheet" href="form.css">
<title>Document</title>
</head>
<body onresize="change()">
<?php
include 'assets/header/header.php';
?>
<?php
include 'assets/header/cuentaheader.php';
?>
<ul class="acmenu">
<li onclick="location.href='cuenta-index.php';">Perfil</li>
<li onclick="location.href='cuenta-builds.php';">Tus Builds</li>
<li onclick="location.href='cuenta-reviews.php';">Tus reviews</li>
<li onclick="location.href='cuenta-favoritas.php';">Partes Favoritas</li>
<li onclick="location.href='cuenta-guardadas.php';">Builds Guardadas</li>
<li class="selected" onclick="location.href='Admin.php';">Admin Menu</li>
<p>.</p>
</ul>
<div id="adminmenu" style="display: none;">
<p class="category-title">Users</p>
<div class="category" id="users">
</div>
<p class="category-title">Reviews con reporte</p>
<div class="category" id="revs">
</div>
<script src = "assets/js/cuenta-admin.js"></script>
<p class="title">
Agregar parte
</p>
<form class="form" action="controllers/part_controller.php" onsubmit="return chequeo()" method="POST" autocomplete="off" enctype="multipart/form-data">
<div>
<?php
if (array_key_exists("error", $_GET))
echo '<p style="color:red;">' .$_GET["error"]. '</p>';
?>
</div>
<div class="input-group">
<label for="types">*Tipo: </label>
<select name="types" id="types">
<option value="cpu">CPU</option>
<option value="mb">MB</option>
<option value="cas">CASE</option>
<option value="gpu">GPU</option>
<option value="ssd">SSD</option>
<option value="cpc">COOLER</option>
<option value="psu">PSU</option>
<option value="ram">RAM</option>
<option value="fan">FAN</option>
</select>
</div>
<div class="input-group">
<label for="name">*Nombre: </label>
<input type="text" name="name" class="form-control">
</div>
<div class="input-group">
<label for="desc">*Descripción: </label>
<input type="text" name="desc" class="form-control">
</div>
<div class="input-group">
<label for="price">*Precio(MXN): </label>
<input type="number" name="price" class="form-control">
</div>
<div class="input-group">
<label for="brand">*Marca: </label>
<input type="text" name="brand" class="form-control">
</div>
<div class="input-group">
<label for="socket">*Socket(CPU MB): </label>
<input type="text" name="socket" class="form-control">
</div>
<div class="input-group">
<label for="ff">*Factor de forma(Case MB):</label>
<input type="text" name="ff" class="form-control">
</div>
<div class="input-group">
<label for="wat">Consumo(W): </label>
<input type="number" name="wat" class="form-control">
</div>
<div class="input-group">
<label for="ddr">*Ddr(MB RAM):</label>
<input type="number" name="ddr" class="form-control">
</div>
<div class="input-group">
<label for="photo">*Imagen(JPG):</label>
<input type="file" name="photo" id="photo" onchange="handleFiles(this.files)" accept=".jpg">
</div>
<button class="btn" style="cursor: pointer;">Agregar parte</button>
</form>
</div>
<script>
document.addEventListener("DOMContentLoaded", function(){
checkAdmin();
})
function checkAdmin(){
if(<?php
if(array_key_exists("id",$_SESSION))
if($_SESSION["type"]=="admin")
echo json_encode(true);
else
echo json_encode(false);
?>==true)
document.getElementById("adminmenu").style.display = "block";
}
</script>
</body>
</html>