function saveData($data) { $id = $data['table_id'] = dbIdReport('table', 'create Tables', json_encode($data), 120); $data['table_created'] = date("Y-m-d H:i:s"); $this->db->insert($this->table, $data); $str = $this->db->last_query(); logConfig("create Tables:{$str}", 'logDB'); //==========TAMBAHKAN STATUS $data2 = array('tabstat_tables' => $id, 'tabstat_status' => 1); $this->db->insert($this->tableRel, $data2); $str = $this->db->last_query(); logConfig("create Relation:{$str}", 'logDB'); $data2 = array('tabstat_tables' => $id, 'tabstat_status' => 2); $this->db->insert($this->tableRel, $data2); $str = $this->db->last_query(); logConfig("create Relation:{$str}", 'logDB'); //==========CREATE TABLE========== $prefix = $data['table_prefix'] . "_"; $fields = array($prefix . 'id' => array('type' => 'BIGINT', 'auto_increment' => TRUE), $prefix . 'code' => array('type' => 'VARCHAR', 'constraint' => '100'), $prefix . 'name' => array('type' => 'VARCHAR', 'constraint' => '100'), $prefix . 'detail' => array('type' => 'text'), $prefix . 'modified' => array('type' => 'timestamp'), $prefix . 'created' => array('type' => 'datetime'), $prefix . 'status' => array('type' => 'int')); for ($i = 1; $i <= 10; $i++) { $name1 = sprintf("%sfield%02s", $prefix, $i); $fields[$name1] = array('type' => 'VARCHAR', 'constraint' => '100'); } $this->dbforge->add_field($fields); $this->dbforge->add_key($prefix . 'id', TRUE); $this->dbforge->create_table($data['table_name'], TRUE); $str = $this->db->last_query(); logConfig("create table:{$str}", 'logDB'); $this->db->reset_query(); return $id; }
function saveData($data) { $id = $data['gun_id'] = dbIdReport('id', 'create Gundam', json_encode($data), 100); $data['gun_created'] = date("Y-m-d H:i:s"); $this->db->insert($this->table, $data); $str = $this->db->last_query(); logConfig("create Gundam:{$str}", 'logDB'); return $id; }
function saveData($data) { $id = $data['stat_id'] = dbIdReport('status', 'create Status', json_encode($data), 2000); $data['stat_created'] = date("Y-m-d H:i:s"); $this->db->insert($this->table, $data); $str = $this->db->last_query(); logConfig("create Status:{$str}", 'logDB'); return $id; }
function saveData($data) { $id = $data['country_id'] = dbIdReport('permit', 'create Permision', json_encode($data), 10); $data['country_created'] = date("Y-m-d H:i:s"); $this->db->insert($this->table, $data); $str = $this->db->last_query(); logConfig("create Permision:{$str}", 'logDB'); return $id; }
$title = 'Save Data'; } else { } if ($post['type'] == 'subMenuSave') { $id = dbIdReport('menu', 'create sub menu', json_encode($post), 2000); $data = array('menu_id' => $id, 'menu_name' => $post['name'], 'menu_title' => $post['title'], 'menu_parent' => $post['parent'], 'menu_href' => $post['href'], 'menu_detail' => $post['detail']); $this->menu->saveData($data); $done = true; echo "<div>Sub Menu Created id:{$id} ({$post['title']})</div>"; $title = 'Save Data'; } else { } if ($post['type'] == 'menuUpdate') { $id = dbIdReport('menu', 'update menu', json_encode($post), 2000); $data = array('menu_name' => $post['name'], 'menu_title' => $post['title'], 'menu_parent' => $post['parent'], 'menu_href' => $post['href'], 'menu_detail' => $post['detail'], 'menu_position' => $post['pos'], 'menu_icon' => $post['icon'], 'menu_show' => $post['show']); $this->menu->updateData($data, $post['menu_id']); $done = true; echo "<div>Menu update id:{$post['menu_id']} ({$post['title']})</div>"; $title = 'Update Data'; } else { } if ($done == false) { $id = dbIdReport('id', 'error', json_encode($_REQUEST)); echo 'check your parameter'; $title = 'Error'; } else { } $content = ob_get_contents(); ob_end_clean(); $result = array('body' => $content, 'title' => $title, 'footer' => '-', 'post' => $post); echo json_encode($result);
<?php /**** views : member/memberPermisionEditForm_view created : 09-11-2015 11:09:06 By : Gunawan Wibisono Using : CI3 Main Model ****/ defined('BASEPATH') or exit('No direct script access allowed'); ob_start(); $module = "permision"; //change this $data = $this->{$module}->getData($post['permit_id'], 'permit_id'); $id = dbIdReport('id', 'edit mujur_permision', $post['permit_id']); $atr = array('id' => 'frmMain'); $hidden = array('type' => 'update', 'permit_id' => $post['permit_id']); echo form_open('', $atr, $hidden); echo bsInput("Nama", 'name', $data['name'], 'Nama Yang Jelas'); ?> <?php $atr = array('onclick' => 'saveFormData()'); echo bsButton('Save', 0, 'btn-save', $atr); ?> </form> <?php $content = ob_get_contents(); ob_end_clean(); $result = array('body' => $content, 'title' => 'Update mujur_permision', 'footer' => ' '); echo json_encode($result);
****/ defined('BASEPATH') or exit('No direct script access allowed'); ob_start(); $responce = (object) array(); $page = $get['page']; // get the requested page $limit = $get['rows']; // get how many rows we want to have into the grid $sidx = $get['sidx']; // get index row - i.e. user click to sort $sord = $get['sord']; // get the direction if (!$sidx) { $sidx = 1; } $id = dbIdReport('id', 'list menu ', json_encode($get)); if (isset($get['parent'])) { if ($get['_search'] === 'false') { $count = $this->menu->totalAllSub($get['parent']); if (intval($count) > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 0; } if ($page > $total_pages) { $page = $total_pages; } $start = $limit * $page - $limit; // do not put $limit*($page - 1) if ($start < 0) { $start = 0;
<?php /**** views : core/coreStatusEditForm_view created : 11-11-2015 19:15:35 By : Gunawan Wibisono Using : CI3 Main Model ****/ defined('BASEPATH') or exit('No direct script access allowed'); ob_start(); $module = "status"; //change this $data = $this->{$module}->getData($post['stat_id'], 'stat_id'); $id = dbIdReport('id', 'edit mujur_status', $post['stat_id']); $atr = array('id' => 'frmMain'); $hidden = array('type' => 'update', 'stat_id' => $post['stat_id']); echo form_open('', $atr, $hidden); echo bsInput("Code", 'code', $data['code'], 'Nama Yang Jelas'); echo bsInput("Nama", 'name', $data['name'], 'Nama Yang Jelas'); echo bsText("Detail", 'detail', ''); ?> <?php $atr = array('onclick' => 'saveFormData()'); echo bsButton('Save', 0, 'btn-save', $atr); ?> </form> <?php $content = ob_get_contents(); ob_end_clean(); $result = array('body' => $content, 'title' => 'Update mujur_status', 'footer' => ' ');
function __CONSTRUCT() { parent::__construct(); $this->load->model('menu_model', 'menu'); $this->load->model('main_model', 'maincore'); $this->load->model('tables_model', 'table'); $this->load->model('status_model', 'status'); $this->load->model('permision_model', 'permision'); $this->load->model('user_model', 'user'); $this->load->library('session'); $this->param['user'] = $user = $this->maincore->checkUser(); if ($user == false) { $pos = $this->uri->segment(1, '') . "/" . $this->uri->segment(2, ''); $url = base_url() . $pos; $this->session->set_userdata('target_url', $url); //$this->session->set_userdata($data); redirect(base_url('member/login'), 'refresh'); } else { } date_default_timezone_set('Asia/Jakarta'); $this->param['title'] = 'ERP-admin'; $this->param['today'] = date('Y-m-d'); $this->param['folder'] = $this->folder . '/'; $this->param['baseFolder'] = 'metro/'; $this->param['footerJS'] = array(); log_message('info', 'post:' . json_encode($_POST)); log_message('info', 'get:' . json_encode($_GET)); $this->param['defaultMenu'] = 'Core'; $this->param['thisUrl'] = $this->uri->segment(1) . '/' . $this->uri->segment(2); $this->param['css'] = array('jqgrid3.8/ui.jqgrid.css'); $this->param['js'] = array('metro/jquery-1.9.1.min.js'); $this->param['footerJS'] = array('metro/jquery-migrate-1.0.0.min.js', 'metro/jquery-ui-1.10.0.custom.min.js', 'metro/jquery.chosen.min.js', 'metro/jquery.cleditor.min.js', 'metro/jquery.cookie.js', 'metro/jquery.dataTables.min.js', 'metro/jquery.elfinder.min.js', 'metro/jquery.flot.js', 'metro/jquery.flot.pie.js', 'metro/jquery.flot.resize.min.js', 'metro/jquery.flot.stack.js', 'metro/jquery.gritter.min.js', 'metro/jquery.imagesloaded.js', 'metro/jquery.iphone.toggle.js', 'metro/jquery.knob.modified.js', 'metro/jquery.masonry.min.js', 'metro/jquery.noty.js', 'metro/jquery.raty.min.js', 'metro/jquery.sparkline.min.js', 'metro/jquery.ui.touch-punch.js', 'metro/jquery.uniform.min.js', 'metro/jquery.uploadify-3.1.min.js', 'metro/modernizr.js', 'metro/retina.js', 'metro/bootstrap.min.js', 'metro/counter.js', 'metro/custom.js', 'metro/excanvas.js', 'metro/fullcalendar.min.js', 'jqgrid3.8/i18n/grid.locale-en.js', 'jqgrid3.8/jquery.jqGrid.js'); //=============MAIN JS $jsScript = 'main.js'; $this->checkView($jsScript, 'js'); $this->param['footerJS'][] = $jsScript; //=============sub JS $name = $this->uri->segment(2, ''); $jsScript = $this->param['folder'] . $this->uri->segment(1) . ucfirst($name) . ".js"; if ($name != '') { $this->param['footerJS'][] = $jsScript; } else { } $this->param['dataUrl'] = $this->uri->segment(1) . "_" . $name; $this->param['myUrl'] = $this->uri->segment(1) . ucfirst($name); $id = dbIdReport('id', 'activity', json_encode($_REQUEST)); $this->param['breadcrumbs'] = array('unknown'); }
<?php /**** views : core/data/coreStatus_data created : 11-11-2015 19:15:35 By : Gunawan Wibisono Using : CI3 Main Model ****/ defined('BASEPATH') or exit('No direct script access allowed'); ob_start(); $module = "status"; //change this $id = dbIdReport('id', 'mujur_status list', json_encode($get)); $responce = (object) array(); $page = $get['page']; // get the requested page $limit = $get['rows']; // get how many rows we want to have into the grid $sidx = $get['sidx']; // get index row - i.e. user click to sort $sord = $get['sord']; // get the direction if (!$sidx) { $sidx = 1; } if ($get['_search'] === 'false') { $count = $this->{$module}->totalAll(); if (intval($count) > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 0;
<?php /**** views : core/data/corePermision_data created : 11-11-2015 02:58:34 By : Gunawan Wibisono Using : CI3 Main Model ****/ defined('BASEPATH') or exit('No direct script access allowed'); ob_start(); $module = "permision"; //change this $id = dbIdReport('id', 'mujur_permision list', json_encode($get)); $responce = (object) array(); $page = $get['page']; // get the requested page $limit = $get['rows']; // get how many rows we want to have into the grid $sidx = $get['sidx']; // get index row - i.e. user click to sort $sord = $get['sord']; // get the direction if (!$sidx) { $sidx = 1; } if ($get['_search'] === 'false') { $count = $this->{$module}->totalAll(); if (intval($count) > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 0;
<?php /**** views : core/coreMenuEditForm_view created : 09-11-2015 12:34:25 By : Gunawan Wibisono Using : CI3 Main Model ****/ defined('BASEPATH') or exit('No direct script access allowed'); ob_start(); $atr = array('id' => 'frmMainMenu'); $hidden = array('type' => 'menuUpdate', 'menu_id' => $post['menu_id']); $data = $this->menu->getData($post['menu_id'], 'menu_id'); $id = dbIdReport('id', 'edit menu ', $post['menu_id']); //print_r($data); //echo "`".implode("`, `",array_keys($data))."`"; echo form_open('email/send', $atr, $hidden); $atr = array('onclick' => 'saveFormData()'); echo bsButton('Save', 0, 'btn-save', $atr); $menu = array(); if ($data['parent'] == 0) { $menu[] = 'Parent'; } else { $SQL = "select menu_id id,menu_title title from {$this->menu->table} \n\twhere menu_parent=0"; //{$data['menu_parent']}"; $result = dbQuery($SQL, 1); $i = 0; foreach ($result->result_array() as $row) { $menu[$row['id']] = $row['title']; } }
function __CONSTRUCT() { parent::__construct(); $this->load->model('user_model', 'user'); $this->load->model('menu_model', 'menu'); $this->load->model('invoice_model', 'invoice'); $this->load->model('main_model', 'maincore'); date_default_timezone_set('Asia/Jakarta'); $this->param['title'] = 'ERP-User'; $this->param['today'] = date('Y-m-d'); $this->param['folder'] = 'user/'; $this->param['footerJS'] = array(); log_message('info', 'post:' . json_encode($_POST)); log_message('info', 'get:' . json_encode($_GET)); $this->param['defaultMenu'] = 'Core'; $this->param['thisUrl'] = $this->uri->segment(1) . '/' . $this->uri->segment(2); $this->param['css'] = array('cupertino/jquery-ui-1.10.3.custom.min.css', 'jqgrid3.8/ui.jqgrid.css'); $this->param['js'] = array('jquery-1.9.min.js', 'bootstrap.js'); $this->param['footerJS'] = array('jquery-ui-1.9.2.min.js', 'jqgrid3.8/i18n/grid.locale-en.js', 'jqgrid3.8/jquery.jqGrid.js'); //=============MAIN JS $jsScript = 'main.js'; $this->checkView($jsScript, 'js'); $this->param['footerJS'][] = $jsScript; //=============sub JS $name = $this->uri->segment(2, ''); $jsScript = $this->param['folder'] . $this->uri->segment(1) . "_" . $name . ".js"; if ($name != '') { $this->param['footerJS'][] = $jsScript; $this->checkView($jsScript, 'js'); } else { } $this->param['dataUrl'] = $this->uri->segment(1) . "_" . $name; $this->param['myUrl'] = $name; $id = dbIdReport('id', 'activity', json_encode($_REQUEST)); }
<?php /**** views : core/coreTable_data created : 11-11-2015 00:21:36 By : Gunawan Wibisono Using : CI3 Main Model ****/ defined('BASEPATH') or exit('No direct script access allowed'); ob_start(); $id = dbIdReport('id', 'table list', json_encode($get)); $responce = (object) array(); $page = $get['page']; // get the requested page $limit = $get['rows']; // get how many rows we want to have into the grid $sidx = $get['sidx']; // get index row - i.e. user click to sort $sord = $get['sord']; // get the direction if (!$sidx) { $sidx = 1; } if ($get['_search'] === 'false') { $count = $this->table->totalAll(); if (intval($count) > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 0; } if ($page > $total_pages) {
<?php /**** views : core/data/coreMenu_data created : 09-11-2015 12:37:08 By : Gunawan Wibisono Using : CI3 Main Model ****/ defined('BASEPATH') or exit('No direct script access allowed'); ob_start(); $id = dbIdReport('id', 'parent menu list ', json_encode($get)); ob_start(); $id = dbIdReport('id', 'parent menu list ', json_encode($get)); $responce = (object) array(); $page = $get['page']; // get the requested page $limit = $get['rows']; // get how many rows we want to have into the grid $sidx = $get['sidx']; // get index row - i.e. user click to sort $sord = $get['sord']; // get the direction if (!$sidx) { $sidx = 1; } if ($get['_search'] === 'false') { $count = $this->menu->totalAllParent(); if (intval($count) > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 0;