示例#1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     //
     $user = \Auth::user();
     //dd($user);
     $rArtifacts = array();
     $rMethodology = array();
     $rCompany = \App\RegistryCompany::where('id_period', $id)->where('id_student', $user->id)->get();
     if (count($rCompany) > 0) {
         $rMethodology = \App\RegistryMethodology::where('id_period', $id)->where('id_company', $rCompany[0]->id_company)->get();
         if (count($rMethodology) > 0) {
             //dd($rMethodology[0]->id_methodology);
             $rArtifacts = \App\Methodology::Join('phases', function ($join) {
                 $join->on('phases.id_methodology', '=', 'methodologies.id');
             })->join('artifacts', function ($join) {
                 $join->on('artifacts.id_phase', '=', 'phases.id');
             })->leftJoin('calendars', function ($leftJoin) use($user, $rCompany, $id) {
                 $leftJoin->on('calendars.id_phase', '=', 'phases.id')->where('calendars.id_artifact', '=', 'artifacts.id')->where('calendars.id_methodology', '=', 'methodologies.id')->where('calendars.id_student', '=', $user->id)->where('calendars.id_period', '=', $id)->where('calendars.id_company', '=', $rCompany[0]->id_company);
             })->select('methodologies.id as meth_id', 'methodologies.name as meth_name', 'phases.id as pha_id', 'phases.name as pha_name', 'artifacts.id as art_id', 'artifacts.name as art_name', 'artifacts.start as art_start', 'artifacts.delivery as art_delivery', 'calendars.id_calendar as id_calendar', 'calendars.htmlLink as htmlLink')->where('artifacts.active', true)->where('phases.active', true)->where('methodologies.active', true)->where('methodologies.id', $rMethodology[0]->id_methodology)->orderBy('artifacts.delivery', 'asce')->get();
             //	dd($rArtifacts);
         } else {
             $rMethodology = array();
         }
     } else {
         $rCompany = array();
     }
     //$artifacts = \App\Artifact::orderBy('delivery','asc')->get();//all()->orderBy('delivery', 'asce');
     return view('Admin.Course.Advance.advance', ['rMethodology' => $rMethodology, 'rArtifacts' => $rArtifacts, 'rCompany' => $rCompany, 'id' => $id]);
     /*$artifact = \App\Artifact::findOrFail($id);
     		return view('Admin.Course.Advance.show',
     		[
     			'artifact'=>$artifact
     			]
     		);*/
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     //period.company
     $data = explode('.', $id);
     $rArtifacts = array();
     $rMethodology = array();
     $rMethodology = \App\RegistryMethodology::where('id_period', $data[0])->where('id_company', $data[1])->get();
     if (count($rMethodology) > 0) {
         //dd($rMethodology[0]->id_methodology);
         $rArtifacts = \App\Methodology::Join('phases', function ($join) {
             $join->on('phases.id_methodology', '=', 'methodologies.id');
         })->join('artifacts', function ($join) {
             $join->on('artifacts.id_phase', '=', 'phases.id');
         })->select('methodologies.id as meth_id', 'methodologies.name as meth_name', 'phases.id as pha_id', 'phases.name as pha_name', 'artifacts.id as art_id', 'artifacts.name as art_name', 'artifacts.start as art_start', 'artifacts.delivery as art_delivery')->where('artifacts.active', true)->where('phases.active', true)->where('methodologies.active', true)->where('methodologies.id', $rMethodology[0]->id_methodology)->orderBy('artifacts.delivery', 'asce')->get();
         //	dd($rArtifacts);
     } else {
         $rMethodology = array();
     }
     return view('Admin.Evaluation.advance', ['rMethodology' => $rMethodology, 'rArtifacts' => $rArtifacts, 'data' => $data]);
     //
 }
示例#3
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     //
     $methodology = \App\Methodology::lists('name', 'id');
     $currentuser = $this->user;
     $company = \App\RegistryCompany::Join('companies', function ($join) use($currentuser) {
         $join->on('companies.id', '=', 'registry_companies.id_company')->where('registry_companies.id_student', '=', $currentuser->id);
     })->select('companies.id', 'companies.name')->where('id_period', $id)->get();
     //dd($company[0]->name);
     if (count($company) > 0) {
         $teamwork = \App\RegistryCompany::Join('users', function ($join) use($company) {
             $join->on('users.id', '=', 'registry_companies.id_student')->where('registry_companies.id_company', '=', $company[0]->id);
         })->select('users.id', 'users.first_name', 'users.last_name', 'users.email')->where('id_period', $id)->get();
     } else {
         $teamwork = array();
     }
     if (count($company) > 0 && count($teamwork) > 0) {
         $account = \App\ConfigCorreo::where('id_company', '=', $company[0]->id)->where('id_period', '=', $id)->get();
         if (count($account) > 0) {
             $account = $account[0];
         } else {
             $account = array();
         }
     } else {
         $account = array();
     }
     if (count($company) > 0 && count($teamwork) > 0) {
         $methodology_use = \App\RegistryMethodology::where('id_company', '=', $company[0]->id)->where('id_period', '=', $id)->get();
         if (count($methodology_use) > 0) {
             $methodology_use = $methodology_use[0];
         } else {
             $methodology_use = array();
         }
     } else {
         $methodology_use = array();
     }
     //dd();
     return view("Admin.Course.Settings.setting", ['company' => $company, 'teamwork' => $teamwork, 'id' => $id, 'account' => $account, 'methodology' => $methodology, 'methodology_use' => $methodology_use]);
 }