Разработка web-узла системы бронирования номеров в отелях, страница 2

                    header("Location: index.php");

                    //die('fail');

          }

          $login = $_SESSION["login"];

          //echo '';

          ?>

          <link rel="stylesheet" type="text/css" href="shop.css" >

          <script  type="text/javascript" src="func.js"></script>

          <?php

          include("header.php");

          echo '<div align=right>Добро пожаловать, '.$login. '</div><br>';

          //echo '<a href=show_cart.php> Корзина </a>';

          echo '<h2>Свободные номера:</h2><br>';

          if(mysql_connect("localhost", $db_user, $db_pass))

          {

                    mysql_select_db($db_name);

                    $result = mysql_query("SELECT * FROM rooms_data");

                    if(mysql_num_rows($result) == 0)

                    {

                              die("<h2>Извините, но на данный момент нет свободных номеров</h2>");

                    }

                    while($row=mysql_fetch_array($result))

                    {

                              $id = $row["id"];

                              echo '<table>';

                              echo '<tr><td>';

                              $imgpath = $row["image"];

                              echo '<img src='.$imgpath.'>';

                              echo '</td></tr>';

                              echo '<tr><td>Название отеля:</td><td>'.$row["name"].'</td></tr><br>';

                              echo '<tr><td>Категория номера:</td><td>'.$row["class"].'</td></tr><br>';

                              echo '<tr><td>Количество мест:</td><td>'.$row["place_count"].'</td></tr><br>';

                              echo '<tr><td>Цена:</td><td>'.$row["price"]. '</td></tr><br>';

                              //echo '<div class=good.'$id.'>';

                              echo '<tr><td><div id="good'.$id.'">';

                              if(!in_array($id, $_SESSION["rooms"]))

                              {

                                         //print_r($_SESSION);

                                         echo '<a href="javascript:add_cart('. $id . ')">Забронировать</a>';//</div>';

                              }

                              else

                              {

                                         echo '<b>Номер забронирован!</b>';

                              }

                              echo '</div></tr></td>';

                              //echo '<div id="test"></div>';

                              echo '<br><hr>';

                    }

          }

?>

Show_cart.php

<?php

          include 'config.php';

          session_start();

          if(!isset($_SESSION["login"]))

          {

                    header("Location: index.php");

          }

          mysql_connect("localhost", $db_user, $db_pass);

          mysql_select_db($db_name);