admin_page.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <?php session_start(); ?>
  2. <html lang="en">
  3. <head id="top">
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <link rel="stylesheet" href="styles/ad.css">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>Shop</title>
  9. </head>
  10. <header>
  11. <div class="logo_content">
  12. <div class="logo">SITE-SHOP</div>
  13. </div>
  14. <div class="hd">
  15. <div class = "login1">
  16. <button type="submit" class = "login"><a href="index.html">
  17. <p class="log" id="openModalBtn3">Выйти</p></a>
  18. </button>
  19. </div>
  20. </div>
  21. </header>
  22. <body>
  23. <script src="bloki.js"></script>
  24. <div id="nav-bar">
  25. <input id="nav-toggle" type="checkbox"/>
  26. <div id="nav-header"><a id="nav-title" target="_blank"><i class="fab fa-codepen"></i>Администратор: <?php echo $_SESSION['login'];
  27. ?></a>
  28. <label for="nav-toggle"><span id="nav-toggle-burger"></span></label>
  29. <hr/>
  30. </div>
  31. <div id="nav-content">
  32. <div class="nav-button" id="open" onclick="togglePanel()"><i class="fas fa-gem"></i><span>Пользователи</span></div>
  33. <div class="nav-button" onclick="togglePanel1()"><i class="fas fa-gem"></i><span>Заявки на регистрацию</span><div class ="colvo_z"> <?php include 'count_z.php'; ?><?php echo $countik?></div></div>
  34. <div class="nav-button" onclick="togglePanel2()"><i class="fas fa-gem"></i><span>Отзывы</span></div>
  35. <div class="nav-button" onclick="togglePanel3()"><i class="fas fa-gem"></i><span>Склад продукции</span></div>
  36. <div class="nav-button" onclick="togglePanel4()"><i class="fas fa-gem"></i><span>Добавить продукцию</span></div>
  37. <div class="nav-button" onclick="togglePanel5()"><i class="fas fa-gem"></i><span>Статистика</span></div>
  38. <div class="nav-button" onclick="togglePanel6()"><i class="fas fa-gem"></i><span>Заказы</span><div class ="colvo_z"> <?php include 'count_z.php'; ?><?php echo $countik1?></div></div>
  39. <div id="nav-content-highlight"></div>
  40. </div>
  41. <input id="nav-footer-toggle" type="checkbox"/>
  42. <!-- <div id="nav-footer">
  43. </div> -->
  44. </div>
  45. <div class="warehouse" id="warehouse">
  46. <?php include 'connect.php';
  47. $result = mysqli_query($mysql, "SELECT * FROM `Products`");
  48. ?>
  49. <div class="product_card_conteiner">
  50. <?php
  51. While($Products= mysqli_fetch_assoc($result)){
  52. ?>
  53. <div class="product_card">
  54. <div class="img_cont">
  55. <div class="im"><?php echo $Products['img'];?></div>
  56. </div>
  57. <div class="name_star">
  58. <p><?php echo $Products['title'];?></p>
  59. <p>остаток на складе: <?php echo $Products['count_p'];?></p>
  60. </div>
  61. <div class="discription"><?php echo $Products['discription'];?></div>
  62. </div>
  63. <?php
  64. }
  65. ?>
  66. </div>
  67. </div>
  68. <div class="statistics" id="statistics">
  69. <div> <?php include 'count_user.php'; ?>
  70. <div class="content_status">
  71. <div class="krug3">
  72. </div>
  73. <p> Средний балл сайта: <?php echo $Avg_b?></p>
  74. </div>
  75. <div class="content_status">
  76. <div class="krug2">
  77. </div>
  78. <p> Количество пользователей: <?php echo $count?></p>
  79. </div>
  80. <div class="content_status">
  81. <div class="krug1">
  82. </div>
  83. <p> Количество комментариев: <?php echo $count1?></p>
  84. </div>
  85. <div class="s"><a href="Statisic.csv" download><p>Получить данные о заказах</p><a></div>
  86. </div>
  87. </div>
  88. <script>
  89. function zabirat(){
  90. var dan =document.getElementById('myDiv').innerText;
  91. document.getElementById('id').value =dan;
  92. }
  93. function zabirat1(){
  94. var dan =document.getElementById('myDiv').innerText;
  95. var login1 =document.getElementById('login1').innerText;
  96. var region1 =document.getElementById('region1').innerText;
  97. var FIOo =document.getElementById('FIOo').innerText;
  98. var Email1 =document.getElementById('Email1').innerText;
  99. var password1 =document.getElementById('password1').innerText;
  100. document.getElementById('id1').value =dan;
  101. document.getElementById('login').value =login1;
  102. document.getElementById('region').value =region1;
  103. document.getElementById('FIO').value =FIOo;
  104. document.getElementById('Email').value =Email1;
  105. document.getElementById('password').value =password1;
  106. }
  107. function zabirat2(){
  108. var dan =document.getElementById('hide_order').innerText;
  109. document.getElementById('id_hide').value =dan;
  110. }
  111. function zabirat4(){
  112. var login =document.getElementById('login_order').innerText;
  113. var count =document.getElementById('hide_count').innerText;
  114. var prod =document.getElementById('product_id').innerText;
  115. var summ =document.getElementById('sum_order').innerText;
  116. document.getElementById('login_orders').value =login;
  117. document.getElementById('id_count_s').value =count;
  118. document.getElementById('summ_order').value =summ;
  119. document.getElementById('hide_product').value =prod;
  120. var dan =document.getElementById('hide_order').innerText;
  121. document.getElementById('id_hider').value =dan;
  122. var dan1 =document.getElementById('hide_order').innerText;
  123. var count1 =document.getElementById('hide_count').innerText;
  124. var prod1 =document.getElementById('product_id').innerText;
  125. document.getElementById('id_hide').value =dan1;
  126. document.getElementById('hide_c').value = count1;
  127. document.getElementById('hide_pr').value = prod1;
  128. }
  129. function zabirat3(){
  130. }
  131. </script>
  132. <div class="zajavki" id="zajavki">
  133. <?php include 'connect.php';
  134. $result = mysqli_query($mysql, "SELECT * FROM `ZUsers`");
  135. ?>
  136. <div class="product_card_conteiner1" id="b">
  137. <?php
  138. While($ZUsers= mysqli_fetch_assoc($result)){
  139. ?>
  140. <div class="product_card1">
  141. <div class="text_card">
  142. <div class="ouput_text" id="login1">
  143. <?php echo $ZUsers['login'];?></div>
  144. <div class="ouput_text"id="region1">
  145. <?php echo $ZUsers['region'];?></div>
  146. <div class="ouput_text" id="FIOo">
  147. <?php echo $ZUsers['FIO'];?></div>
  148. <div class="ouput_text" id="Email1">
  149. <?php echo $ZUsers['Email'];?></div>
  150. <div class="ouput_text" id="password1">
  151. <?php echo $ZUsers['password'];?></div>
  152. <div class="ouput_text">Номер заявки:<p id="myDiv" >
  153. <?php echo$ZUsers['id'];?></p> </div>
  154. </div>
  155. <div class="knopkii">
  156. <form action="delete_record.php" method="post">
  157. <input type="hidden" id="id" name="id" class="delete" >
  158. <button type="submit" class="but_otprav" onclick="zabirat()">Отклонить</button>
  159. </form>
  160. <form action="add_use.php" method="post">
  161. <input type="hidden" id="id1" name="id1" class="delete" >
  162. <input class="inp" type="hidden" id="FIO" name="FIO" placeholder="ФИО" required>
  163. <input class="inp" type="hidden" id="region" name="region" placeholder="регион" required>
  164. <input class="inp" type="hidden" id="login" name="login" placeholder="логин" required>
  165. <input class="inp" type="hidden" id="Email" name="Email" placeholder="Email" required>
  166. <input class="inp" type="hidden" id="password" name="password" placeholder="пароль" required>
  167. <button type="submit" class="but_otprav" onclick="zabirat1()">Принять</button>
  168. </form>
  169. </div>
  170. </div>
  171. <?php
  172. }
  173. ?>
  174. </div>
  175. </div>
  176. <div class="orders" id="orders">
  177. <?php include 'connect.php';
  178. $result = mysqli_query($mysql, "SELECT * FROM `Orders1` where 'condition_order' =0");
  179. ?>
  180. <div class="product_card_conteiner1" id="b">
  181. <?php
  182. While($Orders1= mysqli_fetch_assoc($result)){
  183. ?>
  184. <div class="product_card1">
  185. <div class="text_card">
  186. <div class="ouput_text" id="id_login">Пользователь:
  187. <?php echo $Orders1['id_login'];?></div>
  188. <div class="ouput_text" id="summ">Сумма:
  189. <?php echo $Orders1['summ'];?></div>
  190. <div class="ouput_text" id="count_prod"> Количество:
  191. <?php echo $Orders1['count_prod'];?></div>
  192. <div class="hide" id="hide_count"><?php echo $Orders1['count_prod'];?> </div>
  193. <div class="hide" id="product_id"><?php echo $Orders1['product_id'];?> </div>
  194. <div class="hide" id="login_order"><?php echo $Orders1['id_login'];?> </div>
  195. <div class="hide" id="sum_order"><?php echo $Orders1['summ'];?> </div>
  196. <div class="ouput_text">Код товара:
  197. <?php echo $Orders1['product_id'];?></div>
  198. <div class="hide" id="hide_order"><?php echo $Orders1['id'];?> </div>
  199. </div>
  200. <div class="knopkii">
  201. <form action="delete_order.php" method="post">
  202. <input type="hidden" id="id_hide" name="id_hide" class="delete" >
  203. <button type="submit" class="but_otprav" onclick="zabirat2()">Отклонить</button>
  204. </form>
  205. <!-- <form action="update_order.php" method="post">
  206. <input type="hidden" id="hide_c" name="hide_c" class="delete" >
  207. <input type="hidden" id="hide_pr" name="hide_pr" class="delete" >
  208. <button type="submit" class="but_otprav" onclick="zabirat3()">Принять</button>
  209. </form> -->
  210. <form action="update_status.php" method="post">
  211. <input type="hidden" id="id_hider" name="id_hider" class="delete" >
  212. <input type="hidden" id="summ_order" name="summ_order" class="delete" >
  213. <input type="hidden" id="hide_product" name="hide_product" class="delete" >
  214. <input type="hidden" id="id_count_s" name="id_count_s" class="delete" >
  215. <input type="hidden" id="login_orders" name="login_orders" class="delete" >
  216. <input type="hidden" id="hide_c" name="hide_c" class="delete" >
  217. <input type="hidden" id="hide_pr" name="hide_pr" class="delete" >
  218. <button type="submit" class="but_otprav" onclick="zabirat4()">Обновить статус</button>
  219. </form>
  220. </div>
  221. </div>
  222. <?php
  223. }
  224. ?>
  225. </div>
  226. </div>
  227. <div class="add_product" id="add_product">
  228. <div id="modal" class="modal">
  229. <div class="modal-content">
  230. <h2>Добавить товар</h2>
  231. <form id="myForm" action="add_product.php" method="POST" class="forma">
  232. <input class="inp" type="text" id="title" name="title" placeholder="Название товара" required>
  233. <input class="inp" type="text" id="discription" name="discription" placeholder="Описание" required>
  234. <input class="inp" type="number" id="count_p" name="count_p" placeholder="Количество" required>
  235. <input class="inp" type="number" id="price" name="price" placeholder="Цена" required>
  236. <input class="inp" type="file" id="img" name="img" placeholder="Изображение" required>
  237. <p class="ft">Заполните необходимые поля, чтобы сформировать новую карточку товара.</p>
  238. <button type="submit" class="but_otprav">Добавить</button>
  239. </form>
  240. </div>
  241. </div>
  242. </div>
  243. <div class="reviews" id="reviews">
  244. <?php include 'connect.php';
  245. $result1 = mysqli_query($mysql, "SELECT * FROM `reviews`");
  246. ?>
  247. <div class="com-containe" id="bb">
  248. <?php
  249. While($reviews= mysqli_fetch_assoc($result1)){
  250. ?>
  251. <div class="com">
  252. <div class="krug"></div>
  253. <p class="text_in_com">Дата:
  254. <?php echo $reviews['date'];?></p>
  255. <p class="text_in_com">Комментарий:
  256. <?php echo $reviews['review'];?> </p>
  257. <p class="text_in_com">Оценка:
  258. <?php echo $reviews['rating'];?></p>
  259. </div>
  260. <?php
  261. }
  262. ?>
  263. </div>
  264. </div>
  265. <div class="users" id="users">
  266. <?php include 'connect.php';
  267. $result1 = mysqli_query($mysql, "SELECT * FROM `Users`");
  268. ?>
  269. <div class="com-containe" id="bb">
  270. <?php
  271. While($Users= mysqli_fetch_assoc($result1)){
  272. ?>
  273. <div class="com">
  274. <div class="krug"></div>
  275. <p class="text_in_com">Логин:
  276. <?php echo $Users['login'];?></p>
  277. <p class="text_in_com"> Регион:
  278. <?php echo $Users['region'];?> </p>
  279. <p class="text_in_com"> ФИО:
  280. <?php echo $Users['FIO'];?></p>
  281. <p class="text_in_com"> Почта:
  282. <?php echo $Users['Email'];?> </p>
  283. <p class="text_in_com"> Пароль:
  284. <?php echo $Users['password'];?> </p>
  285. <p class="text_in_com"> Роль:
  286. <?php echo $Users['role'];?> </p>
  287. </div>
  288. <?php
  289. }
  290. ?>
  291. </div>
  292. </div>
  293. </body>
  294. <footer>
  295. </footer>
  296. </html>