Example #1
0
 /**
  * Display the specified resource.
  * GET /ingredients/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $prod_unit_obj = new ProductionUnit();
     $units = $prod_unit_obj->showUnitTypes($id);
     $ingredient = $this->stock->findOrFail($id);
     $supplier = $this->supplier->findOrFail($ingredient->supplier_id);
     return View::make('stocks.show')->with('ingredient', $ingredient)->with('units', $units)->with('supplier', $supplier)->with('title', $ingredient->name . ' | Ingredient details');
 }
Example #2
0
 public function showUnitTypes($ingredient_id)
 {
     $prod_unit_obj = new ProductionUnit();
     $units = $prod_unit_obj->showUnitTypes($ingredient_id);
     return View::make('inventory.unit-types')->with('title', 'Unit types')->with('units', $units);
 }
 private function ParseProductionUnit($item)
 {
     $type = $item["type"];
     return ProductionUnit::FromIDResource(self::ParseIDResource($item), $type);
 }
Example #4
0
			background:#01A525;padding:5px;color:#fff;
		}

		.failed {

			background:#ff0000;padding:5px;color:#fff;
		}
	</style>
@stop

@section('content')

	<?php 
$item_obj = new Item();
$prod_unit = new ProductionUnit();
$item_id = '';
?>
<!-- {{ Form::open(['route' => 'productions.cook','id' => 'formCook'])}} -->
<!-- {{ Form::submit("Let's Cook", ['class' => 'btn btn-large btn-primary pull-right'])}} -->
	<span class="pull-right">
        <a  class="btn btn-primary btn-large" href="/items/productions"><i class="icon icon-cog"></i> Back to Production</a>
    </span>
	<h2 class="head-1 ">Item Recipes</h2><hr/>
	<!-- <a id="addItem" class="btn btn-primary">Add Item</a><br/><br/> -->
	
	<div class="row" >

	<div id="loaderContainer"></div>
	 
	  @foreach($production_items as $item)
Example #5
0
 /**
  * Remove unit from the ingredient's unit list
  */
 public function removeUnit($ing_id, $unit_id)
 {
     $prod_unit = new ProductionUnit();
     $prod_unit->removeIngredientUnit($ing_id, $unit_id);
     return Response::json(['response' => 200, 'msg' => 'Unit has been removed.']);
 }