當前位置: 首頁>>代碼示例>>PHP>>正文


PHP wbModule類代碼示例

本文整理匯總了PHP中wbModule的典型用法代碼示例。如果您正苦於以下問題:PHP wbModule類的具體用法?PHP wbModule怎麽用?PHP wbModule使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了wbModule類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: main

    public static function main()
    {
        if (!wbUser::isLoggedIn()) {
            $redirecturl = wbModule::url('bds', 'bds', 'main');
            wbResponse::Redirect(wbModule::url('base', 'base', 'loginform', array('redirecturl' => urlencode($redirecturl))));
        }
        $loadjsmod = wbRequest::getVarClean('loadjsmod', 'str', '');
        wbPage::setPage('jspage');
        $userInfo = wbUser::getSession();
        $role = '';
        if (isset($userInfo['roles'][0]['role_name'])) {
            $role = strtolower($userInfo['roles'][0]['role_name']);
        }
        $script = <<<HEREDOC
    Webi.ROUTE_URL = "ws.php?type=json&module=bds";
    var _UNAME = "{$userInfo['user_name']}";
    var _RNAME = "{$userInfo['user_realname']}";
    var _GNAME = "{$role}";
HEREDOC;
        wbPage::addScriptCode($script);
        wbPage::addScript('modules/bds/views/script/properties.js');
        wbPage::addScript('modules/bds/views/script/GridPanel.js');
        wbPage::addScript('modules/bds/views/script/FormPanel.js');
        wbPage::addScript('modules/bds/views/script/ModulePanel.js');
        wbPage::addScript('modules/base/views/script/roles-jsloader.php');
        wbPage::addScript('modules/bds/views/script/jsloader.php');
        return array('loadjsmod' => $loadjsmod);
    }
開發者ID:rayminami,項目名稱:cc_webservice,代碼行數:28,代碼來源:bds_controller.php

示例2: angin

 public static function angin()
 {
     $sort = wbRequest::getVarClean('sort', 'str', 't_cuaca_id');
     $dir = wbRequest::getVarClean('dir', 'str', 'DESC');
     $query = wbRequest::getVarClean('query', 'str', '');
     $tahun = wbRequest::getVarClean('tahun', 'int', 0);
     $jenis = wbRequest::getVarClean('jenis', 'int', 0);
     try {
         $table =& wbModule::getModel('bds', 't_cuaca');
         //Set default criteria. You can override this if you want
         foreach ($table->fields as $key => $field) {
             if (!empty(${$key})) {
                 // <-- Perhatikan simbol $$
                 if ($field['type'] == 'str') {
                     $table->setCriteria($table->getAlias() . $key . $table->likeOperator . '?', array(${$key}));
                 } else {
                     $table->setCriteria($table->getAlias() . $key . ' = ?', array(${$key}));
                 }
             }
         }
         $query = $table->getDisplayFieldCriteria($query);
         if (!empty($query)) {
             $table->setCriteria($query);
         }
         $items = $table->getAll(0, -1, $sort, $dir);
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
     }
     $data = array('items' => array(), 'total' => 0, 'success' => false, 'message' => '');
     $data['items'] = $items;
     $data['success'] = true;
     return $data;
 }
開發者ID:rayminami,項目名稱:cc_webservice,代碼行數:33,代碼來源:statistik_cuaca_controller.php

示例3: wbMain

function wbMain()
{
    wbCore::init();
    list($module, $class, $method) = wbRequest::getController();
    // theme override
    $theme = wbRequest::getVarClean('theme');
    if (!empty($theme)) {
        wbPage::setTheme($theme);
    }
    $page = wbRequest::getVarClean('page');
    if (!empty($page)) {
        wbPage::setPage($page);
    }
    ob_start();
    $modView = wbModule::getView($module, $class, $method);
    if (ob_get_length() > 0) {
        $rawOutput = ob_get_contents();
        $modView = 'The following lines were printed in raw mode by module, however this
                      should not happen. The module is probably directly calling functions
                      like echo, print, or printf. Please modify the module to exclude direct output.
                      The module is violating Webi architecture principles.<br /><br />' . $rawOutput . '<br /><br />This is the real module output:<br /><br />' . $modView;
    }
    ob_end_clean();
    wbPage::render($modView);
}
開發者ID:wiliamdecosta,項目名稱:ifalconi_oci_responsive,代碼行數:25,代碼來源:index.php

