function ProcessRequest()
 {
     $mainMsg = '';
     $detailMsg = '';
     $type = '';
     // implements component messenger
     $msg = Messenger::Instance()->Receive(__FILE__, $this->mComponentName);
     if (!empty($msg)) {
         $codeMainMsg = $msg[0][0];
         Configuration::Instance()->Load('error.conf.php', 'default');
         $mainMsgConf = Configuration::Instance()->GetValue('error', $codeMainMsg);
         $mainMsg = $mainMsgConf['lang'];
         $detailMsg = $msg[0][1];
         $type = $mainMsgConf['type'];
     } else {
         // for compatibility backward, delete me!
         if (isset($this->mComponentParameters['notebox_mainmsg'])) {
             $codeMainMsg = $this->mComponentParameters['notebox_mainmsg'];
             Configuration::Instance()->Load('error.conf.php', 'default');
             $mainMsgConf = Configuration::Instance()->GetValue('error', $codeMainMsg);
             $mainMsg = $mainMsgConf['lang'];
             $detailMsg = $this->mComponentParameters['notebox_detailmsg'];
             $type = $mainMsgConf['type'];
         }
     }
     return array('mainMsg' => $mainMsg, 'detailMsg' => $detailMsg, 'type' => $type);
 }
 /** 
  * $msg[0][0] URL form pencarian
  * $msg[0][1] value nama
  */
 function ProcessRequest()
 {
     $msg = Messenger::Instance()->Receive(__FILE__, $this->mComponentName);
     $return['module_name'] = $msg[0][0];
     $return['value_nama'] = $msg[0][1];
     return $return;
 }
 function ProcessRequest()
 {
     $mObj = new Anggota();
     $messenger = Messenger::Instance()->Receive(__FILE__);
     $request_data = array();
     $arr_kelompok = $mObj->getKelompok();
     $message = $style = $messengerData = NULL;
     $data_id = Dispatcher::Instance()->Decrypt($mObj->_GET['data_id']);
     $data_anggota = $mObj->getDetilAnggota($data_id);
     $request_data['kelompok'] = $data_anggota['kelompok_id'];
     $request_data['id'] = $data_anggota['id'];
     $request_data['nama'] = $data_anggota['nama'];
     $request_data['email'] = $data_anggota['email'];
     $request_data['phone'] = $data_anggota['phone'];
     $request_data['alamat'] = $data_anggota['address'];
     if ($messenger) {
         $message = $messenger[0][1];
         $style = $messenger[0][2];
         $messengerData = $messenger[0][0];
         $request_data['id'] = $messengerData['data_id'];
         $request_data['kelompok'] = $messengerData['kelompok'];
         $request_data['nama'] = $messengerData['nama'];
         $request_data['email'] = $messengerData['email'];
         $request_data['phone'] = $messengerData['phone'];
         $request_data['alamat'] = $messengerData['alamat'];
     }
     # Combobox
     Messenger::Instance()->SendToComponent('combobox', 'Combobox', 'view', 'html', 'kelompok', array('kelompok', $arr_kelompok, $request_data['kelompok'], false, 'id="cmb_kelompok"'), Messenger::CurrentRequest);
     return compact('request_data', 'message', 'style');
 }
 function ProcessRequest()
 {
     $msg = Messenger::Instance()->Receive(__FILE__);
     @($return['Pesan'] = $msg[0][1]);
     @($return['Data'] = $msg[0][0]);
     $applicationId = Configuration::Instance()->GetValue('application', 'application_id');
     $idDec = Dispatcher::Instance()->Decrypt($_REQUEST['grp']);
     if ($idDec == '') {
         @($idDec = Dispatcher::Instance()->Decrypt($return['Data']['0']['grp']));
     }
     $groupObj = new AppGroup();
     $menuGroup = $groupObj->GetAllPrivilege($idDec, $applicationId);
     $return['menuGroup'] = $menuGroup;
     $dataGroup = $groupObj->GetDataGroupById($idDec);
     $dataUnitKerja = $groupObj->GetComboUnitKerja($applicationId);
     #action
     $actionTemp = $groupObj->GetAllAksiByGroupId($idDec);
     foreach ($actionTemp as $values) {
         $key = $values['MenuId'];
         $actionGroup[$key][] = $values;
     }
     //print_r($actionGroup);
     //exit;
     $return['actionGroup'] = $actionGroup;
     if (isset($dataGroup['0']['group_unit_id'])) {
         $unit_selected = $dataGroup['0']['group_unit_id'];
     } else {
         @($unit_selected = $return['Data']['0']['unit_kerja']);
     }
     Messenger::Instance()->SendToComponent('combobox', 'Combobox', 'view', 'html', 'unit_kerja', array('unit_kerja', $dataUnitKerja, $unit_selected, 'false'), Messenger::CurrentRequest);
     $return['decDataId'] = $idDec;
     $return['dataGroup'] = $dataGroup;
     return $return;
 }
