public function mostrarInfo($url)
 {
     //Me quedo con el item, buscando por url
     $item = Item::where('url', $url)->first();
     $this->array_view['item'] = $item;
     return View::make($this->folder_name . '.' . $this->project_name . '-ver', $this->array_view);
 }
예제 #2
0
 public function categoryModify(Request $request, $id)
 {
     $cat_to_mod = Category::where('id', $id)->first();
     $inputs = $request->except('_token', 'button');
     if ($request->button == 'mod') {
         $x = 0;
         foreach ($inputs as $input) {
             if (!empty($input)) {
                 $x = 1;
             }
         }
         if ($x == 0) {
             return redirect('admin');
         }
         if ($request->name) {
             $cat_to_mod->name = $request->name;
         }
         $cat_to_mod->save();
     }
     if ($request->button == 'del') {
         $item_count = Item::where('category_id', $id)->get()->count();
         if ($item_count >= 1) {
             return redirect('admin')->withErrors('Suppression impossible : des produits appartiennent a cette catgorie');
         }
         $cat_to_mod->delete();
         return redirect('admin')->with('status', 'Catégorie supprimée');
     }
     return redirect('admin')->with('status', 'Modifications de la catégorie enregistrées');
 }
예제 #3
0
 public function showIndex()
 {
     if (!Auth::check()) {
         return View::make('login', array('title' => 'edison'));
     }
     $category_names = array('ent' => 'エンターテイメント', 'music' => '音楽', 'sing' => '歌ってみた', 'play' => '演奏してみた', 'dance' => '踊ってみた', 'vocaloid' => 'VOCALOID', 'nicoindies' => 'ニコニコインディーズ', 'animal' => '動物', 'cooking' => '料理', 'nature' => '自然', 'travel' => '旅行', 'sport' => 'スポーツ', 'lecture' => 'ニコニコ動画講座', 'drive' => '車載動画', 'history' => '歴史', 'politics' => '政治', 'science' => '科学', 'tech' => 'ニコニコ技術部', 'handcraft' => 'ニコニコ手芸部', 'make' => '作ってみた', 'anime' => 'アニメ', 'game' => 'ゲーム', 'toho' => '東方', 'imas' => 'アイドルマスター', 'radio' => 'ラジオ', 'draw' => '描いてみた', 'are' => '例のアレ', 'diary' => '日記', 'other' => 'その他', 'r18' => 'R-18', 'original' => 'オリジナル', 'portrait' => '似顔絵', 'character' => 'キャラクター');
     $all_items = Item::orderBy('created_at', 'desc')->take(10)->get();
     foreach ($all_items as &$item) {
         $item['user'] = User::where('id', '=', $item->user_id)->get()[0];
         $item['star_count'] = Starmap::where('item_id', '=', $item->id)->count();
         $item['comment_count'] = Comment::where('item_id', '=', $item->id)->count();
         if ($item->category_id != 0) {
             $item['category'] = Category::where('id', '=', $item->category_id)->get()[0]->content;
         }
     }
     $recent_works = Work::orderBy('created_at', 'desc')->take(10)->get();
     foreach ($recent_works as &$work) {
         $item = Item::where('id', '=', $work->item_id)->get()[0];
         $work['item'] = $item;
         $work['user'] = User::where('id', '=', $work->user_id)->get()[0];
         $work['item_poster_screen_name'] = User::where('id', '=', $item->user_id)->get()[0]->screen_name;
         if ($item->category_id != 0) {
             $work['item_category'] = Category::where('id', '=', $item->category_id)->get()[0]->content;
         }
     }
     $user = User::where('screen_name', '=', Auth::user()->screen_name)->get()[0];
     $data = array('title' => 'edison', 'user' => $user, 'all_items' => $all_items, 'recent_works' => $recent_works, 'categories' => $category_names, 'star_count' => Starmap::where('user_id', '=', $user->id)->count(), 'work_count' => Work::where('user_id', '=', Auth::user()->id)->count());
     return View::make('index', $data);
 }
 public function run()
 {
     $participants = DB::table('event_participant')->get();
     foreach ($participants as $participant) {
         $player = Player::find($participant->player_id);
         $user = User::find($participant->user_id);
         $event = Evento::find($participant->event_id);
         $payment = Payment::find($participant->payment_id);
         $uuid = Uuid::generate();
         $new = new Participant();
         $new->id = $uuid;
         $new->firstname = $player->firstname;
         $new->lastname = $player->lastname;
         $new->due = $event->getOriginal('fee');
         $new->early_due = $event->getOriginal('early_fee');
         $new->early_due_deadline = $event->early_deadline;
         $new->method = 'full';
         $new->plan_id = Null;
         $new->player_id = $player->id;
         $new->event_id = $participant->event_id;
         $new->accepted_on = $participant->created_at;
         $new->accepted_by = $user->profile->firstname . " " . $user->profile->lastname;
         $new->accepted_user = $participant->user_id;
         $new->status = 1;
         $new->created_at = $participant->created_at;
         $new->updated_at = $participant->updated_at;
         $new->save();
         $update = Item::where('payment_id', '=', $payment->id)->firstOrFail();
         $update->participant_id = $uuid;
         $update->save();
     }
 }
