コード例 #1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show()
 {
     $info = new Item();
     $info->setTable($this->getLoginUsername());
     //$info->setTable($this->getLoginUsername());
     $list = $info->all($this->getLoginUsername(), array('taskname', 'deadline', 'description', 'important'));
     return view('auth.profile')->with(array('username' => $this->getLoginUsername(), 'list' => $list));
 }
コード例 #2
0
    public function map(){
 
		$items = Item::all();
                //$items = Item::distance(0.1,'45.05,7.6667')->get();
 
		return view('items.map')->with(['items'=>$items]);
 
	}
コード例 #3
0
 function newsale(Request $request)
 {
     $values = $request->all();
     $sale = Sale::create($values);
     $sales = Sale::all();
     $items = Item::all();
     $vendors = Vendor::all();
     return view('stockmaster.sales', ['vendors' => $vendors, 'newsale' => $sale, 'items' => $items, 'user' => Auth::user()]);
 }
コード例 #4
0
ファイル: Main.php プロジェクト: luijar/fp-php
 public function __invoke() : View
 {
     $extractShorName = function ($item) {
         return $item->state->getShortName();
     };
     $allItems = Item::all();
     $newItems = P::pipe(P::filter(P::pipe($extractShorName, P::eq('new'))), 'P::size');
     return view('main')->with('items', $allItems)->with('remaining_item_count', $newItems($allItems));
 }
コード例 #5
0
 public function booking(Request $request)
 {
     $values = $request->all();
     $booking = Booking::create($values);
     $user = Auth::user();
     $items = Item::all();
     $i = 0;
     return view('customer', ['i' => $i, 'booking' => $booking, 'user' => $user, 'items' => $items]);
 }
コード例 #6
0
 /**
  * @return $this
  */
 public function viewCatDets($catName)
 {
     $imDets = DB::select(DB::raw("SELECT * FROM items WHERE catRef = (SELECT catID FROM categories WHERE catName ='{$catName}')"));
     //  $catDets = DB::select(DB::raw("SELECT * FROM categories WHERE "))
     $categories = Category::all();
     $items = Item::all();
     return view('pages/Main/categoryView', compact('categories', 'items', 'imDets', 'catName'));
     //return view('pages/Main/categoryView')->with('imDets',$imDets);
 }
コード例 #7
0
 public function create()
 {
     $items = Item::all();
     if (count($items) < 1) {
         return redirect()->action('ItemsController@index')->with('message', 'Anda belum memasukan data produk');
     } else {
         return view('itemin.create', compact('items'));
     }
 }
コード例 #8
0
 /**
  * @param $catName
  * this function handle the viewing of category of products
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function viewCatDets($catName)
 {
     //retreive the categories images with product details based on the user click
     $imDets = DB::select(DB::raw("SELECT * FROM items WHERE catRef = (SELECT catID FROM categories WHERE catName ='{$catName}')"));
     $categories = Category::all();
     $items = Item::all();
     $data = session()->get('items');
     //        return json_encode($imDets);
     return view('pages/Main/categoryView', compact('categories', 'items', 'imDets', 'catName', 'data'));
 }
コード例 #9
0
ファイル: ItemService.php プロジェクト: luijar/fp-php
 /**
  * Get counts of items that are new and which ones are completed
  * @return Tuple(int, int, int)
  */
 public static function countNewAndDoneItems() : Tuple
 {
     $countNewAndPast = P::partition(function ($item) {
         $name = $item->state->getShortname();
         return $name === 'expired' || $name === 'completed';
     }, Item::all());
     list($done, $new) = $countNewAndPast;
     $counts = Tuple::create('integer', 'integer');
     return $counts(count($done), count($new));
 }
コード例 #10
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function getUserProfile()
 {
     $user = Auth::user();
     $items = Item::all();
     $profileList = Profile::where('user_id', '=', 1)->lists('characterName', 'id');
     // $request = /* where (useSkills = profile_id)
     //               return [item_id => [tier_id], item_id => [tier_id]] */
     $itemList = useSkill::where('profile_id', '=', 1)->join('items', 'items.id', '=', 'item_id')->join('tiers', 'tiers.id', '=', 'tier_id')->groupBy('items.name')->get(['items.name', 'tiers.tier']);
     return view('profile.profile', compact('items', 'profileList', 'itemList'));
 }
コード例 #11
0
ファイル: ItemImagenes.php プロジェクト: ateszki/nh
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $items = Item::all();
     foreach ($items as $item) {
         $imgs = glob(storage_path('app') . "/prodimag/" . trim($item->codigo) . "*-G*");
         $item->imagenes = count($imgs) > 0 ? true : false;
         $item->imagen = count($imgs) > 0 ? substr($imgs[rand(0, count($imgs) - 1)], -15, 9) : NULL;
         $item->save();
     }
 }
コード例 #12
0
 /**
  * Get all items from the database and display it. 
  * Go to: list.app/items
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $items = array();
     foreach (Item::all() as $item) {
         if (\Auth::user()->id == $item->user_id) {
             array_push($items, $item);
         }
     }
     return view('items.index', compact('items'));
 }
コード例 #13
0
 public function postRegister(Request $request)
 {
     $validator = $this->registrar->validator($request->all());
     if ($validator->fails()) {
         $items = Item::all();
         $i = 0;
         return view('main', ['i' => $i, 'items' => $items, 'errors' => $validator->errors(), 'input' => $request->all()]);
     }
     $user = $this->registrar->create($request->all());
     $this->auth->login($user);
     return $this->authenticated($request, $user);
 }
コード例 #14
0
 public function getItems()
 {
     $itemlist = Item::all();
     $items = Item::all();
     $itemspack = [];
     foreach ($items as $item) {
         $uom = BulkUnit::where('uom_id', $item->uom_id)->lists('name');
         $itemspack[$item->uom_id] = $uom;
     }
     $jsonified = json_encode($itemspack);
     $data = ['items' => $jsonified];
     return view('operations/purchase/index', $data, compact('itemlist'));
 }
コード例 #15
0
 function booking(Request $request)
 {
     $items = Item::all();
     $i = 0;
     $values = $request->all();
     $rules = ['name' => 'required|max:100', 'adrsl1' => 'required', 'adrsl2' => 'required', 'place' => 'required', 'pin' => 'required|digits:6', 'email' => 'required|email', 'phone' => 'required|digits:10', 'pickdate' => 'required|date_format:Y-m-d|after:today'];
     $validator = Validator::make($request->all(), $rules);
     if ($validator->fails()) {
         return view('main', ['i' => $i, 'items' => $items, 'req_errors' => $validator->errors(), 'req_inputs' => $request->all()]);
         // ['status'=>'fail','error'=>'invalid data',,];
     }
     $booking = Booking::create($values);
     return view('main', ['i' => $i, 'booking' => $booking, 'items' => $items]);
 }
コード例 #16
0
ファイル: AdminController.php プロジェクト: starmatt/webpapa
 public function getIndex()
 {
     $user = Auth::user();
     $users = User::where('id', '!=', $user->id)->get();
     $items = Item::all();
     $categories = Category::all();
     $orders = Order::where('status', '!=', 0)->orderBy('created_at', 'desc')->get();
     $site_name = DB::table('master')->first()->site_name;
     $cd = DB::table('master')->first()->carts_cd;
     $cd = ['hrs' => floor($cd / 60), 'min' => $cd % 60];
     foreach ($orders as $order) {
         $order->address = unserialize($order->address);
         $order->fullname = unserialize($order->fullname);
     }
     return view('admin/admin', ['admin' => $user, 'users' => $users, 'items' => $items, 'categories' => $categories, 'orders' => $orders, 'cd' => $cd, 'name' => $site_name]);
 }
コード例 #17
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(CustomerRequest $request)
 {
     try {
         Customer::create($request->all());
         $customer = Customer::orderBy('created_at', 'desc')->first();
         $items = Item::all();
         foreach ($items as $item) {
             Price::create(['item_id' => $item->id, 'customer_id' => $customer->id, 'custom_price' => $item->price, 'sellable' => '1']);
         }
         return redirect('customer')->with('message', 'Data berhasil dibuat!');
     } catch (\Illuminate\Database\QueryException $e) {
         return redirect('customer')->with('message', 'Data dengan email tersebut sudah digunakan!');
     } catch (\PDOException $e) {
         return redirect('customer')->with('message', 'Data dengan email tersebut sudah digunakan!');
     }
 }
コード例 #18
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     if (isset($_GET['all']) && session('password') == getenv('MAIL_PASSWORD') && session('email') == getenv('MAIL_USERNAME')) {
         $items = Item::all();
         return response()->json($items);
     } else {
         date_default_timezone_set("America/Los_Angeles");
         // Ordering should not happen between 9 PM Friday through Saturday
         if (date('l') == 'Friday' && date('G') >= 21 || date('l') == 'Saturday') {
             return Response::make("[]", 503);
             // Service Unavailable
         } else {
             $items = Item::where('active', 1)->get();
             return response()->json($items);
         }
     }
 }
コード例 #19
0
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     /**this method selects rules from database and bind to this view whenever it is used */
     view()->composer('partials/dashboardleftcolumn', function ($view) {
         $view->with('rules', \App\Rule::all(['rule_name', 'controller']));
     });
     view()->composer('partials/foodpartial', function ($view) {
         $view->with('items', \App\Item::all());
         //->where(['state',1]);
     });
     view()->composer('menu', function ($view) {
         $view->with('messages', \App\Item::all());
         //->where(['state',1]);
     });
     view()->composer('partials/productform', function ($view) {
         $id = Auth::user()->user_id;
         $view->with('shops', \App\Shop::all()->where('user_id', $id));
     });
 }