Ejemplo n.º 5
0
 function SendCustomAlert($strAlert, $modul, $sub_modul, $css = '')
 {
     if (is_array($strAlert)) {
         Messenger::Instance()->Send($modul, $sub_modul, 'view', 'html', array($_POST->AsArray(), vsprintf($strAlert[0], $strAlert[1]), $css), Messenger::NextRequest);
     } else {
         Messenger::Instance()->Send($modul, $sub_modul, 'view', 'html', array($_POST->AsArray(), $strAlert, $css), Messenger::NextRequest);
     }
 }
 function Add()
 {
     if (isset($this->_POST['btnsimpan'])) {
         $add = $this->Obj->DoAddMahasiswa($this->_POST['nama_mhs'], $this->_POST['alamat_mhs']);
         if ($add == true) {
             Messenger::Instance()->Send('latihan_enam', 'ListMahasiswa', 'view', 'html', array($this->_POST, 'Penambahan data berhasil dilakukan', $this->cssDone), Messenger::NextRequest);
         } else {
             Messenger::Instance()->Send('latihan_enam', 'ListMahasiswa', 'view', 'html', array($this->_POST, 'Penambahan data gagal dilakukan', $this->cssFail), Messenger::NextRequest);
         }
         return $this->pageView;
     }
 }
 function Update()
 {
     if (isset($this->_POST['btnsimpan'])) {
         $idMahasiswa = $this->_POST['id_mhs'];
         $update = $this->Obj->DoUpdateMahasiswa($this->_POST['nama_mhs'], $this->_POST['alamat_mhs'], $idMahasiswa);
         if ($update == true) {
             Messenger::Instance()->Send('latihan_sembilan', 'ListMahasiswa', 'view', 'html', array($this->_POST, 'Update Data Berhasil Dilakukan', $this->cssDone), Messenger::NextRequest);
         } else {
             Messenger::Instance()->Send('latihan_sembilan', 'ListMahasiswa', 'view', 'html', array($this->_POST, 'Update Data Gagal Dilakukan', $this->cssFail), Messenger::NextRequest);
         }
         return $this->pageView;
     }
 }
 function ProcessRequest()
 {
     $msg = Messenger::Instance()->Receive(__FILE__);
     if ($msg) {
         $return['Pesan'] = $msg[0][1];
         $return['Data'] = $msg[0];
     } else {
         $return['Pesan'] = null;
         $return['Data'] = null;
     }
     $return['usr'] = Dispatcher::Instance()->Decrypt($_REQUEST['usr']);
     return $return;
 }
 function Delete()
 {
     $mhsId = $this->_POST['idDelete'];
     if (isset($mhsId)) {
         $delete = $this->Obj->DoDeleteMahasiswa($mhsId);
         if ($delete == true) {
             Messenger::Instance()->Send('latihan_sepuluh', 'ListMahasiswa', 'view', 'html', array($this->_POST, 'Delete Data Berhasil Dilakukan', $this->cssDone), Messenger::NextRequest);
         } else {
             Messenger::Instance()->Send('latihan_sepuluh', 'ListMahasiswa', 'view', 'html', array($this->_POST, 'Delete Data Gagal Dilakukan', $this->cssFail), Messenger::NextRequest);
         }
     }
     return $this->pageView;
 }
 function ProcessRequest()
 {
     $msg = Messenger::Instance()->Receive(__FILE__);
     @($return['Pesan'] = $msg[0][1]);
     @($return['css'] = $msg[0][2]);
     $applicationId = Configuration::Instance()->GetValue('application', 'application_id');
     $groupObj = new AppGroup();
     $dataGroup = $groupObj->GetDataGroup('', $applicationId, true);
     #print_r($dataGroup);
     $return['dataGroup'] = $dataGroup;
     @($return['start'] = $startRec + 1);
     return $return;
 }
 function ProcessRequest()
 {
     $messenger = Messenger::Instance()->Receive(__FILE__);
     $mObj = new Anggota();
     $arr_kelompok = $mObj->getKelompok();
     $request_data = array();
     $query_string = '';
     $message = $style = $message = NULL;
     if (isset($mObj->_POST['btnSearch'])) {
         $request_data['nama'] = $mObj->_POST['nama'];
         $request_data['kelompok'] = $mObj->_POST['kelompok'];
     } elseif (isset($mObj->_GET['search'])) {
         $request_data['nama'] = Dispatcher::Instance()->Decrypt($mObj->_GET['nama']);
         $request_data['kelompok'] = Dispatcher::Instance()->Decrypt($mObj->_GET['kelompok']);
     } else {
         $request_data['nama'] = '';
         $request_data['kelompok'] = '';
     }
     if (method_exists(Dispatcher::Instance(), 'getQueryString')) {
         # @param array
         $query_string = Dispatcher::instance()->getQueryString($request_data);
     } else {
         $query = array();
         foreach ($request_data as $key => $value) {
             $query[$key] = Dispatcher::Instance()->Encrypt($value);
         }
         $query_string = urldecode(http_build_query($query));
     }
     $offset = 0;
     $limit = 20;
     $page = 0;
     if (isset($_GET['page'])) {
         $page = (string) $_GET['page']->StripHtmlTags()->SqlString()->Raw();
         $offset = ($page - 1) * $limit;
     }
     #paging url
     $url = Dispatcher::Instance()->GetUrl(Dispatcher::Instance()->mModule, Dispatcher::Instance()->mSubModule, Dispatcher::Instance()->mAction, Dispatcher::Instance()->mType) . '&search=' . Dispatcher::Instance()->Encrypt(1) . '&' . $query_string;
     $destination_id = "subcontent-element";
     $data_list = $mObj->getDataAnggota($offset, $limit, $request_data);
     $total_data = $mObj->Count();
     #send data to pagging component
     Messenger::Instance()->SendToComponent('paging', 'Paging', 'view', 'html', 'paging_top', array($limit, $total_data, $url, $page, $destination_id), Messenger::CurrentRequest);
     # Combobox
     Messenger::Instance()->SendToComponent('combobox', 'Combobox', 'view', 'html', 'kelompok', array('kelompok', $arr_kelompok, $request_data['kelompok'], true, 'id="cmb_kelompok"'), Messenger::CurrentRequest);
     $start = $offset + 1;
     if ($messenger) {
         $message = $messenger[0][1];
         $style = $messenger[0][2];
     }
     return compact('request_data', 'query_string', 'start', 'data_list', 'message', 'style');
 }
 function ProcessRequest()
 {
     $msg = Messenger::Instance()->Receive(__FILE__, $this->mComponentName);
     $return['idNama'] = !empty($msg[0][0]) ? $msg[0][0] : '';
     $return['arrData'] = !empty($msg[0][1]) ? $msg[0][1] : '';
     #lebih baik "id" dan "name" di typecast ke string dulu.
     $return['id'] = !empty($msg[0][2]) ? $msg[0][2] : '';
     $return['all'] = !empty($msg[0][3]) ? $msg[0][3] : '';
     $return['action'] = !empty($msg[0][4]) ? $msg[0][4] : '';
     $return['multiple'] = !empty($msg[0][5]) ? $msg[0][5] : '';
     $return['size'] = !empty($msg[0][6]) ? $msg[0][6] : '';
     $return['inputId'] = !empty($msg[0][7]) ? $msg[0][7] : '';
     return $return;
 }
 function ProcessRequest()
 {
     $msg = Messenger::Instance()->Receive(__FILE__);
     if ($msg) {
         $return['pesan'] = $msg[0][1];
         $return['css'] = $msg[0][2];
     } else {
         $return['pesan'] = null;
         $return['css'] = null;
     }
     $Obj = new Mahasiswa();
     $return['dataMahasiswa'] = $Obj->GetListMahasiswa();
     return $return;
 }
 function ProcessRequest()
 {
     $objBusiness = new JenisIdentitas();
     $msg = Messenger::Instance()->Receive(__FILE__, $this->mComponentName);
     $selectedValue = '';
     $status = '';
     if (!empty($msg)) {
         $selectedValue = $msg[0][0];
         $status = $msg[0][1];
     } else {
         $selectedValue = $this->mComponentParameters['selected'];
         $status = $this->mComponentParameters['status'];
     }
     return array("result" => $objBusiness->GetAllJenisIdentitas(), "selectedval" => $selectedValue, "status" => $status);
 }
