function check_for_entries($student_no)
 {
     $entries = Students::all();
     $counter = 0;
     foreach ($entries as $entry) {
         if ($entry->student_id == $student_no) {
             $counter++;
         }
     }
     return $counter;
 }
示例#2
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $input = Request::all();
     // $student = new Students;
     // $student->school_id = $input['school_id'];
     // $student->lastname = $input['lastname'];
     // $student->firstname = $input['firstname'];
     // $student->middlename = $input['middlename'];
     // $student->password = $input['password'];
     // $student->save();
     //dd($input);
     Students::create($input);
     $user = new User();
     $user->school_id = $input['school_id'];
     $user->password = $input['password'];
     $user->status = "0";
     $user->save();
     return $input;
 }
示例#3
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);
 }
示例#4
0
//Route::get('/movies', function () {
//$Movies = \App\Movie::where('title','=','shuga')->get();
//$Movies = \App\movie::where('rating','>'2)->get(); //select * from movies where rating > 2
//return $movies;
//$movie= new \App\Movie();
//$Movie->title='Akirachix';
//$movie->genre='awesome';
//$movie->rating=5;
//$movie->save();
// $movie= \App\Movie::find(5);
// $movie->genre='Horror';
// $movie->rating=4;
// $movie->save();
// return $movie;
//return \App\Movie::all();
Route::get('/students', function () {
    //$Students = \App\Students::where('lastname','=','Maich')->get();
    //return $Students;
    $students = new \App\Students();
    $students->id = '6';
    $students->firstname = 'Cate';
    $students->lastname = 'Mwai';
    $students->save();
    // $movie= \App\Movie::find(5);
    // $movie->genre='Horror';
    // $movie->rating=4;
    // $movie->save();
    // return $movie;
    return \App\Students::all();
    Route::get('/movies', 'studentsController@index');
});
 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);
 }
 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);
 }
 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);
 }
示例#8
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 public function create(array $data)
 {
     return Students::create(['school_id' => $data['school_id'], 'lastname' => $data['lastname'], 'firstname' => $data['firstname'], 'middlename' => $data['middlename'], 'password' => bcrypt($data['password'])]);
 }
 function daily_report()
 {
     $date = $_POST['reportDate'];
     $branch = $_POST['branch'];
     if ($branch == '0') {
         $entries = Students::latest('entry_time')->where('entry_time', '=', $date)->get();
     } else {
         switch ($branch) {
             case 1:
                 $branch = "CS";
                 break;
             case 2:
                 $branch = "IT";
                 break;
             case 3:
                 $branch = "EC";
                 break;
             case 4:
                 $branch = "EN";
                 break;
             case 5:
                 $branch = "EI";
                 break;
             case 6:
                 $branch = "CE";
                 break;
             case 7:
                 $branch = "ME";
                 break;
             case 8:
                 $branch = "MCA";
                 break;
             case 9:
                 $branch = "MBA";
                 break;
         }
         $entries = Students::latest('entry_time')->where('entry_time', '=', $date)->get();
     }
     return view('DailyReportGenerated', compact('entries', 'branch', 'date'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $students = Students::all();
     $data = array('students' => $students);
     return view('students.list', $data);
 }