本文整理汇总了PHP中Application_Model_DbTable_DbGlobal类的典型用法代码示例。如果您正苦于以下问题:PHP Application_Model_DbTable_DbGlobal类的具体用法?PHP Application_Model_DbTable_DbGlobal怎么用?PHP Application_Model_DbTable_DbGlobal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Application_Model_DbTable_DbGlobal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addProgramName
public function addProgramName($data = null, $type = null)
{
$_title = new Zend_Dojo_Form_Element_TextBox('title');
$_title->setAttribs(array('dojoType' => $this->tvalidate, 'required' => 'true', 'class' => 'fullside'));
$_db = new Application_Model_DbTable_DbGlobal();
if (!empty($type)) {
$rows = $_db->getServiceType(2);
} else {
$rows = $_db->getServiceType(1);
}
//array_unshift($rows,array('id' => '-1',"title"=>$this->tr->translate("ADD")) );
$opt = "";
if (!empty($rows)) {
foreach ($rows as $row) {
$opt[$row['id']] = $row['title'];
}
}
$_service_name = new Zend_Dojo_Form_Element_FilteringSelect("type");
$_service_name->setMultiOptions($opt);
$_service_name->setAttribs(array('dojoType' => $this->filter, 'required' => 'true', 'class' => 'fullside'));
$_desc = new Zend_Dojo_Form_Element_Textarea('desc');
$_desc->setAttribs(array('dojoType' => $this->tarea, 'class' => 'fullside', 'style' => 'width:96%;min-height:50px;'));
$_status = new Zend_Dojo_Form_Element_FilteringSelect('status_program');
$_status->setAttribs(array('dojoType' => $this->filter, 'class' => 'fullside'));
$_status_opt = array(1 => $this->tr->translate("ACTIVE"), 2 => $this->tr->translate("DACTIVE"));
$_status->setMultiOptions($_status_opt);
if (!empty($data)) {
$_title->setValue($data['title']);
$_desc->setValue($data['desc']);
}
$this->addElements(array($_service_name, $_title, $_desc, $_status));
return $this;
}
示例2: editAction
public function editAction()
{
$db = new agreement_Model_DbTable_DbAgreement();
if ($this->getRequest()->isPost()) {
$data = $this->getRequest()->getPost();
try {
$db->addAgreement($data);
Application_Form_FrmMessage::Sucessfull("EDIT_SUCCESS", "/agreement/imdex/add");
} catch (Exception $e) {
Application_Form_FrmMessage::message("Application Error");
Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
}
}
$id = $this->getRequest()->getParam('id');
if (empty($id)) {
$this->_redirect("/agreement");
}
$this->view->row_agreement = $db->getAgreementById($id);
print_r($db->getAgreementById($id));
$db = new Application_Model_DbTable_DbGlobal();
$this->view->rs_tax = $db->getAllTax();
$owner = $db->getAllNameOwner();
$this->view->country = $db->getAllCountry();
$this->view->rows_owner = $owner;
$cus = new Booking_Model_DbTable_DbBooking();
$rows_cus = $cus->getIdNamecustomer();
$this->view->rows_cus = $rows_cus;
$row_vehicle = $cus->getVehiclerefNo();
$this->view->row_vehicle = $row_vehicle;
$db = new agreement_Model_DbTable_DbAgreement();
$this->view->rsbooking = $db->getAllBookingNumber();
}
示例3: FrmBrand
public function FrmBrand($frm = null)
{
$db = new Application_Model_DbTable_DbGlobal();
$status = new Zend_Form_Element_Select('status');
$_arr_status = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
$status->setMultiOptions($_arr_status);
$status->setAttribs(array('class' => 'form-control validate[required]'));
$parent = new Zend_Form_Element_Select("parent_id");
$parent->setAttribs(array('class' => 'select', 'style' => 'width:100%'));
$category = $db->getAllBrand();
if (empty($category)) {
$option_category = array('0' => 'No Brand To Select');
} else {
$option_category = array('0' => 'Choose Brand');
foreach ($category as $row_cat) {
$option_category[$row_cat["brand_id"]] = $row_cat["name_kh"];
}
}
$parent->setMultiOptions($option_category);
$brand_en = new Zend_Form_Element_Text("name_en");
$brand_en->setAttribs(array('class' => 'validate[required]', 'placeholder' => ' Brand Name In English', "OnChange" => "GetBrandName(1)"));
$brand_km = new Zend_Form_Element_Text("name_km");
$brand_km->setAttribs(array('class' => 'validate[required]', 'placeholder' => ' Brand Name In Khmer', "OnChange" => "GetBrandName(2)"));
$icon = new Zend_Form_Element_File("icon");
$this->addElements(array($icon, $status, $brand_en, $brand_km, $parent));
if ($frm != "") {
$parent->setValue($frm["parent_id"]);
$brand_en->setValue($frm["name_en"]);
$brand_km->setValue($frm["name_kh"]);
$status->setValue($frm["status"]);
}
return $this;
}
示例4: FrmAddSchool
public function FrmAddSchool($data = null)
{
$_classname = new Zend_Dojo_Form_Element_TextBox('schoolname');
$_classname->setAttribs(array('dojoType' => $this->tvalidate, 'required' => 'true', 'class' => 'fullside'));
$_province = new Zend_Dojo_Form_Element_FilteringSelect('province');
$_province->setAttribs(array('dojoType' => $this->filter, 'class' => 'fullside'));
$_db = new Application_Model_DbTable_DbGlobal();
$rows_school = $_db->getGlobalDb("SELECT province_id,province_en_name FROM rms_province ");
$opt_school = "";
if (!empty($rows_school)) {
foreach ($rows_school as $row) {
$opt_school[$row['province_id']] = $row['province_en_name'];
}
}
$_province->setMultiOptions($opt_school);
$_status = new Zend_Dojo_Form_Element_FilteringSelect('status');
$_status->setAttribs(array('dojoType' => $this->filter, 'class' => 'fullside'));
$_status_opt = array(1 => $this->tr->translate("ACTIVE"), 2 => $this->tr->translate("DACTIVE"));
$_status->setMultiOptions($_status_opt);
$_submit = new Zend_Dojo_Form_Element_SubmitButton('submit');
$_submit->setLabel("save");
$id = new Zend_Form_Element_Hidden('id');
if (!empty($data)) {
$_classname->setValue($data['school_name']);
$_status->setValue($data['status']);
$_province->setValue($data['province_id']);
$id->setValue($data['id']);
}
$this->addElements(array($_classname, $_status, $_submit, $_province, $id));
return $this;
}
示例5: addMeasure
public function addMeasure($data)
{
$db = new Application_Model_DbTable_DbGlobal();
$_arr = array("measure_name" => $data["measure_name"]);
$result = $db->addRecord($_arr, "tb_measure");
return $result;
}
示例6: FrmGeneraljurnal
public function FrmGeneraljurnal($data = null)
{
$Brance = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
$Brance->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true, 'onchange' => 'getJurnalcode();'));
$db = new Application_Model_DbTable_DbGlobal();
$rows = $db->getAllBranchName();
$options = '';
if (!empty($rows)) {
foreach ($rows as $row) {
$options[$row['br_id']] = $row['branch_namekh'];
}
}
$rows = $db->getAllBranchName();
$options = array('' => '---Select Branch---');
if (!empty($rows)) {
foreach ($rows as $row) {
$options[$row['br_id']] = $row['branch_namekh'];
}
}
$Brance->setMultiOptions($options);
$_currency_type = new Zend_Dojo_Form_Element_FilteringSelect('currency_type');
$_currency_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
$opt = $db->getVewOptoinTypeByType(15, 1, 3, 1);
$_currency_type->setMultiOptions($opt);
$_currency_type->setValue(2);
$parent = new Zend_Dojo_Form_Element_FilteringSelect('parent');
$parent->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true, 'onchange' => 'getAllAccountNameByParents();'));
$db = new Accounting_Model_DbTable_DbChartaccount();
$option = $db->getAllchartaccount(3, 1);
$parent->setMultiOptions($option);
$Add_Date = new Zend_Dojo_Form_Element_DateTextBox('add_date');
$Add_Date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside', 'required' => true));
$Add_Date->setValue(date('Y-m-d'));
$Account_Number = new Zend_Dojo_Form_Element_TextBox('journal_code');
$Account_Number->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'readOnly' => 'readOnly', 'required' => 'true'));
$invoice = new Zend_Dojo_Form_Element_TextBox('invoice');
$invoice->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
$Note = new Zend_Dojo_Form_Element_TextBox('note');
$Note->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
$Debit = new Zend_Dojo_Form_Element_NumberTextBox('debit');
$Debit->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => 1, 'readonly' => 'readonly'));
// $Debit->setValue(0);
$Credit = new Zend_Dojo_Form_Element_NumberTextBox('credit');
$Credit->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => 1, 'readonly' => 'readonly'));
$id = new Zend_Form_Element_Hidden('id');
if ($data != null) {
$id->setValue($data['id']);
$Brance->setValue($data['branch_id']);
$Account_Number->setValue($data['journal_code']);
$invoice->setValue($data['receipt_number']);
$_currency_type->setValue($data['currency_id']);
$Note->setValue($data['note']);
$Add_Date->setValue($data['date']);
$Debit->setValue($data['debit']);
$Credit->setValue($data['credit']);
}
// $Credit->setValue(0);
$this->addElements(array($id, $invoice, $_currency_type, $parent, $Add_Date, $Account_Number, $Note, $Debit, $Credit, $Brance));
return $this;
}
示例7: editAction
public function editAction()
{
if ($this->getRequest()->isPost()) {
$data = $this->getRequest()->getPost();
//print_r($data);exit();
try {
$db_make = new Vehicle_Model_DbTable_DbMake();
if (!empty($data['save_close'])) {
$db_make->updateMake($data);
Application_Form_FrmMessage::Sucessfull($this->tr->translate("INSERT_SUCCESS"), self::REDIRECT_URL_ADD_CLOSE);
}
} catch (Exception $e) {
Application_Form_FrmMessage::message($this->tr->translate("INSERT_FAIL"));
$err = $e->getMessage();
Application_Model_DbTable_DbUserLog::writeMessageError($err);
}
}
$id = $this->getRequest()->getParam('id');
$db_make = new Vehicle_Model_DbTable_DbMake();
$rows = $db_make->getMakeById($id);
$this->view->row = $rows;
$db = new Application_Model_DbTable_DbGlobal();
$status = $db->getViews(2);
$this->view->status_view = $status;
}
示例8: SelectItem
public function SelectItem()
{
$db = $this->getAdapter();
$user_info = new Application_Model_DbTable_DbGetUserInfo();
$result = $user_info->getUserInfo();
$db = new Application_Model_DbTable_DbGlobal();
$productSql = "SELECT\n\t\t\t\tp.pro_id\n\t\t\t\t,p.item_name\n\t\t\t\t,p.item_code\n\t\t\t\t,(SELECT g.Name FROM tb_category AS g WHERE g.CategoryId = (SELECT cate_id FROM tb_product WHERE pro_id = pl.`pro_id` LIMIT 1)) AS Cate_name\n\t\t\t\t,(SELECT b.Name FROM tb_branch AS b WHERE b.branch_id = (SELECT brand_id FROM tb_product WHERE pro_id = pl.`pro_id` LIMIT 1 )) AS Branch\n\t\t\t\t,(SELECT lo.Name FROM tb_sublocation AS lo WHERE lo.LocationId = pl.LocationId LIMIT 1) AS LocationName\n\t\t\t\t,pl.qty\n\t\t\tFROM tb_prolocation AS pl,tb_product AS p WHERE pl.`pro_id`=p.pro_id ";
$str_condition = " AND pl.LocationId";
$productSql .= $db->getAccessPermission($result["level"], $str_condition, $result["location_id"]);
if ($this->getRequest()->isPost()) {
$post = $this->getRequest()->getPost();
$productName = $this->getRequest()->getParam('s_name');
if ($post['LocationId'] !== '' and $post['LocationId'] != 0) {
$productSql .= " AND pl.LocationId = " . trim($post['LocationId']);
}
if ($post['p_name'] != '') {
$productSql .= " AND p.item_name LIKE '%" . trim($post['p_name']) . "%'";
$productSql .= " OR p.item_code LIKE '%" . trim($post['p_name']) . "%'";
}
if ($post['category_id'] !== '' and $post['category_id'] != 0) {
//echo $post['category_id']; exit();
$productSql .= " AND p.cate_id =" . trim($post['category_id']);
}
if ($post['branch_id'] !== '' and $post['branch_id'] != 0) {
$productSql .= " AND p.brand_id =" . trim($post['branch_id']);
}
}
//echo $productSql;exit();
$productSql .= " ORDER BY p.item_name,p.cate_id DESC";
return $rows = $db_rs->fetchAll($productSql);
}
示例9: editAction
public function editAction()
{
$db_model = new Driverguide_Model_DbTable_DbDriver();
if ($this->getRequest()->isPost()) {
$data = $this->getRequest()->getPost();
try {
$id = $db_model->updateDriver($data);
Application_Form_FrmMessage::Sucessfull("EDIT_SUCCESSS", "/driverguide");
} catch (Exception $e) {
Application_Form_FrmMessage::message("Application Error");
Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
}
}
$db = new Application_Model_DbTable_DbGlobal();
$client_type = $db->getclientdtype();
array_unshift($client_type, array('id' => -1, 'name' => '---Add New ---'));
$this->view->clienttype = $client_type;
$dbpop = new Application_Form_FrmPopupGlobal();
$this->view->frm_popup_clienttype = $dbpop->frmPopupclienttype();
$id = $this->getRequest()->getParam("id");
$row = $db_model->getDriverById($id);
$this->view->rs = $row;
$fm = new Group_Form_FrmClient();
$frm = $fm->FrmaddGuide($row);
Application_Model_Decorator::removeAllDecorator($frm);
$this->view->frm_client = $frm;
}
示例10: init
public function init()
{
$request = Zend_Controller_Front::getInstance()->getRequest();
$db = new Application_Model_DbTable_DbGlobal();
/////////////Filter stock/////////////////
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
$nameElement = new Zend_Form_Element_Text('s_name');
$nameValue = $request->getParam('s_name');
$nameElement->setValue($nameValue);
$this->addElement($nameElement);
$phonevalue = $request->getParam('phone');
$phoneElement = new Zend_Form_Element_Text('phone');
$phoneElement->setValue($phonevalue);
$this->addElement($phoneElement);
$rs = $db->getGlobalDb('SELECT LocationId,Name FROM tb_sublocation ORDER BY LocationId DESC ');
$options = array('' => $tr->translate('Please_Select'));
$agentValue = $request->getParam('stock_location');
foreach ($rs as $read) {
$options[$read['LocationId']] = $read['Name'];
}
$sale_agent = new Zend_Form_Element_Select('stock_location');
$sale_agent->setMultiOptions($options);
$sale_agent->setAttribs(array('id' => 'LocationId', 'class' => 'demo-code-language'));
$sale_agent->setValue($agentValue);
$this->addElement($sale_agent);
return $this;
}
示例11: editAction
public function editAction()
{
if ($this->getRequest()->isPost()) {
try {
$_data = $this->getRequest()->getPost();
$_dbmodel = new Application_Model_DbTable_DbDept();
$_dbmodel->UpdateDepartment($_data);
Application_Form_FrmMessage::Sucessfull("ការកៃប្រែដោយជោគជ័យ !", "/global/faculty/index");
//$this->_redirect("");
} catch (Exception $e) {
$err = $e->getMessage();
Application_Form_FrmMessage::message("Application Error!");
Application_Model_DbTable_DbUserLog::writeMessageError($err);
echo $e->getMessage();
exit;
}
}
$id = $this->getRequest()->getParam("id");
$_db = new Application_Model_DbTable_DbGlobal();
$_row = $_db->getDeptById($id);
$frm = new Application_Form_FrmOther();
$frm->FrmAddDept($_row);
Application_Model_Decorator::removeAllDecorator($frm);
$this->view->frm_dept = $frm;
}
示例12: indexAction
public function indexAction()
{
try {
$db = new Other_Model_DbTable_DbZone();
if ($this->getRequest()->isPost()) {
$search = $this->getRequest()->getPost();
} else {
$search = array('adv_search' => '', 'search_status' => -1);
}
$rs_rows = $db->getAllZoneArea($search);
$glClass = new Application_Model_GlobalClass();
$rs_rows = $glClass->getImgActive($rs_rows, BASE_URL, true);
$list = new Application_Form_Frmtable();
$collumns = array("ZONE_NAME", "ZONE_NUMBER", "DATE", "STATUS", "BY");
$link = array('module' => 'other', 'controller' => 'zone', 'action' => 'edit');
$this->view->list = $list->getCheckList(0, $collumns, $rs_rows, array('zone_name' => $link, 'zone_num' => $link));
} catch (Exception $e) {
Application_Form_FrmMessage::message("Application Error");
echo $e->getMessage();
Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
}
$frm = new Other_Form_FrmZone();
$frm_co = $frm->FrmAddZone();
Application_Model_Decorator::removeAllDecorator($frm_co);
$this->view->frm_zone = $frm_co;
$db = new Application_Model_DbTable_DbGlobal();
$this->view->district = $db->getAllDistricts();
$this->view->commune_name = $db->getCommune();
$this->view->result = $search;
}
示例13: indexAction
function indexAction()
{
$dbbooking = new Application_Model_DbTable_Dbstuffrental();
$db_globle = new Application_Model_DbTable_DbGlobal();
if ($this->getRequest()->isPost()) {
$post = $this->getRequest()->getPost();
if (isset($post["term_condiction"])) {
$dbbooking->createSessionStuffBooking($post, 3);
//print_r("test");exit();
$this->_redirect("stuffbooking/index");
} elseif (isset($post["confirm_book"])) {
$dbbooking->createSessionStuffBooking($post, 4);
$this->_redirect("stuffbooking/index");
}
}
$customer_session = new Zend_Session_Namespace('customer');
$user_session = $customer_session->customer_session;
if (!empty($user_session)) {
$customer_user_session = $user_session;
$customer_user = $customer_session->customer_id;
$this->view->user_name = $customer_session->customer_name;
$this->view->user_info = $customer_session->user_info;
} else {
$customer_user_session = 0;
}
$db = new Application_Model_DbTable_Dbbookingtaxi();
$session = new Zend_Session_Namespace('stuffbooking');
$this->view->bookinginfo = $session;
$this->view->producttermcomdiction = $db_globle->getAllParameter('producttermcomdiction');
$frmbooks = new Application_Form_FrmBooking();
$frmbooking = $frmbooks->FromBooking();
Application_Model_Decorator::removeAllDecorator($frmbooking);
$this->view->frmbooking = $frmbooking;
$this->view->user_session = $customer_user_session;
}
示例14: rptVillageAction
function rptVillageAction(){
$db = new Report_Model_DbTable_DbParamater();
$this->view->village_list = $db->getAllVillage();
//print_r($db->getAllstaff());
$key = new Application_Model_DbTable_DbKeycode();
$this->view->data=$key->getKeyCodeMiniInv(TRUE);
if($this->getRequest()->isPost()){
$search = $this->getRequest()->getPost();
//
if(isset($search['btn_search'])){
//print_r($search);exit();
$this->view->village_list = $db->getAllVillage($search);
}else{
$collumn = array("vill_id","village_namekh","village_name","displayby","commune_name","district_name","province_en_name","modify_date","status","user_name");
$this->exportFileToExcel('ln_village',$db->getAllVillage(),$collumn);
}
}else {
$search = array('adv_search' => '',
'search_status' => -1,
'province_name'=>0,
'district_name'=>'',
'commune_name'=>'');
}
$frm = new Other_Form_FrmVillage();
$frms = $frm->FrmAddVillage();
Application_Model_Decorator::removeAllDecorator($frms);
$this->view->frm_village= $frms;
$db= new Application_Model_DbTable_DbGlobal();
$this->view->district = $db->getAllDistricts();
$this->view->commune_name = $db->getCommune();
$this->view->result = $search;
}
示例15: editAction
public function editAction()
{
$db = new Other_Model_DbTable_DbVillage();
if ($this->getRequest()->isPost()) {
$_data = $this->getRequest()->getPost();
try {
$db->addVillage($_data);
Application_Form_FrmMessage::Sucessfull("ការបញ្ចូលជោគជ័យ !", '/other/Village');
} catch (Exception $e) {
Application_Form_FrmMessage::message("ការបញ្ចូលមិនជោគជ័យ");
$err = $e->getMessage();
Application_Model_DbTable_DbUserLog::writeMessageError($err);
}
}
$id = $this->getRequest()->getParam("id");
$row = $db->getVillageById($id);
$this->view->row = $row;
if (empty($row)) {
$this->_redirect('other/Village');
}
$fm = new Other_Form_FrmVillage();
$frm = $fm->FrmAddVillage($row);
Application_Model_Decorator::removeAllDecorator($frm);
$this->view->frm_village = $frm;
$db = new Application_Model_DbTable_DbGlobal();
$this->view->district = $db->getAllDistricts();
$this->view->commune_name = $db->getCommune();
}