예제 #5
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if ($this->user->inGroup(Sentry::findGroupByName('supporter')) || $this->user->inGroup(Sentry::findGroupByName('administer'))) {
         $items = Item::orderBy('id', 'desc')->paginate(10);
     } else {
         $items = Item::where('user_id', '=', $this->user->id)->orderBy('id', 'desc')->paginate(10);
     }
     return View::make('items.index', compact('items'));
 }
예제 #6
0
 /**
  * Update the specified resource in storage.
  * PUT /items/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $item = Item::where('id', $id)->update(Input::all());
     if ($item) {
         return ['status' => true, 'item' => $item];
     } else {
         return ['status' => false];
     }
 }
예제 #7
0
파일: api.php 프로젝트: kulor/orm_rest_api
 function item_delete()
 {
     $item = new Item();
     $item->where('id', $this->post('id'));
     $item->get();
     $item->delete();
     $message = array('id' => $this->post('id'), 'message' => 'DELETED!');
     $this->response($message, 200);
     // 200 being the HTTP response code
 }
예제 #8
0
 public function index()
 {
     try {
         $items = Item::where('active', '=', '1')->orderBy('vendor_id')->orderBy('name')->get();
         foreach ($items as $item) {
             $item->vendor_name = Vendor::where('id', '=', $item->vendor_id)->pluck('name');
         }
         return $items->toJSON();
     } catch (Exception $e) {
         return json_encode('{"error":{"text":' . $e->getMessage() . '}}');
     }
 }
예제 #9
0
 public function isRoom($item)
 {
     // player location
     $currentRoom = Auth::user();
     $currentRoom = $currentRoom->player_location_id;
     $itemRoom = Item::where("name", $item)->firstOrFail();
     $itemRoom = $itemRoom->map_id;
     if ($currentRoom == $itemRoom) {
         return true;
     } else {
         return false;
     }
 }
예제 #10
0
 public function getStars($screen_name)
 {
     $user = User::where('screen_name', '=', $screen_name)->first();
     $star_lists = Starmap::where('user_id', '=', $user->id)->orderby('created_at', 'desc')->take(10)->get();
     $star_items = array();
     foreach ($star_lists as &$star_list) {
         $star_list['item'] = Item::where('id', '=', $star_list->item_id)->get()[0];
         $star_list['item']['user'] = User::where('id', '=', $star_list->item->user_id)->get()[0];
         $star_list['item']['star_count'] = Starmap::where('id', '=', $star_list->item_id)->count();
         $star_list['item']['comment_count'] = Comment::where('id', '=', $star_list->item_id)->count();
         $star_list['category_name'] = Category::where('id', '=', $star_list->item->category_id)->first()->content;
     }
     return $star_lists;
 }
예제 #11
0
 /**
  * Display a listing of the resource.
  * GET /oss
  *
  * @return Response
  */
 public function index()
 {
     $documents = Auth::user()->documents;
     $i = 0;
     $num = $documents->count();
     if ($num == 0) {
         $ids = 0;
     } else {
         foreach ($documents as $document) {
             $ids[$i] = $document->id;
         }
     }
     $items = Item::where('document_id', $ids)->get();
     return View::make('items.oss')->with('items', $items);
 }
 public function vistaListado()
 {
     $items_borrados = Item::where('estado', 'B')->lists('id');
     if (count($items_borrados) > 0) {
         $portfolios = Portfolio::whereNotIn('item_id', $items_borrados)->get();
     } else {
         $portfolios = Portfolio::all();
     }
     $categorias = Categoria::where('estado', 'A')->get();
     $secciones = Seccion::where('estado', 'A')->get();
     $this->array_view['portfolios'] = $portfolios;
     $this->array_view['categorias'] = $categorias;
     $this->array_view['secciones'] = $secciones;
     //Hace que se muestre el html lista.blade.php de la carpeta item
     //con los parametros pasados por el array
     return View::make($this->folder_name . '.lista', $this->array_view);
 }
예제 #13
0
 public function index()
 {
     $documents = Auth::user()->documents;
     $i = 0;
     $num = $documents->count();
     if ($num == 0) {
         $ids = 0;
     } else {
         foreach ($documents as $document) {
             $ids[$i] = $document->id;
         }
     }
     $organization = Auth::user()->organization;
     $items = Item::where('document_id', $ids)->get();
     return View::make('home', array('documents' => $documents, 'items' => $items, 'organization' => $organization));
     //return View::make('timeout');
 }
예제 #14
0
 public function getNoticeContents()
 {
     $login_user_id = Auth::user()->id;
     $notice = Starmap::where('user_id', '=', $login_user_id)->where('watched_flag', '=', 0)->where('notice_flag', '=', 1)->get();
     $notice_item_ids = array();
     foreach ($notice as $n) {
         $notice_item_ids[] = $n["item_id"];
     }
     $notice_items_uesr = array();
     $notice_item_titles = array();
     $notice_work_ids = array();
     foreach ($notice_item_ids as $notice_item_id) {
         $notice_items_uesr_ids[] = Item::where('id', '=', $notice_item_id)->get()[0]['user_id'];
         $notice_item_titles[] = Item::where('id', '=', $notice_item_id)->get()[0]['title'];
         $notice_work_ids[] = Work::where('item_id', '=', $notice_item_id)->orderBy('created_at', 'desc')->get()[0]['item_id'];
     }
     //$this->debug($notice_work_ids);
     $notice_work_user_ids = array();
     $notice_work_title = array();
     foreach ($notice_work_ids as $notice_work_id) {
         var_dump($notice_work_id);
         $notice_work_user_ids[] = Work::where('id', '=', $notice_work_id)->orderBy('updated_at', 'asc')->get()[0]['user_id'];
         $notice_work_title[] = Work::where('id', '=', $notice_work_id)->orderBy('id', 'asc')->get()[0]['title'];
     }
     $this->debug($notice_work_user_ids);
     //$this->debug($notice_work_title);
     // ---------
     $notice_work_user_screen_name = array();
     foreach ($notice_work_user_ids as $notice_work_user_id) {
         $notice_work_user_screen_name = User::where('id', '=', $notice_work_user_id)->get()[0]['screen_name'];
     }
     //$this->debug($notice_work_user_screen_name);
     $notice_item_screen_name = array();
     foreach ($notice_items_uesr_ids as $user_id) {
         $notice_item_screen_name[] = User::where('id', '=', $user_id)->get()[0]['screen_name'];
     }
     $json_val = array("notice_title" => $notice_item_titles, "notice_item_id" => $notice_item_ids, "notice_item_user" => $notice_item_screen_name, "notice_work_title" => $notice_work_title, "notice_work_user" => $notice_work_user_screen_name);
     header('Content-type: application/json');
     echo json_encode($json_val);
 }
