<?php
session_start();
include "../config/koneksi.php";

$module=$_GET[module];
$act=$_GET[act];

// Hapus Sales
if ($act=='hapus'){
  mysql_query("DELETE FROM rb_sales WHERE id_sales='$_GET[id]'");
  header('location:sales.html');
}

// Input Sales
elseif ($act=='input'){
  mysql_query("INSERT INTO rb_sales(nama_sales,
                                 no_telpon,
								 alamat,
								 keterangan) 
	                       VALUES('$_POST[nama_sales]',
                                '$_POST[no_telp]',
								'$_POST[alamat_lengkap]',
								'$_POST[keterangan]')");
  header('location:sales.html');
}

// Update Sales
elseif ($act=='update'){
    mysql_query("UPDATE rb_sales SET nama_sales  = '$_POST[nama_sales]', 
                                     no_telpon   = '$_POST[no_telp]',
								     alamat		 = '$_POST[alamat_lengkap]',
									 keterangan	 = '$_POST[keterangan]' 
                              WHERE  id_sales = '$_POST[id]'");
  header('location:sales.html');
}
?>
