コード例 #1
0
 public function instituteReport($Iid)
 {
     /****Admin****/
     $today = date('Y-m-d');
     $y = date("Y");
     //return $today;
     $totalStudents = Students::where('status', '=', 1)->where('institute_code', '=', $Iid)->count();
     $totalStudentsMale = Students::where('status', '=', 1)->where('institute_code', '=', $Iid)->where('gender', '=', 'Male')->count();
     $totalStudentsFemale = Students::where('status', '=', 1)->where('institute_code', '=', $Iid)->where('gender', '=', 'Female')->count();
     $totalTeachesrs = Teacher::where('institute_code', '=', $Iid)->count();
     $teacherAttendence = Attendence::where('institute_code', '=', $Iid)->where('type', '=', 'Teacher')->where('status', '=', 0)->where('created_at', 'LIKE', "%{$today}%")->count();
     $teacherAttendence1 = Attendence::where('institute_code', '=', $Iid)->where('type', '=', 'Teacher')->where('status', '=', 1)->where('created_at', 'LIKE', "%{$today}%")->count();
     $total = $teacherAttendence + $teacherAttendence1;
     //return $total;
     $today_atten = (int) ($total / $totalTeachesrs * 100);
     //return $today_atten;
     $a1 = Attendence::where('institute_code', '=', $Iid)->where('created_at', 'LIKE', "%{$y}%")->where('type', '=', 'Teacher')->where('status', '=', 1)->count();
     $a0 = Attendence::where('institute_code', '=', $Iid)->where('created_at', 'LIKE', "%{$y}%")->where('type', '=', 'Teacher')->where('status', '=', 0)->count();
     $ay = $a1 + $a0;
     //return $ay;
     if ($y % 4 == 0) {
         $x = 366;
         $year_percent = (int) ($ay / $x * 100);
     } else {
         $yx = 365;
         $year_percent = (int) ($ay / $yx * 100);
     }
     //return $atten_percent;
     // return $AtotalInstitute;
     $totalTeacherMale = Teacher::where('institute_code', '=', $Iid)->where('gender', '=', 'Male')->count();
     $totalTeacherFemale = Teacher::where('institute_code', '=', $Iid)->where('gender', '=', 'Female')->count();
     $m = date("Y-m");
     ///$h=Holyday::where('holiday_date','LIKE',"%2016-03%")->get();
     //$h=Holyday::where('holiday_date','LIKE',"%$m%")->get();
     $d = date('t');
     $at = Holyday::where('holiday_date', 'LIKE', "%{$m}%")->count();
     $p = $d - $at;
     //return $p;
     $a12 = Attendence::where('institute_code', '=', $Iid)->where('created_at', 'LIKE', "%{$m}%")->where('type', '=', 'Teacher')->where('status', '=', 1)->count();
     $a02 = Attendence::where('institute_code', '=', $Iid)->where('created_at', 'LIKE', "%{$m}%")->where('type', '=', 'Teacher')->where('status', '=', 0)->count();
     $ay2 = $a12 + $a02;
     //return $a12.$a02;
     $t = $totalTeachesrs * $p;
     $ms = (int) ($ay2 / $t * 100);
     $at = Holyday::where('holiday_date', 'LIKE', "%{$m}%")->count();
     $InstiHolyday = InstiHolyday::where('holiday_date', 'LIKE', "%{$m}%")->where('institute_code', '=', $Iid)->count();
     $InstiWeekEnd = AcademicCalender::where('institute_code', '=', $Iid)->pluck('weekendday');
     $WeekEnd1 = str_limit($InstiWeekEnd, 3, '');
     $WeekEnd2 = substr($InstiWeekEnd, 4);
     $WeekEnd3 = substr($InstiWeekEnd, 9);
     //   return date('d', strtotime($WeekEnd1));
     $month = date('m');
     $year = date("Y");
     $start_date = "01-" . $month . "-" . $year;
     $start_time = strtotime($start_date);
     $end_time = strtotime("+1 month", $start_time);
     for ($i = $start_time; $i < $end_time; $i += 86400) {
         $list[] = date('D', $i);
     }
     $p = $d - ($at + $InstiHolyday);
     $ms = (int) ($p / $d * 100);
     //students attendence report saif...
     //today attendence calculation
     $totalStudents = Students::where('institute_code', '=', $Iid)->count();
     $totalstudentsAtten = Attendence::where('institute_code', '=', $Iid)->where('type', '=', 'Student')->where('status', '=', 0)->where('created_at', 'LIKE', "%{$today}%")->count();
     $studentTodayReport = (int) ($totalstudentsAtten / $totalStudents * 100);
     //monthly calculation
     $stdPrestAve = Attendence::where('institute_code', '=', $Iid)->where('type', '=', 'Student')->where('status', '=', 0)->where('created_at', 'LIKE', "%{$m}%")->count();
     //$presentPersent= (int)(($stdPrestAve/$p)*100);
     $mtotal = $totalStudents * $p;
     $monthpresentPersent = (int) ($stdPrestAve / $mtotal * 100);
     ///yearly calculation
     return view('superadmin.ListofInstituteReport')->with('totalStudents', $totalStudents)->with('totalTeachesrs', $totalTeachesrs)->with('totalStudentsMale', $totalStudentsMale)->with('totalStudentsFemale', $totalStudentsFemale)->with('today', $today_atten)->with('year', $year_percent)->with('m', $totalTeacherMale)->with('f', $totalTeacherFemale)->with('mon', $ms)->with('studentTodayReport', $studentTodayReport)->with('monthpresentPersent', $monthpresentPersent);
 }