Ejemplo n.º 15
0
 function ProcessRequest()
 {
     require_once GTFW_APP_DIR . 'module/gtfw_menu/response/Process.proc.class.php';
     $Proc = new Process();
     $post = $_POST->AsArray();
     $result = $Proc->input();
     if ($result == true) {
         Messenger::Instance()->Send('gtfw_menu', 'menu', 'view', 'html', array(NULL, 'Penambahan data berhasil', 'notebox-done'), Messenger::NextRequest);
         $redirect = Dispatcher::Instance()->GetUrl('gtfw_menu', 'menu', 'view', 'html') . '&display';
     } else {
         Messenger::Instance()->Send('gtfw_menu', 'input', 'view', 'html', array($post, implode('<br/>', $Proc->err_msg), 'notebox-warning'), Messenger::NextRequest);
         $redirect = Dispatcher::Instance()->GetUrl('gtfw_menu', 'add', 'view', 'html');
     }
     $this->RedirectTo($redirect);
 }
 function ProcessRequest()
 {
     $messenger = Messenger::Instance()->Receive(__FILE__);
     $mObj = new Kelompok();
     $message = $style = $messengerData = NULL;
     $request_data = array();
     if ($messenger) {
         $message = $messenger[0][1];
         $style = $messenger[0][2];
         $messengerData = $messenger[0][0];
         $request_data['id'] = $messengerData['data_id'];
         $request_data['nama'] = $messengerData['nama'];
     }
     return compact('request_data', 'message', 'style');
 }
 function ProcessRequest()
 {
     $Obj = new Menu();
     $msg = Messenger::Instance()->Receive(__FILE__);
     $filter_data = !empty($msg[0][0]) ? $msg[0][0] : NULL;
     $message['content'] = !empty($msg[0][1]) ? $msg[0][1] : NULL;
     $message['style'] = !empty($msg[0][2]) ? $msg[0][2] : NULL;
     $view_per_page = Configuration::Instance()->GetValue('application', 'paging_limit');
     $view_per_page = 5;
     if (!isset($_GET['display']) || empty($filter_data)) {
         $page = 1;
         $start = 0;
         $display = $view_per_page;
         $filter = compact('page', 'display', 'start');
     } elseif ($_GET['display']->Raw() != '') {
         $page = (int) $_GET['page']->SqlString()->Raw();
         $display = (int) $_GET['display']->SqlString()->Raw();
         if ($page < 1) {
             $page = 1;
         }
         if ($display < 1) {
             $display = $view_per_page;
         }
         $start = ($page - 1) * $display;
         $filter = compact('page', 'display', 'start');
         $filter += $filter_data;
     } else {
         $filter = $filter_data;
         $page = $filter['page'];
         $display = $filter['display'];
         $start = $filter['start'];
     }
     $post_data = $_POST->AsArray();
     if (!empty($post_data)) {
         foreach ($post_data as $key => $value) {
             $filter[$key] = $value;
         }
         $url_add = "&{$key}={$value}";
         $url = Dispatcher::Instance()->GetUrl(Dispatcher::Instance()->mModule, Dispatcher::Instance()->mSubModule, Dispatcher::Instance()->mAction, Dispatcher::Instance()->mType) . $url_add . '&display=' . $view_per_page;
     } else {
         $url = Dispatcher::Instance()->GetUrl(Dispatcher::Instance()->mModule, Dispatcher::Instance()->mSubModule, Dispatcher::Instance()->mAction, Dispatcher::Instance()->mType, false, true) . '&display=' . $view_per_page;
     }
     Messenger::Instance()->Send(Dispatcher::Instance()->mModule, Dispatcher::Instance()->mSubModule, Dispatcher::Instance()->mAction, Dispatcher::Instance()->mType, array($filter), Messenger::UntilFetched);
     $data = $Obj->getData($filter);
     $total = $Obj->countData();
     Messenger::Instance()->SendToComponent('paging', 'paging', 'view', 'html', 'paging_top', array($display, $total, $url, $page), Messenger::CurrentRequest);
     return compact('data', 'filter', 'message');
 }
 function ProcessRequest()
 {
     $msg = Messenger::Instance()->Receive(__FILE__);
     if ($msg) {
         $return['Pesan'] = $msg[0][1];
         $return['css'] = $msg[0][2];
     } else {
         $return['Pesan'] = null;
         $return['css'] = null;
     }
     $applicationId = Configuration::Instance()->GetValue('application', 'application_id');
     $groupObj = new AppGroup();
     $dataGroup = $groupObj->GetDataGroup('', $applicationId, true);
     $return['dataGroup'] = $dataGroup;
     return $return;
 }
 function ProcessRequest()
 {
     $page = false;
     $itemsViewed = 10;
     $totItems = 0;
     $url = '';
     // By default fetch param from gtfw-render module
     $itemsViewed = $this->mComponentParameters['itemviewed'];
     $totItems = $this->mComponentParameters['totitems'];
     $url = $this->mComponentParameters['pagingurl'];
     if (isset($this->mComponentParameters['page'])) {
         $page = $this->mComponentParameters['page'];
     } else {
         $page = false;
     }
     if (isset($this->mComponentParameters['nav_class'])) {
         $nav_class = $this->mComponentParameters['nav_class'];
     } else {
         $nav_class = '';
     }
     // support component messenger
     $msg = Messenger::Instance()->Receive(__FILE__, $this->mComponentName);
     if (!empty($msg)) {
         //SysLog::Log(print_r($msg, true), 'paging');
         $itemsViewed = $msg[0][0];
         $totItems = $msg[0][1];
         $url = $msg[0][2];
         if (isset($msg[0][3])) {
             $page = $msg[0][3][0];
             $keyword = $msg[0][3][1];
             $combo = $msg[0][3][2];
         } else {
             $page = false;
             $keyword = false;
             $combo = false;
         }
     }
     //SysLog::Log('nav_class: '.$nav_class, 'paging');
     $arrayMsg = array("totItems" => $totItems, "itemsViewed" => $itemsViewed, "url" => $url, "page" => $page, "nav_class" => $nav_class);
     if (empty($nav_class)) {
         $nav_class = 'subcontent-element';
     }
     Messenger::Instance()->Send('paging', 'Paging', 'view', 'html', $arrayMsg, Messenger::NextRequest);
     return array('exec' => 'GtfwAjax.replaceContentWithUrl("' . $nav_class . '"," ' . Dispatcher::Instance()->GetUrl('paging', 'Paging', 'view', 'html') . '&ascomponent=1")');
 }
 function ProcessRequest()
 {
     $Obj = new Mahasiswa();
     $totalData = $Obj->GetCountMahasiswa();
     $itemViewed = 5;
     $currPage = 1;
     $startRec = 0;
     if (isset($_GET['page'])) {
         $currPage = (string) $_GET['page']->StripHtmlTags()->SqlString()->Raw();
         $startRec = ($currPage - 1) * $itemViewed;
     }
     $return['dataMahasiswa'] = $Obj->GetListMahasiswa($startRec, $itemViewed);
     $url = Dispatcher::Instance()->GetUrl(Dispatcher::Instance()->mModule, Dispatcher::Instance()->mSubModule, Dispatcher::Instance()->mAction, Dispatcher::Instance()->mType);
     $destination_id = "subcontent-element";
     Messenger::Instance()->SendToComponent('paging', 'Paging', 'view', 'html', 'paging_top', array($itemViewed, $totalData, $url, $currPage, $destination_id), Messenger::CurrentRequest);
     $return['start_number'] = $startRec + 1;
     return $return;
 }
 function input()
 {
     $post = $_POST->AsArray();
     $app_id = Configuration::Instance()->GetValue('application', 'application_id');
     $result = $this->check_input($post);
     $msg = '';
     if ($result) {
         if (empty($post['data-id'])) {
             $this->Obj->StartTrans();
             $params = array($post['parent_id'], $post['name'], $post['is_show'], $post['icon'], $post['order'], $app_id);
             if ($result) {
                 $result = $this->Obj->add($params);
             }
             if ($result) {
                 $msg .= 'Penambahan data Berhasil Dilakukan';
                 $css = $this->cssDone;
             } else {
                 $msg .= 'Gagal Menambah Data';
                 $css = $this->cssFail;
             }
             $this->Obj->EndTrans($result);
         } else {
             $this->Obj->StartTrans();
             $params = array($post['parent_id'], $post['name'], $post['is_show'], $post['icon'], $post['order'], $app_id, $post['data-id']);
             if ($result) {
                 $result = $this->Obj->edit($params);
             }
             if ($result) {
                 $msg .= 'Pengubahan data Berhasil Dilakukan';
                 $css = $this->cssDone;
             } else {
                 $msg .= 'Gagal Mengubah Data';
                 $css = $this->cssFail;
             }
             $this->Obj->EndTrans($result);
         }
     }
     if ($result) {
         Messenger::Instance()->Send('gtfw_menu', 'menu', 'view', 'html', array(NULL, $msg, $css), Messenger::NextRequest);
     } else {
         Messenger::Instance()->Send('gtfw_menu', 'menu', 'view', 'html', array($post, $msg, $css), Messenger::NextRequest);
     }
     return $result;
 }
 public function Delete()
 {
     $id_delete = $this->mObj->_POST['idDelete'];
     if ($id_delete) {
         $process = $this->mObj->doDeleteAnggota($id_delete);
         if ($process === true) {
             $message = 'Proses penghapusan data berhasil';
             $style = 'notebox-done';
         } else {
             $message = 'Proses penghapusan data gagal';
             $style = 'notebox-warning';
         }
     } else {
         $message = 'Tidak ada data yang akan dihapus';
         $style = 'notebox-done';
     }
     Messenger::Instance()->Send('anggota', 'Anggota', 'view', 'html', array(NULL, $message, $style), Messenger::NextRequest);
     return $this->url_view;
 }
 function ProcessRequest()
 {
     $messenger = Messenger::Instance()->Receive(__FILE__);
     $mObj = new Kelompok();
     $data_id = Dispatcher::Instance()->Decrypt($mObj->_GET['data_id']);
     $message = $style = $messengerData = NULL;
     $request_data = array();
     $data_kelompok = $mObj->getDataDetilKelompok($data_id);
     // set default data dari database
     $request_data['id'] = $data_kelompok['id'];
     $request_data['nama'] = $data_kelompok['nama'];
     if ($messenger) {
         $message = $messenger[0][1];
         $style = $messenger[0][2];
         $messengerData = $messenger[0][0];
         $request_data['id'] = $messengerData['data_id'];
         $request_data['nama'] = $messengerData['nama'];
     }
     return compact('request_data', 'message', 'style');
 }
 function ProcessRequest()
 {
     $msg = Messenger::Instance()->Receive(__FILE__);
     if ($msg) {
         $return['Pesan'] = $msg[0][1];
         $return['Data'] = $msg[0];
     } else {
         $return['Pesan'] = null;
         $return['Data'] = null;
     }
     $decUsr = Dispatcher::Instance()->Decrypt($_REQUEST['usr']);
     if ($decUsr == '') {
         $decUsr = Dispatcher::Instance()->Decrypt($return['Data']['0']['usr']);
     }
     $applicationId = Configuration::Instance()->GetValue('application', 'application_id');
     $userObj = new AppUser();
     $dataUser = $userObj->GetDataUserById($decUsr);
     $dataUnitKerja = $userObj->GetComboUnitKerja($applicationId);
     if (isset($dataUser['0']['unit_kerja_id'])) {
         $unit_selected = $dataUser['0']['unit_kerja_id'];
     } else {
         $unit_selected = $return['Data']['0']['unit_kerja'];
     }
     Messenger::Instance()->SendToComponent('combobox', 'Combobox', 'view', 'html', 'unit_kerja', array('unit_kerja', $dataUnitKerja, $unit_selected, 'false', 'onChange="updateGroup();"', false, '', '', '', ''), Messenger::CurrentRequest);
     if (isset($unit_selected)) {
         $data_combo_group = $userObj->GetDataGroupByUnitId("", $unit_selected, $applicationId);
         if ($_REQUEST['usr'] == '') {
             $group_selected = $return['Data']['0']['group'];
         } else {
             $group_selected = $dataUser['0']['group_id'];
         }
     } else {
         $group_selected = null;
         $data_combo_group = null;
     }
     Messenger::Instance()->SendToComponent('combobox', 'Combobox', 'view', 'html', 'group', array('group', $data_combo_group, $group_selected, 'false', '', '', '', ''), Messenger::CurrentRequest);
     $return['dataUser'] = $dataUser;
     return $return;
 }
 function ProcessRequest()
 {
     // sample only, delete me
     $msg = Messenger::Instance()->Receive(__FILE__, $this->mComponentName);
     if (empty($msg[0][1])) {
         $msg[0][1] = '1926';
     }
     $this->mComponentParameters['selecteddate'] = $msg[0][0];
     $this->mComponentParameters['year_start'] = $msg[0][1];
     $this->mComponentParameters['year_end'] = $msg[0][2];
     $this->mComponentParameters['nullable'] = $msg[0][3];
     $this->mComponentParameters['status'] = $msg[0][4];
     //print $this->mComponentParameters['exclude'];
     //
     $yearStart = false;
     $selectedValue = '';
     if (isset($this->mComponentParameters['selecteddate']) && trim($this->mComponentParameters['selecteddate']) != '') {
         $selectedValue = $this->mComponentParameters['selecteddate'];
     } elseif (trim($this->mComponentParameters['selecteddate']) == '') {
         $selectedValue = $this->mComponentParameters['selecteddate'];
     } else {
         $selectedValue = date("Y-m-d");
     }
     if (isset($this->mComponentParameters['year_start']) && isset($this->mComponentParameters['year_end'])) {
         $yearStart = $this->mComponentParameters['year_start'];
         $yearEnd = $this->mComponentParameters['year_end'];
     } else {
         $yearStart = $this->mComponentParameters['year_start'];
         $yearEnd = date("Y");
     }
     if (isset($this->mComponentParameters['status']) && trim($this->mComponentParameters['status']) != '') {
         $status = $this->mComponentParameters['status'];
     }
     $nullable = $this->mComponentParameters['nullable'];
     //added by choirul, status combo = exclude
     $day = date("j");
     $mo = date("n");
     return array("comboDate" => $this->fillComboDate($day, $mo, $yearStart, $yearEnd, $nullable), "selectedval" => $selectedValue, "componentName" => $this->mComponentName, "status" => $status, "exclude" => $this->mComponentParameters['exclude']);
 }
 function ProcessRequest()
 {
     # if js is enabled
     if (isset($msg[0]['page'])) {
         $msg = Messenger::Instance()->Receive(__FILE__);
         $itemsViewed = $msg[0]['itemsViewed'];
         $url = $msg[0]['url'];
         $page = $msg[0]['page'];
         $nav_class = $msg[0]['nav_class'];
         $keyword = $msg[0]['keyword'];
         $combo = $msg[0]['combo'];
     } else {
         $page = false;
         $itemsViewed = 10;
         $totItems = 0;
         $url = '';
         // By default fetch param from gtfw-render module
         if (isset($this->mComponentParameters['itemviewed'])) {
             $itemsViewed = $this->mComponentParameters['itemviewed'];
         }
         if (isset($this->mComponentParameters['totitems'])) {
             $totItems = $this->mComponentParameters['totitems'];
         }
         if (isset($this->mComponentParameters['pagingurl'])) {
             $url = $this->mComponentParameters['pagingurl'];
         }
         if (isset($this->mComponentParameters['page'])) {
             $page = $this->mComponentParameters['page'];
         } else {
             $page = false;
         }
         if (isset($this->mComponentParameters['nav_class'])) {
             $nav_class = $this->mComponentParameters['nav_class'];
         } else {
             $nav_class = '';
         }
         // support component messenger
         $msg = Messenger::Instance()->Receive(__FILE__, $this->mComponentName);
         if (!empty($msg)) {
             //SysLog::Log(print_r($msg, true), 'paging');
             $itemsViewed = $msg[0][0];
             $totItems = $msg[0][1];
             $url = $msg[0][2];
             @($nav_class = $msg[0][4]);
             if (isset($msg[0][3])) {
                 if (is_array($msg[0][3])) {
                     $page = $msg[0][3][0];
                     $keyword = $msg[0][3][1];
                     $combo = $msg[0][3][2];
                 } else {
                     $page = $msg[0][3];
                     $keyword = false;
                     $combo = false;
                 }
             } else {
                 $page = false;
                 $keyword = false;
                 $combo = false;
             }
         }
         //SysLog::Log('nav_class: '.$nav_class, 'paging');
     }
     return $this->multipage($totItems, $itemsViewed, $url, $page, $nav_class, $keyword, $combo);
 }