예제 #15
0
 public function create($item_id)
 {
     $data = Input::all();
     $item = Item::where('id', '=', $item_id)->get()[0];
     $screen_name = User::where('id', '=', $item->user_id)->first()['attributes']['screen_name'];
     $now = date("Y-m-d H:i:s");
     if ($item['type'] == 'video') {
         $reg = '/^http:\\/\\/www\\.nicovideo\\.jp\\/watch\\/(sm[0-9]+)/';
     } else {
         $reg = '/^http:\\/\\/seiga\\.nicovideo\\.jp\\/seiga\\/im([0-9]+)/';
     }
     preg_match($reg, $data['url'], $match);
     $nico_content = $match ? $match[1] : 0;
     if ($item['type'] == 'video') {
         $Niconico = new Niconico();
         $ret = $Niconico->getThumbInfo($nico_content);
         $title = $ret->title;
         $thumbnail_url = $ret->thumbnail_url;
     } else {
         $title = '';
         $thumbnail_url = "http://lohas.nicoseiga.jp/thumb/{$nico_content}q";
     }
     if ($nico_content) {
         $work = new Work();
         $work->item_id = $item_id;
         $work->user_id = Auth::user()->id;
         $work->url = $data['url'];
         $work->title = $title;
         $work->thumbnail_url = $thumbnail_url;
         $work->comment = nl2br(htmlspecialchars($data['comment']));
         $work->created_at = date("Y-m-d H:i:s");
         $work->updated_at = date("Y-m-d H:i:s");
         $work->save();
         Starmap::where('item_id', '=', $item_id)->update(array('notice_flag' => 1));
         return Redirect::to("/{$screen_name}/items/{$item_id}");
     } else {
         echo "その作品はあかん";
     }
 }
예제 #16
0
 /**
  * postModal (入库确认)
  */
 public function postModal()
 {
     //itemReceivedPackageDetail->id
     $id = Input::get('id');
     $position = Input::get('readyposition');
     $itemReceivedPackageDetail = ItemReceivedPackageDetail::find($id);
     $itemReceivedPackageDetail->status = 2;
     $itemReceivedPackageDetail->readyposition = $position;
     $itemReceivedPackageDetail->save();
     //历史入库记录
     $historyWareHouse = new HistoryWarehouse();
     $historyWareHouse->identity = $itemReceivedPackageDetail->identity;
     $historyWareHouse->item = $itemReceivedPackageDetail->item;
     $historyWareHouse->batch = $itemReceivedPackageDetail->batch;
     $historyWareHouse->quantity = $itemReceivedPackageDetail->quantity;
     $historyWareHouse->position = $position;
     $historyWareHouse->operator = 5;
     $historyWareHouse->save();
     //库存汇总
     $wareHouse = Warehouse::where('item', $itemReceivedPackageDetail->item)->where('position', $position)->first();
     if ($wareHouse) {
         $wareHouse->quantity = $wareHouse->quantity + $itemReceivedPackageDetail->quantity;
         $wareHouse->save();
     } else {
         $wareHouse = new Warehouse();
         $wareHouse->item = $itemReceivedPackageDetail->item;
         $wareHouse->position = $position;
         $wareHouse->quantity = $itemReceivedPackageDetail->quantity;
         $wareHouse->save();
     }
     //更新item总库存
     $items = Item::where('code', $itemReceivedPackageDetail->item)->first();
     $items->stock += $itemReceivedPackageDetail->quantity;
     $items->readystock -= $itemReceivedPackageDetail->quantity;
     $items->save();
     return Redirect::back();
 }
