本文整理汇总了PHP中Am_Form_Admin::addDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Am_Form_Admin::addDate方法的具体用法?PHP Am_Form_Admin::addDate怎么用?PHP Am_Form_Admin::addDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Am_Form_Admin
的用法示例。
在下文中一共展示了Am_Form_Admin::addDate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createForm
public function createForm()
{
$form = new Am_Form_Admin();
$options = Am_Currency::getSupportedCurrencies();
array_remove_value($options, Am_Currency::getDefault());
$sel = $form->addSelect('currency', array('class' => 'am-combobox'))->setLabel(___('Currency'))->loadOptions($options)->addRule('required');
$date = $form->addDate('date')->setLabel(___('Date'))->addRule('required')->addRule('callback2', "--wrong date--", array($this, 'checkDate'));
$rate = $form->addText('rate', array('length' => 8))->setLabel(___("Exchange Rate\nenter cost of 1 (one) %s", Am_Currency::getDefault()))->addRule('required');
return $form;
}
示例2: createAccessForm
public function createAccessForm()
{
static $form;
if (!$form) {
$form = new Am_Form_Admin();
$form->setAction($url = $this->getUrl(null, 'c', null, 'payments', 'addaccess', 'user_id', $this->user_id));
$sel = $form->addSelect('product_id');
$options = $this->getDi()->productTable->getOptions();
$sel->addOption(___('Please select an item...'), '');
foreach ($options as $k => $v) {
$sel->addOption($v, $k);
}
$sel->addRule('required', 'this field is required');
$form->addDate('begin_date')->addRule('required', 'this field is required');
$form->addDate('expire_date')->addRule('required', 'this field is required');
$form->addSaveButton('Add Access Manually');
}
return $form;
}
示例3: createForm
function createForm()
{
$form = new Am_Form_Admin();
$form->setAction($this->getUrl(null, 'clear'));
$form->addDate('dat')->setLabel(___("Date to Purge\nall records prior to this date will be removed from selected tables"))->addRule('required');
$section = $form->addFieldset('tables')->setLabel(___('Tables to Purge'));
foreach ($this->getItems() as $id => $item) {
$section->addAdvCheckbox($id)->setLabel(array($item['title'], $item['desc']));
}
$form->addSaveButton(___('Clear'));
return $form;
}
示例4: run
function run()
{
$form = new Am_Form_Admin('form-grid-payout');
$form->setAttribute('name', 'payout');
$date = $form->addDate('payout_date')->setLabel(___('Payout Date'))->setValue(sqlDate($this->getDi()->dateTime));
foreach ($this->grid->getVariablesList() as $k) {
$form->addHidden($this->grid->getId() . '_' . $k)->setValue($this->grid->getRequest()->get($k, ""));
}
$form->addSaveButton(___("Run Payout"));
$form->setDataSources(array($this->grid->getCompleteRequest()));
if ($form->isSubmitted() && $form->validate()) {
$values = $form->getValue();
$this->getDi()->affCommissionTable->runPayout($values['payout_date']);
$this->grid->redirectBack();
} else {
echo $this->renderTitle();
echo $form;
}
}
示例5: createForm
protected function createForm()
{
$f = new Am_Form_Admin();
$f->addText('user')->setLabel(___('Enter username of existing user'))->addRule('required');
$f->addSelect('product_id')->setLabel(___('Product'))->loadOptions(Am_Di::getInstance()->productTable->getOptions());
$f->addScript()->setScript(<<<CUT
\$(function(){
\$("#user-0" ).autocomplete({
minLength: 2,
source: window.rootUrl + "/admin-users/autocomplete"
});
});
CUT
);
$tmp = $this->grid->getRecord();
if ($tmp->name == EmailTemplate::EXPIRE) {
$f->addDate('expires')->setLabel(___('Expiration Date'))->addRule('required');
}
$f->addSaveButton(___('Preview'));
foreach ($this->grid->getVariablesList() as $k) {
$kk = $this->grid->getId() . '_' . $k;
if ($v = @$_REQUEST[$kk]) {
$f->addHidden($kk)->setValue($v);
}
}
return $f;
}
示例6: changeRebillDateAction
function changeRebillDateAction()
{
$this->getDi()->authAdmin->getUser()->checkPermission('grid_invoice', 'edit');
$invoice_id = $this->_request->getInt('invoice_id');
$form = new Am_Form_Admin();
$form->addDate('rebill_date');
$vals = $form->getValue();
$rebill_date = $vals['rebill_date'];
try {
if (!$invoice_id) {
throw new Am_Exception_InputError('No invoice provided');
}
$invoice = $this->getDi()->invoiceTable->load($invoice_id);
// Invoice must be recurring active and rebills should be controlled by paylsystem,
// otherwise this doesn't make any sence
if ($invoice->status != Invoice::RECURRING_ACTIVE || $invoice->getPaysystem()->getRecurringType() != Am_Paysystem_Abstract::REPORTS_CRONREBILL) {
throw new Am_Exception_InputError('Unable to change rebill_date for this invoice!');
}
$rebill_date = new DateTime($rebill_date);
$old_rebill_date = $invoice->rebill_date;
$invoice->updateQuick('rebill_date', $rebill_date->format('Y-m-d'));
$invoice->data()->set('first_rebill_failure', null)->update();
$this->getDi()->invoiceLogTable->log($invoice_id, null, ___('Rebill Date changed from %s to %s', $old_rebill_date, $invoice->rebill_date));
Am_Controller::ajaxResponse(array('ok' => true, 'msg' => ___('Rebill date has been changed!')));
} catch (Exception $e) {
Am_Controller::ajaxResponse(array('ok' => false, 'msg' => $e->getMessage()));
}
}