Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con = mysqli_connect('localhost', 'root', '', 'karat');
- $tgl=date('Y-m-d');
- if(isset($_POST['update'])){
- mysqli_query($con,"update servis set name_servis='{$_POST['name_servis']}', gol= 1 where code_servis='{$_POST['code_servis']}'");
- mysqli_query($con,"delete from servis_detil where kd_servis='{$_POST['code_servis']}'");
- foreach($_POST['nm_prod'] as $key => $judul){
- if(!$judul){
- continue;
- }
- $sql = mysqli_query($con, "insert into servis_detil (kd_servis, kd_prod, nm_prod, qty)
- values ('{$_POST['code_servis']}','{$_POST['kd_prod'][$key]}','{$judul}','{$_POST['qty'][$key]}')");
- }
- mysqli_query($con,"insert into outbox (number, date, code_prod, name_prod, price, stock)
- values('{$_POST['code_servis']}','$tgl','{$_POST['kd_prod'][$key]}','{$judul}','0','{$_POST['qty'][$key]}')")or die(mysqli_error());
- header("Location: servis.php"); exit();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment