Advertisement
Guest User

Untitled

a guest
Jan 30th, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 12.74 KB | None | 0 0
  1. <?php
  2. include 'include/connect.php';
  3.  
  4. $checku = $_COOKIE['user'];
  5. $checkp = $_COOKIE['pass'];
  6. $get = mysqli_query($link, "SELECT * FROM `admin` WHERE name='$checku'");
  7. $ass = mysqli_fetch_assoc($get);
  8. if ($ass['lvl'] < 4){
  9.  
  10. if (($ass['name'] == $checku) AND ($ass['password'] == $checkp)){
  11.     $settings = mysqli_query($link, "SELECT * FROM `settings` WHERE id='1'");
  12.         $coun = mysqli_fetch_assoc($settings);
  13.         $country1 = $coun['map1'];
  14.         $country2 = $coun['map2'];
  15.         $country3 = $coun['map3'];
  16.         $country4 = $coun['map4'];
  17.         $country5 = $coun['map5'];
  18.         $country6 = $coun['map6'];
  19.         $country7 = $coun['map7'];
  20.         $country8 = $coun['map8'];
  21.         $country9 = $coun['map9'];
  22.         $country10 = $coun['map10'];
  23.         $country11 = $coun['map11'];
  24.         $country12 = $coun['map12'];
  25.  
  26.  
  27.     if ((isset($_POST['link'])) AND (isset($_POST['money'])) AND (isset($_POST['zap1'])) AND (isset($_POST['zap2'])) AND (isset($_POST['zap3'])) AND (isset($_POST['country']))){
  28.         $country = $_POST['country'];
  29.         if ($country=='1'){
  30.             $cgo = $country1;
  31.         } elseif ($country=='2'){
  32.             $cgo = $country2;
  33.         }elseif ($country=='3'){
  34.             $cgo = $country3;
  35.         }elseif ($country=='4'){
  36.             $cgo = $country4;
  37.         }elseif ($country=='5'){
  38.             $cgo = $country5;
  39.         }elseif ($country=='6'){
  40.             $cgo = $country6;
  41.         }elseif ($country=='7'){
  42.             $cgo = $country7;
  43.         }elseif ($country=='8'){
  44.             $cgo = $country8;
  45.         }elseif ($country=='9'){
  46.             $cgo = $country9;
  47.         }elseif ($country=='10'){
  48.             $cgo = $country10;
  49.         }elseif ($country=='11'){
  50.             $cgo = $country11;
  51.         }elseif ($country=='12'){
  52.             $cgo = $country12;
  53.         } else{
  54.             die();
  55.         }
  56.         $checku = $_COOKIE['user'];
  57.         $link = $_POST['link'];
  58.         $money = $_POST['money'];
  59.         $zap1 = $_POST['zap1'];
  60.         $zap2 = $_POST['zap2'];
  61.         $zap3 = $_POST['zap3'];
  62.         $add = mysqli_query($link, "INSERT INTO `tovars` (country, tovar, value, zapros, zapros2, zapros3, editor) VALUES ('$cgo','$link', '$money', '$zap1', '$zap2', '$zap3', '$checku')");
  63.         if ($add == true){
  64.             echo "<html>
  65.            <head>
  66.                <title>Функции администратора</title>
  67.                <link rel='stylesheet' href='style/style.css'>
  68.            </head>
  69.            <body>
  70.                <div class='box'>
  71.                <!-- Лево -->";
  72.                 include 'part/left.php';
  73.            
  74.                         echo "<!-- Право -->
  75.                        <div class='right'>
  76.                            <div class='work'>
  77.                                <div class='name'><span class='n_rasdel'>Мониторинг</span></div>
  78.                                <br>
  79.                                <div class='civ'>
  80.                                    <form action='add.php' method='post'>
  81.                                        <div class='input'>
  82.                                        <span class='help'>Ссылка на скачивание файла - </span><input type='text' class='add' required name='link' placeholder='Можно загрузить на mega.nz'><br>
  83.                                        <span class='help'>Цена - </span><input class='add' type='text' name='money' required placeholder='В рублях'><br>
  84.                                        <span class='help'>Запрос 1 - </span><input class='add' type='text' name='zap1' required placeholder='paypal.com'><br>
  85.                                        <span class='help'>Запрос 2 - </span><input class='add' type='text' name='zap2' required placeholder='amazon.com'><br>
  86.                                        <span class='help'>Запрос 3 - </span><input class='add' type='text' name='zap3' required placeholder='blockhain.com'><br>
  87.                                        </div>
  88.                                        <span class='help'>Выбери Раздел - </span> <br>
  89.                                        $country1<input class='add_country' type='radio' name='country' value='1' required>
  90.                                        $country2<input class='add_country' type='radio' name='country' value='2' required>
  91.                                        $country3<input class='add_country' type='radio' name='country' value='3' required>
  92.                                        $country4<input class='add_country' type='radio' name='country' value='4' required>
  93.                                        $country5<input class='add_country' type='radio' name='country' value='5' required>
  94.                                        $country6<input class='add_country' type='radio' name='country' value='6' required>
  95.                                        $country7<input class='add_country' type='radio' name='country' value='7' required>
  96.                                        $country8<input class='add_country' type='radio' name='country' value='8' required>
  97.                                        $country9<input class='add_country' type='radio' name='country' value='9' required>
  98.                                        $country10<input class='add_country' type='radio' name='country' value='10' required>
  99.                                        $country11<input class='add_country' type='radio' name='country' value='11' required>
  100.                                        $country12<input class='add_country' type='radio' name='country' value='12' required>
  101.            
  102.                                        <br> <input class='add_bt' type='submit' >
  103.                                    </form>
  104.                                    <span style='color: green'> Добавлено </span>
  105.                                </div>
  106.                            </div>
  107.                        </div>
  108.                    </div>
  109.                </div>
  110.            </body>
  111.            </html>";
  112.         }else {
  113.             echo "<html>
  114. <head>
  115.    <title>Функции администратора</title>
  116.    <link rel='stylesheet' href='style/style.css'>
  117. </head>
  118. <body>
  119.    <div class='box'>
  120.    <!-- Лево -->";
  121.     include 'part/left.php';
  122.  
  123.             echo "<!-- Право -->
  124.            <div class='right'>
  125.                <div class='work'>
  126.                    <div class='name'><span class='n_rasdel'>Мониторинг</span></div>
  127.                    <br>
  128.                    <div class='civ'>
  129.                        <form action='add.php' method='post'>
  130.                            <div class='input'>
  131.                            <span class='help'>Ссылка на скачивание файла - </span><input type='text' class='add' required name='link' placeholder='Можно загрузить на mega.nz'><br>
  132.                            <span class='help'>Цена - </span><input class='add' type='text' name='money' required placeholder='В рублях'><br>
  133.                            <span class='help'>Запрос 1 - </span><input class='add' type='text' name='zap1' required placeholder='paypal.com'><br>
  134.                            <span class='help'>Запрос 2 - </span><input class='add' type='text' name='zap2' required placeholder='amazon.com'><br>
  135.                            <span class='help'>Запрос 3 - </span><input class='add' type='text' name='zap3' required placeholder='blockhain.com'><br>
  136.                            </div>
  137.                            <span class='help'>Выбери Раздел - </span> <br>
  138.                            $country1<input class='add_country' type='radio' name='country' value='1' required>
  139.                            $country2<input class='add_country' type='radio' name='country' value='2' required>
  140.                            $country3<input class='add_country' type='radio' name='country' value='3' required>
  141.                            $country4<input class='add_country' type='radio' name='country' value='4' required>
  142.                            $country5<input class='add_country' type='radio' name='country' value='5' required>
  143.                            $country6<input class='add_country' type='radio' name='country' value='6' required>
  144.                            $country7<input class='add_country' type='radio' name='country' value='7' required>
  145.                            $country8<input class='add_country' type='radio' name='country' value='8' required>
  146.                            $country9<input class='add_country' type='radio' name='country' value='9' required>
  147.                            $country10<input class='add_country' type='radio' name='country' value='10' required>
  148.                            $country11<input class='add_country' type='radio' name='country' value='11' required>
  149.                            $country12<input class='add_country' type='radio' name='country' value='12' required>
  150.  
  151.                            <br> <input class='add_bt' type='submit' >
  152.                        </form>
  153.                        <span style='color: red'> Ошибка $cgo ; $link ; $money ; $zap1 ; $zap2 ; $zap3 ; $checku <br> MYSQL ошибка -"; echo mysqli_errno($add) . ": " . mysqli_error($add);
  154.                          echo ";</span>
  155.                    </div>
  156.                </div>
  157.            </div>
  158.        </div>
  159.    </div>
  160. </body>
  161. </html>";
  162.         }
  163.     }else {
  164. echo "<html>
  165. <head>
  166.    <title>Функции администратора</title>
  167.    <link rel='stylesheet' href='style/style.css'>
  168. </head>
  169. <body>
  170.    <div class='box'>
  171.    <!-- Лево -->";
  172.     include 'part/left.php';
  173.  
  174.             echo "<!-- Право -->
  175.            <div class='right'>
  176.                <div class='work'>
  177.                    <div class='name'><span class='n_rasdel'>Мониторинг</span></div>
  178.                    <br>
  179.                    <div class='civ'>
  180.                        <form action='add.php' method='post'>
  181.                            <div class='input'>
  182.                            <span class='help'>Ссылка на скачивание файла - </span><input type='text' class='add' required name='link' placeholder='Можно загрузить на mega.nz'><br>
  183.                            <span class='help'>Цена - </span><input class='add' type='text' name='money' required placeholder='В рублях'><br>
  184.                            <span class='help'>Запрос 1 - </span><input class='add' type='text' name='zap1' required placeholder='paypal.com'><br>
  185.                            <span class='help'>Запрос 2 - </span><input class='add' type='text' name='zap2' required placeholder='amazon.com'><br>
  186.                            <span class='help'>Запрос 3 - </span><input class='add' type='text' name='zap3' required placeholder='blockhain.com'><br>
  187.                            </div>
  188.                            <span class='help'>Выбери Раздел - </span> <br>
  189.                            $country1<input class='add_country' type='radio' name='country' value='1' required>
  190.                            $country2<input class='add_country' type='radio' name='country' value='2' required>
  191.                            $country3<input class='add_country' type='radio' name='country' value='3' required>
  192.                            $country4<input class='add_country' type='radio' name='country' value='4' required>
  193.                            $country5<input class='add_country' type='radio' name='country' value='5' required>
  194.                            $country6<input class='add_country' type='radio' name='country' value='6' required>
  195.                            $country7<input class='add_country' type='radio' name='country' value='7' required>
  196.                            $country8<input class='add_country' type='radio' name='country' value='8' required>
  197.                            $country9<input class='add_country' type='radio' name='country' value='9' required>
  198.                            $country10<input class='add_country' type='radio' name='country' value='10' required>
  199.                            $country11<input class='add_country' type='radio' name='country' value='11' required>
  200.                            $country12<input class='add_country' type='radio' name='country' value='12' required>
  201.  
  202.                            <br> <input class='add_bt' type='submit' >
  203.                        </form>
  204.                    </div>
  205.                </div>
  206.            </div>
  207.        </div>
  208.    </div>
  209. </body>
  210. </html>";
  211. }
  212. }else{
  213.     $redirect_url = 'login.php';
  214.     header('Location: http://groupy.pro/admin/admin.php');
  215. }
  216. } else {
  217. echo "У вас нету доступа к этому разделу";
  218.  
  219. }
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226. include 'include/close.php';
  227.  
  228. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement