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 `supplier` WHERE `NoSupplier` = ".$_GET["id"];
- $ambil=mysql_query($act,$server_connect);
- header("Location:../index.php?what=supplier&delete_success=true");
- }else if($_GET["action"]=="save"){
- if(!empty($_POST["NmSupplier"])&&!empty($_POST["AlmtSupplier"])&&!empty($_POST["TlpSupplier"])){
- $perintah="INSERT INTO `supplier` (`NoSupplier`, `NmSupplier`, `AlmtSupplier`, `TlpSupplier`) VALUES (NULL, '".$_POST["NmSupplier"]."', '".$_POST["AlmtSupplier"]."', '".$_POST["TlpSupplier"]."')";
- $ambil=mysql_query($perintah,$server_connect);
- header("Location:../index.php?what=supplier&tab=input&input_success=true");
- }else{
- header("Location:../index.php?what=supplier&tab=input&empty_fields=true");
- }
- }else if($_GET["action"]=="edit"&&isset($_GET["id"])){
- header("Location:../index.php?what=supplier&tab=input&action=edit&id=".$_GET["id"]);
- }else if($_GET["action"]=="update"){
- if(!empty($_GET["id"])&&!empty($_POST["NmSupplier"])&&!empty($_POST["AlmtSupplier"])&&!empty($_POST["TlpSupplier"])){
- $perintah="UPDATE `supplier` SET `NmSupplier`='".$_POST["NmSupplier"]."', `AlmtSupplier`='".$_POST["AlmtKaryawan"]."', `TlpSupplier` = '".$_POST["TlpSupplier"]."' WHERE `NoSupplier` = '".$_GET["id"]."'";
- $ambil=mysql_query($perintah,$server_connect);
- header("Location:../index.php?what=supplier&edit_success=true");
- }else{
- header("Location:../index.php?what=supplier&tab=input&action=edit&id=".$_GET["id"]."&empty_fields=true");
- }
- }else{
- header("Location:../index.php?what=supplier&error=true");
- }
- }else{header("Location:../index.php?what=supplier&error=true");}
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement