-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontrol-panel.php
145 lines (119 loc) · 6.17 KB
/
control-panel.php
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>control-panel</title>
<link rel="stylesheet" href="css/style-control-panel.css" type="text/css">
</head>
<body>
<nav>
<ul class="headinglist">
<Li class="hlinks"> <a href="#" class="hlinks">ALL</a> </Li>
<Li class="hlinks"> <a href="index.php" class="hlinks">Home</a> </Li>
<Li class="hlinks"> <a href="#" class="hlinks">Smart</a> </Li>
<Li class="hlinks"> <a href="#" class="hlinks">Food</a> </Li>
<Li class="hlinks"> <a href="#" class="hlinks">Cofee</a> </Li>
<Li class="hlinks"> <a href="control-panel.php" class="hlinks">Control-panel</a> </Li>
</ul>
</nav>
<form action="php/controlPnelBack.php" method="post" enctype="multipart/form-data" class="foem">
<?php
session_start();
if( isset($_SESSION['username']) && $_SESSION['username'] == 'admin')
{
//--------contion ------------
include 'conationDB.php';
//--------End conetion--------
echo '<h1><em>welcome '. $_SESSION['username'].'</em><br>';
//id of items tabul
$stmt =$database->prepare("SELECT `heading`, `details`, `price`, `image0`,`id` FROM `items` ");
$stmt->execute();
foreach($stmt as $data){ $ID = $data['id']; }
//id of items tabul
$stmt =$database->prepare("SELECT `heading`, `details`, `price`, `image0`,`id` FROM `food` ");
$stmt->execute();
foreach($stmt as $data){ $ID_food = $data['id']; }
//id of items tabul
$stmt =$database->prepare("SELECT `heading`, `details`, `price`, `image0`,`id` FROM `smart` ");
$stmt->execute();
foreach($stmt as $data){ $ID_smart = $data['id']; }
if(isset($_POST['submit']))
{
$addAdata =$_SESSION['$addAdata'];
if($addAdata==true)
{
echo ('<span><div class="outside outside-warning">
<div class="inside inside-warning">
<div id="head">🚫successful: </div>
Done add item
</div>
</div>
</span>'
);
}
}
}
else
{
echo ('<span><div class="outside outside-warning">
<div class="inside inside-warning">
<div id="head">🚫try Hack: </div>
block of all system ports
</div>
</div>
</span>');
}
?>
<header>
<h1>add - items 📃</h1>
</header>
<div>
<input type="heading" name="id" value="<?php if(isset($ID)){ echo' main = '. (++$ID) ;} ?>" class=" id" require ></input>
<input type="heading" name="id_food" value="<?php if(isset($ID_food)){echo'food='.(++$ID_food);} ?>" class=" id" require ></input>
<input type="heading" name="id_smart" value="<?php if(isset($ID_smart)){echo'smart='.(++$ID_smart);} ?>" class=" id" require ></input>
<h2 class="heading" >heading</h2>
<input type="text" name="heading" class="heading1"require onkeyup="fetch_data(this.value)">
<h2 class="heading">details</h2>
<input type="text" name="details" class="todo-input details1 "require>
<h2 class="heading">long details</h2>
<input type="text" name="long_details" class="todo-input details1 "require>
<h2 class="heading">price</h2>
<input type="text" name="price" class="todo-input price1"require>
<h2 class="heading">image0 link</h2>
<input type="file" name="image0"class="todo-input image01" require>
<span class="gender-title">parts</span>
<div class="gender-details">
<input type="radio" name="part" id="dot-1" value="items">
<input type="radio" name="part" id="dot-2" value="food">
<input type="radio" name="part" id="dot-3" value="smart">
<div class="categoty">
<label for="dot-1">
<span class="dot one"></span>
<span class="gender">items</span>
</label>
<label for="dot-2">
<span class="dot tow"></span>
<span class="gender">food</span>
</label>
<label for="dot-3">
<span class="dot three"></span>
<span class="gender">smart</span>
</label>
</div>
</div>
<br>
<button type="submit" name="submit" value="uplode data" class="submit"> ➕ add - items</button>
</form>
<div class="todo-container">
<ul class="todo-list">
<!-- <div class="todo">
<li>Item No 1</li>
<button class="complete-btn">✔️</button>
<button class="trash-btn">❌</button>
</div> -->
</ul>
</div>
<script src="js/app.js" type="text/javascript"></script>
</body>
</html>