<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_sistem, $sistem);
$query_okey = "SELECT * FROM verivikasi_tb where bulan='$bulan' and tahun='$tahun'";
$okey = mysql_query($query_okey, $sistem) or die(mysql_error());
$row_okey = mysql_fetch_assoc($okey);
$totalRows_okey = mysql_num_rows($okey);


?>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="5">
  <tr>
    <td><h3 style="color:#033">Daftar Unit Yang Telah Menyelesaikan Laporan Transaksi Bulan <?php echo $bulan;?> Tahun <?php echo $tahun;?></h3></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" align="center" cellpadding="2" class="form_body">
      <tr align="center" style="background:url(images/bg2.png)">
        <td height="35">Kode Unit</td>
        <td>Bulan</td>
        <td>Tahun</td>
        <td>Register</td>
        <td>Verifikator</td>
        <td>Waktu Catat</td>
        <td>Proses</td>
      </tr>
      <tr>
        <td colspan="7"><hr></td>
      </tr>
      <?php do { ?>
      <tr align="center">
        <td height="30"><?php echo $row_okey['kode_unit'];?></td>
        <td><?php echo $row_okey['bulan'];?></td>
        <td><?php echo $row_okey['tahun'];?></td>
        <td><?php echo $row_okey['key_register'];?></td>
        <td><?php echo $row_okey['verifikator'];?></td>
        <td><?php echo $row_okey['waktu'];?></td>
        <td><a href="?section=Setting&module=hapus_key&register=<?php echo $row_okey['key_register'];?>"><img src="images/cross.png" height="20" width="20" /></a></td>
      </tr>
      <tr>
        <td colspan="7"><hr></td>
      </tr>
      <?php } while ($row_okey = mysql_fetch_assoc($okey)); ?>
    </table></td>
  </tr>
  <tr>
    <td><form id="form1" name="form1" method="post" action="?section=Setting&module=open_konsol&konsol=Not Active">
      <input class="button" type="submit" name="button" id="button" value="Selesai Konsolidasi" />
    </form></td>
  </tr>
</table>
<p>&nbsp;</p>
<?php
mysql_free_result($okey);
?>
