本文整理汇总了PHP中wbModule::getModel方法的典型用法代码示例。如果您正苦于以下问题:PHP wbModule::getModel方法的具体用法?PHP wbModule::getModel怎么用?PHP wbModule::getModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wbModule
的用法示例。
在下文中一共展示了wbModule::getModel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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());
}
}
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例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;
}
示例8: 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;
}
示例9: 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;
}
示例10: 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;
}
示例11: 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;
}
示例12: 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;
}
示例13: cekValid
public function cekValid($param_name, $mmart_tahun)
{
$table =& wbModule::getModel('bds', 'p_parameter');
$param_id = $table->getIDbyName($param_name);
if (empty($param_id)) {
return '- Kesalahan Penulisan Jenis Pasar : ' . $param_name . '<br> ';
}
$isExist = $this->isExist($param_id, $mmart_tahun);
if ($isExist) {
return '- Data ' . $param_name . ' di Tahun ' . $mmart_tahun . ' sudah ada <br>';
}
return '';
}
示例14: read
/**
* read
* controler for get all items
*/
public static function read($args = array())
{
// Security check
//if (!wbSecurity::check('p_vat_type')) return;
// Get arguments from argument array
extract($args);
$start = wbRequest::getVarClean('start', 'int', 0);
$limit = wbRequest::getVarClean('limit', 'int', 50);
$sort = wbRequest::getVarClean('sort', 'str', 'p_region_id');
$dir = wbRequest::getVarClean('dir', 'str', 'ASC');
$query = wbRequest::getVarClean('query', 'str', '');
$p_region_id = wbRequest::getVarClean('p_region_id', 'int', 0);
$parent_id = wbRequest::getVarClean('parent_id', 'int', 0);
$description = wbRequest::getVarClean('description', 'str', '');
$data = array('items' => array(), 'total' => 0, 'success' => false, 'message' => '');
try {
$table =& wbModule::getModel('bds', 'p_sub_region');
//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}));
}
}
}
if (!empty($parent_id)) {
$table->setCriteria('parent_id = ', array($parent_id));
} else {
$table->setCriteria("parent_id = 749");
}
if (!empty($code)) {
$table->setCriteria('(code ILIKE ?)', array('%' . $code . '%'));
}
$query = $table->getDisplayFieldCriteria($query);
if (!empty($query)) {
$table->setCriteria($query);
}
$items = $table->getAll($start, $limit, $sort, $dir);
$total = $table->countAll();
$data['items'] = $items;
$data['total'] = $total;
$data['success'] = true;
} catch (Exception $e) {
$data['message'] = $e->getMessage();
}
return $data;
}
示例15: show
public static function show()
{
$tJalan =& wbModule::getModel('bds', 'd_jalan');
$jenis_jalan = wbRequest::getVarClean('jenis_jalan', 'int', 0);
//timestamp
$t = wbRequest::getVarClean('t', 'str', '');
if (empty($jenis_jalan)) {
exit;
}
$items = $tJalan->getAllByJenisJalan($jenis_jalan);
$data = array('items' => array(), 'total' => 0, 'success' => false, 'message' => '');
$data['items'] = $items;
$data['success'] = true;
return $data;
}