本文整理汇总了PHP中Supplier::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Supplier::model方法的具体用法?PHP Supplier::model怎么用?PHP Supplier::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Supplier
的用法示例。
在下文中一共展示了Supplier::model方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getNum
public function getNum($code)
{
switch ($code) {
case 1:
$rows = Commodity::model()->findAll();
$heading = 'commodity';
$count = count($rows);
break;
case 2:
$rows = Category::model()->findAll();
$heading = 'category';
$count = count($rows);
break;
case 3:
$rows = Supplier::model()->findAll();
$heading = 'supplier';
$count = count($rows);
break;
case 4:
$rows = User::model()->findAll();
$heading = 'user';
$count = count($rows);
break;
case 5:
$rows = Allocate::model()->findAll();
$heading = 'allocate';
$count = count($rows);
break;
}
$content = '<b style="class:circle">' . $count . '</b><br/>';
$i = 2;
if ($code != 5) {
foreach ($rows as $r) {
$content .= $r['name'] . '<br/>';
--$i;
if ($i <= 0) {
break;
}
}
while ($i != 0) {
$content .= '<br/>';
--$i;
}
$content .= '<p style="display:inline;text-align:right"><i><a href="http://localhost/asset_management/index.php/' . $heading . '/admin">View All</a></i></p><br/>';
}
return $content;
}
示例2: loadModel
/**
* Returns the data model based on the primary key given in the GET variable.
* If the data model is not found, an HTTP exception will be raised.
* @param integer $id the ID of the model to be loaded
* @return Supplier the loaded model
* @throws CHttpException
*/
public function loadModel($id)
{
$model = Supplier::model()->findByPk($id);
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
示例3: undodeleteSupplier
public function undodeleteSupplier($supplier_id)
{
Supplier::model()->updateByPk((int) $supplier_id, array('status' => Yii::app()->params['active_status']));
}
示例4: array
<div class="span3"><?php
echo $form->textField($model, 'inventory_no', array('span' => 2));
?>
</div>
</div>
</div>
</tr>
<tr>
<div class="row">
<div class="col-md-3 col-sm-6">
<div class="span2"><?php
echo $form->labelEx($model, 'supplier_id', array('class' => 'inline-labels'));
?>
</div>
<div class="span3"><?php
echo $form->dropDownList($model, 'supplier_id', CHtml::listData(Supplier::model()->findAll(), 'id', 'name'), array('span' => 2, 'prompt' => '---'));
?>
<?php
echo TbHtml::button('+', array('color' => TbHtml::BUTTON_COLOR_SUCCESS, 'size' => TbHtml::BUTTON_SIZE_DEFAULT, 'onclick' => 'js:document.location.href="/asset_management/index.php/supplier/create"'));
?>
</div>
<div class="span2"><?php
echo $form->labelEx($model, 'status_id', array('class' => 'inline-labels'));
?>
</div>
<div class="span3"><?php
echo $form->dropDownList($model, 'status_id', CHtml::listData(Status::model()->findAll(), 'id', 'status'), array('span' => 2, 'prompt' => '---'));
?>
<?php
echo TbHtml::button('+', array('color' => TbHtml::BUTTON_COLOR_SUCCESS, 'size' => TbHtml::BUTTON_SIZE_DEFAULT, 'onclick' => 'js:document.location.href="/asset_management/index.php/status/create"'));
?>
示例5: array
<div class="form">
<?php
$form = $this->beginWidget('application.widgets.SnapActiveForm', array('id' => 'supplier-item-form', 'enableAjaxValidation' => false, 'layout' => BsHtml::FORM_LAYOUT_HORIZONTAL, 'htmlOptions' => array('enctype' => 'multipart/form-data', 'class' => 'row')));
?>
<div class="col-lg-9 clearfix">
<?php
echo $form->textFieldControlGroup($model, 'name', array('size' => 45, 'maxlength' => 45));
?>
<?php
echo $form->dropDownListControlGroup($model, 'supplier_id', CHtml::listData(Supplier::model()->findAll(), 'id', 'name'), array('class' => 'chosen'));
?>
<?php
echo $form->dropDownListControlGroup($model, 'packing_station_id', CHtml::listData(PackingStation::model()->findAll(), 'id', 'name'), array('class' => 'chosen'));
?>
<?php
echo $form->textFieldControlGroup($model, 'value', array('size' => 7, 'maxlength' => 7));
?>
<?php
echo $form->dropDownListControlGroup($model, 'unit', $model->getUnitList());
?>
<?php
echo $form->dropDownListControlGroup($model, 'available_from', $model->getMonthList());
?>
<?php
echo $form->dropDownListControlGroup($model, 'available_to', $model->getMonthList());
?>
<?php
示例6: reload
private function reload($data = array())
{
$this->layout = '//layouts/column_sale';
$model = new ReceivingItem();
$data['model'] = $model;
$data = $this->sessionInfo($data);
//echo $data['trans_header']; die();
//$data['n_item_expire']=ItemExpir::model()->count('item_id=:item_id and quantity>0',array('item_id'=>(int)$item_id));
$model->comment = $data['comment'];
if ($data['supplier_id'] != null) {
$supplier = Supplier::model()->findbyPk($data['supplier_id']);
$data['supplier'] = $supplier;
//$data['company_name'] = $supplier->company_name;
//$data['full_name'] = $supplier->first_name . ' ' . $supplier->last_name;
//$data['mobile_no'] = $supplier->mobile_no;
}
if (Yii::app()->request->isAjaxRequest) {
$cs = Yii::app()->clientScript;
$cs->scriptMap = array('jquery.js' => false, 'bootstrap.js' => false, 'jquery.min.js' => false, 'bootstrap.notify.js' => false, 'bootstrap.bootbox.min.js' => false, 'bootstrap.min.js' => false, 'jquery-ui.min.js' => false, 'EModalDlg.js' => false);
Yii::app()->clientScript->scriptMap['jquery-ui.css'] = false;
Yii::app()->clientScript->scriptMap['box.css'] = false;
$this->renderPartial('admin', $data, false, true);
} else {
$this->render('admin', $data);
}
}
示例7: sessionInfo
protected function sessionInfo($data = array())
{
$model = new ReceivingPayment();
$data['model'] = $model;
$data['supplier_id'] = Yii::app()->rpaymentCart->getSupplierId();
$data['employee_id'] = Yii::app()->session['employeeid'];
if ($data['supplier_id'] !== null) {
$account = AccountSupplier::model()->getAccountInfo($data['supplier_id']);
$data['account'] = $account;
$data['balance'] = $account->current_balance;
$supplier = Supplier::model()->findbyPk($data['supplier_id']);
$data['fullname'] = $supplier->company_name . ' [ ' . $supplier->first_name . ' ' . $supplier->last_name . ' ] ';
$data['save_button'] = false;
} else {
$data['fullname'] = '';
$data['balance'] = 0;
$data['save_button'] = true;
}
return $data;
}
示例8: actionGeoCode
public function actionGeoCode()
{
define("MAPS_HOST", "maps.google.com");
//define("KEY", "AIzaSyAU7aJq2EcQYJV7BsjZg1lkhR2dYBTZxfU");
define("KEY", "AIzaSyDtX7h4kdxUSrWpqVz3uRYP2-gxDMXa6hM");
$delay = 0;
$base_url = "http://" . MAPS_HOST . "/maps/geo?output=xml" . "&key=" . KEY;
$Suppliers = Supplier::model()->findAll();
foreach ($Suppliers as $supplier) {
$id = $supplier->id;
$address = $supplier->address . ' ' . $supplier->address2 . ', ' . $supplier->suburb . ', ' . $supplier->state . ', ' . $supplier->postcode;
$address = trim($address, ' ,');
if (!empty($address)) {
$request_url = $base_url . "&q=" . urlencode($address . ', Australia');
$xml = simplexml_load_file($request_url) or die("url not loading");
$status = $xml->Response->Status->code;
if (strcmp($status, "200") == 0) {
// Successful geocode
$geocode_pending = false;
$coordinates = $xml->Response->Placemark->Point->coordinates;
$coordinatesSplit = split(",", $coordinates);
// Format: Longitude, Latitude, Altitude
$lat = $coordinatesSplit[1];
$lng = $coordinatesSplit[0];
$supplier->lattitude = $lat;
$supplier->longitude = $lng;
$supplier->save();
} else {
if (strcmp($status, "620") == 0) {
// sent geocodes too fast
$delay += 100000;
} else {
// failure to geocode
$geocode_pending = false;
echo "Address " . $address . ", Australia failed to geocoded. ";
echo "Received status " . $status . "\n";
}
}
usleep($delay);
}
}
}
示例9: array
$form = $this->beginWidget('CActiveForm', array('id' => 'purchinforec-form', 'enableAjaxValidation' => false));
$this->widget('ToolbarButton', array('isSave' => true, 'UrlSave' => 'purchinforec/write', 'isCancel' => true, 'UrlCancel' => 'purchinforec/cancelwrite'));
echo $form->hiddenField($model, 'purchinforecid');
?>
<table>
<tr>
<td>
<div class="row">
<?php
echo $form->labelEx($model, 'addressbookid');
?>
<?php
echo $form->hiddenField($model, 'addressbookid');
?>
<input type="text" name="addressbook_name" id="addressbook_name" readonly value="<?php
echo Supplier::model()->findByPk($model->addressbookid) !== null ? Supplier::model()->findByPk($model->addressbookid)->fullname : '';
?>
">
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'addressbook_dialog', 'options' => array('title' => Yii::t('app', 'Supplier'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true)));
$this->widget('zii.widgets.grid.CGridView', array('id' => 'addressbook-grid', 'dataProvider' => $supplier->Searchwstatus(), 'filter' => $supplier, 'template' => '{summary}{pager}<br>{items}{pager}{summary}', 'columns' => array(array('header' => '', 'type' => 'raw', 'value' => 'CHtml::Button("+",
array("name" => "send_addressbook",
"id" => "send_addressbook",
"onClick" => "$(\\"#addressbook_dialog\\").dialog(\\"close\\"); $(\\"#addressbook_name\\").val(\\"$data->fullname\\"); $(\\"#Purchinforec_addressbookid\\").val(\\"$data->addressbookid\\");"))'), array('name' => 'addressbookid', 'visible' => false, 'value' => '$data->addressbookid', 'htmlOptions' => array('width' => '1%')), 'fullname', array('class' => 'CCheckBoxColumn', 'name' => 'recordstatus', 'selectableRows' => '0', 'header' => 'Record Status', 'checked' => '$data->recordstatus'))));
$this->endWidget('zii.widgets.jui.CJuiDialog');
echo CHtml::Button('...', array('onclick' => '$("#addressbook_dialog").dialog("open"); return false;'));
?>
<?php
echo $form->error($model, 'addressbookid');
?>
</div>
示例10: Report
/**
* just an example
* */
public static function Report($cid)
{
$m = InvoicePallet::model()->findByAttributes(array('id' => $cid));
$n = Supplier::model()->findByAttributes(array('number' => $m->supplier_no));
$i = Pallet::model()->findByAttributes(array('id' => $m->pid));
spl_autoload_unregister(array('YiiBase', 'autoload'));
require_once Yii::getPathOfAlias('webroot') . '/assets/phpword/samples/Sample_Header.php';
spl_autoload_register(array('YiiBase', 'autoload'));
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$phpWord->setDefaultFontName('新宋体');
$phpWord->setDefaultFontSize(12);
$phpWord->setDefaultParagraphStyle(array('align' => 'both', 'lineHeight' => '2'));
$section = $phpWord->addSection();
$section->addText('开票通知', array('bold' => true, 'size' => 24), array('align' => 'center', 'space' => array('before' => 200, 'after' => 100)));
$section->addText('注意:请收到立即开票!谢谢!', array('bold' => true, 'size' => 20), array('align' => 'center', 'space' => array('before' => 200, 'after' => 200)));
$section->addText('TO:' . ' ' . $n->name . ' 传真:', null, array('align' => 'left'));
$section->addText('公司名称:拓泓贸易(上海)有限公司', null, array('align' => 'left'));
$section->addText('纳税人识别号:310112690186868', null, array('align' => 'left'));
$section->addText('开票地址电话:上海市闵行区元江路5500号D1幢869室(021-54846073)', null, array('align' => 'left'));
$section->addText('开户行及账号:上海浦东发展银行闵行支行 98280154740006293', null, array('align' => 'left'));
$section->addTextBreak(1);
$section->addText('开票资料如下:', array('bold' => true, 'size' => 16), array('align' => 'left'));
$styleTable = array('borderSize' => 2, 'borderColor' => '686868', 'align' => 'center');
$styleFirstRow = array('borderBottomSize' => 18, 'borderBottomColor' => '0000FF', 'bgColor' => '66BBFF');
$styleCell = array('valign' => 'center', 'halign' => 'center');
$fontStyle = array('bold' => false, 'size' => 11, 'borderSize' => 2);
$center = array('spaceBefore' => 10, 'spaceAfter' => 0, 'align' => 'center', 'valign' => 'center');
$phpWord->addTableStyle('table1', $styleTable, array('align' => 'center'));
$table = $section->addTable('table1');
$table->addRow();
$table->addCell(1800)->addText('开票品名', $fontStyle, $center);
$table->addCell(1000)->addText('型号', $fontStyle, $center);
$table->addCell(800)->addText('数量', $fontStyle, $center);
$table->addCell(800)->addText('单位', $fontStyle, $center);
$table->addCell(1000)->addText('单价', $fontStyle, $center);
$table->addCell(1800)->addText('总价', $fontStyle, $center);
$table->addCell(2500)->addText('合同号', $fontStyle, $center);
$table->addRow();
$table->addCell(1800)->addText($m->type, $fontStyle, $center);
$table->addCell(1000)->addText($m->model, $fontStyle, $center);
$table->addCell(800)->addText($m->num, $fontStyle, $center);
$table->addCell(800)->addText($m->unit, $fontStyle, $center);
$table->addCell(800)->addText($m->unit_price, $fontStyle, $center);
$table->addCell(1800)->addText($m->unit_price * $m->num, $fontStyle, $center);
$table->addCell(2500)->addText($i->purchase_contract_no, $fontStyle, $center);
$table->addRow();
$table->addCell(1800)->addText('合计', $fontStyle, $center);
$table->addCell(1000)->addText('', $fontStyle, $center);
$table->addCell(800)->addText('', $fontStyle, $center);
$table->addCell(800)->addText('', $fontStyle, $center);
$table->addCell(800)->addText('', $fontStyle, $center);
$table->addCell(1800)->addText('¥' . $m->unit_price * $m->num, $fontStyle, $center);
$table->addCell(2500)->addText($i->purchase_contract_no, $fontStyle, $center);
$section->addText('请开票后,全套发票寄至以下地址:', array('bold' => true, 'size' => 12), array('align' => 'left'));
$section->addText('上海市闵行区曲吴路589号9号楼205', null, array('align' => 'left'));
$section->addText('拓泓贸易(上海)有限公司', null, array('align' => 'left'));
$section->addText('电话:021-54846073 13661561440', null, array('align' => 'left'));
$section->addText('联系人:叶建伟', null, array('align' => 'left'));
$section->addText('如有疑问,请今日联系!', null, array('align' => 'left'));
$section->addText('日期:' . date('Y-m-d'), null, array('align' => 'left'));
$fileName = "{$n->name}.doc";
// $fileName = iconv ( "utf-8", "gb2312", $fileName);
// $fileName = mb_convert_encoding($fileName, "utf-8", "auto");
$absPath = Yii::getPathOfAlias('webroot');
$relPath = '/uploads/files/';
$file = $absPath . $relPath . $fileName;
$fPath = $relPath . $fileName;
$fName = '开票通知 - ' . date("Ymd");
$res = array('name' => $fName, 'url' => $fPath);
write($phpWord, $file, $writers);
return $res;
}