Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include "../../settings/connection.php";
- include "../../settings/auth-admin.php";
- if(isset($_GET["action"])){
- if($_GET["action"]=="delete"&&isset($_GET["id"])){
- $act="DELETE from `diskon` WHERE `KodeDiskon` = ".$_GET["id"];
- $ambil=mysql_query($act,$server_connect);
- header("Location:../index.php?what=diskon&delete_success=true");
- }else if($_GET["action"]=="save"){
- if(!empty($_POST["NmDiskon"])&&!empty($_POST["NoJenisLaundry"])&&!empty($_POST["JenisHitungan"])&&!empty($_POST["DiatasJumlahHitungan"])&&!empty($_POST["JumlahDiskon"])){
- $perintah="INSERT INTO `diskon` (`KodeDiskon`, `NmDiskon`, `NoJenisLaundry`, `JenisHitungan`, `DiatasJumlahHitungan`, `JumlahDiskon`) VALUES (NULL, '".$_POST["NmDiskon"]."', '".$_POST["NoJenisLaundry"]."', '".$_POST["JenisHitungan"]."', '".$_POST["DiatasJumlahHitungan"]."', '".$_POST["JumlahDiskon"]."')";
- $ambil=mysql_query($perintah,$server_connect);
- header("Location:../index.php?what=diskon&tab=input&input_success=true");
- }else{
- header("Location:../index.php?what=diskon&tab=input&empty_fields=true");
- }
- }else if($_GET["action"]=="edit"&&isset($_GET["id"])){
- header("Location:../index.php?what=diskon&tab=input&action=edit&id=".$_GET["id"]);
- }else if($_GET["action"]=="update"){
- if(!empty($_GET["id"])&&!empty($_POST["NmDiskon"])&&!empty($_POST["NoJenisLaundry"])&&!empty($_POST["JenisHitungan"])&&!empty($_POST["DiatasJumlahHitungan"])&&!empty($_POST["JumlahDiskon"])){
- $perintah="UPDATE `diskon` SET `NmDiskon`='".$_POST["NmDiskon"]."', `NoJenisLaundry`='".$_POST["NoJenisLaundry"]."', `JenisHitungan` = '".$_POST["JenisHitungan"]."', `DiatasJumlahHitungan`='".$_POST["DiatasJumlahHitungan"]."', `JumlahDiskon`='".$_POST["JumlahDiskon"]."' WHERE `KodeDiskon` = '".$_GET["id"]."'";
- $ambil=mysql_query($perintah,$server_connect);
- header("Location:../index.php?what=diskon&edit_success=true");
- }else{
- header("Location:../index.php?what=diskon&tab=input&action=edit&id=".$_GET["id"]."&empty_fields=true");
- }
- }else{
- header("Location:../index.php?what=diskon&error=true");
- }
- }else{header("Location:../index.php?what=diskon&error=true");}
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement