public function info($get) { $ctrl = new SampleProduceOrderController(); $r = Result::convert($ctrl->info($get)); $view = new ViewBase($r); return $view->render('sampleproduceorder/info.php'); }
public function __construct($data = array()) { parent::__construct($data); $this->setPropertiesDefine(array('parent_id' => array('alias' => '上级部门', 'options' => function () { $data = Department::find()->field('id', 'parent_id', 'name')->all(true); $tmp = array_combine(array_column($data, 'id'), array_column($data, 'name')); array_unshift_assoc($tmp, 0, '顶级'); return $tmp; }, 'form' => function ($val = null, self $instance = null) { $data = Department::find()->field('id', 'parent_id', 'name')->all(true); return ViewBase::generateParentTreeSelector($data, $instance); }), 'manager_id' => array('alias' => '负责人', 'options' => function () { $data = User::find('state=?', User::STATE_ENABLED)->field('id', 'name')->all(true); return array_combine(array_column($data, 'id'), array_column($data, 'name')); }, 'display' => function (self $item) { $tmp = User::findOneByPk($item->manager_id); if (!$tmp) { return ''; } return $tmp->state == User::STATE_ENABLED ? $tmp->name : '<del>' . $tmp->name . '</del>'; }), 'stage_id' => array('options' => function () { return WorkStage::$work_stage_list; }), 'stage_name' => array('getter' => function ($item) { if ($item->stage_id) { return WorkStage::$work_stage_list[$item->stage_id]; } return ''; }, 'alias' => '负责流程'))); }
public static function checkAuth($controller, $action) { if (!$controller || !$action) { return; } $result = self::isAuthAction($controller, $action); if (!$result) { if (!self::instance()->isLogin()) { $url = Router::getUrl('index/login'); $html = <<<EOT <!doctype html> <html lang="en"> <head> \t<meta charset="UTF-8"> \t<title>Document</title> \t<script>top.location.href="{$url}";</script> </head> <body> \t正在登录系统... </body> </html> EOT; die($html); } else { //暂时不返回 $viewer = new ViewBase(); echo $viewer->render('index/deny.php', true); die; } } }
<input type="hidden" name="<?php echo $field; ?> " value="<?php echo $extend_info->{$field}; ?> " rel="upload-file" data-url="<?php echo Config::get('upload/url') . $extend_info->{$field}; ?> "> <?php } else { ?> <?php echo ViewBase::renderFormElement($extend_info->{$field}, $field, $def, $extend_info); ?> <?php if ($def['description']) { ?> <span class="frm-field-desc"> <?php echo $def['description']; ?> </span> <?php } ?> <?php } ?>
<table class="frm-tbl"> <caption>更新样品</caption> <tbody> <tr> <td class="col-label">货号</td> <td> <?php echo $sample->sample_no; ?> </td> </tr> <tr> <td>样品图片</td> <td> <?php echo \www\ViewBase::displayField('sample_first_image_src', $sample); ?> </td> </tr> <tr> <td class="col-label">包装方式</td> <td> <select name="sample_package_id" required="required"> <?php foreach (\www\model\Sample::findOneByPk($sample->sample_id)->package_list as $v) { ?> <option value ="<?php echo $v->id; ?> "><?php echo $v->pack_name;
echo GlobalConf::SAMPLE_TYPE_SINGLE; ?> " checked="checked">单件</label> <label><input type="radio" name="sample_type" value="<?php echo GlobalConf::SAMPLE_TYPE_SUITE; ?> ">套件</label> </td> </tr> <tr id="work-flow-wrap"> <td class="col-label"> 工艺流程 </td> <td> <?php echo ViewBase::renderFormElement($tmp_single->technic_flow_id_list, 'technic_flow_id_list', $single_defines['technic_flow_id_list'], $tmp_single); ?> </td> </tr> <tr> <td class="col-label">分类</td> <td> <select name="category_id"> <?php foreach ($category_list as $id => $n) { ?> <option value="<?php echo $id; ?> "><?php echo $n;
public function info($get) { $id = $get['id']; $sample = Sample::findOneByPk($id); $mould_list = SampleMould::find('sample_id=?', $id)->all(); $package_type_list = SamplePackage::find('sample_id=?', $id)->all(); $sample_image_list = SampleImage::find('sample_id=?', $id)->all(); $tpl = $sample->sample_type == GlobalConf::SAMPLE_TYPE_SINGLE ? 'sample/single_info.php' : 'sample/suite_info.php'; $v = new ViewBase(array('mould_list' => $mould_list, 'package_type_list' => $package_type_list, 'sample_image_list' => $sample_image_list, 'sample' => $sample)); return $v->render($tpl, true); }
<?php echo \www\ViewBase::getSideMenu();