Example #1
0
 public function actionStudentProfilePdf($sid)
 {
     $nationality = $stuAdd = [];
     $stuMaster = StuMaster::findOne($sid);
     $stuDocs = StuDocs::find()->where(['stu_docs_stu_master_id' => $sid])->join('join', 'document_category dc', 'dc.doc_category_id = stu_docs_category_id AND dc.is_status <> 2')->all();
     $stuInfo = StuInfo::find()->where(['stu_info_stu_master_id' => $sid])->one();
     $stuCourse = Courses::findOne($stuMaster->stu_master_course_id);
     $stuBatch = Batches::findOne($stuMaster->stu_master_batch_id);
     $stuSection = Section::findOne($stuMaster->stu_master_section_id);
     $stuGuard = StuGuardians::findAll(['guardia_stu_master_id' => $sid]);
     $sDocs = new StuDocs();
     if ($stuMaster->stu_master_nationality_id !== null) {
         $nationality = Nationality::findOne($stuMaster->stu_master_nationality_id)->nationality_name;
     }
     if ($stuMaster->stu_master_stu_address_id !== null) {
         $stuAdd = StuAddress::findOne($stuMaster->stu_master_stu_address_id);
     }
     $html = $this->renderPartial('/stu-master/stuprofilepdf', ['stuDocs' => $stuDocs, 'stuMaster' => $stuMaster, 'stuInfo' => $stuInfo, 'nationality' => $nationality, 'stuBatch' => $stuBatch, 'stuCourse' => $stuCourse, 'stuSection' => $stuSection, 'stuAdd' => $stuAdd, 'stuGuard' => $stuGuard, 'sDocs' => $sDocs]);
     $fName = $stuInfo->stu_first_name . "_" . $stuInfo->stu_last_name . "_" . date('Ymd-His');
     return Yii::$app->pdf->exportData(Yii::t('report', 'Student Report'), $fName, $html);
 }
 $i = 1;
 $add_city_c = $add_c = $add_city = $add_s = $add_co = $add_city_c = '';
 foreach ($student_data as $t => $sd) {
     if ($i % 2 == 0) {
         $bgcolor = "#FFFFFF";
     } else {
         $bgcolor = "#E3E3E3";
     }
     echo '<tr align=center bgcolor=' . $bgcolor . '>';
     echo "<td style='text-align:center;'>" . $i . "</td>";
     foreach ($selected_list as $s) {
         if ($s == 'batch_name') {
             if ($sd['stu_master_batch_id'] == 0) {
                 echo "<td style='text-align:center;'><i>Not Set</i></td>";
             } else {
                 echo "<td style='text-align:center;'>" . Batches::findOne($sd['stu_master_batch_id'])->{$s} . "</td>";
             }
         } else {
             if ($s == 'course_name') {
                 if ($sd['stu_master_course_id'] == 0) {
                     echo "<td></i> Not Set</i></td>";
                 } else {
                     echo "<td>" . Courses::findOne($sd['stu_master_course_id'])->{$s} . "</td>";
                 }
             } else {
                 if ($s == 'section_name') {
                     if ($sd['stu_master_section_id'] == 0) {
                         echo "<td> Not Set </td>";
                     } else {
                         echo "<td>" . Section::findOne($sd['stu_master_section_id'])->{$s} . "</td>";
                     }
Example #3
0
 /**
  * Finds the Batches model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Batches the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Batches::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #4
0
                 }
             }
         }
     }
 }
 echo "</tr>";
 $i = 1;
 foreach ($student_data as $t => $sd) {
     echo "<tr>";
     echo "<td class='text-center'>" . $i . "</td>";
     foreach ($selected_list as $s) {
         if ($s == 'batch_name') {
             if ($sd['stu_master_batch_id'] == 0) {
                 echo "<td class='text-center'><i>" . Yii::t('report', 'Not Set') . "</i></td>";
             } else {
                 echo "<td class='text-center'>" . Batches::findOne($sd['stu_master_batch_id'])->{$s} . "</td>";
             }
         } else {
             if ($s == 'course_name') {
                 if ($sd['stu_master_course_id'] == 0) {
                     echo "<td></i> " . Yii::t('report', 'Not Set') . "</i></td>";
                 } else {
                     echo "<td>" . Courses::findOne($sd['stu_master_course_id'])->{$s} . "</td>";
                 }
             } else {
                 if ($s == 'section_name') {
                     if ($sd['stu_master_section_id'] == 0) {
                         echo "<td> " . Yii::t('report', 'Not Set') . " </td>";
                     } else {
                         echo "<td>" . Section::findOne($sd['stu_master_section_id'])->{$s} . "</td>";
                     }
Example #5
0
 $i = 1;
 $add_c = $add_s = $add_city = $add_co = $add_city_c = '';
 $student_info = new StuInfo();
 echo "</br></br><h1>" . Yii::t('report', 'Students List') . "</h1>";
 foreach ($student_data as $t => $sd) {
     echo "<h3>" . $sd['stu_first_name'] . " " . $sd['stu_last_name'] . "</h3>";
     echo "<table>";
     echo '<tr >';
     echo "<td class='label'>" . Yii::t('report', 'SI No.') . "</td><td>" . $i . "</td>";
     foreach ($selected_list as $s) {
         if ($s == 'batch_name') {
             echo "<tr><td class='label'>" . Yii::t('report', 'Batch') . " </td>";
             if ($sd['stu_master_batch_id'] == 0) {
                 echo "<td ><i>" . Yii::t('report', 'Not Set') . "</i></td></tr>";
             } else {
                 echo "<td>" . Batches::findOne($sd['stu_master_batch_id'])->{$s} . "</td></tr>";
             }
         } else {
             if ($s == 'course_name') {
                 echo "<tr><td class='label'>" . Yii::t('report', 'Course') . "</td>";
                 if ($sd['stu_master_batch_id'] == 0) {
                     echo "<td><i>" . Yii::t('report', 'Not Set') . "</i></td></tr>";
                 } else {
                     echo "<td>" . Courses::findOne($sd['stu_master_course_id'])->{$s} . "</td></tr>";
                 }
             } else {
                 if ($s == 'section_name') {
                     echo "<tr><td class='label'>" . Yii::t('report', 'Section') . " </td>";
                     if ($sd['stu_master_section_id'] == 0) {
                         echo "<td ><i>" . Yii::t('report', 'Not Set') . "</i></td></tr>";
                     } else {