Advertisement
Guest User

X

a guest
Jun 28th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. include './config/db_connection.php';
  4. $db = new database();
  5. $db->connectMysql();
  6. $aa=mysql_fetch_array(mysql_query("SELECT COUNT(no_polisi)as jum FROM DATA WHERE kode_tempat = 'A'"));
  7. $no_polisi = $_POST['no_polisi'];
  8. $kode_tempat = $_POST['kode_tempat'];
  9. $tanggal = $_POST['tanggal'];
  10. $jam = $_POST['jam'];
  11. $tarif = $_POST['tarif'];
  12. if (isset($_POST['simpan'])) {
  13. $query = mysql_query("INSERT INTO data VALUES('$no_polisi','$kode_tempat','$tanggal','$jam','$tarif')");
  14. if ($aa[jum]<10) {
  15. } else {
  16. echo "<script>alert('Maaf Kapasitas sudah penuh');history.go(-1);</script>";
  17. }
  18. if ($query) {
  19. echo "<script>alert('Data Berhasil Ditambahkan');history.go(-1);</script>";
  20. } else {
  21. echo "<script>alert('Maaf Nomer Polisi yang anda masukkan sudah terdaftar');history.go(-1);</script>";
  22. }
  23.  
  24. } else{
  25. header('location:cek_login.php');
  26. }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement