本文整理匯總了PHP中Coupon::deleteSelection方法的典型用法代碼示例。如果您正苦於以下問題:PHP Coupon::deleteSelection方法的具體用法?PHP Coupon::deleteSelection怎麽用?PHP Coupon::deleteSelection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Coupon
的用法示例。
在下文中一共展示了Coupon::deleteSelection方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Coupon
<?php
if (intval(Tools::G('delete')) > 0) {
$object = new Coupon(intval(Tools::getRequest('delete')));
if (Validate::isLoadedObject($object)) {
$object->delete();
}
if (is_array($object->_errors) and count($object->_errors) > 0) {
$errors = $object->_errors;
} else {
UIAdminAlerts::conf('優惠碼已刪除');
}
} elseif (Tools::isSubmit('subDelete')) {
$select_cat = Tools::getRequest('categoryBox');
$coupon = new Coupon();
if ($coupon->deleteSelection($select_cat)) {
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')));