<?php
mysql_select_db($database_sistem, $sistem);
$query_Recordset1 = "SELECT * FROM akun_tb where perkiraan='$_GET[perkir]'";
$Recordset1 = mysql_query($query_Recordset1, $sistem) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>

  <?php
mysql_free_result($Recordset1);
?>
<script type="text/javascript" charset="utf-8">
          $(document).ready(function(){
            $('#bbkas').dataTable({
					     "oLanguage": {
						      "sLengthMenu": "Tampilkan _MENU_ data per halaman",
						      "sSearch": "Pencarian: ", 
						      "sZeroRecords": "Maaf, tidak ada data yang ditemukan",
						      "sInfo": "Menampilkan _START_ s/d _END_ dari _TOTAL_ data",
						      "sInfoEmpty": "Menampilkan 0 s/d 0 dari 0 data",
						      "sInfoFiltered": "(di filter dari _MAX_ total data)",
						      "oPaginate": {
						          "sFirst": "<<",
						          "sLast": ">>", 
						          "sPrevious": "<", 
						          "sNext": ">"
					       }
				      },
              "sPaginationType":"full_numbers",
              "bJQueryUI":true
            });
          })    
        </script>

<table width="95%" border="0" align="center" cellpadding="5" cellspacing="5">
  <tr>
    <td><form action="?section=Setting&module=update" method="post" name="form1" id="form1">
      <table class="isi_tabel" align="left" cellpadding="4" cellspacing="4">
        <tr valign="baseline">
          <td colspan="2" align="left" nowrap="nowrap"><h2><span style="color: #033">Form Edit cakupan Akun <?php echo $row_Recordset1['akun'];?></span></h2></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="left">Akun</td>
          <td>:
            <input name="akun" type="text" value="<?php echo $row_Recordset1['akun'];?>" size="4" maxlength="4" readonly="readonly" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="left">Perkiraan</td>
          <td>:
            <input name="perkiraan" type="text" value="<?php echo $row_Recordset1['perkiraan'];?>" size="4" maxlength="4" readonly="readonly" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="left" valign="top">Jenis Akun</td>
          <td><label for="kelompok"></label>
            <input name="kelompok" type="text" id="kelompok" value="<?php echo $row_Recordset1['kelompok'];?>" readonly="readonly" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="left" valign="top">Keterangan</td>
          <td valign="top"><textarea name="keterangan" cols="40" rows="2" readonly="readonly"><?php echo $row_Recordset1['keterangan'];?></textarea></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="left" valign="top">Konten</td>
          <td valign="top"><textarea name="konten" cols="40" rows="3"><?php echo $row_Recordset1['konten'];?></textarea></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="left">&nbsp;</td>
          <td><?php 
	  if($_SESSION['level']=='Unit'){
	  ?>
            <input class="button" name="Submit" type="submit" value="Edit Cakupan Akun" disabled="disabled" />
            <input class="button" name="Submit2" type="reset" value="Reset" />
            <?php }
	  elseif($_SESSION['level']=='Pusat'){
	  ?>
            <input class="button" name="Submit" type="submit" value="Edit Cakupan Akun" />
            <input class="button" name="Submit2" type="reset" value="Reset" />
            <?php
	  }
	  ?></td>
        </tr>
      </table>
      <input type="hidden" name="jenis" value="<?php echo $row_Recordset1['jenis'];?>" />
      <input type="hidden" name="kode_unit" value="<?php echo $row_Recordset1['kode_unit'];?>" size="32" />
      <input type="hidden" name="akb" value="<?php echo $row_Recordset1['akb'];?>" />
      <input type="hidden" name="index" value="<?php echo $row_Recordset1['index'];?>" />
      <input type="hidden" name="MM_update" value="form1" />
    </form></td>
  </tr>
  <tr>
    <td><hr /></td>
  </tr>
  <tr>
    <td><table width="400" class="isi_tabel">
        <tr valign="middle">
          <td width="53"><span style="color:#033"><a href="?section=Setting&module=print&amp;bb=daftar_akun"><img src="images/cetak1.png" width="41" height="32" /></a></span></td>
          <td width="335"><h2><span style="color:#033">Daftar Akun</span></h2></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" align="center"  bgcolor="#FFFFFF" class="display" id="bbkas">
      <thead>
        <tr height="30" class="form_body">
          <th align="center" width="58">No</th>
          <th width="96" align="center">Akun</th>
          <th width="97" align="center">Perkiraan</th>
          <th width="200" align="center">Keterangan</th>
          <th width="86" align="center">Index</th>
          <th width="286" align="center">Cakupan Akun</th>
          <th width="50" align="center">Edit</th>
        </tr>
        </thead>
      <tbody>
      
        <?php        mysql_select_db("csabrude_akurat");
					          $sql = mysql_query("SELECT * From akun_tb where kode_unit='All' order by perkiraan asc ");
					          $no = 1;
							
                    while ($r = mysql_fetch_array($sql)) {
                      echo "<tr height='25' class='isi_tabel'>
          <td align='center'>$no</td>
            <td align='center'>$r[akun]</td>
			<td align='center'>$r[perkiraan]</td>
			<td align='left'>$r[keterangan]</td>
			<td align='center'>$r[index]</td>
			<td align='justify'>$r[konten]</td>
			<td align='justify'>";?><?php 
			if($_SESSION['level']=='Pusat'){
				if($r['kelompok']=='Pendapatan'){
				?><a href="?section=Setting&module=cakupan&perkir=<?php echo $r['perkiraan'];?>"><img src="images/edit.png" height="30" width="30" /></a><?php }elseif($r['kelompok']=='Pengeluaran'){
					?><a href="?section=Setting&module=cakupan&perkir=<?php echo $r['perkiraan'];?>"><img src="images/edit.png" height="30" width="30" /></a><?php }else{?>
					<img src="images/edit.png" height="30" width="30" />	
				<?php	}
			}else{;?>
				<img src="images/edit.png" height="30" width="30" />
				<?php }
				echo"</td>
          </tr>";
                      $no++;
                    }
                    ?>
      </tbody>
      <tfoot>
        <tr>
       <th colspan="7" align="center">&nbsp;</th>
          </tr>
      </tfoot>
    </table>
 </td>
  </tr>
   <tr>
    <td>&nbsp;</td>
  </tr>
</table>
        