1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- $host = "kurek620.beget.tech";
- $username = "kurek620_baze";
- $password = "6910WASD579h";
- $database = "kurek620_baze";
- $mysql = new mysqli($host, $username, $password, $database);
- if($mysql->connect_error){
- die("Ошибка подключения". $mysql->connect_error);
- }
- $id = $_POST["id_hider"];
-
- $count_order = $_POST["id_count_s"];
- $login = $_POST["login_orders"];
- $summ_order = $_POST["summ_order"];
- $id_product = $_POST["hide_product"];
-
-
- $setting = $_POST["hide_c"];
- $product_id = $_POST["hide_pr"];
-
- $query = "UPDATE Products SET count_p = count_p - $setting WHERE id = $product_id";
- $result = $mysql->query($query);
- if(!$result){
- echo "Что то не так" . $mysql->error;
- }
- else{
-
-
- echo "<script>window.location.href = 'admin_page.php';</script>";
-
- }
- $query = "DELETE FROM Orders1 WHERE id = $id";
- if ($mysql->query($query) === TRUE) {
- echo "<script>window.location.href = 'admin_page.php';</script>";
- } else {
- echo "Ошибка при удалении записи: " . $mysql->error;
- }
-
- $query = "INSERT INTO Orders (`login`, `count_order`, `summ_order`, `id_product`)
- VALUES ('$login', '$count_order', '$summ_order', '$id_product')";
- $result = $mysql->query($query);
- if(!$result){
- echo "Что то не так" . $mysql->error;
- }
- else{
-
- echo "<script>window.location.href = 'admin_page.php';</script>";
-
- }
- $id = $_POST["id_hide"];
- ?>
-
-
-
- ?>
|