app/Http/Controllers/ManualPurchaseRequestMappingController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index($itemID)
    {
        $agreementHeaders = [];
        $branchItem = [];
		foreach(AgreementLine::where('itemID',$itemID)->get()->pluck('agreementID') as $value)
		{
		    if(AgreementHeader::where("agreementID", $value)->where("status","Active")->exists()) {
		        $agreement = AgreementHeader::where("agreementID", $value)->where("status","Active")->first();
		        array_push($agreementHeaders,  $agreement);
		        array_push($agreementLines, AgreementLine::where('agreementID', $agreement->agreementID)->where('revision', $agreement->revision)->where('itemID', $value));
		    }
		}
		if(BranchItem::where("itemID", $itemID)->exists()) {
		    array_push($branchItem, Branch::where("itemID", $itemID)->get());
		}
		return View::make('manualPurchaseRequestMapping.index')->with('agreementHeaders', $agreementHeaders)->with('agreementLines', $agreementLines)->with('branchItem', $branchItem);
    }
public function index ( $ itemID ) { $ agreementHeaders = [ ] ; $ branchItem = [ ] ; foreach ( AgreementLine :: where ( 'itemID' , $ itemID ) -> get ( ) -> pluck ( 'agreementID' ) as $ value ) { if ( AgreementHeader :: where ( " agreementID " , $ value ) -> where ( " status " , " Active " ) -> exists ( ) ) { $ agreement = AgreementHeader :: where ( " agreementID " , $ value ) -> where ( " status " , " Active " ) -> first ( ) ; array_push ( $ agreementHeaders , $ agreement ) ; array_push ( $ agreementLines , AgreementLine :: where ( 'agreementID' , $ agreement -> agreementID ) -> where ( 'revision' , $ agreement -> revision ) -> where ( 'itemID' , $ value ) ) ; } } if ( BranchItem :: where ( " itemID " , $ itemID ) -> exists ( ) ) { array_push ( $ branchItem , Branch :: where ( " itemID " , $ itemID ) -> get ( ) ) ; } return View :: make ( 'manualPurchaseRequestMapping.index' ) -> with ( 'agreementHeaders' , $ agreementHeaders ) -> with ( 'agreementLines' , $ agreementLines ) -> with ( 'branchItem' , $ branchItem ) ; }
Display a listing of the resource.
Display a listing of the resource .
// Retrieve all the supplier // Kim Lam  // Load the view and pass the retrieved supplier to the view for further processing //return View::make('supplier.index')->with('supplier', $supplier);