本文整理匯總了PHP中Coupon::loadData方法的典型用法代碼示例。如果您正苦於以下問題:PHP Coupon::loadData方法的具體用法?PHP Coupon::loadData怎麽用?PHP Coupon::loadData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Coupon
的用法示例。
在下文中一共展示了Coupon::loadData方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: displayMain
public function displayMain()
{
global $smarty;
$result = Coupon::loadData();
if ($result) {
$smarty->assign(array('coupons' => $result));
}
return $smarty->fetch('cart.tpl');
}
示例2: elseif
UIAdminAlerts::conf('優惠碼已刪除');
}
} elseif (intval(Tools::getRequest('toggleStatus')) > 0) {
$object = new Coupon(intval(Tools::getRequest('toggleStatus')));
if (Validate::isLoadedObject($object)) {
$object->toggleStatus();
}
if (is_array($object->_errors) and count($object->_errors) > 0) {
$errors = $object->_errors;
} else {
UIAdminAlerts::conf('優惠碼已更新');
}
}
$table = new UIAdminTable('coupon', 'Coupon', 'id_coupon');
$table->header = array(array('sort' => false, 'isCheckAll' => 'itemsBox[]'), array('name' => 'id_coupon', 'title' => 'ID', 'width' => '80px', 'filter' => 'string'), array('name' => 'id_user', 'title' => '狀態碼', 'filter' => 'string'), array('name' => 'off', 'title' => '狀態信息', 'filter' => 'string'), array('name' => 'amount', 'title' => '狀態信息', 'filter' => 'string'), array('name' => 'active', 'title' => '狀態信息', 'filter' => 'string'), array('name' => 'add_date', 'title' => '狀態信息', 'filter' => 'string'), array('sort' => false, 'title' => '操作', 'class' => 'text-right', 'isAction' => array('edit', 'delete')));
$filter = $table->initFilter();
$orderBy = isset($_GET['orderby']) ? Tools::G('orderby') : 'id_coupon';
$orderWay = isset($_GET['orderway']) ? Tools::G('orderway') : 'desc';
$limit = $cookie->getPost('pagination') ? $cookie->getPost('pagination') : '50';
$p = Tools::G('p') ? Tools::G('p') == 0 ? 1 : Tools::G('p') : 1;
$result = Coupon::loadData($p, $limit, $orderBy, $orderWay, $filter);
if (isset($errors)) {
UIAdminAlerts::MError($errors);
}
$breadcrumb = new UIAdminBreadcrumb();
$breadcrumb->home();
$breadcrumb->add(array('title' => '優惠碼', 'active' => true));
$bread = $breadcrumb->draw();
echo UIViewBlock::area(array('bread' => $bread), 'breadcrumb');
$btn_group = array(array('type' => 'button', 'title' => '批量刪除', 'confirm' => '你確定要刪除選中項?', 'class' => 'btn-danger', 'icon' => 'remove'));
echo UIViewBlock::area(array('title' => '優惠碼', 'table' => $table, 'result' => $result, 'limit' => $limit, 'btn_groups' => $btn_group), 'table');