/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (Session::get('level') == '1' || Session::get('level') == '2' && Session::get('fingerprint') == md5($_SERVER['HTTP_USER_AGENT'] . $_SERVER['REMOTE_ADDR'])) {
         $data = Type::all();
         return View::make('type.index', array('data' => $data));
     } else {
         return Redirect::to('/');
     }
 }
Пример #2
0
 public function search(Request $request, $type_id)
 {
     $types = Type::all();
     $keyword = "%" . $request->keyword . "%";
     //        return $keyword;
     $attributes = Attribute::with('type')->where('name', 'like', $keyword)->paginate(config('wyshop.page_size'));
     //        return $attributes;
     return view('admin.attribute.index', ['types' => $types, 'type_id' => $type_id, 'attributes' => $attributes]);
 }
Пример #3
0
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     //获取商品类型
     $type_list = Type::all();
     //获取商品分类
     $categoryData = Category::get();
     $cate_list = getTree($categoryData);
     return view('admin.goods.create', compact('type_list', 'cate_list'));
 }
 /**
  * Affiche la liste des types de matières premières.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     try {
         $user = Auth::user();
         $role = $user->role;
         $types = Type::all()->sortby('nom');
         foreach ($types as $type) {
             if ($type->commentaire == "") {
                 $type->commentaire = "Aucun commentaire disponible";
             }
         }
     } catch (ModelNotFoundException $e) {
         App::abort(404);
     }
     return View::make('types.index', compact('types', 'role'));
 }
Пример #5
0
 /**
  * edit data page
  * @param int id
  * @return view
  */
 public function edit($id)
 {
     $type = Type::all();
     $attribute = Attribute::findOrFail($id);
     return view('admin.attribute.edit', compact('attribute', 'type'));
 }
 public function edit($type_id, $id)
 {
     $types = Type::all();
     $attribute = Attribute::find($id);
     return view('admin.attribute.edit', ['types' => $types, 'type_id' => $type_id, 'attribute' => $attribute]);
 }
Пример #7
0
 <!-- World News -->
<?php 
use app\models\News;
use app\models\Type;
use yii\helpers\Url;
?>
            <?php 
foreach (Type::all() as $itemtype) {
    ?>
                    <div class="column-two-third">
                        <h5 class="line">
                            <span><?php 
    echo $itemtype->name;
    ?>
</span>
                            <div class="navbar">
                                <a id="next2" class="next" href="#"><span></span></a>   
                                <a id="prev2" class="prev" href="#"><span></span></a>
                            </div>
                        </h5>
                        
                        <div class="outerwide" >
                            <ul class="wnews" id="carousel2">
                            <?php 
    foreach (News::fromType($itemtype->id) as $item) {
        ?>
                                <li>
                                    <img src="<?php 
        echo $item->images;
        ?>
" width="300" height="162" alt="MyPassion" class="alignleft" />
Пример #8
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit(Request $request, $id)
 {
     // find a single resource by ID
     $output = DefaultItem::find($id);
     if ($output) {
         // get list of possible service types
         $types = Type::all();
         // Get full list of default items
         $default_items = DefaultItem::with('type')->orderBy('type_id')->orderBy('seq_no');
         return view($this->view_one, array('default_item' => $output, 'types' => $types, 'default_items' => $default_items->get()));
     }
     //
     $message = 'Error! DefaultItem with id "' . $id . '" not found';
     return \Redirect::route($this->view_idx)->with(['status' => $message]);
 }
Пример #9
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return view('admin.types.list', array('types' => Type::all()));
 }