Advertisement
barbos01

meniu dinamic

May 26th, 2022
789
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  2.  
  3. <style>
  4.     .wrap form{
  5.         width: 313px;
  6.         justify-content: flex-end;
  7.         display: flex;
  8.         align-items: center;
  9.         flex-direction: row;
  10.     }
  11.  
  12.     .wrap{
  13.         width:313px;
  14.     }
  15.     .top-bar, .top-bar ul {
  16.         background-color: #9d0011;
  17.     }
  18.    
  19. </style>
  20. <div class="top-bar">
  21.         <div class="top-bar-left">
  22.             <ul class="dropdown menu" data-dropdown-menu>
  23.                 <li class="menu-text">Welcome <?php echo $_SESSION['username']; ?>!</li>
  24.                 <?php
  25.                     include ('db.php');
  26.                     include('verificare.php');
  27.                     $user_type = $_SESSION['type'];
  28.                     $sql_pagini = "SELECT * FROM pages WHERE tip_user in ('$user_type', '2')";
  29.                     $result_pagini = mysqli_query($con, $sql_pagini);
  30.                     while ($table_data = mysqli_fetch_array($result_pagini, MYSQLI_ASSOC)) {
  31.                         echo "<li><a href=".$table_data['pg_name'].">".$table_data['nume_meniu']."</a></li>";
  32.                     }
  33.                 ?>
  34.             </ul>
  35.         </div>
  36.         <div class="wrap">
  37.             <div class="search">
  38.             <form id="usrform" action="" method="post">
  39.                 <input name = "cautare" type="text" class="searchTerm" placeholder="Cauta judet ex. Maramures.">
  40.                     <button name ="cauta" type="submit" class="searchButton"><i class="fa fa-search"></i></button>
  41.             </form>
  42.             </div>
  43.         </div>
  44. </div>
  45.  
  46. <?php
  47.     include 'red.php';
  48.     if(isset($_REQUEST['cautare']) and $_REQUEST['cautare'] !="") {
  49.         $name_jud = $_REQUEST['cautare'];
  50.         $sql_jud = "SELECT id FROM judete WHERE name='$name_jud'";  
  51.         $result_jud = mysqli_query($con, $sql_jud);
  52.         $row_cnt = mysqli_num_rows($result_jud);
  53.         if($row_cnt == 1) {
  54.             redirect('topic.php?jud='.$name_jud.'');
  55.         }
  56.         else {
  57.  
  58.         }
  59.     }
  60.     else {
  61.  
  62.     }
  63. ?>
Advertisement
RAW Paste Data Copied
Advertisement