예제 #17
0
 /**
  * postPackageCheckedin (拆包检验入库)
  */
 public function postPackageCheckedin()
 {
     $id = Input::get('id');
     $position = Input::get('readyposition');
     $itemReceivedPackageDetail = ItemReceivedPackageDetail::find($id);
     $itemReceivedPackageDetail->status = 2;
     $itemReceivedPackageDetail->readyposition = $position;
     $itemReceivedPackageDetail->save();
     //历史入库记录
     $historyWareHouse = new HistoryWarehouse();
     $historyWareHouse->identity = $itemReceivedPackageDetail->identity;
     $historyWareHouse->item = $itemReceivedPackageDetail->item;
     $historyWareHouse->batch = $itemReceivedPackageDetail->batch;
     $historyWareHouse->quantity = $itemReceivedPackageDetail->quantity;
     $historyWareHouse->position = $position;
     $historyWareHouse->operator = 5;
     $historyWareHouse->save();
     //库存汇总
     $wareHouse = Warehouse::where('item', $itemReceivedPackageDetail->item)->where('position', $position)->first();
     if ($wareHouse) {
         $wareHouse->quantity = $wareHouse->quantity + $itemReceivedPackageDetail->quantity;
         $wareHouse->save();
     } else {
         $wareHouse = new Warehouse();
         $wareHouse->item = $itemReceivedPackageDetail->item;
         $wareHouse->position = $position;
         $wareHouse->quantity = $itemReceivedPackageDetail->quantity;
         $wareHouse->save();
     }
     //更新item总库存
     $items = Item::where('code', $itemReceivedPackageDetail->item)->first();
     $items->stock += $itemReceivedPackageDetail->quantity;
     $items->readystock -= $itemReceivedPackageDetail->quantity;
     $items->save();
     //到包日期|包号
     $itemReceivedPackage = ItemReceivedPackage::find($itemReceivedPackageDetail->package_id);
     $package_checked_date = $itemReceivedPackage->package_checked_date;
     $package_no = $itemReceivedPackage->package_no;
     //供应商
     $supplier = Supplier::find($itemReceivedPackageDetail->supplier_id);
     //details
     $itemReceivedPackageDetails = ItemReceivedPackageDetail::where('package_id', $itemReceivedPackageDetail->package_id)->orderBy('status')->get();
     return View::make('admin.itemreceive.packagedetail')->with('itemReceivedPackageDetails', $itemReceivedPackageDetails)->with('supplier', $supplier)->with('package_checked_date', $package_checked_date)->with('package_no', $package_no);
 }
예제 #18
0
 public function getView($id)
 {
     $document = Document::find($id);
     //$items = Document::find($id)->items;
     $items = Item::where('document_id', '=', $id)->paginate(50);
     // Если такого документа нет, то вернем пользователю ошибку 404 - Не найдено
     if (!$document) {
         App::abort(404);
     }
     return View::make('documents/view', array('items' => $items, 'document' => $document));
 }
예제 #19
0
 public function getDocView($id)
 {
     $document = Document::find($id);
     $user = Document::find($id)->user();
     $organization_id = $document->user->organization_id;
     $organization = Organization::find($organization_id);
     //$items = Document::find($id)->items;
     $items = Item::where('document_id', '=', $id)->paginate(50);
     // Если такого документа нет, то вернем пользователю ошибку 404 - Не найдено
     if (!$document) {
         App::abort(404);
     }
     return View::make('admin.DocView', array('items' => $items, 'document' => $document, 'organization' => $organization));
 }