Ejemplo n.º 27
0
    // set $name to component's name via $this->mComponentName to receive message sent to component
    // ex. Messenger::Instance()->Receive(__FILE__, $this->mComponentName)
    public function Receive($receiver, $name = '')
    {
        $receiver = is_object($receiver) ? get_class($receiver) : str_replace('\\', '/', $receiver);
        $receiver .= "_{$name}";
        $msg = $this->mrMessageQueue->GetMessage($receiver);
        // reflect changes to session immediately
        $_SESSION['messenger_queue'] = serialize($this->mrMessageQueue);
        return $msg;
    }
    public function MessageCount($receiver = NULL, $name = '')
    {
        if ($receiver) {
            $receiver = is_object($receiver) ? get_class($receiver) : str_replace('\\', '/', $receiver);
            $receiver .= "_{$name}";
        }
        return $this->mrMessageQueue->MessageCount($receiver);
    }
    public static function &Instance()
    {
        if (self::$mrInstance == NULL) {
            $class_name = __CLASS__;
            self::$mrInstance = new $class_name();
        }
        return self::$mrInstance;
    }
}
// init
Messenger::Instance();
 function SendAlert($alert, $sub_modul, $css = '')
 {
     Messenger::Instance()->Send('gtfw_group', $sub_modul, 'view', 'html', array($this->_POST, $alert, $css), Messenger::NextRequest);
 }
 function ProcessRequest()
 {
     $GtfwModule = new GtfwModule();
     $cfg_hak_akses_per_aksi = Configuration::Instance()->GetValue('application', 'cfg_hak_akses_per_aksi');
     if ($cfg_hak_akses_per_aksi) {
         $settingShowAksesPerAksi = 1;
     } else {
         $settingShowAksesPerAksi = 0;
     }
     $return['setting_aksi'] = $settingShowAksesPerAksi;
     $this->POST = $_POST->AsArray();
     $this->modulName = $_GET['moduleName'];
     if ($GtfwModule->aktif == 'bo') {
         $path_module = Configuration::Instance()->GetValue('application', 'docroot') . 'module/' . $this->modulName . '/response/';
         $AppId = Configuration::Instance()->GetValue('application', 'application_id');
     } else {
         $path_module = str_replace("bo", "fo", Configuration::Instance()->GetValue('application', 'docroot')) . 'module/' . $this->modulName . '/response/';
         $AppId = Configuration::Instance()->GetValue('application', 'application_portal_id');
     }
     if (isset($this->POST['btnsimpan'])) {
         $result = $this->Register();
         if ($result === true) {
             $this->Pesan = $this->POST['btnsimpan'] . ' Module dan ' . $this->POST['btnsimpan'] . ' Menu Berhasil';
             $this->css = 'success';
         } else {
             $this->Pesan = $this->POST['btnsimpan'] . ' Module dan ' . $this->POST['btnsimpan'] . ' Menu Gagal';
             $this->css = 'danger';
         }
     }
     $i = 0;
     if (file_exists($path_module)) {
         $dir = dir($path_module);
         while (false !== ($entry = $dir->read())) {
             if ($entry != '..' && $entry != '.') {
                 $Temp = $GtfwModule->PecahFile($entry);
                 $ActionList = array("Do", "View", "Popup", "Input", "Combo");
                 if (in_array($Temp['Action'], $ActionList)) {
                     $listFile[$i] = $Temp;
                     $GetModule = $GtfwModule->GetModuleByFile($this->modulName, $Temp['SubModuleName'], $Temp['Action'], $Temp['Type'], $AppId);
                     if (!empty($GetModule)) {
                         $labelAksi = $GtfwModule->GetLabelAksi($GetModule[0]['AksiId']);
                     }
                     $listFile[$i]['name_checkbox'] = $this->modulName . "-" . $Temp['SubModuleName'] . "-" . $Temp['Action'] . "-" . $Temp['Type'];
                     if (sizeof($GetModule) == 0) {
                         $listFile[$i]['checkbox'] = '<input type=checkbox name="' . $listFile[$i]['name_checkbox'] . '" checked>';
                         $listFile[$i]['combobox'] = '<select name="Access-' . $listFile[$i]['name_checkbox'] . '"><option value="Exclusive">Exclusive</option><option value="All">All</option></select>';
                         $listFile[$i]['aksiLabel'] = '';
                         $this->RegisterStatus = true;
                     } else {
                         $listFile[$i]['checkbox'] = 'Sudah';
                         $listFile[$i]['combobox'] = $GetModule[0]['Access'];
                         if (!empty($labelAksi)) {
                             $listFile[$i]['aksiLabel'] = $labelAksi[0]['aksiLabel'];
                         } else {
                             $listFile[$i]['aksiLabel'] = '';
                         }
                         $this->MenuId = $GetModule[0]['MenuId'];
                     }
                     if ($GetModule) {
                         if ($GetModule[0]['ModuleId'] == $GetModule[0]['MenuDefaultModuleId'] && sizeof($GetModule) > 0) {
                             $listFile[$i]["default"] = 'checked';
                         } else {
                             $listFile[$i]["default"] = '';
                         }
                     }
                     $i++;
                 }
             }
         }
     }
     if (!empty($this->MenuId)) {
         $readonly = 'readonly=true';
         $return['dataMenu'] = $GtfwModule->GetMenuById($this->MenuId);
     } else {
         $readonly = '';
         $return['dataMenu'] = null;
     }
     $IsShow = array(0 => array('ID' => 'Yes', 'NAME' => 'Yes'), 1 => array('ID' => 'No', 'NAME' => 'No'));
     Messenger::Instance()->SendToComponent('combobox', 'Combobox', 'view', 'html', 'IsShow', array('IsShow', $IsShow, $return['dataMenu'][0]['IsShow'], '', ' style="width:100px;" ' . $readonly, '', '', ''), Messenger::CurrentRequest);
     $MenuParentId = $GtfwModule->GetParentMenu($AppId);
     Messenger::Instance()->SendToComponent('combobox', 'Combobox', 'view', 'html', 'MenuParentId', array('MenuParentId', $MenuParentId, $return['dataMenu'][0]['MenuParentId'], '', ' style="width:300px;" ' . $readonly, '', '', ''), Messenger::CurrentRequest);
     $return['dataSheet'] = $listFile;
     return $return;
 }
 function ProcessRequest()
 {
     if (!empty($_POST['id'])) {
         $_POST = $_POST->AsArray();
         $msg = Messenger::Instance()->Receive(__FILE__);
         if ($msg) {
             $return[0]['label'] = $msg[0][0];
             $return[0]['urlDelete'] = $msg[0][1];
             $return[0]['urlReturn'] = $msg[0][2];
         } else {
             $return[0]['label'] = null;
             $return[0]['urlDelete'] = null;
             $return[0]['urlReturn'] = null;
         }
         //if(!empty($_POST['is_satker']))
         // $return[0]['message'] = $msg[0][3];
         for ($i = 0; $i < sizeof($_POST['id']); $i++) {
             $return[$i]['id'] = $_POST['id'][$i];
             $return[$i]['dataname'] = $_POST['name'][$_POST['id'][$i]];
             /*if($_POST['is_parent'][$_POST['id'][$i]]) 
               $return[0]['message'] = "<br />" . $msg[0][3];*/
         }
         $return[0]['message'] = '';
         $return[0]['multiple'] = "YES";
         $return[0]['emptydata'] = "NO";
         //print_r($msg);
     } elseif (trim($_GET['id']) != "" && $_GET['call'] == 'post') {
         $id = $_GET['id'];
         $name = $_GET['name'];
         $explId = explode('|', $id);
         $explName = explode('|', $name);
         for ($i = 0; $i < sizeof($explId); $i++) {
             $return[$i]['id'] = $explId[$i];
             $return[$i]['dataname'] = $explName[$i];
         }
         $return[0]['message'] = Dispatcher::Instance()->Decrypt($_GET['message']);
         $return[0]['multiple'] = "YES";
         $return[0]['emptydata'] = "NO";
         $deleteUrl = Dispatcher::Instance()->Decrypt((string) $_GET['urlDelete']);
         $urlDel = explode('-', $deleteUrl);
         //-> Array ( [0] => unitkerja|deleteUnitkerja|do|html [1] => cari [2] => )
         $newUrl = explode('|', $urlDel['0']);
         //-> Array ( [0] => unitkerja [1] => deleteUnitkerja [2] => do [3] => html )
         /*$par = explode('|',$urlDel['1']); //->Array ( [0] => cari )
         		$val = explode('|',$urlDel['2']); //->Array ( [0] => )
         		for($i=0;$i<count($par);$i++){
         			$str .= '&'.$par[$i].'='.Dispatcher::Instance()->Encrypt($val[$i]);
         		}*/
         $str = '';
         $return[0]['urlDelete'] = Dispatcher::Instance()->GetUrl($newUrl['0'], $newUrl['1'], $newUrl['2'], $newUrl['3']) . $str;
         $returnUrl = Dispatcher::Instance()->Decrypt((string) $_GET['urlReturn']);
         $urlRet = explode('-', $returnUrl);
         $newUrl = explode('|', $urlRet['0']);
         /*$par = explode('|',$urlRet['1']);
         		$val = explode('|',$urlRet['2']);
         		$str ='';
         		for($i=0;$i<count($par);$i++) {
         			$str .= '&'.$par[$i].'='.Dispatcher::Instance()->Encrypt($val[$i]);
         		}*/
         $str = '';
         $return[0]['urlReturn'] = Dispatcher::Instance()->GetUrl($newUrl['0'], $newUrl['1'], $newUrl['2'], $newUrl['3']) . $str;
         $return[0]['label'] = Dispatcher::Instance()->Decrypt((string) $_GET['label']);
     } elseif (trim($_GET['id']) != "") {
         $return[0]['id'] = Dispatcher::Instance()->Decrypt((string) $_GET['id']);
         $return[0]['jenjang'] = Dispatcher::Instance()->Decrypt((string) $_GET['jenjang']);
         $return[0]['dataname'] = Dispatcher::Instance()->Decrypt($_GET['dataName']);
         $return[0]['message'] = Dispatcher::Instance()->Decrypt($_GET['message']);
         $return[0]['multiple'] = "NO";
         $return[0]['emptydata'] = "NO";
         $deleteUrl = Dispatcher::Instance()->Decrypt((string) $_GET['urlDelete']);
         $urlDel = explode('-', $deleteUrl);
         //-> Array ( [0] => unitkerja|deleteUnitkerja|do|html [1] => cari [2] => )
         $newUrl = explode('|', $urlDel['0']);
         //-> Array ( [0] => unitkerja [1] => deleteUnitkerja [2] => do [3] => html )
         /*$par = explode('|',$urlDel['1']); //->Array ( [0] => cari )
         		$val = explode('|',$urlDel['2']); //->Array ( [0] => )
         		for($i=0;$i<count($par);$i++){
         			$str .= '&'.$par[$i].'='.Dispatcher::Instance()->Encrypt($val[$i]);
         		}*/
         $str = '';
         $return[0]['urlDelete'] = Dispatcher::Instance()->GetUrl($newUrl['0'], $newUrl['1'], $newUrl['2'], $newUrl['3']) . $str;
         $returnUrl = Dispatcher::Instance()->Decrypt((string) $_GET['urlReturn']);
         $urlRet = explode('-', $returnUrl);
         $newUrl = explode('|', $urlRet['0']);
         /*$par = explode('|',$urlRet['1']);
         		$val = explode('|',$urlRet['2']);
         		$str ='';
         		for($i=0;$i<count($par);$i++) {
         			$str .= '&'.$par[$i].'='.Dispatcher::Instance()->Encrypt($val[$i]);
         		}*/
         $str = '';
         $return[0]['urlReturn'] = Dispatcher::Instance()->GetUrl($newUrl['0'], $newUrl['1'], $newUrl['2'], $newUrl['3']) . $str;
         $return[0]['label'] = Dispatcher::Instance()->Decrypt((string) $_GET['label']);
     } else {
         $msg = Messenger::Instance()->Receive(__FILE__);
         $return[0]['label'] = $msg[0][0];
         $return[0]['urlDelete'] = $msg[0][1];
         $return[0]['urlReturn'] = $msg[0][2];
         //$this->RedirectTo($return[0]['urlReturn']);
         $return[0]['message'] = '';
         $return[0]['emptydata'] = "YES";
     }
     return $return;
 }