コード例 #2
0
 public function getMarkViews($roll, $cid)
 {
     $stdInfo = Students::where('institute_code', '=', Auth::user()->institute_id)->where('roll', '=', $roll)->where('class', '=', $cid)->first();
     $stdClass = ClassAdd::where('class_id', '=', $stdInfo->class)->pluck('class_name');
     $showAllMark = Mark::where('institute_code', '=', Auth::user()->institute_id)->where('roll', '=', $roll)->where('class_id', '=', $cid)->get();
     $showAllMarkExamName = Mark::where('institute_code', '=', Auth::user()->institute_id)->where('roll', '=', $roll)->where('class_id', '=', $cid)->select('exam_name')->distinct()->get();
     //    $showAllMarkExamName=Mark::where('institute_code','=',Auth::user()->institute_id)->where('roll','=', $roll)->where('class_id','=',$cid)->get();
     $MarkViewGrade = Mark::where('institute_code', '=', Auth::user()->institute_id)->where('roll', '=', $roll)->where('class_id', '=', $cid)->first();
     //return $showAllMark->sub_mark;
     $allGrad = GradeSystem::where('institute_code', '=', Auth::user()->institute_id)->get();
     $MarkViewGrade = Mark::where('institute_code', '=', Auth::user()->institute_id)->where('roll', '=', $roll)->where('class_id', '=', $cid)->get();
     /*  foreach ($allGrad as $key => $value) {
              //return $MarkViewGrade->sub_mark;
              $MarkViewGrade=Mark::where('institute_code','=',Auth::user()->institute_id)->where('roll','=', $roll)->where('class_id','=',$cid)->get();
     
              //return $MarkViewGrade;
              foreach ($MarkViewGrade as $key => $markget) {
         //  return $value->mark_form;
                if ($markget->sub_mark>=$value->mark_form && $markget->sub_mark<=$value->mark_upto) {
     
                 $point=$value->grade_point ;
                 $grade=$value->grade_name ;
                 return view('admin.resultMark.markviews')->with('stdInfo',$stdInfo)->with('stdClass',$stdClass)
                 ->with('showAllMark',$showAllMark)->with('MarkViewGrade',$MarkViewGrade)->with('allGrad',$allGrad)->with('point',$point)->with('grade',$grade);
     
                }
     
                else {
                  return 2 ;
                }
              }
     
     
     
            }*/
     //  return $point.$grade;
     return view('admin.resultMark.markviews')->with('stdInfo', $stdInfo)->with('stdClass', $stdClass)->with('showAllMark', $showAllMark)->with('MarkViewGrade', $MarkViewGrade)->with('allGrad', $allGrad)->with('showAllMarkExamName', $showAllMarkExamName);
 }