예제 #20
0
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
Route::bind('task', function ($value, $route) {
    return Item::where('id', $value)->first();
});
Route::get('/', array('as' => 'home', 'uses' => 'HomeController@getIndex'))->before('auth');
Route::post('item', array('uses' => 'HomeController@postIndex'))->before('csrf');
Route::get('/new', array('as' => 'new', 'uses' => 'HomeController@getNew'));
Route::post('/new', array('uses' => 'HomeController@postNew'))->before('csrf');
Route::get('/up/{task}', array('as' => 'up', 'uses' => 'HomeController@getUpdate'));
Route::post('/up', array('uses' => 'HomeController@postUpdate'))->before('csrf');
Route::get('/delete/{task}', array('as' => 'delete', 'uses' => 'HomeController@getDelete'));
Route::get('login', array('as' => 'login', 'uses' => 'AuthController@getlogin'))->before('guest');
Route::post('login', array('uses' => 'AuthController@postlogin'))->before('csrf');
예제 #21
0
    /**
     * input() takes Input::all and creates a table with info
     * @return associative array $data to views
     */
    public function input()
    {
        $validator = Validator::make(Input::all(), array('cmmf' => 'required', 'quantity' => 'required'));
        if ($validator->fails()) {
            return View::make('input')->with(array('response' => '<p style="color:red;">Please check your input and try again.</p>'));
        } else {
            $notFoundItems = array();
            $cmmf = trim(Input::get('cmmf'));
            //Stores the inputted cmmfs and quantities in Session variables incase user wants to use Back button to redo query
            Session::flash('cmmf', $cmmf);
            $quantity = trim(Input::get('quantity'));
            Session::flash('quantity', $quantity);
            //broken up by newline to be processes line by line
            $quantities = explode(PHP_EOL, $quantity);
            $cmmfs = explode(PHP_EOL, $cmmf);
            //$stats is var storing the table data for the summary of the shipment
            $stats = '<div class="CSSTableGenerator" >
                <table id="stats" ><tr>
                        <td>
                            Total Pieces
                        </td>
                        <td >
                            Total Cartons
                        </td>
                        <td>
                        Total Weight
                        </td>
                        <td>
                        Total Pallets
                        </td>
                    <td>
                    Total Spaces
                    </td>



                    </tr>';
            //if the amount of cmmfs supplied doesn't match the amount of quantities supplied then state error
            if (count($cmmfs) != count($quantities)) {
                return View::make('input', array('response' => '<p style="color:red;">ERROR: NUMBER OF CMMFS DO NOT MATCH THE NUMBER OF QUANTITIES SUPPLIED.</p>'));
            }
            $totalQuantity = null;
            $totalCartons = null;
            $totalWeight = null;
            $totalPallets = null;
            $totalSpaces = null;
            //$i tracks the index for each line items of both the inputted cmmf and quantity array
            $i = 0;
            $response = '<div class="CSSTableGenerator" >
                <table id="table" ><tr>
                        <td>
                            CMMF
                        </td>

                        <td >
                            Quantity
                        </td>
                        <td>Size</td>
                         <td>Case</td>
                        <td>
                        Total Cases
                        </td>
                          <td>
                        Weight
                        </td>
                        <td>
                        Total Weight
                        </td>
                        <td>Cartons per Pallet</td>
                        <td>
                    Total Pallets
                    </td>

                    <td>
                    Total Spaces
                    </td>



                    </tr>';
            //now checks each of the cmmfs (broken up by newline) supplied from input
            foreach ($cmmfs as $cmmf) {
                $item = Item::where('cmmf', '=', $cmmf)->first();
                //checks if cmmf
                if ($item == null) {
                    //item isn't found, so added to the $notFoundItems array to be displayed later and shows as NA for that row/item
                    array_push($notFoundItems, $cmmf);
                    //echo $cmmf . ' not in DB<br>';
                    $response .= '<tr>
                        <td>
                            ' . $cmmf . '
                        </td>
                        <td >
                            ' . $quantities[$i] . '
                        </td>
                         <td>NA</td>
                         <td>NA</td>
                        <td>
                        NA
                        </td>
                         <td>
                        NA
                        </td>
                         <td>
                        NA
                        </td>
                         <td>
                        NA
                        </td>
                        <td>
                        NA
                        </td>
                    <td>
                    NA
                    </td>


                    </tr>';
                } else {
                    $linequantity = $quantities[$i];
                    $linequantity = str_replace(',', '', $linequantity);
                    $linequantity = intval($linequantity);
                    $varcmmf = $item->cmmf;
                    // add info to totals variables
                    $totalQuantity += $linequantity;
                    $totalCartons += ceil($item->getCartonCount($linequantity));
                    $totalWeight += $item->getWeight($linequantity);
                    $totalPallets += $item->getPalletCount($linequantity);
                    $totalSpaces += $item->getSpaceCount($linequantity);
                    //end of info to totals variables
                    $response .= '<tr>
                        <td>
                            ' . $varcmmf . '
                        </td>
                        <td >
                            ' . $linequantity . '
                        </td>
                        <td>' . $item->size . '</td>
                         <td>' . $item->case . '</td>
                        <td>
                       ' . ceil($item->getCartonCount($linequantity)) . '
                        </td>
                        <td>
                        ' . number_format($item->weight, 2, '.', '') . '
                        </td>
                        <td>
                       ' . number_format($item->getWeight($linequantity), 2, '.', '') . '
                        </td>
                        <td>
                        ' . $item->cartonsperpallet . '
                        </td>
                              <td>
                    ' . number_format($item->getPalletCount($linequantity), 2, '.', '') . '
                    </td>

                      <td>
                  ' . number_format($item->getSpaceCount($linequantity), 2, '.', '') . '
                    </td>


                    </tr>';
                    //                echo $item->getSpaceCount($quantities[$i]) . '<br>';
                }
                $i++;
            }
            $stats .= '<tr>
<td>' . $totalQuantity . '

</td>
<td>
' . $totalCartons . '
</td>
<td>
' . number_format($totalWeight, 2, '.', '') . '
</td>
<td>
' . number_format($totalPallets, 2, '.', '') . '
</td>
<td>
' . number_format($totalSpaces, 2, '.', '') . '
</td>


</tr></table>
            </div>
            ';
            $response .= '                </table>
            </div>
            ';
            $data['stats'] = $stats;
            $data['response'] = $response;
            $data['missingitems'] = array_unique($notFoundItems);
            return View::make('output-table')->with($data);
        }
    }
