public static function get_select_storage($value, $groupid) { $storage = Storage_device::getList("enable = 1 and groupid = ?", $groupid); foreach ($storage as $row) { if ($row->id == $value) { $temp .= '<option value="' . $row->id . '" selected="selected">' . $row->name . '</option>'; } else { $temp .= '<option value="' . $row->id . '">' . $row->name . '</option>'; } } return $temp; }
public function view_rate() { $id = intval(Core::$_dataFilter->valueCheck(Core::get("id"), "Require,Integer", "id不能为空,数据非法!")); $type = intval(Core::get("t", '0')); $channel = self::i($id); //实例化模板 $tp = PHP_Templates::factory(); //设置模板文件 $tp->setFiles('set_rate_channel'); if ($channel->code) { $tp->code = $channel->code; $tp->name = $channel->name; $groupid = $channel->groupid; $tp->type = $type; if ($type === 3) { $storage = Storage_channel::getOne("channel_id = ?", $id); $tp->selestorage = self::get_select_storage($storage->storage_id, $groupid); if ($storage->old_storage) { $storage = Storage_device::i($storage->old_storage); } $tp->old_storage = $storage->name; } elseif ($type === 2) { $tp->selemodule = self::get_select_module($channel->pullback); } elseif ($type === 1) { $tp->selectrans = self::get_select_trans($channel->transport); } else { $tp->selectrate = self::get_select_rate($channel->rate); $tp->selectwidth = self::get_select_width($channel->encode, true); $tp->selectheight = self::get_select_width($channel->encode, false); } } //输出页面 $tp->execute(); //释放模板变量 unset($tp); }
public static function getstorage($value) { $Storage_channel = Storage_channel::getOne('channel_id = ?', $value[0]); if ($Storage_channel) { $sid = $Storage_channel->storage_id; $storage = Storage_device::i($sid); if ($storage) { $temp = $storage->name . '<br/>'; } } $temp .= '<a class="_pageinalStorage" xls="' . $value[0] . '" href="javascript:void(0);">修改</a>'; return $temp; }