コード例 #1
0
ファイル: showitem.entity.php プロジェクト: bushvin/wingman
error_reporting(E_ALL);
ini_set('display_errors', '1');
// 0 - disabled; 1 - enabled
//
$USER = new user($_SESSION["auth::id"]);
$USER->acl("entity");
$USER->acl("currency");
$USER->acl("vat");
/* fix!
if ($USER->get("acl")->entity->read !== true || $USER->get("acl")->currency->list !== true || $USER->get("acl")->vat->list !== true) {
	header('HTTP/1.1 401 Unauthorized');
    exit();
}
*/
$o = new entity($data->data->id);
$o->details();
$sql = "SELECT `id`,`name` FROM `##_" . $_SESSION['space'] . "_entity_type` WHERE `deleted`=0 AND `id`>0 ORDER BY `name`;";
$DBO->query($sql);
$ot = $DBO->result("objectlist");
$sql = "SELECT `id`,`name` FROM `##_language` WHERE `deleted`=0 AND `id`>0 ORDER BY `name`;";
$DBO->query($sql);
$lang = $DBO->result("objectlist");
$sql = "SELECT `id`,`reference` FROM `##_" . $_SESSION['space'] . "_offer` WHERE `entity_id`='" . $o->get("id") . "';";
$DBO->query($sql);
$offers = $DBO->result("objectlist");
$sql = "SELECT `id`,CONCAT(`type`,' - ',DATE_FORMAT(`date`,'%Y-%m-%d'),' - ',`uid`,' - ', `reference`) `reference` FROM `##_" . $_SESSION['space'] . "_transaction` WHERE `entity_id`='" . $o->get("id") . "' AND `deleted`='0' ORDER BY `date` desc;";
$DBO->query($sql);
$transactions = $DBO->result("objectlist");
?>
<div class="title"><?php 
echo ucwords($o->get("id") == -1 ? ENTITY_NEW_ENTITY : ENTITY_EDIT_ENTITY);