예제 #22
0
파일: item.php 프로젝트: rezachess/Planning
 public function checkOverlap($user = null)
 {
     if ($user == null && $this->user == null) {
         throw new UserNotFound();
     }
     if ($user == null) {
         $user = $this->user;
     }
     $item = new Item();
     $item->where(array("start <=" => $this->start, "end >=" => $this->end))->get_by_related($user);
     if ($item->exists()) {
         throw new Item_Overlap_With_Other_Item();
     }
 }
예제 #23
0
파일: routes.php 프로젝트: fagray/fposs
    return substr($date, 8, 2);
    // return Carbon::yesterday()->endOfDay();
    // return (new Sale)->getYesterdaysBestSeller();
    // return Carbon::create(2015,2,3,0)->startOfDay();
    // return Carbon::create(2015-08-26 23:06:20)->endOfDay();
    // return $prod->getCurrentProduction()->toArray();
    return Auth::user()->role;
    if (Auth::attempt(array('password' => 'raymund123'))) {
        return 'true';
    } else {
        return 'false';
    }
    // return 10 + -10;
    // return Item::find(1)->cart;
    $temp = TempCart::all()->toArray();
    $item = Item::where('barcode', '=', '900110023')->get()->toArray();
    // return TempCart::all();
    return json_encode(array_merge($temp, $item));
    return DNS1D::getBarcodeHTML('123456789', "EAN13", 2, 60);
    $production = Production::find(2);
    return $production->items;
});
Route::get('test/{trans_id}', ['uses' => 'SalesController@printInvoice']);
Route::get('sample/{code}', ['uses' => 'SalesController@processOrder']);
Route::get('/item/findbyname/{name}', ['uses' => 'ItemsController@findByName']);
Route::group(array('before' => 'auth'), function () {
    Route::get('/', ['as' => 'home', 'uses' => 'BaseController@index']);
    // Route::get('/',function(){
    // 	return View::make('index')
    // 		->with('title',"Flibbys Point of Sale System");
    // });
예제 #24
0
 public function testNoDocument()
 {
     $items = Item::where('name', 'nothing')->get();
     $this->assertInstanceOf('Illuminate\\Database\\Eloquent\\Collection', $items);
     $this->assertEquals(0, $items->count());
     $item = Item::where('name', 'nothing')->first();
     $this->assertEquals(null, $item);
     $item = Item::find('51c33d8981fec6813e00000a');
     $this->assertEquals(null, $item);
 }
예제 #25
0
 public function aggregateSales()
 {
     $count = 0;
     foreach ($this->children as $e) {
         $count += Item::where('team_id', $e->id)->sum('price');
     }
     return $count + Item::where('team_id', $this->id)->sum('price');
 }
예제 #26
0
include './includes/nav.php';
?>

      <div class="customercontainer">
        <div class="container">
          <div class="row">
            <div class="col s12">
              <h4>Search Results</h3>
              <ul class="collection">
              <?php 
foreach ($res as $res) {
    echo '<li class="collection-item">
                  <div class="img-wrap">
                  <img src="../' . $res->img . '" class="responsive-img circle"></div>
                  <h4 class="line1">' . $res->name . '</h4>';
    $cuisines = Item::where('restaurant_id', $res->id)->distinct('cuisine')->lists('cuisine')->toArray();
    /* Shouldn't do the above query like this */
    echo '<p> Cuisines: ';
    foreach ($cuisines as $key => $cuisine) {
        if ($key == sizeof($cuisines) - 1) {
            echo $cuisine;
        } else {
            echo $cuisine . ',';
        }
    }
    echo '</p>

                  <div class="chip">' . $res->place . '</div>
                  <div class="chip">Min order : &#8377 ' . $res->min_order . '</div>
                  <a href="./menu.php?id=' . $res->id . '" class="waves-effect btn menubtn">Menu</a>
                  </li>';
예제 #27
0
 public function showShop()
 {
     $title = 'Shop';
     $items = Item::where('stock', '>', 0)->get();
     return View::make('shop')->with('title', $title)->with('items', $items);
 }
예제 #28
0
require_once '../classes/session.php';
require_once '../classes/functions.php';
require __DIR__ . '/../vendor/autoload.php';
require_once '../classes/Item.php';
require_once '../classes/Restaurant.php';
require '../config.php';
require '../classes/boot.php';
require '../classes/Uploader.php';
$session = new Session();
$session->adminForceLogin("../index.php");
$rest_id = $_GET['rest_id'];
$item_id = $_GET['item_id'];
if (isset($_POST['create'])) {
    $file = $_FILES['img'];
    $item = Item::where('item_id', $item_id)->first();
    //dd($item);
    unlink('../' . $item->img);
    $item->img = 'public/images/uploads/items/' . basename($file['name']);
    $item->save();
    $error = Uploader::attach_file($file, '../public/images/uploads/items', basename($file['name']));
    if ($error == 0) {
        header("location:view_items.php?id={$rest_id}");
    }
}
$item = Item::find($item_id);
?>


<?php 
getTemplate(1, 'header', []);
예제 #29
0
 public function history($param, $id)
 {
     if ($param) {
         // 1- validate dates, make sure start date is less than end date
         // 2- Build query where create_at is more than start less than end
         return $param;
         return Redirect::action('AccountingController@Index')->with('result_query', $transaction);
     } else {
         $paydata = Item::where('club_id', '=', $id->id)->get();
         return $paydata;
     }
 }
예제 #30
0
function menu()
{
    $rest_id = $_GET['id'];
    $items = Item::where("restaurant_id", $rest_id)->get();
    return $items;
}