Skip to content

Instantly share code, notes, and snippets.

@n3tr
Last active December 14, 2015 18:19
Show Gist options
  • Save n3tr/5128645 to your computer and use it in GitHub Desktop.
Save n3tr/5128645 to your computer and use it in GitHub Desktop.
public function get_generate(){
$usermapping = Usermapping::with(array('course_mapping'))->where('user_id','=',Auth::user()->id)->get();
$credit_local = 0;
$credit_inter = 0;
foreach ($usermapping as $mapping) {
$credit_local += $mapping->course_mapping->localcourse->credit;
$credit = $mapping->course_mapping->intercourse->intercoursedetail[0]->credit;
$credit_inter += $credit;
}
return View::make('transfers.generatedoc')
->with('usermapping',$usermapping)
->with('credit_local',$credit_local)
->with('credit_inter',$credit_inter);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment