app/Http/Controllers/DefectController.php
/**
	 * Display a listing of the resource.
	 *
	 * @return Response
	 */
Display a listing of the resource.
@return Response
Display a listing of the resource . @return Response
public function index()
	{
		$charts_obj = new ChartsHandler();
		$id = session()->get('open_project');
		$project = \App\TestProject::find($id);
		$project->functionalities = \App\TestFunctionality::where('tp_id' , $id)->get();
		$lab_details = \App\Defect::where('tp_id' , $id)->orderBy('created_at', 'asc')->get();
		$chart_details = $charts_obj->initChartDetails();		
		foreach ($lab_details as $key => $value) {
			$lab = \App\Lab::where('tc_id' , $value->tc_id)->orderBy('created_at', 'desc')->first();
			$value->lab = $lab;
			$tsc = \App\TestScenario::select('tsc_name')->where('tsc_id' , $value->tsc_id)->get();
			$value->tsc_name = $tsc[0]->tsc_name;
			$fn  = \App\TestFunctionality::select('tf_name')->where('tf_id' , $lab->tf_id)->get();
			$value->tf_name = $fn[0]->tf_name;
			$chart_value['tc_status'] = $value->status;
			$chart_value['execution_result'] = $value->lab->execution_result;
			$chart_value['checkpoint_result'] = $value->lab->checkpoint_result;
			$chart_details = $charts_obj->getChartSummary($chart_value, $chart_details);
		}
		$charts_obj->createExecutionPieChart($chart_details);
		$charts_obj->createCheckpointPieChart($chart_details);
		return view('defects.defects', ['project' => $project, 'lab_results' => $lab_details]);	 
	}
public function index ( ) { $ charts_obj = new ChartsHandler ( ) ; $ id = session ( ) -> get ( 'open_project' ) ; $ project = \ App \ TestProject :: find ( $ id ) ; $ project -> functionalities = \ App \ TestFunctionality :: where ( 'tp_id' , $ id ) -> get ( ) ; $ lab_details = \ App \ Defect :: where ( 'tp_id' , $ id ) -> orderBy ( 'created_at' , 'asc' ) -> get ( ) ; $ chart_details = $ charts_obj -> initChartDetails ( ) ; foreach ( $ lab_details as $ key => $ value ) { $ lab = \ App \ Lab :: where ( 'tc_id' , $ value -> tc_id ) -> orderBy ( 'created_at' , 'desc' ) -> first ( ) ; $ value -> lab = $ lab ; $ tsc = \ App \ TestScenario :: select ( 'tsc_name' ) -> where ( 'tsc_id' , $ value -> tsc_id ) -> get ( ) ; $ value -> tsc_name = $ tsc [ 0 ] -> tsc_name ; $ fn = \ App \ TestFunctionality :: select ( 'tf_name' ) -> where ( 'tf_id' , $ lab -> tf_id ) -> get ( ) ; $ value -> tf_name = $ fn [ 0 ] -> tf_name ; $ chart_value [ 'tc_status' ] = $ value -> status ; $ chart_value [ 'execution_result' ] = $ value -> lab -> execution_result ; $ chart_value [ 'checkpoint_result' ] = $ value -> lab -> checkpoint_result ; $ chart_details = $ charts_obj -> getChartSummary ( $ chart_value , $ chart_details ) ; } $ charts_obj -> createExecutionPieChart ( $ chart_details ) ; $ charts_obj -> createCheckpointPieChart ( $ chart_details ) ; return view ( 'defects.defects' , [ 'project' => $ project , 'lab_results' => $ lab_details ] ) ; }
Display a listing of the resource.
Display a listing of the resource .
//Get details about test cases /* 
			Pie Charts showing summary of results 
		*/