本文整理汇总了PHP中Vendor::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Vendor::model方法的具体用法?PHP Vendor::model怎么用?PHP Vendor::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vendor
的用法示例。
在下文中一共展示了Vendor::model方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<div class="row">
<?php
echo $form->label($model, 'id');
?>
<?php
echo $form->textField($model, 'id');
?>
</div>
<div class="row">
<?php
echo $form->label($model, 'vendor_id');
?>
<?php
echo $form->dropDownList($model, 'vendor_id', GxHtml::listDataEx(Vendor::model()->findAllAttributes(null, true)), array('prompt' => Yii::t('app', 'All')));
?>
</div>
<div class="row">
<?php
echo $form->label($model, 'text');
?>
<?php
echo $form->textArea($model, 'text');
?>
</div>
<div class="row">
<?php
echo $form->label($model, 'create_date');
示例2: array
<?php
$this->breadcrumbs = array($model->label(2) => array('index'), Yii::t('app', 'Manage'));
$this->menu = array(array('label' => Yii::t('app', 'List') . ' ' . $model->label(2), 'url' => array('index')), array('label' => Yii::t('app', 'Create') . ' ' . $model->label(), 'url' => array('create')));
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('vendor-mobile-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>
<h1><?php
echo Yii::t('app', 'Manage') . ' ' . GxHtml::encode($model->label(2));
?>
</h1>
<p>
You may optionally enter a comparison operator (<, <=, >, >=, <> or =) at the beginning of each of your search values to specify how the comparison should be done.
</p>
<?php
echo GxHtml::link(Yii::t('app', 'Advanced Search'), '#', array('class' => 'search-button'));
?>
<div class="search-form">
<?php
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->
<?php
$this->widget('zii.widgets.grid.CGridView', array('id' => 'vendor-mobile-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('id', array('name' => 'subdistribution_id', 'value' => 'GxHtml::valueEx($data->subdistribution)', 'filter' => GxHtml::listDataEx(Subdistribution::model()->findAllAttributes(null, true))), array('name' => 'vendor_id', 'value' => 'GxHtml::valueEx($data->vendor)', 'filter' => GxHtml::listDataEx(Vendor::model()->findAllAttributes(null, true))), array('name' => 'phone_id', 'value' => 'GxHtml::valueEx($data->phone)', 'filter' => GxHtml::listDataEx(Phone::model()->findAllAttributes(null, true))), array('class' => 'CButtonColumn'))));
示例3:
<span class="required">*</span> <?php
echo Yii::t('app', 'are required');
?>
.
</p>
<?php
echo $form->errorSummary($model);
?>
<div class="row">
<?php
echo $form->labelEx($model, 'vendor_id');
?>
<?php
echo $form->dropDownList($model, 'vendor_id', GxHtml::listDataEx(Vendor::model()->findAllAttributes(null, true)));
?>
<?php
echo $form->error($model, 'vendor_id');
?>
</div><!-- row -->
<div class="row">
<?php
echo $form->labelEx($model, 'text');
?>
<?php
echo $form->textArea($model, 'text');
?>
<?php
echo $form->error($model, 'text');
?>
示例4: actiondeleteVoucherVendor
public function actiondeleteVoucherVendor()
{
if (isset($_POST) && !empty($_POST)) {
$distribution = Distribution::model()->findByPk($_POST['distribution_id']);
$vendor = Vendor::model()->findByPk($_POST['vendor_id']);
$subdistributions = $distribution->subdistributions;
$criteria_string = "(0";
foreach ($subdistributions as $subdistribution) {
foreach ($subdistribution->distributionVouchers as $ditributioVoucher) {
$criteria_string = $criteria_string . ", " . $ditributioVoucher->id;
}
}
$criteria_string = $criteria_string . ")";
$criteria_string2 = "(0";
foreach ($_POST['beneficiaries'] as $ben_id) {
$criteria_string2 = $criteria_string2 . ", " . $ben_id;
}
$criteria_string2 = $criteria_string2 . ")";
$vouchers = Voucher::model()->findAll("vendor_id = " . $vendor->id . " and distribution_voucher_id in " . $criteria_string . " and ben_id in " . $criteria_string2);
foreach ($vouchers as $voucher) {
$voucher->vendor_id = NULL;
$voucher->update();
$voucher->save();
}
}
}