<?php
include("header.php");
?>

<div style="background-color: cadetblue">
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <?php










  if (isset($_SESSION['state_login']) && $_SESSION['state_login'] === true) {

  ?>


    <td width="8">
      </tbody>
      </table>

      </form>



      <p>&nbsp;</p>
      <p>&nbsp;</p>

    <?php
  }

    ?>



















    <div>
      <form method="post" action="action-nazar.php">
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <table width="349" border="1" align="center" cellspacing="2">
          <tbody>
            <tr>
              <td width="339" style="text-align: center; background-color: darkorange">نظرات</td>
            </tr>
          </tbody>
        </table>
        <table width="484" height="348" border="1" align="center" cellspacing="2">
          <tbody>
            <tr bgcolor="#D0FF00">
              <td width="330" height="51" style="text-align: center"><input name="name" type="text" id="name" size="40"></td>
              <td width="138" style="text-align: center">نام کاربری :</td>
            </tr>
            <tr bgcolor="#3AFF00">
              <td height="59" style="text-align: center"><input name="email" type="text" id="email" size="40"></td>
              <td style="text-align: center">پست الکترونیکی :</td>
            </tr>
            <tr bgcolor="#00FFF3">
              <td height="168" style="text-align: center"><textarea name="matn" cols="60" rows="10" id="matn"></textarea></td>
              <td style="text-align: center">متن پیام :</td>
            </tr>
            <tr>
              <td height="58" colspan="2" style="text-align: center"><input type="reset" name="button" id="button" value="پاک کردن">
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                <input type="submit" name="button2" id="button2" value="ثبت">
              </td>
            </tr>
          </tbody>
        </table>
        <hr width="800" size="20" color="hsla(308,100%,49%,1.00)" align="center">

        <p>&nbsp;</p>

      </form>






      <?php

      $link = mysqli_connect("localhost", "root", "", "shop-moble");
      if (mysqli_connect_errno())
        exit("این خطا رخ داده است" . mysqli_connect_error());

      $query1 = "SELECT * FROM nazar";
      $row1 = mysqli_query($link, $query1);


      while ($row = mysqli_fetch_array($row1)) {
      ?>


        <table width="498" height="292" border="1" align="right" cellspacing="2">
          <tbody>
            <tr>
              <td width="443" height="42" style="text-align: right"><?php echo ($row['name']); ?>
            </tr>

            <tr>
              <td><span style="text-align: center">
                  <textarea name="addres2" cols="60" rows="11" readonly id="addres2"><?php echo ($row['text']); ?></textarea>
                </span></td>
            </tr>
          </tbody>
        </table>

        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>

        <hr width="800" size="20" color="hsla(24,100%,50%,1.00)" align="center">

        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
      <?php
      }
      ?>

      <p style="text-align: center">&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
    </div>





</div>