示例4: afterWrite

 public function afterWrite()
 {
     if ($this->actionType == 'CREATE') {
         $table_inbox =& wbModule::getModel('bds', 't_message_inbox');
         $items = $this->record;
         try {
             // begin transaction block
             $table_inbox->dbconn->BeginTrans();
             // insert master
             $items[$table_inbox->pkey] = $table_inbox->GenID();
             unset($items['t_message_outbox_id']);
             $table_inbox->record = $items;
             $table_inbox->record['creation_date'] = date('Y-m-d h:i:s');
             $table_inbox->record['update_date'] = date('Y-m-d');
             $table_inbox->record['message_status'] = 'U';
             //print_r($table_inbox->record);
             //print_r($items);
             //exit;
             $table_inbox->create();
             // insert detail
             // all ok, commit transaction
             $table_inbox->dbconn->CommitTrans();
         } catch (Exception $e) {
             // something happen, rollback transaction
             $table_inbox->dbconn->RollbackTrans();
             throw new Exception($e->getMessage());
         }
     }
 }
開發者ID:rayminami,項目名稱:mpd-wp,代碼行數:29,代碼來源:t_message_outbox.php

示例5: getItem

 public static function getItem()
 {
     $jsonItems = wbRequest::getVarClean('jsonItems', 'str', '');
     $item = wbUtil::jsonDecode($jsonItems);
     $tTernak =& wbModule::getModel('bds', 't_ternak');
     $itemTernak = $tTernak->getItem($item['tahun'], $item['param_id']);
     $data = array('items' => array(), 'total' => 0, 'success' => true, 'message' => '');
     $data['items'] = $itemTernak;
     return $data;
 }
開發者ID:rayminami,項目名稱:cc_webservice,代碼行數:10,代碼來源:statistik_peternakan_controller.php

示例6: getItem

 public static function getItem()
 {
     $jsonItems = wbRequest::getVarClean('jsonItems', 'str', '');
     $item = wbUtil::jsonDecode($jsonItems);
     $tArmada =& wbModule::getModel('bds', 't_armada');
     $itemArmada = $tArmada->getItem($item['tahun'], $item['trayek_id']);
     $data = array('items' => array(), 'total' => 0, 'success' => true, 'message' => '');
     $data['items'] = $itemArmada;
     return $data;
 }
開發者ID:rayminami,項目名稱:cc_webservice,代碼行數:10,代碼來源:statistik_rute_angkutan_controller.php

示例7: tampil

 public static function tampil()
 {
     $tahun = wbRequest::getVarClean('tahun', 'int', 0);
     $daerah =& wbModule::getModel('bds', 'd_pasar');
     $items = $daerah->rekapPasar($tahun);
     $data = array('items' => array(), 'total' => 0, 'success' => false, 'message' => '');
     $data['items'] = $items;
     $data['success'] = true;
     return $data;
 }
開發者ID:rayminami,項目名稱:cc_webservice,代碼行數:10,代碼來源:statistik_pasar_daerah_controller.php

示例8: pendidikan

 public static function pendidikan()
 {
     $tParameter =& wbModule::getModel('bds', 'p_parameter');
     $tParameter->setCriteria('p_parameter_type.ptype_code ILIKE ?', 'PENDIDIKAN');
     $items = $tParameter->getAll(0, -1, 'param_listing_no', 'ASC');
     $data = array('items' => array(), 'total' => 0, 'success' => false, 'message' => '');
     $data['items'] = $items;
     $data['success'] = true;
     return $data;
 }
開發者ID:rayminami,項目名稱:mpd-wp,代碼行數:10,代碼來源:statistik_penduduk_controller.php

示例9: tampil

 public static function tampil()
 {
     $tahun = wbRequest::getVarClean('tahun', 'int', 0);
     $wilayah =& wbModule::getModel('bds', 'p_parameter');
     $items = $wilayah->pbb_sppt($tahun);
     $data = array('items' => array(), 'total' => 0, 'success' => false, 'message' => '');
     $data['items'] = $items;
     $data['success'] = true;
     return $data;
 }
開發者ID:rayminami,項目名稱:mpd-wp,代碼行數:10,代碼來源:statistik_pbb_controller.php

示例10: getProduksiKomoditas

 public static function getProduksiKomoditas()
 {
     $jsonItems = wbRequest::getVarClean('jsonItems', 'str', '');
     $item = wbUtil::jsonDecode($jsonItems);
     $tProduksi =& wbModule::getModel('bds', 't_agr_komod_prod');
     $itemProduksi = $tProduksi->getProduksiKomoditas($item['tahun'], $item['d_agr_komiditas_id']);
     $data = array('items' => array(), 'total' => 0, 'success' => true, 'message' => '');
     $data['items'] = $itemProduksi;
     return $data;
 }
開發者ID:rayminami,項目名稱:mpd-wp,代碼行數:10,代碼來源:statistik_pertanian_controller.php

