<?php

session_start();

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

$db = new database();

$id_user = $_SESSION['user_id'];
$tanggal = date('d-m-Y');
$id_order = $_GET['id_order'];
$id_barang = $_GET['id_barang'];
$review = strip_tags(trim($_POST['isi-review']));
$star = strip_tags(trim($_POST['star']));

$sql = "INSERT INTO `review` (`id_order`, `id_barang`, `id_user`, `tanggal`, `bintang`, `deskripsi`) VALUES ($id_order, $id_barang, $id_user, '$tanggal', $star, '$review')";

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

if ($result) {
	header("location:index.php?menu=detail_order&id=$id_order");
}

?>