Esempio n. 1
0
 protected function addparent()
 {
     global $user;
     global $objPDO;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin() == true && isset($_GET['uid'])) {
         global $objPDO;
         $studentProfile = new StudentProfile($objPDO);
         $studentProfile->loadByUserId($_GET['uid']);
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/addparent.php';
     } else {
         header('Location:http://localhost/cloud');
     }
 }
 protected function sectionview()
 {
     global $user;
     global $objPDO;
     $student = new Student($objPDO, $user->getuserId());
     if ($student->checkStudent()) {
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_section_class.php';
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php';
         $role = $student->getacctType();
         $stu_pro = new StudentProfile($objPDO);
         $stu_pro->loadByUserId($student->getID());
         $sec = new StudentSection($objPDO);
         $class = $sec->getByStudentId($stu_pro->getID());
     } else {
         $class = $_GET['uid'];
     }
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin() == true || $student->checkTeacher() || $student->checkStudent()) {
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/timetable_settings_class.php';
         $sett = new TimetableSettings($objPDO);
         $slots = $sett->getAllSlots();
         if (!isset($slots)) {
             $num_slots = 0;
         } else {
             $num_slots = count($slots);
         }
         include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/subject_class.php';
         include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/section_teacher_subject_class.php';
         include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/timetable_class.php';
         $rel = new SectionTeacherSubjectRelations($objPDO);
         $teasubrel = $rel->getByClass($class);
         $subjects = array();
         for ($i = 0; $i < count($teasubrel); $i++) {
             $subjects[$teasubrel[$i]['subject_id']] = Subject::getSubjectName($teasubrel[$i]['subject_id']);
         }
         $tt = new Timetable($objPDO);
         $timetable = $tt->getBySection($class);
         $total = 0;
         $count = array();
         foreach ($timetable as $key => $value) {
             $total++;
             if (array_key_exists($value, $count)) {
                 $count[$value]++;
             } else {
                 $count[$value] = 1;
             }
         }
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/section_timetable_view_template.php';
     } else {
         header('Location:http://localhost/cloud');
     }
 }
 protected function report()
 {
     global $user;
     global $objPDO;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin() == true || $student->checkTeacher() || $student->checkStudent()) {
         $role = $student->getacctType();
         $sid = NULL;
         if ($student->checkStudent()) {
             include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php';
             $sid = $student->getID();
         } else {
             if (isset($_GET['uid'])) {
                 $sid = $_GET['uid'];
             }
         }
         if ($sid) {
             include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php';
             include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/attendence_class.php';
             include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_section_class.php';
             include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/section_class.php';
             $stu = new StudentProfile($objPDO);
             $stu->loadByUserId($sid);
             $roll_number = $stu->getRollNo();
             $name = $stu->getName();
             $section = new StudentSection($objPDO);
             $section_id = $section->getByStudentId($sid);
             $sec = new Section($objPDO, $section_id);
             $section_name = $sec->getCode();
             $att = new Attendence($objPDO);
             $total_days = $att->getBySectionId($section_id);
             $attendance = $att->getByStudentId($stu->getID());
             $present = 0;
             $absent = 0;
             foreach ($attendance as $key => $value) {
                 if ($value['presence'] == 1) {
                     $present++;
                 } else {
                     if ($value['presence'] == 0) {
                         $absent++;
                     }
                 }
             }
             include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/report_view.php';
         } else {
             echo 'error';
         }
     } else {
         header('Location:http://localhost/cloud');
     }
 }
    public function makepdf()
    {
        global $user;
        // Get required files.
        require_once 'others/fpdf/fpdf.php';
        // Set some document variables
        $author = "eduCloud";
        $x = 35;
        $text = <<<EOT
Hello
EOT;
        // Create fpdf object
        $pdf = new FPDF('P', 'pt', 'Letter');
        // Set base font to start
        $pdf->SetFont('Arial', 'B', 16);
        // Add a new page to the document
        $pdf->addPage();
        $pdf->setLeftMargin($x);
        //page border
        $pdf->Line(35, 30, 35, 750);
        $pdf->Line(35, 30, 575, 30);
        $pdf->Line(575, 30, 575, 750);
        $pdf->Line(575, 750, 35, 750);
        //end of page border
        // Set the x,y coordinates of the cursor
        $pdf->SetXY($x + 20, 40);
        // Write 'Simple PDF' with a line height of 1 at the current position
        $pdf->Write(25, 'Enrollment Form');
        $pdf->Image($_SERVER['DOCUMENT_ROOT'] . '/cloud/images/school_logo.jpg', 500, 35, 50, 50, 'JPG');
        // Reset the font
        // Reset font, color, and coordinates
        $pdf->SetFont('Arial', '', 12);
        $pdf->SetTextColor(0, 0, 0);
        $pdf->SetLeftMargin($x + 50);
        $pdf->setXY($x + 50, 90);
        global $objPDO;
        require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php';
        $record = new StudentProfile($objPDO);
        $record->loadByUserId($_GET['uid']);
        // Write out a long text blurb.
        //$array=$record->getAsArray();
        //$x=0;
        /* TEMPLATE 1 DESIGN*/
        $pdf->SetFont('Arial', '', 8);
        $pdf->setFillColor(255, 255, 255);
        $pdf->cell(200, 20, 'Admission Number (reference) : ' . $record->getAdmissionNumber(), 0, 1, 'L', true);
        $pdf->SetFont('Arial', '', 12);
        $pdf->setFillColor(50, 50, 50);
        $pdf->setTextColor(255, 255, 255);
        $pdf->cell(450, 20, 'Student Details', 0, 1, 'C', true);
        $pdf->setTextColor(0, 0, 0);
        $pdf->setFillColor(221, 221, 221);
        $pdf->cell(200, 20, 'Student Name', 0, 0, 'C', true);
        $pdf->cell(250, 20, $record->getName(), 0, 1, 'C', true);
        $pdf->setFillColor(255, 255, 255);
        $pdf->cell(200, 20, 'Roll Number *', 0, 0, 'C', true);
        $pdf->cell(250, 20, $record->getRollNo(), 0, 1, 'C', true);
        $pdf->setFillColor(221, 221, 221);
        $pdf->cell(200, 20, 'Class', 0, 0, 'C', true);
        $pdf->cell(250, 20, $record->getClassLevel(), 0, 1, 'C', true);
        $pdf->setFillColor(255, 255, 255);
        $pdf->cell(200, 20, 'Date Of Birth', 0, 0, 'C', true);
        $pdf->cell(250, 20, $record->getDateOfBirth(), 0, 1, 'C', true);
        $pdf->setFillColor(221, 221, 221);
        $pdf->cell(200, 20, 'Gender', 0, 0, 'C', true);
        $pdf->cell(250, 20, ucfirst($record->getGender()), 0, 1, 'C', true);
        $pdf->setFillColor(255, 255, 255);
        $pdf->cell(200, 20, 'Blood Group', 0, 0, 'C', true);
        $pdf->cell(250, 20, $record->getBloodGroup(), 0, 1, 'C', true);
        $pdf->setFillColor(221, 221, 221);
        $pdf->cell(200, 20, 'Category', 0, 0, 'C', true);
        $pdf->cell(250, 20, $record->getCategory(), 0, 1, 'C', true);
        $pdf->setFillColor(255, 255, 255);
        $pdf->cell(200, 20, '', 0, 0, 'C', true);
        $pdf->cell(250, 20, '', 0, 1, 'C', true);
        $pdf->setFillColor(50, 50, 50);
        $pdf->setTextColor(255, 255, 255);
        $pdf->cell(450, 20, 'Contact Details', 0, 1, 'C', true);
        $pdf->setTextColor(0, 0, 0);
        $pdf->setFillColor(221, 221, 221);
        $pdf->cell(200, 20, 'Correspondence Address', 0, 0, 'C', true);
        $pdf->cell(250, 20, $record->getCorrespondenceAddressLine1(), 0, 1, 'C', true);
        $pdf->cell(200, 20, '', 0, 0, 'C', true);
        $pdf->cell(250, 20, $record->getCorrespondenceAddressLine2(), 0, 1, 'C', true);
        $pdf->setFillColor(255, 255, 255);
        $pdf->cell(200, 20, 'City', 0, 0, 'C', true);
        $pdf->cell(250, 20, $record->getCorrespondenceCity(), 0, 1, 'C', true);
        $pdf->setFillColor(221, 221, 221);
        $pdf->cell(200, 20, 'State', 0, 0, 'C', true);
        $pdf->cell(250, 20, $record->getCorrespondenceState(), 0, 1, 'C', true);
        $pdf->setFillColor(255, 255, 255);
        $pdf->cell(200, 20, 'Pincode', 0, 0, 'C', true);
        $pdf->cell(250, 20, $record->getCorrespondencePincode(), 0, 1, 'C', true);
        $pdf->setFillColor(221, 221, 221);
        $pdf->cell(200, 20, 'Phone', 0, 0, 'C', true);
        $pdf->cell(250, 20, $record->getPhone(), 0, 1, 'C', true);
        $pdf->setFillColor(255, 255, 255);
        $pdf->cell(200, 20, 'Mobile', 0, 0, 'C', true);
        $pdf->cell(250, 20, $record->getMobile(), 0, 1, 'C', true);
        $pdf->setFillColor(221, 221, 221);
        $pdf->cell(200, 20, 'Email', 0, 0, 'C', true);
        $pdf->cell(250, 20, $record->getEmail(), 0, 1, 'C', true);
        $pdf->setFillColor(255, 255, 255);
        $pdf->cell(450, 20, '', 0, 1, 'C', true);
        $pdf->setFillColor(50, 50, 50);
        $pdf->setTextColor(255, 255, 255);
        $pdf->cell(450, 20, 'Login Details', 0, 1, 'C', true);
        $pdf->setTextColor(0, 0, 0);
        $pdf->setFillColor(221, 221, 221);
        $pdf->cell(200, 20, 'Roll Number *', 0, 0, 'C', true);
        $pdf->cell(250, 20, $record->getRollNo(), 0, 1, 'C', true);
        $pdf->setFillColor(255, 255, 255);
        $pdf->cell(200, 20, 'Temporary Password **', 0, 0, 'C', true);
        $pdf->cell(250, 20, $record->getTempPass(), 0, 1, 'C', true);
        /* TEMPLATE 1 DESIGN END*/
        $pdf->SetFont('Arial', '', 10);
        $pdf->SetXY($x + 100, 620);
        $pdf->write(15, 'Student\'s Signature');
        $pdf->SetXY($x + 350, 620);
        $pdf->write(15, 'Parent\'s Signature');
        $pdf->SetXY($x + 230, 680);
        $pdf->write(15, 'Admin\'s Signature');
        $pdf->SetFont('Arial', '', 8);
        $pdf->SetXY($x + 20, 710);
        $pdf->write(15, '* Roll Number may be Temporary , ** Please Change the Password for Security Reasons');
        $pdf->SetXY($x + 20, 720);
        $pdf->write(15, 'This is a Computer Generated Form. If any Discrepancy Contact Admin : eduCloud Reference Number ' . $user->getuserId());
        // Close the document and save to the filesystem with the name simple.pdf
        $pdf->Output('generated_files/enroll' . $record->getUserId() . '.pdf', 'F');
        header('Location:http://localhost/cloud/generated_files/enroll' . $record->getUserId() . '.pdf');
    }