Advertisement
barbos01

edit.php

May 26th, 2022
694
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.91 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. include("auth.php"); //include auth.php file on all secure pages ?>
  5. <!DOCTYPE html>
  6. <html>
  7.  
  8. <head>
  9.     <meta charset="utf-8" />
  10.     <meta http-equiv="x-ua-compatible" content="ie=edge" />
  11.     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  12.     <title>Foundation for Sites</title>
  13.     <link rel="stylesheet" href="css/foundation.css" />
  14.     <link rel="stylesheet" href="css/app.css" />
  15.     <link rel="stylesheet" href="css/app.css" />
  16.     <link rel="stylesheet" href="css/styleAuth.css" />
  17.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  18.     <script src='https://kit.fontawesome.com/a076d05399.js' crossorigin='anonymous'></script>
  19.     <style>
  20.       body {
  21.           background-color: rgb(255, 255, 255);
  22.         }
  23.         img {
  24.           border-radius: 8px;
  25.           display: block;
  26.           margin-left: auto;
  27.           margin-right: auto;
  28.           width: 60%
  29.         }
  30.        
  31.         .card {
  32.           background-color: rgb(255, 255, 255);
  33.           padding-top: 5%;
  34.           border: 0px;
  35.           width: auto;
  36.           height: 650px;
  37.         }
  38.         .top-bar, .top-bar ul {
  39.           background-color: #ff0000;
  40.          color: white;
  41.       }
  42.       a {
  43.         color: white;
  44.       }
  45.       a:hover {
  46.         color: black;
  47.       }
  48.       .links-button {
  49.             display: inline-block;
  50.             vertical-align: middle;
  51.             margin: 0 0 1rem 0;
  52.             font-family: inherit;
  53.             padding: 0.85em 1em;
  54.             -webkit-appearance: none;
  55.             border: 1px solid rgb(0, 0, 0);
  56.             border-radius: 0;
  57.             transition: background-color 0.25s ease-out, color 0.25s ease-out;
  58.             font-size: 0.8rem;
  59.             line-height: 1;
  60.             text-align: center;
  61.             cursor: pointer;
  62.             background-color: #060a085b;
  63.            color: #fefefe;
  64.        }
  65.  
  66.         #customers {
  67.            font-family: Arial, Helvetica, sans-serif;
  68.             border-collapse: collapse;
  69.             width: 100%;
  70.         }
  71.  
  72.         #customers td,
  73.        #customers th {
  74.            border: 1px solid #ddd;
  75.            padding: 8px;
  76.         }
  77.  
  78.         #customers tr {
  79.            background-color: white;
  80.         }
  81.  
  82.         #customers tr:hover {
  83.            background-color: wheat;
  84.         }
  85.  
  86.         #customers th {
  87.            padding-top: 12px;
  88.             padding-bottom: 12px;
  89.             text-align: left;
  90.             background-color: #a64200;
  91.            color: white;
  92.         }
  93.  
  94.         div .container {
  95.             margin: 0px 0px;
  96.             padding: 0px 0px;
  97.            
  98.         }
  99.        
  100.         ul.pagination a{
  101.             display: inline-block;
  102.             vertical-align: middle;
  103.             margin: 0 0 1rem 0;
  104.             font-family: inherit;
  105.             padding: 0.85em 1em;
  106.             -webkit-appearance: none;
  107.             border: 1px solid rgb(0, 0, 0);
  108.             border-radius: 0;
  109.             transition: background-color 0.25s ease-out, color 0.25s ease-out;
  110.             font-size: 0.8rem;
  111.             line-height: 1;
  112.             text-align: center;
  113.             cursor: pointer;
  114.             background-color: #9d0011;
  115.            color: #fefefe;
  116.        }
  117.         ul.pagination a:visited {
  118.             background-color: #9d0011;
  119.            color: black;
  120.         }
  121.         td>h3>a {
  122.           color: black;
  123.           font-size: 1.1rem;
  124.         }
  125.         #customers a {
  126.            color: black;
  127.         }
  128.         #customers a:hover {
  129.            color: #9d0011;
  130.        }
  131.         .adb1 {
  132.             display: flex;
  133.             justify-content: start;
  134.             flex-direction: column;
  135.             align-items: center;
  136.         }
  137.         .adb {
  138.             padding-top:220px;
  139.         }
  140.     </style>
  141. </head>
  142. <body>
  143.     <?php
  144.       include("verificare.php");
  145.       if($_SESSION["type"] == 0) {
  146.         echo "<script>window.location.href='index.php';</script>";  
  147.       }
  148.       else {
  149.         include("header-admin.php");
  150.       }
  151.        
  152.     ?>
  153.     <?php
  154.         if($_GET['table'] == 'judet') {
  155.     ?>
  156.  
  157.                 <div class = "adb">
  158.                     <form id="topicForm" action="" method="POST">
  159.                         <label for="fname">Numele categoriei actuale: <b><?php echo $_GET['name'] ?></b></label>
  160.                         <label for="fname">Introduceti noul nume pentru aceasta categorie: </label>
  161.                         <input type="text" id="fname" name="numJUD" value="">
  162.                         <div class = "adb1">
  163.                             <input type="submit" name="submit" value="Modifica" />
  164.                             <input type="submit" name="submit1" value="Inapoi la Admin Panel"/>
  165.                             </div>
  166.                         </form>
  167.                 </div>
  168.  
  169.     <?php
  170.         }
  171.         else if($_GET['table'] == 'topic') {
  172.             ?>
  173.        
  174.                         <div class = "adb">
  175.                             <form id="topicForm" action="" method="POST">
  176.                                 <label for="fname">Numele topicului actual: <b><?php echo $_GET['top'] ?></b>, din categoria <b><?php echo $_GET['jud'] ?></ b></label>
  177.                                 <label for="fname">Introduceti noul nume pentru aceasta topic: </label>
  178.                                 <div class = "adb1">
  179.                                     <input type="text" id="fname" name="numTOP" value="">
  180.                                     <input type="submit" name="submit" value="Adauga un topic" />
  181.                                     <input type="submit" name="submit1" value="Inapoi la Admin Panel"/>
  182.                                 </div>
  183.                             </form>
  184.                         </div>
  185.        
  186.             <?php
  187.                 }
  188.         else if($_GET['table'] == 'raspuns') {
  189.             ?>
  190.                
  191.                         <div class = "adb">
  192.                             <form id="topicForm" action="" method="POST">
  193.                                 <label for="fname">Modificati raspunsul din topicul: <b><?php echo $_GET['top'] ?></b></label>
  194.                                 <label for="fname">Introduceti noul nume pentru aceasta topic: </label>
  195.                                 <div class = "adb1">
  196.                                     <input type="text" id="fname" name="numRASP" value="">
  197.                                     <input type="submit" name="submit" value="Modifica raspuns" />
  198.                                     <input type="submit" name="submit1" value="Inapoi la Admin Panel"/>
  199.                                 </div>
  200.                             </form>
  201.                         </div>
  202.                
  203.             <?php
  204.                 }
  205.     ?>
  206.  
  207.     <?php include('footer.php') ?>
  208. </body>
  209.  
  210. </html>
  211.  
  212. <?php
  213.     if(isset($_POST['submit1'])){echo "<script>window.location.href='adminPanel.php';</script>";}
  214.     else if(isset($_POST['numTOP']) and $_POST['numTOP'] != ""){
  215.         $name = $_POST['numTOP'];
  216.         $id_top = $_GET['id_top'];
  217.         $sql = "UPDATE topic SET numetopic='$name' WHERE id='$id_top'";
  218.         $result = mysqli_query($con,$sql);
  219.         echo "<script>window.location.href='adminPanel.php';</script>";
  220.     }
  221.     else if(isset($_POST['numJUD']) and $_POST['numJUD'] != "") {
  222.         $name = $_POST['numJUD'];
  223.         $id_jud = $_GET['id_jud'];
  224.         $sql = "UPDATE judete SET name='$name' WHERE id='$id_jud'";
  225.         $result = mysqli_query($con,$sql);
  226.         echo "<script>window.location.href='adminPanel.php';</script>";
  227.     }
  228.     else if(isset($_POST['numRASP']) and $_POST['numRASP'] != "") {
  229.         $name = $_POST['numRASP'];
  230.         $id_rasp = $_GET['id_rasp'];
  231.         $sql = "UPDATE raspunsuri SET raspuns='$name' WHERE id='$id_rasp'";
  232.         $result = mysqli_query($con,$sql);
  233.         echo "<script>window.location.href='adminPanel.php';</script>";
  234.     }
  235.  
  236. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement