/**
  * 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));
 }
    public function map(){
 
		$items = Item::all();
                //$items = Item::distance(0.1,'45.05,7.6667')->get();
 
		return view('items.map')->with(['items'=>$items]);
 
	}
 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()]);
 }
Example #4
0
 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));
 }
 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]);
 }
Example #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);
 }
Example #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'));
     }
 }
 /**
  * @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'));
 }
Example #9
0
 /**
  * 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));
 }
 /**
  * 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'));
 }
Example #11
0
 /**
  * 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();
     }
 }
Example #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'));
 }
 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);
 }
 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'));
 }
 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]);
 }
Example #16
0
 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]);
 }
Example #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!');
     }
 }
Example #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);
         }
     }
 }
 /**
  * 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));
     });
 }
Example #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]);
         }
     }
 }
Example #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');
?>
;
Example #22
0
 /**
  * Display a listing of items.
  *
  * @return Response
  */
 public function index()
 {
     $items = Item::all();
     return view('items.index', compact('items'));
 }
Example #23
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function show()
 {
     $Items = Item::all();
     return view('welcome', ['Items' => $Items]);
 }
Example #24
0
 public function showItems()
 {
     return view('items', ['items' => Item::all()]);
 }
Example #25
0
 public function report()
 {
     $from = \Request::get('from');
     $to = \Request::get('to');
     $items = Item::all();
     return view('item.report', compact('items', 'from', 'to'));
 }
 public function all()
 {
     return Item::all();
 }
 public function edit($id)
 {
     $saleItem = InvoiceItem::find($id);
     $itemOptions = Item::all()->lists('name', 'id');
     return view('invoice_items.edit', compact('saleItem', 'itemOptions'));
 }
 /**
  * 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]);
 }
Example #29
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $invoices = Invoice::all();
     $items = Item::all();
     return view("index", compact("invoices"));
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $items = Item::all();
     return view('admin.items.index', ['items' => $items]);
 }