<div align="center">



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

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


  $url = $mbl_cod = $mbl_name = $mbl_select_cantre = $mbl_price = $mbl_img = $mbl_textarea = "";
  $btn_action = "افزودن کالا";
  if (isset($_GET['action']) && $_GET['action'] == 'EDIT') {
    $id = $_GET['id'];
    $query = "SELECT * FROM mbl WHERE mbl_cod='$id'";
    $resolt = mysqli_query($link, $query);
    if ($kkk = mysqli_fetch_array($resolt)) {


      $mbl_cod = $kkk['mbl_cod'];
      $mbl_name = $kkk['mbl_name'];
      $mbl_select_cantre = $kkk['mbl_select_cantre'];
      $mbl_price = $kkk['mbl_price'];
      $mbl_img = $kkk['mbl_img'];
      $mbl_textarea = $kkk['mbl_textarea'];
      $url = "?id=$mbl_cod&action=EDIT";
      $btn_action = "ویرایش مبل";
    }
  }


  ?>






  <!--The following script tag downloads a font from the Adobe Edge Web Fonts server for use within the web page. We recommend that you do not modify it.-->
  <script>
    var __adobewebfontsappname__ = "dreamweaver"
  </script>
  <script src="http://use.edgefonts.net/abril-fatface:n4:default;aguafina-script:n4:default.js" type="text/javascript"></script>



  <form method="post" action="action-perodact.php<?php if (!empty($url)) echo ($url); ?>" enctype="multipart/form-data">

    <table width="100%" height="460" border="1" dir="ltr" align="right">
      <tbody>


        <tr>
          <td width="952" bgcolor="#2E0EF9" style="text-align: right"><input type="text" name="mbl_cod" id="mbl_cod" placeholder="cod" value="<?php echo ($mbl_cod) ?>"></td>

          <td width="196" bgcolor="#2E0EF9" style="text-align: right"><strong>کد مبل</strong></td>
        </tr>



        <tr>
          <td width="952" bgcolor="#DF08FC" style="text-align: right"><input type="text" name="mbl_name" id="mbl_name" value="<?php echo ($mbl_name) ?>"></td>

          <td width="196" bgcolor="#DF08FC" style="text-align: right"><strong>نام مبل</strong></td>
        </tr>



        <tr>
          <td width="952" bgcolor="#FFFD00" style="text-align: right"><input type="text" name="mbl_select_cantre" id="mbl_select_cantre" value="<?php echo ($mbl_select_cantre) ?>"></td>
          <td width="196" bgcolor="#FFFD00" style="text-align: right; font-size: 16px;"><strong>کشور سازنده</strong></td>
        </tr>

        <tr>
          <td bgcolor="#08F706" style="text-align: right"><select name="jens" size="0" id="jens">
              <option>مخملی</option>
              <option>ابریشمی</option>
              <option>سلطنتی</option>
              <option>پارچه ای</option>
            </select></td>
          <td bgcolor="#08F706" style="text-align: right; font-family: aguafina-script; font-style: normal; font-weight: 400; font-size: 18px;">جنس</td>
        </tr>

        <tr>
          <td width="952" style="text-align: right"><input type="text" name="mbl_price" id="mbl_price" value="<?php echo ($mbl_price) ?>"></td>
          <td width="196" style="text-align: right"><strong>قیمت مبل 7 نفره</strong></td>

        </tr>



        <tr>
          <td width="952" height="95" bgcolor="#FC6BFB" style="text-align: right"> <input type="file" name="mbl_img" style="float: right" id="mbl_img" size="30" value="<?php echo ($mbl_img); ?>">
            <?php if (!empty($mbl_img))
              echo ("<img src='img/$mbl_img' width='300px' height='250px' />"); ?>
          </td>
          <td width="196" bgcolor="#FC6BFB"><strong>تصویر مبل</strong></td>
        </tr>


        <tr>
          <td width="952" style="text-align: right"><textarea name="mbl_textarea" id="mbl_textarea" style="text-align: right" cols="45" rows="10" wrap="virtual"><?php echo ($mbl_textarea) ?></textarea></td>
          <td width="196" style="text-align: right"><strong>توضیحات درباره مبل (ویژگی مبل)</strong></td>
        </tr>



        <tr style="text-align: center;">
          <td height="48" colspan="2" bgcolor="#AE0EF4"><span style="text-align: center"></span>
            <input type="reset" name="button" id="button" value="پاک کردن">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input type="submit" name="button2" id="button2" value="<?php echo ($btn_action) ?>">
          </td>
        </tr>
      </tbody>
    </table>

  </form>

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



  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <form method="post" action="admin_factor.php">



    <input style="background-color: chartreuse" size="40" type="submit" name="submit" id="submit" value="Submit">
  </form>





</div>