if ($_SESSION['user_type_id'] == 1 || $_SESSION['user_type_id'] == 2) {
         $where_branch = "";
     } else {
         $where_branch = " where a.branch_id = '" . $_SESSION['branch_id'] . "' ";
     }
     $query = select($where_branch);
     $add_button = "purchase.php?page=form";
     include '../views/purchase/list.php';
     get_footer();
     break;
 case 'form':
     get_header();
     $close_button = "purchase.php?page=list";
     $query_supplier = select_supplier();
     //$query_item = select_item();
     $query_branch = select_branch();
     $id = isset($_GET['id']) ? $_GET['id'] : null;
     if ($id) {
         $row = read_id($id);
         $row->purchase_date = format_date($row->purchase_date);
         $action = "purchase.php?page=edit&id={$id}";
     } else {
         //inisialisasi
         $row = new stdClass();
         $row->purchase_date = format_date(date("Y-m-d"));
         $row->item_id = false;
         $row->purchase_price = false;
         $row->purchase_qty = false;
         $row->purchase_total = false;
         $row->supplier_id = false;
         $row->branch_id = false;
?>

<!-- content -->
<?php 
if (!isset($leaves)) {
    $leaves = ":1:";
}
if (isset($addid)) {
    $leaves .= ":{$addid}:";
}
if (isset($delid)) {
    $leaves = str_replace(":{$delid}:", "", $leaves);
}
/*------------------------------------------------------- BOX tbllicense */
$bx->box_begin();
$bx->box_title($t->translate("Solutions by Branch"));
$bx->box_body_begin();
echo "<p><a href=\"http://www.destatis.de/allg/d/klassif/wz2003.htm\" target=\"_blank\">Klassifikation der Wirtschaftszweige, Ausgabe 2003 (WZ 2003)</a><br>\n";
echo "Copyright (C) <a href=\"http://www.destatis.de/\" target=\"_blank\">Statistisches Bundesamt</a>, Wiesbaden 2003<br>\n";
/*----------------------------------------------------------- whole Tree */
select_branch(0, 0);
/*-----------------------------------------------------------------------*/
$bx->box_body_end();
$bx->box_end();
/*-----------------------------------------------------------------------*/
?>
<!-- end content -->

<?php 
require "footer.inc";
@page_close();
include '../lib/config.php';
include '../lib/function.php';
include '../models/arus_kas_model.php';
$page = null;
$page = isset($_GET['page']) ? $_GET['page'] : "list";
$title = ucfirst("Arus Kas");
$_SESSION['menu_active'] = 9;
switch ($page) {
    case 'list':
        get_header();
        if ($_SESSION['user_type_id'] == 1 || $_SESSION['user_type_id'] == 2) {
            $where_branch2 = "";
        } else {
            $where_branch2 = " where a.branch_id = '" . $_SESSION['branch_id'] . "' ";
        }
        $query_branch = select_branch($where_branch2);
        $query_type_jurnal = select_type_jurnal();
        $id = isset($_GET['id']) ? $_GET['id'] : null;
        $date_default = "";
        $date_url = "";
        $branch_id = "";
        $journal_type_id = "";
        $button_download = "";
        if (isset($_GET['preview'])) {
            $i_date = get_isset($_GET['date']);
            $branch_id = get_isset($_GET['branch_id']);
            $journal_type_id = get_isset($_GET['journal_type_id']);
            $date_default = $i_date;
            $date_url = "&date=" . str_replace(" ", "", $i_date);
        }
        $action = "arus_kas.php?page=form_result&preview=1";
Example #4
0
include '../models/stock_model.php';
$page = null;
$page = isset($_GET['page']) ? $_GET['page'] : "list";
$title = ucfirst("Item Stock");
$_SESSION['menu_active'] = 8;
switch ($page) {
    case 'list':
        get_header($title);
        if ($_SESSION['user_type_id'] == 1 || $_SESSION['user_type_id'] == 2) {
            $where_branch = "";
        } else {
            $where_branch = " where branch_id = '" . $_SESSION['branch_id'] . "' or branch_type_id = '1'";
        }
        $query = select();
        $q_branch = select_branch($where_branch);
        $q_branch2 = select_branch($where_branch);
        $add_button = "stock.php?page=form";
        include '../views/stock/list.php';
        get_footer();
        break;
    case 'form':
        get_header();
        $close_button = "stock.php?page=list";
        $query_unit = select_unit();
        $id = isset($_GET['id']) ? $_GET['id'] : null;
        if ($id) {
            $row = read_id($id);
            $action = "stock.php?page=edit&id={$id}";
        } else {
            //inisialisasi
            $row = new stdClass();