コード例 #3
0
 public function getMarkViews()
 {
     //  $stdInfo=Students::where('institute_code','=',Auth::user()->institute_id)->where('roll','=', $roll)->where('class','=',$cid)->first();
     $stdInfo = Students::where('institute_code', '=', Auth::user()->institute_id)->where('st_id', '=', Auth::user()->uid)->first();
     $stdClass = ClassAdd::where('class_id', '=', $stdInfo->class)->pluck('class_name');
     //return $stdInof->class;
     $showAllMark = Mark::where('institute_code', '=', Auth::user()->institute_id)->where('roll', '=', $stdInfo->roll)->where('class_id', '=', $stdInfo->class)->get();
     $showAllMarkExamName = Mark::where('institute_code', '=', Auth::user()->institute_id)->where('roll', '=', $stdInfo->roll)->where('class_id', '=', $stdInfo->class)->select('exam_name')->distinct()->get();
     //    $showAllMarkExamName=Mark::where('institute_code','=',Auth::user()->institute_id)->where('roll','=', $roll)->where('class_id','=',$cid)->get();
     $MarkViewGrade = Mark::where('institute_code', '=', Auth::user()->institute_id)->where('roll', '=', $stdInfo->roll)->where('class_id', '=', $stdInfo->class)->first();
     //return $showAllMark->sub_mark;
     $allGrad = GradeSystem::where('institute_code', '=', Auth::user()->institute_id)->get();
     $MarkViewGrade = Mark::where('institute_code', '=', Auth::user()->institute_id)->where('roll', '=', $stdInfo->roll)->where('class_id', '=', $stdInfo->class)->get();
     return view('admin.resultMark.markviews')->with('stdInfo', $stdInfo)->with('stdClass', $stdClass)->with('showAllMark', $showAllMark)->with('MarkViewGrade', $MarkViewGrade)->with('allGrad', $allGrad)->with('showAllMarkExamName', $showAllMarkExamName);
 }
コード例 #4
0
 public function updateInvoice($id)
 {
     $class = Input::get('class');
     $section = Input::get('section');
     $student = Input::get('student');
     $feetype = Input::get('feetype');
     $amount = Input::get('amount');
     $paidamountid = Input::get('paid');
     $answer = Input::get('answer');
     $date = Input::get('date');
     //return $paidamountid;
     $studentid = Students::where('institute_code', '=', Auth::user()->institute_id)->where('name', '=', $student)->where('class', '=', $class)->pluck('st_id');
     return $studentid;
     $classname = ClassAdd::where('institute_code', '=', Auth::user()->institute_id)->where('class_id', '=', $class)->pluck('class_name');
     $feetypename = AccountFeeType::where('institute_code', '=', Auth::user()->institute_id)->where('fee_id', '=', $feetype)->pluck('fee_type');
     $up = Invoice::where('institute_code', '=', Auth::user()->institute_id)->where('id', '=', $id)->update(['class_id' => $class, 'class_name' => $classname, 'section_id' => $section, 'student_name' => $student, 'student_id' => $studentid, 'fee_type' => $feetypename, 'fee_id' => $feetype, 'total_amount' => $amount, 'payment_ammount' => $paidamountid, 'due_amount' => $answer, 'date' => $date]);
     Session::flash('data', 'Success!');
     return redirect::to('admin/edit/invoice/' . $id);
 }