コード例 #20
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     for ($i = 1; $i < 200; $i++) {
         $name = $faker->shuffle($faker->word());
         $recodeID = $faker->boolean(50) ? rand(0, $i) : NULL;
         Character::create(['name' => $name, 'savename' => $name, 'class' => $faker->randomElement($array = array('A', 'B', 'C', 'D', 'S', 'SS', 'Z')), 'race' => $faker->boolean(50), 'pot' => $faker->boolean(50), 'pof' => $faker->boolean(50), 'adventurer' => $faker->boolean(50), 'recode_id' => NULL]);
         for ($t = 1; $t < 4; $t++) {
             Job::create(['name' => $faker->shuffle($faker->name()), 'number' => $t, 'element' => $faker->randomElement($array = array('None', 'Fire', 'Ice', 'Darkness', 'Lightning', 'Heal', 'Remedy')), 'weapon' => $faker->randomElement($array = array('Sword', 'Bow', 'Spear', 'Staff')), 'minHP' => $faker->numberBetween(0, 130), 'maxHP' => $faker->numberBetween(200, 900), 'minATK' => $faker->numberBetween(0, 130), 'maxATK' => $faker->numberBetween(200, 900), 'minDEF' => $faker->numberBetween(0, 130), 'maxDEF' => $faker->numberBetween(200, 900), 'minMATK' => $faker->numberBetween(0, 130), 'maxMATK' => $faker->numberBetween(200, 900), 'minMDEF' => $faker->numberBetween(0, 130), 'maxMDEF' => $faker->numberBetween(200, 900), 'character_id' => $i]);
             for ($s = 1; $s < 5; $s++) {
                 $skillcount = Skill::all()->count();
                 $skill = Skill::where('id', rand(0, $skillcount - 1))->first();
                 JobSkill::create(['lvl' => rand(0, 15 * $s), 'skill_name' => $skill->name, 'affection' => $faker->word(), 'frequency' => rand(0, 101), 'job_id' => $t * $i]);
                 $itemcount = Item::all()->count();
                 $item = Item::where('id', rand(0, $itemcount - 1))->first();
                 JobItem::create(['quantity' => rand(0, 51), 'item_name' => $item->name, 'job_id' => $t * $i]);
             }
         }
         for ($j = 0; $j < rand(1, 5); $j++) {
             Iteration::create(['trigger' => $faker->word(), 'content' => $faker->text(), 'character_id' => $i, 'trigger_id' => NULL]);
         }
     }
 }
コード例 #21
0
    var suppliers2 = <?php 
echo Supplier::all()->lists('telephone_number', 'id');
?>
;
    $(supplierChange2).text(suppliers2[searcher]);
  });

  $(".itemChange1").change(function(a){
    var searcher = a.currentTarget.value;
    var unitChange = ".itemUnit1";
    // $.get('getItemTerms', {item: searcher}, function(data){
    //   console.log(data);
    // }, 'json');

    var items = <?php 
echo Item::all()->lists('unit', 'id');
?>
;
    $(unitChange).text(items[searcher]);

    $.get('getTopSuppliers', {item: searcher}, function(data){

      var terms = <?php 
echo Supplier::all()->lists('payment_terms', 'id');
?>
;
      var contact = <?php 
echo Supplier::all()->lists('telephone_number', 'id');
?>
;
コード例 #22
0
ファイル: ItemsController.php プロジェクト: artmonger/auction
 /**
  * Display a listing of items.
  *
  * @return Response
  */
 public function index()
 {
     $items = Item::all();
     return view('items.index', compact('items'));
 }
コード例 #23
0
ファイル: ItemController.php プロジェクト: RomanMingalev/WEB
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function show()
 {
     $Items = Item::all();
     return view('welcome', ['Items' => $Items]);
 }
コード例 #24
0
 public function showItems()
 {
     return view('items', ['items' => Item::all()]);
 }
コード例 #25
0
 public function report()
 {
     $from = \Request::get('from');
     $to = \Request::get('to');
     $items = Item::all();
     return view('item.report', compact('items', 'from', 'to'));
 }
コード例 #26
0
 public function all()
 {
     return Item::all();
 }
コード例 #27
0
 public function edit($id)
 {
     $saleItem = InvoiceItem::find($id);
     $itemOptions = Item::all()->lists('name', 'id');
     return view('invoice_items.edit', compact('saleItem', 'itemOptions'));
 }
コード例 #28
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $account = Account::findOrfail($id);
     $itemname = Item::all();
     return view('accounts.edit', ['account' => $account, 'itemname' => $itemname]);
 }
コード例 #29
0
ファイル: InvoiceController.php プロジェクト: bulinjoli/bikes
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $invoices = Invoice::all();
     $items = Item::all();
     return view("index", compact("invoices"));
 }
コード例 #30
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $items = Item::all();
     return view('admin.items.index', ['items' => $items]);
 }