function action_delete_transaction($db) { $id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT); if (!$id) { return json_encode(array('ERROR' => 'Invalid id')); } return json_encode(delete_transaction($db, $id)); }
$datetime1 = new DateTime($date1); $datetime2 = new DateTime($date2); $difference = $datetime1->diff($datetime2); //echo $difference->days; /*$sel = abs(strtotime($date2)-strtotime($date1)); $selisih= $sel /(60*60*24);*/ $jumlah_hari = $difference->days + 1; $jumlah_truk = get_jumlah_truk($date1, $date2, $i_owner_id); $jumlah_pengiriman = get_jumlah_pengiriman($date1, $date2, $i_owner_id); $jumlah_volume = get_jumlah_volume($date1, $date2, $i_owner_id) ? get_jumlah_volume($date1, $date2, $i_owner_id) : 0; $jumlah_volume = str_replace(".", ",", $jumlah_volume); $total_jasa_angkut = get_total_jasa_angkut($date1, $date2, $i_owner_id); $total_jasa_angkut = str_replace(".", ",", $total_jasa_angkut); $total_subsidi_tol = get_total_subsidi_tol($date1, $date2, $i_owner_id); $total_transport = $total_jasa_angkut + $total_subsidi_tol; $total_harga_urukan = get_total_harga_urukan($date1, $date2, $i_owner_id); $total_hpp = get_total_hpp($date1, $date2, $i_owner_id); $title = 'report_kepuasan_customer_tagihan'; $supplier_title = str_replace(" ", "_", $supplier); $format = create_report($title . "_" . $supplier_title . "_" . $i_date); include '../views/report/report_kepuasan_customer_tagihan.php'; break; case 'delete_transaction': $id = isset($_GET['id']) ? $_GET['id'] : null; extract($_POST); $i_date = get_isset($_GET['date']); $date_default = $i_date; delete_transaction($id); header("Location: report_kepuasan_customer.php?page=list&preview=1&date={$date_default}"); break; }