public function index() { $grid["folder"] = "Stock"; $grid["title"] = "Unit Of Measure"; // $cols[] = json_decode('{"field": "state", "checkbox": true}'); $cols[] = json_decode('{ "label": "Nama", "name": "uom_nama", "key": true}'); $cols[] = json_decode('{ "label": "Aktif", "name": "aktif"}'); $grid["url_add"] = App::urlFor("unitOM.a001"); $grid["url_edit"] = App::urlFor("unitOM.v005"); $grid["url_remove"] = App::urlFor("unitOM.d011"); $grid["source_url"] = App::urlFor("unitOM.dataset"); $grid["method"] = "GET"; $grid["cols"] = json_encode($cols); APP::render('component/jqgrid_view', $grid); }
public function index() { $grid["folder"] = "Stock"; $grid["title"] = "Gudang / Warehouse"; $cols[] = json_decode('{"field": "state", "checkbox": true}'); $cols[] = json_decode('{ "title": "ID", "field": "id", "visible": false}'); $cols[] = json_decode('{ "title": "Nama", "field": "warehouse_nama"}'); $cols[] = json_decode('{ "title": "Company", "field": "company", "visible": false}'); $cols[] = json_decode('{ "title": "Keterangan", "field": "keterangan"}'); $grid["url_add"] = App::urlFor("warehouse.a001"); $grid["url_edit"] = App::urlFor("warehouse.v005"); $grid["url_remove"] = App::urlFor("warehouse.d011"); $grid["source_url"] = App::urlFor("warehouse.dataset"); $grid["method"] = "GET"; $grid["cols"] = json_encode($cols); APP::render('warehouse/grid_warehouse', $grid); }
public function index() { $grid["folder"] = "Stock"; $grid["title"] = "Price list / Daftar Harga"; // $cols[] = json_decode('{"field": "state", "checkbox": true}'); $cols[] = json_decode('{ "label": "ID", "name": "id", "key": true, "hidden": true}'); $cols[] = json_decode('{ "label": "Nama", "name": "price_list_nama"}'); $cols[] = json_decode('{ "label": "Kode Tagihan", "name": "kode_invoice"}'); $cols[] = json_decode('{ "label": "Mata uang", "name": "currency"}'); $cols[] = json_decode('{ "label": "Aktif", "name": "aktif", "formatter": "checkbox"}'); $cols[] = json_decode('{ "label": "Pembelian", "name": "pembelian", "formatter": "checkbox"}'); $cols[] = json_decode('{ "label": "Penjualan", "name": "penjualan", "formatter": "checkbox"}'); $grid["url_add"] = App::urlFor("pricelist.a001"); $grid["url_edit"] = App::urlFor("pricelist.v005"); $grid["url_remove"] = App::urlFor("pricelist.d011"); $grid["source_url"] = App::urlFor("pricelist.dataset"); $grid["method"] = "GET"; $grid["cols"] = json_encode($cols); APP::render('component/jqgrid_view', $grid); }
public static function template($name, $locals = array(), $layout = '') { APP::render($name, $locals, $layout); }
<?php require_once __DIR__ . '/../../vendor/sonyschan/lifetree/app.php'; $app = new APP(); // prepare data $data = array('title' => 'My Title'); // use templates $app->render('sample-template', $data);
public function filter() { $grid["folder"] = "Stock"; $grid["title"] = "Daftar Item Price"; $cols[] = json_decode('{"field": "state", "checkbox": true}'); $cols[] = json_decode('{ "title": "Kode Item", "field": "item_kode"}'); $cols[] = json_decode('{ "title": "Price List", "field": "price_list"}'); $cols[] = json_decode('{ "title": "Harga", "field": "price_list_rate"}'); $cols[] = json_decode('{ "title": "", "field": "id", "visible": false}'); $req = APP::request(); if ($req->isPost()) { $params = $req->post(); $grid["anchor"] = $params['anchor']; $grid["value"] = $params['value']; } $grid["url_add"] = App::urlFor("itemprice.a001"); $grid["url_edit"] = App::urlFor("itemprice.v005"); $grid["url_remove"] = App::urlFor("itemprice.d011"); $grid["source_url"] = App::urlFor("itemprice.dataset"); $grid["method"] = "POST"; $grid["cols"] = json_encode($cols); APP::render('itemprice/grid_itemprice', $grid); }
public function filter() { $grid["folder"] = "Stock"; $grid["title"] = "Daftar Item Price"; $cols[] = json_decode('{"field": "state", "checkbox": true}'); $cols[] = json_decode('{ "title": "Kode Item", "field": "item_kode"}'); $cols[] = json_decode('{ "title": "Tanggal Berakhir", "field": "expiry_date"}'); $cols[] = json_decode('{ "title": "", "field": "id"}'); $req = APP::request(); if ($req->isPost()) { $params = $req->post(); $grid["anchor"] = $params['anchor']; $grid["value"] = $params['value']; } $grid["url_add"] = App::urlFor("batch.a001"); $grid["url_edit"] = App::urlFor("batch.v005"); $grid["url_remove"] = App::urlFor("batch.d011"); $grid["source_url"] = App::urlFor("batch.dataset"); $grid["method"] = "POST"; $grid["cols"] = json_encode($cols); APP::render('batch/grid_batch', $grid); }
private function print_harian($params) { try { $condition = array(); $data = array(); if (!empty($params['a']) && !empty($params['z']) && !empty($params['cdate'])) { $col_date = $params['cdate']; $query = sprintf("%s BETWEEN '%s' and '%s' ", $params['cdate'], $params['a'], $params['z']); $condition['conditions'] = $query; } $ar_adapter = \ActiveRecord\ConnectionManager::get_connection($this->app->mode); $connection = $ar_adapter->connection; $stmt = $connection->prepare("select (stocks.get_stock_harian(:awal, :akhir)).*"); $stmt->bindParam(':awal', $params['a']); $stmt->bindParam(':akhir', $params['z']); $stmt->execute(); $stocks = $stmt->fetchAll(PDO::FETCH_CLASS); // print_r($stocks); $data["rows"] = $stocks; $data["title"] = $this->template_header; $data["posting_range"] = sprintf(" %s sampai %s", $params['a'], $params['z']); $data["params"] = sprintf("a=%s&z=%s&cdate=%s", $params['a'], $params['z'], "posting_date"); $data["source_url"] = APP::urlFor('stok.export'); } catch (Exception $e) { App::flash('error', $e); } APP::render('stock/print_laporan_harian', $data); }
public function list_penjualan() { $grid['folder'] = "Laporan"; $grid['title'] = "Penjualan"; $cols = array(); // $cols[] = json_decode('{"field": "state", "checkbox": true}'); $cols[] = json_decode('{ "label": "Nota", "name": "id", "key": true}'); $cols[] = json_decode('{ "label": "Tanggal Posting", "name": "posting_date", "sortable": true}'); $cols[] = json_decode('{ "label": "Jam Posting", "name": "posting_time", "sortable": true}'); $cols[] = json_decode('{ "label": "Reg. no", "name": "pasien_reg_no", "sortable": true}'); $cols[] = json_decode('{ "label": "Nama Pasien", "name": "pasien_nama", "sortable": true}'); $cols[] = json_decode('{ "label": "Alamat Pasien", "name": "pasien_alamat"}'); $cols[] = json_decode('{ "label": "Jenis Tagihan", "name": "price_list"}'); $cols[] = json_decode('{ "label": "Kasir", "name": "kasir"}'); $cols[] = json_decode('{ "label": "Total", "name": "amount", "align": "right", "formatter": "currency", "formatoptions": { "decimalSeparator": ".", "decimalPlaces": "2", "thousandsSeparator": ",", "prefix": "Rp. " } }'); $cols[] = json_decode('{ "label": "Bayar", "name": "payment", "align": "right", "formatter": "currency", "formatoptions": { "decimalSeparator": ".", "decimalPlaces": "2", "thousandsSeparator": ",", "prefix": "Rp. " } }'); $grid["cols"] = json_encode($cols); $grid['source_url'] = APP::urlFor('selling.dataset_penjualan'); $grid['url_print'] = APP::urlFor('selling.print_invoice'); $grid['url_harian'] = APP::urlFor('selling.print_invoice'); $grid['url_cancel'] = APP::urlFor('selling.d011'); $grid['method'] = "GET"; $grid['gridtitle'] = "Penjualan"; // untuk detail penjualan $grid['detail_grid_url'] = APP::urlFor('selling.detail_penjualan'); $grid['detail_grid_title'] = "Invoice #-"; $cols = array(); // $cols[] = json_decode('{"field": "state", "checkbox": true}'); $cols[] = json_decode('{ "label": "id", "name": "id", "key": true, "hidden": true}'); $cols[] = json_decode('{ "label": "Kode Item", "name": "item_kode", "width": 100}'); $cols[] = json_decode('{ "label": "Nama Item","name": "item_nama"}'); $cols[] = json_decode('{ "label": "UOM", "name": "item_uom", "hidden": true}'); $cols[] = json_decode('{ "label": "Dosis", "name": "dosis", "hidden": true}'); $cols[] = json_decode('{ "label": "Batch no", "name": "batch_no", "hidden": true}'); $cols[] = json_decode('{ "label": "Dari Gudang", "name": "warehouse", "hidden": true}'); $cols[] = json_decode('{ "label": "Qty", "name": "actual_qty", "width": 75, "align": "left", "formatter": "integer", "formatoptions": { "thousandsSeparator": "," }, "editable": true, "editrules": { "number": true, "minValue": 0, "maxValue": 10000, "required": true } }'); $cols[] = json_decode('{ "label": "Harga Dasar", "name": "basic_rate", "hidden": true}'); $cols[] = json_decode('{ "label": "Harga Jual", "name": "item_price", "width": 85, "align": "right", "formatter": "currency", "formatoptions": { "decimalSeparator": ".", "decimalPlaces": "2", "thousandsSeparator": ",", "prefix": "Rp. " }, "editable": true, "editrules": { "number": true } }'); $cols[] = json_decode('{ "label": "Total Harga", "name": "amount", "width": 85, "align": "right", "formatter": "currency", "formatoptions": { "decimalSeparator": ".", "decimalPlaces": "2", "thousandsSeparator": ",", "prefix": "Rp. " } }'); $grid["detail_cols"] = json_encode($cols); APP::render('selling/report_view', $grid); }