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


<?php
	
  $id_desa=$_GET["id_desa"];
  
  $qry=mysqli_query($mysqli,"SELECT * FROM m_desa WHERE id_desa='$id_desa'");
  if(mysqli_num_rows($qry)>0){
    
    $data=mysqli_fetch_array($qry);
  
  }

	echo "<h3>EDIT DATA DESA</h3>";
	echo "<h3 align=\"right\"><a href=\"?page=ls_desa&page_desc=Daftar Desa\" style=\"color:#FF0066\">Lihat Semua Desa</a></h3>";

?>

<form name="form1" method="post" action="_edit_desa.php">
  <table width="600" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="204">&nbsp;</td>
      <td width="396">&nbsp;</td>
    </tr>
    <tr>
      <td valign="top">Nama Kecamatan</td>
      <td valign="top">
        <select name="txtIdKecamatan" id="txtIdKecamatan" class="kotak">
          <?php
            $qryx=mysqli_query($mysqli,"SELECT * FROM m_kecamatan ORDER BY nama_kecamatan ASC");
              while($datax=mysqli_fetch_array($qryx)){
                $s="";
                if($datax[id_kecamatan]==$data[id_kecamatan]){
                  $s="selected";
                }
                echo "<option value='$datax[id_kecamatan]' $s>$datax[nama_kecamatan]</option>";
              }
          ?>
        </select>
      </td>
    </tr>

    <tr>
      <td valign="top">Nama Desa</td>
      <td valign="top"><input type="text" name="txtNamaDesa" id="txtNamaDesa" class="kotak" size="40" value="<?php echo $data[nama_desa]; ?>" required><input type="hidden" name="txtIdDesa" id="txtIdDesa" class="kotak" value="<?php echo $data[id_desa]; ?>" readonly></td>
    </tr>

    <tr>
      <td valign="top">Alamat Kantor</td>
      <td valign="top"><textarea name="txtAlamatKantor" id="txtAlamatKantor" class="kotakarea" rows="3" cols="45"><?php echo $data[alamat_kantor]; ?></textarea></td>
    </tr>

    <tr>
      <td valign="top">Nomor Telepon</td>
      <td valign="top"><input type="text" name="txtTelp" id="txtTelp" class="kotak" size="20" value="<?php echo $data[telp_kantor]; ?>" required></td>
    </tr>
    
    <tr>
      <td valign="top">Nomor Fax</td>
      <td valign="top"><input type="text" name="txtFax" id="txtFax" class="kotak" size="20" value="<?php echo $data[fax_kantor]; ?>" required></td>
    </tr>

    <tr>
      <td valign="top">Alamat Email</td>
      <td valign="top"><input type="text" name="txtEmail" id="txtEmail" class="kotak" size="40" value="<?php echo $data[email_kantor]; ?>" required></td>
    </tr>

    <tr>
      <td width="204">&nbsp;</td>
      <td width="396">&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="submit" name="button" id="button" value="Simpan" class="tombol"></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </table>
</form>

