<LINK href="../images/index.css" rel="stylesheet" type="text/css">
<?PHP
$ttglpost1=date("d/m/Y");
$tagenda1 = $_POST["a0"];
$tkegiatan1 = $_POST["a1"];
$tkldi1 = $_POST["a2"];
$tjenisproyek1 = $_POST["a3"];
$tpagu1 = $_POST["a4"];
$tdana1 = $_POST["a5"];
$ttahapan1 = $_POST["a6"];
$tkawal1 = $_POST["a7"];
$tsprint1 = $_POST["a8"];
$tserap1 = $_POST["a9"];
$tket1 = $_POST["a10"];
$error = "";
if ($tagenda1 == ""){$error = "TERJADI ERROR SILAHKAN HUB ADMIN<BR>";}
include("intel_tp4.db.inc.php");
$query = "Select * from $mytable where tagenda = '$tagenda1'";
$result = mysql_query($query); 
if ($row = mysql_fetch_array($result)){ 
if  ($row["tagenda"] == $tagenda1){$error = "$error TIDAK BOLEH ADA DUPLIKASI/NOMOR AGENDA GANDA YAITU NO AGENDA : $tagenda1<br><br>SOLUSI : REFRESH / LOGOUT TERLEBIH DAHULU\n";}
}
if ($error == ""){
$query = "INSERT INTO $mytable(tagenda, ttglpost, tkegiatan, tkldi, tjenisproyek, tpagu, tdana, ttahapan, tkawal,tsprint, tserap, tket) VALUES ('$tagenda1','$ttglpost1','$tkegiatan1','$tkldi1','$tjenisproyek1','$tpagu1','$tdana1','$ttahapan1','$tkawal1','$tsprint1','$tserap1','$tket1')";
$result = mysql_query($query);
print ('<table width="100%"  border="0" cellspacing="1" cellpadding="1">
  <tr>
    <td><table width="100%"  border="0" cellspacing="4" cellpadding="4">
      <tr>
        <td><a href="../index.php?g=tp4&d=inc" class="menu">PENAMBAHAN DATA TP4 BERHASIL DISIMPAN KLIK UNTUK KEMBALI<a></td>
      </tr>
    </table></td>
  </tr>
</table>');

}
else
{
echo "$error.";
} 
?>

