barbos01

edit.php

May 24th, 2022
893
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.90 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.         .adb {
  132.             padding-top: 150px;
  133.         }
  134.     </style>
  135. </head>
  136. <body>
  137.     <?php
  138.       include("verificare.php");
  139.       if($_SESSION["type"] == 0) {
  140.         echo "<script>window.location.href='index.php';</script>";  
  141.       }
  142.       else {
  143.         include("header-admin.php");
  144.       }
  145.        
  146.     ?>
  147.     <?php
  148.         if($_GET['table'] == 'judet') {
  149.     ?>
  150.  
  151.                 <div class = "adb">
  152.                     <form id="topicForm" action="" method="POST">
  153.                         <label for="fname">Numele categoriei actuale: <?php echo $_GET['name'] ?></label>
  154.                         <label for="fname">Introduceti noul nume pentru aceasta categorie: </label>
  155.                         <input type="text" id="fname" name="numJUD" value="">
  156.                         <input type="submit" name="submit" value="Adauga un topic" />
  157.                     </form>
  158.                 </div>
  159.  
  160.     <?php
  161.         }
  162.     ?>
  163.  
  164.     <?php include('footer.php') ?>
  165. </body>
  166.  
  167. </html>
  168.  
  169. <?php
  170.  
  171.     if(isset($_POST['numJUD'])){
  172.         $name = $_POST['numJUD'];
  173.         $id_jud = $_GET['id_jud'];
  174.         $sql = "UPDATE judete SET name='$name' WHERE id='$id_jud'";
  175.         $result = mysqli_query($con,$sql);
  176.         echo "<script>window.location.href='adminPanel.php';</script>";
  177.     }
  178.  
  179. ?>
Advertisement
Add Comment
Please, Sign In to add comment