示例11: getJumlahPerKecamatan

 public static function getJumlahPerKecamatan()
 {
     $jsonItems = wbRequest::getVarClean('jsonItems', 'str', '');
     $item = wbUtil::jsonDecode($jsonItems);
     $tPuskesmas =& wbModule::getModel('bds', 'd_puskesmas');
     $jumlah = $tPuskesmas->getJumlahPerKecamatan($item['wilayah_id']);
     $data = array('items' => array(), 'total' => 0, 'success' => true, 'message' => '');
     $data['items'] = $jumlah;
     return $data;
 }
開發者ID:rayminami,項目名稱:cc_webservice,代碼行數:10,代碼來源:dashboard_puskesmas_controller.php

示例12: cek

 public static function cek()
 {
     $wilayah =& wbModule::getModel('bds', 'p_wilayah');
     $param[0] = array('value' => '94', 'field' => 'wilayah_id');
     $param[1] = array('value' => '88', 'field' => 'wilayah_pid');
     $param[1] = array('value' => '42', 'field' => 'wilayah_status');
     $items = $wilayah->uniqueAll('bds_p_wilayah', $param);
     echo $items;
     exit;
 }
開發者ID:rayminami,項目名稱:mpd-wp,代碼行數:10,代碼來源:statistik_pemerintahan_controller.php

示例13: show_per_jenis

 public static function show_per_jenis()
 {
     $tParameter =& wbModule::getModel('bds', 'p_parameter');
     $tParameter->setCriteria('p_parameter_type.ptype_code ILIKE ?', array('JENIS RUMAH SAKIT'));
     $itemsJenis = $tParameter->getAll(0, -1, 'param_listing_no', 'ASC');
     $data = array('items' => array(), 'total' => 0, 'success' => false, 'message' => '');
     $data['items'] = $itemsJenis;
     $data['success'] = true;
     return $data;
 }
開發者ID:rayminami,項目名稱:mpd-wp,代碼行數:10,代碼來源:dashboard_rumahsakit_controller.php

示例14: ws_proccess

function ws_proccess($search, $getParams, $controller, $postParams, $jsonItems, $start, $limit)
{
    $GLOBALS["Webi_PageTime"] = microtime(true);
    include 'lib/bootstrap.php';
    /* Load Webi Core */
    sys::import('webi.core');
    wbCore::init();
    $_GET['jsonItems'] = $jsonItems;
    if (!empty($getParams)) {
        $getParams =& wbUtil::jsonDecode($getParams);
    } else {
        $getParams = array();
    }
    if (json_decode($postParams) > 0) {
        $postParams = json_decode($postParams);
    } else {
        $postParams = array();
    }
    $controller =& wbUtil::jsonDecode($controller);
    $type = $controller['type'];
    if (!empty($getParams)) {
        foreach ($getParams as $key => $value) {
            $_GET[$key] = $value;
        }
    }
    if (!empty($postParams)) {
        foreach ($postParams as $key => $value) {
            $_POST[$key] = $value;
        }
    }
    $_GET['module'] = $controller['module'];
    $_GET['class'] = $controller['class'];
    $_GET['method'] = $controller['method'];
    list($module, $class, $method) = wbRequest::getController();
    $callback = wbRequest::getVarClean('callback');
    if (!wbModule::isAvailable($module, $class, $type)) {
        header("HTTP/1.1 400 Bad Request");
        return;
    }
    try {
        $result = wbModule::call($module, $class, $method, array(), $type);
    } catch (Exception $e) {
        $result = array('items' => array(), 'total' => 0, 'success' => false, 'message' => $e->getMessage());
    }
    $return = array();
    $return['success'] = $result['success'];
    $return['message'] = $result['message'];
    $return['total'] = (int) $result['total'];
    $return['data'] = $result['items'];
    $return['current'] = (int) $result['current'];
    $return['rowCount'] = (int) $result['rowCount'];
    $return = base64_encode(serialize($return));
    return $return;
}
開發者ID:wiliamdecosta,項目名稱:ifalconi_ws_oci_responsive,代碼行數:54,代碼來源:wsdl.php

示例15: tampil

 public static function tampil()
 {
     $tahun = wbRequest::getVarClean('tahun', 'int', 0);
     $tahun_akhir = wbRequest::getVarClean('tahun_akhir', 'int', 0);
     $industri =& wbModule::getModel('bds', 't_industri');
     $items = $industri->rekapIndustriTahun($tahun, $tahun_akhir);
     $data = array('items' => array(), 'total' => 0, 'success' => false, 'message' => '');
     $data['items'] = $items;
     $data['success'] = true;
     return $data;
 }
開發者ID:rayminami,項目名稱:cc_webservice,代碼行數:11,代碼來源:statistik_industri_controller.php


注:本文中的wbModule類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。