本文整理汇总了PHP中Application_Model_DbTable_DbGlobal::getAllProCategories方法的典型用法代码示例。如果您正苦于以下问题:PHP Application_Model_DbTable_DbGlobal::getAllProCategories方法的具体用法?PHP Application_Model_DbTable_DbGlobal::getAllProCategories怎么用?PHP Application_Model_DbTable_DbGlobal::getAllProCategories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application_Model_DbTable_DbGlobal
的用法示例。
在下文中一共展示了Application_Model_DbTable_DbGlobal::getAllProCategories方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FrmProCate
public function FrmProCate($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->getAllProCategories();
if (empty($category)) {
$option_category = array('' => 'No Category To Select');
} else {
$option_category = array('' => 'Choose Category');
foreach ($category as $row_cat) {
$option_category[$row_cat["cat_id"]] = $row_cat["cat_name_km"];
}
}
$parent->setMultiOptions($option_category);
$cat_name_en = new Zend_Form_Element_Text("name_en");
$cat_name_en->setAttribs(array('class' => 'validate[required]', 'placeholder' => ' Category Name In English', "OnChange" => "GetCatName(1)"));
$cat_name_km = new Zend_Form_Element_Text("name_km");
$cat_name_km->setAttribs(array('class' => 'validate[required]', 'placeholder' => ' Category Name In Khmer', "OnChange" => "GetCatName(2)"));
$icon = new Zend_Form_Element_File("icon");
$this->addElements(array($icon, $status, $cat_name_en, $cat_name_km, $parent));
if ($frm != "") {
$parent->setValue($frm["parent_id"]);
$cat_name_en->setValue($frm["cat_name_en"]);
$cat_name_km->setValue($frm["cat_name_km"]);
$status->setValue($frm["status"]);
}
return $this;
}
示例2: FrmProCate
public function FrmProCate($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]'));
$id_code = new Zend_Form_Element_Text('id_code');
$id_code->setAttribs(array('class' => 'form-control', "readonly" => ""));
$code = product_Model_DbTable_DbProduct::getCallteralCode();
$id_code->setValue($code);
$cat_id = new Zend_Form_Element_Select("cat_id");
$cat_id->setAttribs(array('class' => 'select', 'style' => 'width:100%'));
$category = $db->getAllProCategories();
$option_category = array(0 => 'Choose Category');
foreach ($category as $row_cat) {
$option_category[$row_cat["cat_id"]] = $row_cat["cat_name_km"] . " - " . $row_cat["cat_name_en"];
}
$cat_id->setMultiOptions($option_category);
$cat_name_en = new Zend_Form_Element_Text("name_en");
$cat_name_en->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'Name In English', "OnChange" => "GetCatName(1)"));
$currency = new Zend_Form_Element_Select("currency");
$currency->setAttribs(array('class' => 'form-control validate[required]'));
$dbp = new product_Model_DbTable_DbProduct();
$currencys = $dbp->getAllPro();
$option_currency = array(0 => 'Choose Currency');
foreach ($currencys as $row_currency) {
$option_currency[$row_currency["cu_id"]] = $row_currency["cu_name_km"] . " - " . $row_currency["cu_name_en"];
}
$currency->setMultiOptions($option_currency);
$price = new Zend_Form_Element_Text("price");
$price->setAttribs(array('class' => 'validate[required]'));
$description = new Zend_Form_Element_Textarea("description");
$cat_name_km = new Zend_Form_Element_Text("name_km");
$cat_name_km->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'Name In Khmer', "OnChange" => "GetCatName(2)"));
$icon = new Zend_Form_Element_File("icon");
$this->addElements(array($description, $price, $icon, $status, $cat_name_en, $cat_name_km, $cat_id, $id_code, $currency));
if ($frm != "") {
$cat_id->setValue($frm["cat_id"]);
$cat_name_en->setValue($frm["pro_name_en"]);
$cat_name_km->setValue($frm["pro_name_km"]);
$status->setValue($frm["status"]);
$currency->setValue($frm["cu_id"]);
$price->setValue($frm["price_out"]);
$description->setValue($frm["description"]);
}
return $this;
}
示例3: frmSearch
public function frmSearch($data = null)
{
$request = Zend_Controller_Front::getInstance()->getRequest();
$db = new Application_Model_DbTable_DbGlobal();
$search_text = new Zend_Form_Element("txt_search");
$search_text->setValue($request->getParam("txt_search"));
$cat_id = new Zend_Form_Element_Select("cat_id");
$cat_id->setAttribs(array('class' => 'select', 'style' => 'width:100%'));
$category = $db->getAllProCategories();
$option_category = array(0 => $this->tr->translate("CHOOSE_CATEGORY"));
foreach ($category as $row_cat) {
$option_category[$row_cat["cat_id"]] = $row_cat["cat_name_km"] . " - " . $row_cat["cat_name_en"];
}
$cat_id->setMultiOptions($option_category);
$cat_id->setValue($request->getParam("cat_id"));
$brand = new Zend_Form_Element_Select("brand");
$brand->setAttribs(array('class' => 'select', 'style' => 'width:100%'));
$row_brand = $db->getAllBrand();
$option_brand = array(0 => $this->tr->translate("CHOOSE_BRAND"));
foreach ($row_brand as $rs) {
$option_brand[$rs["brand_id"]] = $rs["name_kh"] . " - " . $rs["name_en"];
}
$brand->setMultiOptions($option_brand);
$brand->setValue($request->getParam("brand"));
if ($data != null) {
}
return $this->addElements(array($search_text, $cat_id, $brand));
}
示例4: FrmSearch
public function FrmSearch($data = null)
{
$request = Zend_Controller_Front::getInstance()->getRequest();
$db = new Application_Model_DbTable_DbGlobal();
$search = new Zend_Form_Element_Text("txt_search");
$search->setValue($request->getParam("txt_search"));
$start_date = new Zend_Form_Element_Text("start_date");
$c_date = date('Y-m-d');
$start_date->setAttribs(array('id' => 'datepicker', 'style' => 'float:left;width:100%', 'class' => 'form-control'));
$_date_s = $request->getParam("start_date");
if (empty($_date_s)) {
$_date_s = date('Y-m-d');
}
$start_date->setValue($_date_s);
$end_date = new Zend_Form_Element_Text("end_date");
$end_date->setAttribs(array('class' => 'datepicker', 'style' => 'width:100% !important'));
$_date_t = $request->getParam("end_date");
if (empty($_date_t)) {
$_date_t = date('Y-m-d');
}
$end_date->setValue($_date_t);
$pay_status = new Zend_Form_Element_Select("pay_status");
$options = array('-1' => $this->tr->translate("SELECT"), '1' => $this->tr->translate("FULL_PAID"), '2' => $this->tr->translate("BALANCE"));
$pay_status->setMultiOptions($options);
$pay_status->setValue($request->getParam("pay_status"));
$option = array('-1' => $this->tr->translate("SELECT"), '1' => $this->tr->translate("ACTIVE"), '0' => $this->tr->translate("DEACTIVE"));
$status = new Zend_Form_Element_Select("status");
$status->setMultiOptions($option);
$status->setValue($request->getParam("status"));
// Product Blog
$cat_id = new Zend_Form_Element_Select("cat_id");
$cat_id->setAttribs(array('class' => 'select', 'style' => 'width:100%'));
$category = $db->getAllProCategories();
$option_category = array(0 => $this->tr->translate("CHOOSE_CATEGORY"));
foreach ($category as $row_cat) {
$option_category[$row_cat["cat_id"]] = $row_cat["cat_name_km"] . " - " . $row_cat["cat_name_en"];
}
$cat_id->setMultiOptions($option_category);
$cat_id->setValue($request->getParam("cat_id"));
$brand = new Zend_Form_Element_Select("brand");
$brand->setAttribs(array('class' => 'select', 'style' => 'width:100%'));
$row_brand = $db->getAllBrand();
$option_brand = array(0 => $this->tr->translate("CHOOSE_BRAND"));
foreach ($row_brand as $rs) {
$option_brand[$rs["brand_id"]] = $rs["name_kh"] . " - " . $rs["name_en"];
}
$brand->setMultiOptions($option_brand);
$brand->setValue($request->getParam("brand"));
// Sale Blog
$row_cu = $db->getCustomer();
$option_cu = array(0 => $this->tr->translate("CHOOSE_CUSTOMER"));
foreach ($row_cu as $rs_cu) {
$option_cu[$rs_cu["customer_id"]] = $rs_cu["name_kh"] . "-" . $rs_cu["name_en"];
}
$customer = new Zend_Form_Element_Select("customer");
$customer->setAttribs(array('class' => 'select', 'style' => 'width:100%'));
$customer->setMultiOptions($option_cu);
$customer->setValue($request->getParam("customer"));
$row_order = $db->getOrderNo();
$option_order = array(-1 => $this->tr->translate("CHOOSE_ORDER_NO"));
foreach ($row_order as $rs_order) {
$option_order[$rs_order["so_id"]] = $rs_order["order_no"];
}
$invoice_no = new Zend_Form_Element_Select("invoice_no");
$invoice_no->setAttribs(array('class' => 'select', 'style' => 'width:100%'));
$invoice_no->setMultiOptions($option_order);
$invoice_no->setValue($request->getParam("invoice_no"));
// Purchase Blog
$supplier = new Zend_Form_Element_Select("supplier");
$dbv = new phurchase_Model_DbTable_DbVendor();
$vendors = $dbv->getAllCate();
$option_vendor = array("" => ' - - - ជ្រើរើសអ្នកផ្គត់ផ្គង - - - ', -1 => " + បន្ថែមអ្នកផ្គត់ផ្គង");
foreach ($vendors as $row_vendors) {
$option_vendor[$row_vendors["vendor_id"]] = $row_vendors["v_name"];
}
$supplier = new Zend_Form_Element_Select("supplier");
$supplier->setMultiOptions($option_vendor);
$supplier->setValue($request->getParam("supplier"));
$row_pu = $db->getPurchaseNo();
$options = array("-1" => ' - - - ជ្រើរើសអ្នកលេខវិក៍យបត្រ - - - ');
foreach ($row_pu as $rs) {
$options[$rs["order_id"]] = $rs["order"];
}
$purchase_no = new Zend_Form_Element_Select("purchase_no");
$purchase_no->setAttribs(array('class' => 'select', 'style' => 'width:100%'));
$purchase_no->setMultiOptions($options);
$purchase_no->setValue($request->getParam("purchase_no"));
if ($data != null) {
}
return $this->addElements(array($search, $start_date, $end_date, $pay_status, $status, $cat_id, $brand, $customer, $invoice_no, $supplier, $purchase_no));
}
示例5: FrmProCate
public function FrmProCate($frm = null)
{
$vendor = new Zend_Form_Element_Select("vendor");
$vendor->setAttribs(array('class' => 'validate[required]', 'onclick' => 'ValueVendor()'));
$dbv = new phurchase_Model_DbTable_DbVendor();
$vendors = $dbv->getAllCate();
$option_vendor = array("" => ' - - - ជ្រើរើសអ្នកផ្គត់ផ្គង - - - ', -1 => " + បន្ថែមអ្នកផ្គត់ផ្គង");
foreach ($vendors as $row_vendors) {
$option_vendor[$row_vendors["vendor_id"]] = $row_vendors["v_name"];
}
$vendor->setMultiOptions($option_vendor);
$c_date = date('Y-m-d');
$date = new Zend_Form_Element_Text('date');
$date->setAttribs(array('id' => 'datepicker', 'style' => 'float:left;width: 120px;', 'class' => 'form-control validate[required]', 'onchange' => 'SubmitValue()'));
$date->setValue($c_date);
$status = new Zend_Form_Element_Select('status');
$_arr_status = array(1 => $this->tr->translate("បង់លុយ"), 2 => $this->tr->translate("ជំពាក់"));
$status->setMultiOptions($_arr_status);
$status->setAttribs(array('class' => 'form-control validate[required]'));
$amount = new Zend_Form_Element_Text("totalAmoun");
$amount->setAttribs(array('class' => 'form-control', "readonly" => ""));
$paid = new Zend_Form_Element_Text("paid");
$paid->setAttribs(array('class' => 'form-control', 'onkeyup' => "doRemain()"));
$discount = new Zend_Form_Element_Text("discount");
$discount->setAttribs(array('class' => 'form-control', 'onkeyup' => "doDiscount()"));
$total = new Zend_Form_Element_Text("remain");
$total->setAttribs(array('class' => 'form-control', "readonly" => ""));
$totalamount = new Zend_Form_Element_Text("totalamount");
$totalamount->setAttribs(array('class' => 'form-control', "readonly" => ""));
$db = new Application_Model_DbTable_DbGlobal();
$id_code = new Zend_Form_Element_Text('id_code');
$id_code->setAttribs(array('class' => 'form-control', "readonly" => ""));
$code = phurchase_Model_DbTable_DbOrder::getCallteralCode();
$id_code->setValue($code);
$cat_id = new Zend_Form_Element_Select("cat_id");
$cat_id->setAttribs(array('class' => 'select', 'style' => 'width:100%'));
$category = $db->getAllProCategories();
$option_category = array(0 => 'Choose Category');
foreach ($category as $row_cat) {
$option_category[$row_cat["cat_id"]] = $row_cat["cat_name_km"] . " - " . $row_cat["cat_name_en"];
}
$cat_id->setMultiOptions($option_category);
$cat_name_en = new Zend_Form_Element_Text("name_en");
$cat_name_en->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'Name In English', "OnChange" => "GetCatName(1)"));
$price = new Zend_Form_Element_Text("price");
$price->setAttribs(array('class' => 'validate[required]'));
$description = new Zend_Form_Element_Textarea("description");
$cat_name_km = new Zend_Form_Element_Text("name_km");
$cat_name_km->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'Name In Khmer', "OnChange" => "GetCatName(2)"));
$icon = new Zend_Form_Element_File("icon");
$this->addElements(array($amount, $paid, $vendor, $discount, $totalamount, $total, $date, $description, $price, $icon, $status, $cat_name_en, $cat_name_km, $cat_id, $id_code));
if ($frm != "") {
$vendor->setValue($frm["vendor_id"]);
$id_code->setValue($frm["order"]);
$date->setValue($frm["date_in"]);
$status->setValue($frm["status"]);
$amount->setValue($frm["all_total"]);
$paid->setValue($frm["paid"]);
$discount->setValue($frm["discount"]);
$total->setValue($frm["balance"]);
}
return $this;
}