本文整理汇总了PHP中Catalog::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Catalog::getAll方法的具体用法?PHP Catalog::getAll怎么用?PHP Catalog::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Catalog
的用法示例。
在下文中一共展示了Catalog::getAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
Yii::app()->getClientScript()->registerCssFile(Yii::app()->theme->baseUrl . '/css/manager.css');
?>
<div class="row white-bg inside-block">
<div class="col-md-12">
<?php
$this->breadcrumbs = array(ProjectModule::t('Zakazs'));
if (Campaign::getId()) {
$columns = array('id');
$projectFields = $model->getFields();
if ($projectFields) {
foreach ($projectFields as $field) {
if ($field->field_type == "LIST") {
$varname = $field->varname;
$columns[] = array('name' => $varname, 'filter' => Catalog::getAll($varname), 'value' => '$data->catalog_' . $varname . '->cat_name');
} elseif ($field->varname != 'soderjanie' && $field->varname != 'description' && $field->varname != 'opisanie') {
// !!! Сделать настраиваемым
$columns[] = $field->varname;
}
}
}
/*$columns[] = array(
'name'=>'date',
'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$model,
'attribute'=>'dbdate',
'language'=>Yii::app()->language,
),true),
'value'=>'$data->dbdate'
);*/
示例2: array
<?php
require_once 'classes/Teacher.php';
require_once 'classes/Catalog.php';
$week = array('пн', 'вт', 'ср', 'чт', 'пт');
$departments = array('Робототехника', 'Инженерия', 'Нано-хирургия');
$timeTable = array('пн' => array(), 'вт' => array(), 'ср' => array(), 'чт' => array(), 'пт' => array());
try {
Catalog::push(new Teacher('Валерий Николаевич'));
Catalog::push(new Teacher('Антон Иванович'));
Catalog::push(new Teacher('Юрий Василиевич'));
Catalog::push(new Teacher('Артур Араратович'));
$teachers = Catalog::getAll();
foreach ($teachers as $name => $object) {
while ($object->getFull() == false) {
$day = $week[mt_rand(0, 4)];
//случайный день
$depart = $departments[mt_rand(0, 2)];
//случайный факультет
$add = $object->putLesson($depart);
if ($add) {
array_push($timeTable[$day], array($name, $depart));
}
}
}
$html = '';
foreach ($timeTable as $key => $value) {
$html .= '<table class="table"><caption>' . $key . '</caption>';
for ($i = 0; $i < count($value); $i++) {
$html .= '<tr><td>' . $value[$i][0] . '</td><td>' . $value[$i][1] . '</td></tr>';
}
示例3: array
echo ProjectModule::t('Link for freelancers');
?>
: <a href="/project/zakaz/list"><?php
echo 'http://' . $_SERVER['SERVER_NAME'] . '/project/zakaz/list';
?>
</a>
</div>
<?php
$this->breadcrumbs = array(ProjectModule::t('Zakazs'));
$columns = array('id');
$columns[] = array('name' => 'title');
if (ProjectField::model()->inTableByVarname('specials')) {
$columns[] = array('name' => 'specials', 'filter' => Catalog::getAll('specials'), 'value' => '$data->catalog_specials->cat_name');
}
if (ProjectField::model()->inTableByVarname('specials2')) {
$columns[] = array('name' => 'specials2', 'filter' => Catalog::getAll('specials2'), 'value' => '$data->catalog_specials2->cat_name');
}
$columns[] = array('name' => 'max_exec_date', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'dbmax_exec_date', 'language' => Yii::app()->language), true), 'value' => '$data->dbmax_exec_date');
$columns[] = array('name' => 'author_informed', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'dbauthor_informed', 'language' => Yii::app()->language), true), 'value' => '$data->dbauthor_informed');
$columns[] = array('name' => 'manager_informed', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'dbmanager_informed', 'language' => Yii::app()->language), true), 'value' => '$data->dbmanager_informed');
$columns[] = array('name' => 'status', 'filter' => ProjectStatus::getAll(), 'value' => '$data->statusName');
$columns[] = array('name' => 'lastPartStatus', 'filter' => ZakazParts::model()->getForFilter(), 'value' => '$data->lastPartStatus');
$columns[] = array('name' => 'lastPartDate', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'lastPartDate', 'language' => Yii::app()->language), true), 'value' => '$data->lastPartDate');
if (ProjectField::model()->inTableByVarname('technicalspec')) {
$columns[] = array('name' => 'technicalspec', 'value' => '$data->technicalspec == 1 ? ProjectModule::t(\'Yes\') : ProjectModule::t(\'No\')', 'filter' => array("0" => ProjectModule::t('No'), "1" => ProjectModule::t('Yes')));
}
$columns[] = array('class' => 'CButtonColumn', 'template' => '{delete}{update}');
/*
$projectFields = $model->getFields();
if ($projectFields) {
foreach($projectFields as $field) {
示例4: round
<?php
require_once 'classes/Department.php';
require_once 'classes/Catalog.php';
$amount = 96;
//готово студентов к поступлению
$percent = 0.72;
//процент парней
$boy = round($amount * $percent);
// готово парней к поступлению
$girl = $amount - $boy;
//готово девушек к поступлению
$string = 'К зачислению готовы ' . $amount . ' студентов. Из них: ' . $boy . ' парней и ' . $girl . ' девушек</br>';
try {
//создаем новые факультеты
Catalog::push(new Department('Робототехника', 0.65, 'male'));
Catalog::push(new Department('Нано-хирургия', 0.35, 'female'));
Catalog::push(new Department('Инженерия', 0.5, 'male'));
$list = Catalog::getAll();
// список всех факультетов
foreach ($list as $key => $value) {
$necessarily = $value->getNecessarily();
$engaged[$necessarily[0]] += $necessarily[1];
$gender = $necessarily[0] == 'male' ? 'парней' : 'девушек';
$string .= 'На "' . $value->getName() . '" нужно зачислить ' . $necessarily[1] . ' ' . $gender . '</br>';
}
$string .= 'Свободны к расприделению ' . ($amount - ($engaged['male'] + $engaged['female'])) . ' студентов </br>';
$string .= 'Из них: ' . ($boy - $engaged['male']) . ' парней, ' . ($girl - $engaged['female']) . ' девушек</br>';
echo $string;
} catch (Exception $e) {
}