<div dir="rtl">
  <?php

  include("header.php");
  if (isset($_SESSION["state_login"]) && $_SESSION["state_login"] === true) {

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







    $mbl_cod = 0;
    if (isset($_GET['action']))
      $mbl_cod = $_GET['action'];
    $query77 = "SELECT * FROM mbl WHERE mbl_cod='$mbl_cod'";

    $mobl1 = mysqli_query($link, $query77);

    $mobl = mysqli_fetch_array($mobl1);








    $cod_meli = 0;
    if (isset($_GET['id']))
      $cod_meli = $_GET['id'];
    $query88 = "SELECT * FROM factor WHERE cod_meli='$cod_meli'";




    $user = mysqli_query($link, $query88);

    $factor = mysqli_fetch_array($user);









  ?>





    <form method="post" action="action_admin_factor.php" enctype="multipart/form-data">


      <div style="text-align: right; background-color: cadetblue" dir="rtl">



        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <table style="background-color: gold" width="60%" border="1" align="center" cellspacing="2">
          <tbody>
            <tr>
              <td>فاکتور</td>
            </tr>

            <div style="background-color: aliceblue;  width= 950" align="center">



              <table style="float: left" width="302" border="0" cellspacing="2">
                <tbody>
                  <tr>
                    <td width="23" height="39">&nbsp;</td>
                    <td width="63">&nbsp;</td>
                    <td width="43">&nbsp;</td>
                    <td width="145">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td height="48">&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td height="186" colspan="4"><img id="mbl_img" name="mbl_img" src="img/<?php echo ($mobl['mbl_img']) ?>" width="376" height="291">
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td height="23">&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td colspan="3" rowspan="7">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td height="23">&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                </tbody>
              </table>
              <p>&nbsp;</p>
              <p> کد ملی :
                <input name="cod_meli" type="text" id="cod_meli" max="10" min="10" value="<?php echo ($factor['cod_meli']); ?>" readonly>
                &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
              </p>
              <p> نام واقعی :
                <input name="name" type="text" id="name" value="<?php echo ($factor['name']); ?>" size="30" readonly>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
              </p>
              <hr width=" 400" size="12" align="right" color="hsla(112,89%,50%,1.00)">
              <p>کد مبل :
                <input name="mbl_cod" type="text" id="mbl_cod" max="10" min="10" value="<?php echo ($factor['mbl_cod']); ?>" readonly>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
              </p>
              <p> نام مبل :
                <input name="mbl_name" type="text" id="mbl_name" value="<?php echo ($factor['mbl_name']); ?>" size="20" readonly>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
              </p>
              <hr width=" 400" size="12" align="right" color="hsla(65,100%,50%,1.00)">
              </p>
              <p>کار :
                <input name="mbl_select_canteri" type="text" id="mbl_select_canteri" value="<?php echo ($factor['mbl_select_cantre']); ?>" size="30" readonly>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
              </p>
              <p>چند نفره
                :
                <input name="mbl_select_nafar" type="text" id="mbl_select_nafar" value="<?php echo ($factor['mbl_select_nafar']); ?>" size="40" readonly>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
              </p>
              <p>به چه صورت :
                <input name="mbl_action_nafar" type="text" id="mbl_action_nafar" value="<?php echo ($factor['mbl_action_nafar']); ?>" size="60" readonly>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
              </p>
              <p>طرح و رنگ به چه صورت :
                <input name="mbl_select_rang" type="text" id="mbl_select_rang" value="<?php echo ($factor['mbl_select_rang']); ?>" size="60" readonly>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
              </p>
              <p>جنس مبل :
                <input name="jens" type="text" id="jens" value="<?php echo ($factor['jens']); ?>" size="30" readonly>
                &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
              </p>
              <p>چند سال ضمانت :
                <input name="mbl_select_years" type="text" id="mbl_select_years" size="40">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
              </p>
              <hr width=" 400" size="12" align="right" color="hsla(310,100%,51%,1.00)">
              شماره تلفن همراه:
              <input name="tel" type="tel" id="tel" value="<?php echo ($factor['tel']); ?>" readonly>
              &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
              <p>ایمیل :
                <input name="email" type="email" id="email" value="<?php echo ($factor['email']); ?>" readonly>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
              </p>
              <p><span style="text-align: center">آدرس ارسال مبل </span>:
                <textarea name="addres" cols="40" rows="6" readonly id="addres"><?php echo ($factor['addres']); ?> </textarea>
                &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
              </p>
              <hr width=" 400" size="12" align="right" color="hsla(179,100%,49%,1.00)">
              <p>قیمت مبل :
                <input name="mbl_price" type="text" id="textfield8" size="40">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
              </p>
              <hr width=" 400" size="12" align="right" color="hsla(112,89%,50%,1.00)">
              <p>
                <input type="submit" name="button" id="button" value="ثبت">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="reset" name="button2" id="button2" value="پاک کردن">
              </p>
            </div>
            <p>&nbsp;</p>
    </form>
</div>
<div>






  <div>

    <p>&nbsp;</p>

    <hr width="900px" align="center" size="15px" color="hsla(123,100%,50%,1.00)">
    <p>&nbsp;</p>



    <table width="1000" border="1" align="center" cellspacing="2">
      <tbody>
        <tr align="center">
          <td width="121" height="107" align="center">ابزار مدیریتی</td>
          <td width="261" align="center">کد مبل</td>
          <td width="184" align="center">نام مبل</td>
          <td width="155" style="text-align: center">نام واقعی<span style="text-align: right"></span></td>
          <td width="245">کد ملی<span style="text-align: center"></span></td>
        </tr>
      </tbody>
    </table>






    <?php
    $query1 = "SELECT * FROM factor";
    $row1 = mysqli_query($link, $query1);



    $query99 = "SELECT * FROM mbl WHERE mbl_cod='$mbl_cod'";
    $result99 = mysqli_query($link, $query99);
    $row99 = mysqli_fetch_array($result99);

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

    ?>

      <table width="1000px" border="1" align="center" cellspacing="2">
        <tbody>
          <tr align="center">
            <td width="121" height="107" align="center">


              <b><a href="admin_factor.php?id=<?php echo ($row['cod_meli']) ?>&action=<?php echo ($row['mbl_cod']) ?>" style="text-decoration: none">بررسی کردن</a></b>
            </td>

            <td width="262" align="center"><?php echo ($row['mbl_cod']); ?> </td>
            <td width="184" align="center"><?php echo ($row['mbl_name']); ?></td>
            <td width="157" align="center"><?php echo ($row['name']); ?></td>
            <td width="242" align="center"><?php echo ($row['cod_meli']); ?></td>
          </tr>
        </tbody>
      </table>

      <p>
    <?php
    }
  }
    ?>

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














</div>