app/Http/Controllers/ReportController.php
/**
	 * Update the specified resource in storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
Update the specified resource in storage.
@param  int  $id
@return Response
Update the specified resource in storage . @param int $id @return Response
public function update($id,  Request $request)
	{
		$set['executed_by'] = session()->get('email');
		$set['execution_type'] = 'manual';
		if($request->type== 'testlab')
		{
			$set['execution_result'] = $request->execution_result;
			$set['checkpoint_result'] = $request->checkpoint_result;
			$update_obj    = new ResultUpdateQueryHandler();
			$update_result = $update_obj->updateExecutionByLabId($id, $set);
			if($update_result == 1)
			{
				$lab = \App\Lab::find($id)->update($set);
				$message = $this->getMessage('messages.update_success');
				Toast::message($message, 'success');	
			}else{
				$message = $this->getMessage('messages.update_failed');
				Toast::message($message, 'danger');
			}
		}elseif($request->type== 'scenariolab'){
			$set['execution_result'] = $request->result;
			$set['checkpoint_result'] = $request->result;		
			$sc_set['executed_by'] = session()->get('email');
			$sc_set['execution_type'] = 'manual';
			$sc_set['result'] = $request->result;
			$sc_set['comment'] = $request->comment;
			$update_obj    = new ResultUpdateQueryHandler();
			$update_result = $update_obj->updateLabsByScenarioLabId($id, $set);
			if($update_result == 1)
			{
				$sc_lab = \App\ScenarioLab::find($id)->update($sc_set);
				$message = $this->getMessage('messages.update_success');
				Toast::message($message, 'success');	
			}else{
				$message = $this->getMessage('messages.update_failed');
				Toast::message($message, 'danger');
			}
		}
		return redirect()->back();
	}
public function update ( $ id , Request $ request ) { $ set [ 'executed_by' ] = session ( ) -> get ( 'email' ) ; $ set [ 'execution_type' ] = 'manual' ; if ( $ request -> type == 'testlab' ) { $ set [ 'execution_result' ] = $ request -> execution_result ; $ set [ 'checkpoint_result' ] = $ request -> checkpoint_result ; $ update_obj = new ResultUpdateQueryHandler ( ) ; $ update_result = $ update_obj -> updateExecutionByLabId ( $ id , $ set ) ; if ( $ update_result == 1 ) { $ lab = \ App \ Lab :: find ( $ id ) -> update ( $ set ) ; $ message = $ this -> getMessage ( 'messages.update_success' ) ; Toast :: message ( $ message , 'success' ) ; } else { $ message = $ this -> getMessage ( 'messages.update_failed' ) ; Toast :: message ( $ message , 'danger' ) ; } } elseif ( $ request -> type == 'scenariolab' ) { $ set [ 'execution_result' ] = $ request -> result ; $ set [ 'checkpoint_result' ] = $ request -> result ; $ sc_set [ 'executed_by' ] = session ( ) -> get ( 'email' ) ; $ sc_set [ 'execution_type' ] = 'manual' ; $ sc_set [ 'result' ] = $ request -> result ; $ sc_set [ 'comment' ] = $ request -> comment ; $ update_obj = new ResultUpdateQueryHandler ( ) ; $ update_result = $ update_obj -> updateLabsByScenarioLabId ( $ id , $ set ) ; if ( $ update_result == 1 ) { $ sc_lab = \ App \ ScenarioLab :: find ( $ id ) -> update ( $ sc_set ) ; $ message = $ this -> getMessage ( 'messages.update_success' ) ; Toast :: message ( $ message , 'success' ) ; } else { $ message = $ this -> getMessage ( 'messages.update_failed' ) ; Toast :: message ( $ message , 'danger' ) ; } } return redirect ( ) -> back ( ) ; }
Update the specified resource in storage.
Update the specified resource in storage .