<?php chdir("../../common"); require_once "init.php"; chdir("../database"); require_once "storeAccount.php"; if (isset($_GET["orderId"])) { $orderId = intval($_GET["orderId"]); $userId = getOrderUserId($orderId); $user = get_UserById($userId); $address = $user["address"]; $storeId = getUserStoreID($userId); if (isset($_SESSION['storesLogin'][$storeId]['userId'])) { $permission = getAccountPermission($_SESSION['storesLogin'][$storeId]['userId']); $permission = $permission["name"]; if ($_SESSION['storesLogin'][$storeId]['userId'] == $userId or $permission == "merchant") { $items = getOrderItens($orderId); $smarty->assign("items", $items); $invoice = getOrderInvoice($orderId); $order = getOrder($orderId); $paid = $order["paid"]; $smarty->assign("invoice", $invoice); $smarty->assign("order", $order); $smarty->assign("paid", $paid); $smarty->assign("address", $address); $smarty->display('store/invoice.tpl'); } } }
<?php header("content-type:text/html; charset=utf-8"); include 'permission.php'; require_once 'include/db_operator_class.php'; if (isset($_GET['userID'])) { $userID = $_GET['userID']; $result = get_UserById($userID); if ($result != null) { echo json_encode($result); } }