<?php

$path_to_root = "";
include $path_to_root . '../database.php';

$db = new database();

$action = $_GET['action'];

if ($action == 'validasi_pembayaran') {
	$id = $_GET['id'];

	$sql = "UPDATE `order` SET `status` = 'verifikasi pembayaran sukses' WHERE `id` = ".$id;

	$result = $db->db_query($sql);

	if ($result) {
		header("location:index.php?menu=pembayaran");
	} else {
		header("location:index.php?menu=detail validasi pembayaran&id=$id");
	}
} elseif ($action == 'tolak_pembayaran') {
	$id = $_GET['id'];

	$sql = "UPDATE `order` SET `status` = 'pembayaran ditolak' WHERE `id` = ".$id;

	$result = $db->db_query($sql);

	if ($result) {
		header("location:index.php?menu=pembayaran");
	} else {
		header("location:index.php?menu=detail validasi pembayaran&id=$id");
	}
}

?>