public function actionParent()
 {
     if (isset($_POST['parentuser'])) {
         $parents = Guardians::model()->findAll(array('condition' => 'uid=:x', 'params' => array(':x' => 0), 'limit' => '1000', 'order' => 'id ASC'));
         if ($parents != NULL) {
             foreach ($parents as $parent) {
                 $user = new User();
                 $profile = new Profile();
                 if ($parent->email != NULL) {
                     //adding user for current guardian
                     $user = new User();
                     $profile = new Profile();
                     $user->username = substr(md5(uniqid(mt_rand(), true)), 0, 10);
                     $user->email = $parent->email;
                     $user->activkey = UserModule::encrypting(microtime() . $parent->first_name);
                     $password = substr(md5(uniqid(mt_rand(), true)), 0, 10);
                     $user->password = UserModule::encrypting($password);
                     $user->superuser = 0;
                     $user->status = 1;
                     if ($user->save()) {
                         //assign role
                         $authorizer = Yii::app()->getModule("rights")->getAuthorizer();
                         $authorizer->authManager->assign('parent', $user->id);
                         //profile
                         $profile->firstname = $parent->first_name;
                         $profile->lastname = $parent->last_name;
                         $profile->user_id = $user->id;
                         $profile->save();
                         //saving user id to guardian table.
                         $parent->saveAttributes(array('uid' => $user->id));
                         UserModule::sendMail($parent->email, UserModule::t("You registered from {site_name}", array('{site_name}' => Yii::app()->name)), UserModule::t("Please login to your account with your email id as username and password {password}", array('{password}' => $password)));
                         $flash = "User created successfully";
                         $type = 'success';
                     }
                 } else {
                     $flash = "No email id given";
                     $type = 'error';
                 }
             }
         }
         Yii::app()->user->setFlash($type, $flash);
         $this->redirect(array('/importcsv'));
     } else {
         $this->render('/default/parent');
     }
 }
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionSendtogroup()
 {
     $model = new Sms();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Sms'])) {
         $model->attributes = $_POST['Sms'];
         if ($model->validate()) {
             if ($model->uid == 'parent') {
                 $userlist = Guardians::model()->findAll();
             }
             if ($model->uid == 'teacher') {
                 $userlist = Employees::model()->findAll();
             }
             if ($userlist != NULL) {
                 foreach ($userlist as $user) {
                     if ($user->mobile_phone) {
                         // $status = SmsSettings::model()->sendSms($user->mobile_phone,0,$model->message) ;
                         $mobile_phone = $user->mobile_phone;
                     } else {
                         $status = 0;
                         $mobile_phone = 0;
                     }
                     $Sms = new Sms();
                     $Sms->uid = $user->uid;
                     $Sms->phone_number = $mobile_phone;
                     $Sms->message = $model->message;
                     $Sms->status = $status;
                     $Sms->save();
                 }
             }
             $this->redirect(array('index'));
         }
     }
     $this->render('create', array('model' => $model));
 }
 public function actionDeactivate($id)
 {
     $model = Courses::model()->findByPk($id);
     $model->is_deleted = 1;
     if ($model->save()) {
         // Batch Deletion
         $batches = Batches::model()->findAllByAttributes(array('course_id' => $id));
         //Selecting all batches under the course with id = $id
         foreach ($batches as $batch) {
             // Student Deletion
             $students = Students::model()->findAllByAttributes(array('batch_id' => $batch->id));
             foreach ($students as $student) {
                 //Making student user inactive
                 if ($student->uid != NULL and $student->uid != 0) {
                     $student_user = User::model()->findByAttributes(array('id' => $student->uid));
                     if ($student_user != NULL) {
                         $student_user->saveAttributes(array('status' => '0'));
                     }
                 }
                 //Making parent user inactive
                 $parent = Guardians::model()->findByAttributes(array('ward_id' => $student->id));
                 if ($parent->uid != NULL and $parent->uid != 0) {
                     $parent_user = User::model()->findByAttributes(array('id' => $parent->uid));
                     if ($parent_user != NULL) {
                         $parent_user->saveAttributes(array('status' => '0'));
                     }
                 }
                 $student->saveAttributes(array('is_active' => '0', 'is_deleted' => '1'));
                 // Student Deleted
             }
             // Subject Association Deletion
             $subjects = Subjects::model()->findAllByAttributes(array('batch_id' => $batch->id));
             foreach ($subjects as $subject) {
                 EmployeesSubjects::model()->DeleteAllByAttributes(array('subject_id' => $subject->id));
                 $subject->delete();
             }
             // Exam Group Deletion
             $examgroups = ExamGroups::model()->findAllByAttributes(array('batch_id' => $batch->id));
             foreach ($examgroups as $examgroup) {
                 // Exams Deletion
                 $exams = Exams::model()->findAllByAttributes(array('exam_group_id' => $examgroup->id));
                 foreach ($exams as $exam) {
                     //Exam Score Deletion
                     $examscores = ExamScores::model()->DeleteAllByAttributes(array('exam_id' => $exam->id));
                     $exam->delete();
                     //Exam Deleted
                 }
                 $examgroup->delete();
                 //Exam Group Deleted
             }
             //Fee Collection Deletion
             $collections = FinanceFeeCollections::model()->findAllByAttributes(array('batch_id' => $batch->id));
             foreach ($collections as $collection) {
                 // Finance Fees Deletion
                 $student_fees = FinanceFees::model()->DeleteAllByAttributes(array('fee_collection_id' => $collection->id));
                 $transaction = FinanceTransaction::model()->DeleteAllByAttributes(array('collection_id' => $collection->id));
                 $collection->delete();
                 // Fee Collection Deleted
             }
             //Fee Category Deletion
             $categories = FinanceFeeCategories::model()->findAllByAttributes(array('batch_id' => $batch->id));
             foreach ($categories as $category) {
                 // Fee Particular Deletion
                 $particulars = FinanceFeeParticulars::model()->DeleteAllByAttributes(array('finance_fee_category_id' => $category->id));
                 $category->delete();
                 // Fee Category Deleted
             }
             //Timetable Entry Deletion
             $periods = TimetableEntries::model()->DeleteAllByAttributes(array('batch_id' => $batch->id));
             //Class Timings Deletion
             $class_timings = ClassTimings::model()->DeleteAllByAttributes(array('batch_id' => $batch->id));
             //Delete Weekdays
             $weekdays = Weekdays::model()->DeleteAllByAttributes(array('batch_id' => $batch->id));
             $batch->is_active = 0;
             $batch->is_deleted = 1;
             $batch->employee_id = ' ';
             $batch->save();
             // Batch Deleted
         }
         Yii::app()->user->setFlash('success', "Selected course is deleted!");
         $this->redirect(array('managecourse'));
     }
 }
Example #4
0
function random_guardian_name()
{
    $g = Guardians::with('name')->where('id', rand(1, 12))->remember(Config::get('site.cache_length'))->first();
    return $g->name->term;
}
Example #5
0
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    	<td width="247" valign="top">
			<?php 
$this->renderPartial('/default/left_side');
?>
             </td>
                <td valign="top">
                <div class="cont_right formWrapper">
                    <h1><?php 
echo Yii::t('report', 'Guardian Details');
?>
</h1>
                    <?php 
$guard = Guardians::model()->findByAttributes(array('id' => $_REQUEST['id']));
$students = Students::model()->findAllByAttributes(array('parent_id' => $guard->id));
?>
                    <div class="pdtab_Con">
                    <table width="100%" cellpadding="0" cellspacing="0" border="0" >
                        <tr class="pdtab-h">
                            <td align="center"><?php 
echo Yii::t('report', 'Name');
?>
</td>
                            <td align="center"><?php 
echo Yii::t('report', 'Student Name');
?>
</td>
                            <td align="center"><?php 
echo Yii::t('report', 'Relation');
 public function actionDeletes()
 {
     $model = Students::model()->findByAttributes(array('id' => $_REQUEST['sid']));
     $model->saveAttributes(array('is_deleted' => '1'));
     //Adding activity to feed via saveFeed($initiator_id,$activity_type,$goal_id,$goal_name,$field_name,$initial_field_value,$new_field_value)
     ActivityFeed::model()->saveFeed(Yii::app()->user->Id, '7', $model->id, ucfirst($model->first_name) . ' ' . ucfirst($model->middle_name) . ' ' . ucfirst($model->last_name), NULL, NULL, NULL);
     if ($model->uid and $model->uid != NULL and $model->uid != 0) {
         $user = User::model()->findByPk($model->uid);
         if ($user) {
             $profile = Profile::model()->findByPk($user->id);
             if ($profile) {
                 $profile->delete();
             }
             $user->delete();
         }
     }
     $guardian = Guardians::model()->findByAttributes(array('ward_id' => $_REQUEST['sid']));
     if ($guardian->uid and $guardian->uid != NULL and $guardian->uid != 0) {
         $parent_user = User::model()->findByPk($guardian->uid);
         if ($parent_user) {
             $profile = Profile::model()->findByPk($parent_user->id);
             if ($profile) {
                 $profile->delete();
             }
             $parent_user->delete();
         }
     }
     $examscores = ExamScores::model()->DeleteAllByAttributes(array('student_id' => $_REQUEST['sid']));
     $transactions = FinanceTransaction::model()->deleteAll('collection_id=:x', array(':x' => $_REQUEST['sid']));
     $this->redirect(array('/courses/batches/batchstudents', 'id' => $_REQUEST['id']));
 }
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Guardians::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Example #8
0
    <td class="listbx_subhdng">Category</td>
    <td class="subhdng_nrmal"><?php 
$cat = StudentCategories::model()->findByAttributes(array('id' => $model->student_category_id));
echo $cat->name;
?>
</td>
    <td class="listbx_subhdng">Religion</td>
    <td class="subhdng_nrmal"><?php 
echo $model->religion;
?>
</td>
  </tr>
  <tr >
    <td colspan="4" class="listbx_subhdng">In case of emergencies,<br />
      contact : <?php 
$posts = Guardians::model()->findByAttributes(array('id' => $model->immediate_contact_id));
if (count($posts) == 0) {
    echo "No Guardians are added" . '&nbsp;&nbsp;' . CHtml::link('Add new', array('guardians/create&id=' . $model->id));
} else {
    echo $posts->first_name . '&nbsp;&nbsp;' . CHtml::link('Add new', array('guardians/create&id=' . $model->id));
}
?>
</td>
  </tr>
  <tr class="table_listbxlast">
    <td colspan="4" class="listbx_subhdng"><span class="subhdng_nrmal">
    <?php 
$prev = StudentPreviousDatas::model()->findAllByAttributes(array('student_id' => $model->id));
if (count($prev) == 0) {
    echo "No Previous Datas";
} else {
Example #9
0
	 <!--navigation ends here-->
     <!--banner starts here-->
     <!--<section id="innerbanner"><img src="images/innerbanner.png" width="1000" height="168"></section>-->
      <!--banner ends here-->
      <!--midsection starts here-->
      
      <!--midsection ends here-->
      <!--innersection starts here-->
      <div id="parent_Sect">
        <?php 
$this->renderPartial('leftside');
?>
 
        <?php 
$user = User::model()->findByAttributes(array('id' => Yii::app()->user->id));
$guard = Guardians::model()->findByAttributes(array('uid' => $user->id));
$student = Students::model()->findByAttributes(array('id' => $guard->ward_id));
$exam = ExamScores::model()->findAll("student_id=:x", array(':x' => $student->id));
?>
        <div id="parent_rightSect">
        	<div class="parentright_innercon">
            <h1><?php 
echo Yii::t('parentportal', 'Exams');
?>
</h1>
            <div class="profile_top">
               	<div class="prof_img">
                <?php 
if ($student->photo_data != NULL) {
    echo '<img  src="' . $this->createUrl('/students/Students/DisplaySavedImage&id=' . $student->primaryKey) . '" alt="' . $student->photo_file_name . '" width="100" height="103" />';
} else {
 public function actionRemove()
 {
     $val = $_GET['val1'];
     $model = Batches::model()->findByPk($val);
     $model->is_active = 0;
     $model->is_deleted = 1;
     $model->employee_id = ' ';
     if ($model->save()) {
         // Student Deletion
         $students = Students::model()->findAllByAttributes(array('batch_id' => $model->id));
         foreach ($students as $student) {
             //Making student user inactive
             if ($student->uid != NULL and $student->uid != 0) {
                 $student_user = User::model()->findByAttributes(array('id' => $student->uid));
                 if ($student_user != NULL) {
                     $student_user->saveAttributes(array('status' => '0'));
                 }
             }
             //Making parent user inactive
             $parent = Guardians::model()->findByAttributes(array('ward_id' => $student->id));
             if ($parent->uid != NULL and $parent->uid != 0) {
                 $parent_user = User::model()->findByAttributes(array('id' => $parent->uid));
                 if ($parent_user != NULL) {
                     $parent_user->saveAttributes(array('status' => '0'));
                 }
             }
             $student->saveAttributes(array('is_active' => '0', 'is_deleted' => '1'));
             // Student Deleted
         }
         // Subject Association Deletion
         $subjects = Subjects::model()->findAllByAttributes(array('batch_id' => $model->id));
         foreach ($subjects as $subject) {
             EmployeesSubjects::model()->DeleteAllByAttributes(array('subject_id' => $subject->id));
             $subject->delete();
         }
         // Exam Group Deletion
         $examgroups = ExamGroups::model()->findAllByAttributes(array('batch_id' => $model->id));
         foreach ($examgroups as $examgroup) {
             // Exams Deletion
             $exams = Exams::model()->findAllByAttributes(array('exam_group_id' => $examgroup->id));
             foreach ($exams as $exam) {
                 //Exam Score Deletion
                 $examscores = ExamScores::model()->DeleteAllByAttributes(array('exam_id' => $exam->id));
                 $exam->delete();
                 //Exam Deleted
             }
             $examgroup->delete();
             //Exam Group Deleted
         }
         //Fee Collection Deletion
         $collections = FinanceFeeCollections::model()->findAllByAttributes(array('batch_id' => $model->id));
         foreach ($collections as $collection) {
             // Finance Fees Deletion
             $student_fees = FinanceFees::model()->DeleteAllByAttributes(array('fee_collection_id' => $collection->id));
             $collection->delete();
             // Fee Collection Deleted
         }
         //Fee Category Deletion
         $categories = FinanceFeeCategories::model()->findAllByAttributes(array('batch_id' => $model->id));
         foreach ($categories as $category) {
             // Fee Particular Deletion
             $particulars = FinanceFeeParticulars::model()->DeleteAllByAttributes(array('finance_fee_category_id' => $category->id));
             $category->delete();
             // Fee Category Deleted
         }
         //Timetable Entry Deletion
         $periods = TimetableEntries::model()->DeleteAllByAttributes(array('batch_id' => $model->id));
         //Class Timings Deletion
         $class_timings = ClassTimings::model()->DeleteAllByAttributes(array('batch_id' => $model->id));
         //Delete Weekdays
         $weekdays = Weekdays::model()->DeleteAllByAttributes(array('batch_id' => $model->id));
     }
     echo $val;
 }
 public function actionSendsms()
 {
     // Function to send Attendance SMS to all students of a batch
     $sms_settings = SmsSettings::model()->findAll();
     if ($sms_settings[0]->is_enabled == '1' and $sms_settings[3]->is_enabled == '1') {
         // Checking if SMS is enabled.
         $students = Students::model()->findAll("batch_id=:x", array(':x' => $_REQUEST['batch_id']));
         // Selecting the students of the batch
         $today = date("Y-m-d");
         $sms_status = 0;
         // Setting a flag variable to check whether atleast one sms was sent.
         if ($students != NULL) {
             foreach ($students as $student) {
                 $is_absent = StudentAttentance::model()->find("date=:x AND student_id=:y", array(':x' => $today, ':y' => $student->id));
                 $absent_no = count($is_absent);
                 if (count($is_absent) != '0' and count($is_absent) != NULL) {
                     // Checking whether the student was absent
                     $guardian = Guardians::model()->findByAttributes(array('ward_id' => $student->id));
                     if (count($guardian) != '0') {
                         // Check if guardian added
                         $to = '';
                         if ($guardian->mobile_phone) {
                             //Checking if phone number is provided
                             $to = $guardian->mobile_phone;
                         }
                         if ($to != '') {
                             // If absent and phone number is provided, send SMS
                             $college = Configurations::model()->findByPk(1);
                             $from = $college->config_value;
                             $message = 'Your child ' . $student->first_name . ' was absent today.';
                             //SmsSettings::model()->sendSms($to,$from,$message);
                             $sms_status = 1;
                             // Set flag variable to 1 if atleast one sms was sent.
                             Yii::app()->user->setFlash('notification', 'Attendance SMS is disabled');
                         }
                         // End check phone number
                     }
                     // End check if guardian added
                 }
                 // End check whether the student was absent
             }
             // End for each student
             if ($sms_status == 0) {
                 // This flag variable will be one if atleast one sms was sent.
                 Yii::app()->user->setFlash('notification', 'No absentees today!');
             }
         } else {
             Yii::app()->user->setFlash('notification', 'No students!');
         }
     }
     // End check if SMS is enabled
     if (isset($_REQUEST['flag']) and $_REQUEST['flag'] == 1) {
         $this->redirect(array('/courses/studentAttentance', 'id' => $_REQUEST['batch_id']));
     } else {
         $this->redirect(array('index', 'id' => $_REQUEST['batch_id']));
     }
 }
Example #12
0
    <td><?php 
echo Yii::t('students', 'Emergeny Contact');
?>
</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr >
    <td colspan="4" class="listbx_subhdng"><?php 
echo Yii::t('students', 'In case of emergencies,');
?>
<br />
     <?php 
echo Yii::t('students', ' contact : ');
$posts = Guardians::model()->findByAttributes(array('id' => $model->parent_id));
if (count($posts) == 0) {
    echo "No Guardians are added" . '&nbsp;&nbsp;' . CHtml::link(Yii::t('students', 'Add new'), array('guardians/create&id=' . $model->id));
} else {
    echo ucfirst($posts->first_name) . ' ' . ucfirst($posts->last_name) . '&nbsp;&nbsp;' . CHtml::link(Yii::t('students', 'Edit'), array('/students/guardians/update', 'id' => $posts->id, 'std' => $model->id));
}
?>
</td>
  </tr>
  <tr class="listbxtop_hdng">
    <td><?php 
echo Yii::t('students', 'Student Previous Datas');
?>
</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
 $list = Students::model()->findAll('batch_id=:x', array(':x' => $_REQUEST['id']));
 $k = 1;
 foreach ($list as $student) {
     if ($student == NULL || $student->is_active == 0 || $student->is_deleted == 1) {
         continue;
     }
     echo "<tr>";
     echo "<td>" . $k . "</td>";
     echo "<td>" . $student->admission_no . "</td>";
     echo "<td style='padding-left:20px'>" . $student->first_name . ' ' . $student->last_name . "</td>";
     $gender = $student->gender;
     if ($gender == "") {
         $gender = "-";
     }
     echo "<td>" . $gender . "</td>";
     $guardian = Guardians::model()->findAll("id=:x", array(':x' => $student->parent_id));
     echo "<td>";
     if ($guardian && $guardian[0]->first_name && $guardian[0]->first_name != "") {
         echo $guardian[0]->first_name;
     } else {
         echo '-';
     }
     echo "</td>";
     echo "<td>";
     if ($guardian && $guardian[0]->mobile_phone && $guardian[0]->mobile_phone != "") {
         echo $guardian[0]->mobile_phone;
     } else {
         echo '-';
     }
     echo "</td>";
     echo "</tr>";
Example #14
0
    echo Yii::app()->user->getFlash('error');
    ?>
    </div>
    <?php 
}
?>
    <div class="emp_tabwrapper">
    <div class="emp_tab_nav">
    	<?php 
$this->renderPartial('/default/emp_tab_nav');
?>
    </div>
    <div class="clear"></div>
    <div class="emp_cntntbx" >
  	<?php 
$parentlist = Guardians::model()->findAll(array('condition' => 'uid=:x', 'params' => array(':x' => 0), 'limit' => '1000', 'order' => 'id ASC'));
?>
   <div align="center" style="font-size:16px; font-style:bold; padding:10px 0px;">
   <?php 
if (count($parentlist) != 0) {
    echo Yii::t('importcsv', 'You have not created user accounts for') . count($parentlist) . '         parents   ' . CHtml::submitButton(Yii::t('importcsv', 'Create Now'), array('confirm' => 'Are you sure?', 'name' => 'parentuser', 'value' => 'Create Now', 'class' => 'formbut'));
} else {
    echo Yii::t('importcsv', 'No data available');
}
?>
   
   </div>
    </div>
    </div>
    
    </div>
Example #15
0
 public function actionParentemailcomplete()
 {
     if (isset($_GET['term'])) {
         $criteria = new CDbCriteria();
         $criteria->alias = "email";
         $criteria->condition = "email like '" . $_GET['term'] . "%'";
         $criteria->order = 'email ASC';
         $guardians = Guardians::model()->findAll($criteria);
         $return_array = array();
         foreach ($guardians as $guardian) {
             $return_array[] = array('label' => $guardian->email, 'id' => $guardian->id);
         }
         echo CJSON::encode($return_array);
         Yii::app()->end();
     }
 }
Example #16
0
                echo '<tr>';
                echo '<td>' . $i . '</td>';
                echo '<td>' . CHtml::link(ucfirst($posts_1->first_name) . ' ' . ucfirst($posts_1->middle_name) . ' ' . ucfirst($posts_1->last_name), array('/students/students/view', 'id' => $posts_1->id)) . '</td>';
                echo '<td>' . $posts_1->admission_no . '</td>';
                echo '<td>' . $categ[$posts_1->student_category_id] . '</td>';
                ?>
                                <td><?php 
                if ($posts_1->gender == 'M') {
                    echo Yii::t('Batch', 'Male');
                } elseif ($posts_1->gender == 'F') {
                    echo Yii::t('Batch', 'Female');
                }
                ?>
</td>
                                 <?php 
                $guardian = Guardians::model()->findAll("id=:x", array(':x' => $posts_1->parent_id));
                ?>
                                <td>
                                    <?php 
                if ($guardian && $guardian[0]->first_name && $guardian[0]->first_name != "") {
                    echo $guardian[0]->first_name;
                } else {
                    echo '-';
                }
                ?>
                                </td>
                                  <td>
                                    <?php 
                if ($guardian && $guardian[0]->mobile_phone && $guardian[0]->mobile_phone != "") {
                    echo $guardian[0]->mobile_phone;
                } else {
 public function actionSendsms()
 {
     /*echo 'Batch ID: '.$_REQUEST['batch_id'].'<br/>';
     		echo 'Fee Collection ID: '.$_REQUEST['collection'].'<br/>';
     		echo 'Days in between: '.$_REQUEST['date_status'].'<br/>';
     		echo 'Amount: '.$_REQUEST['amount'].'<br/>';*/
     $sms_settings = SmsSettings::model()->findAll();
     if ($sms_settings[0]->is_enabled == '1' and $sms_settings[7]->is_enabled == '1') {
         // Checking if SMS is enabled.
         $collection = FinanceFeeCollections::model()->findByAttributes(array('id' => $_REQUEST['collection']));
         /*echo 'Fees Name: '.$collection->name.'<br/>';
         		echo 'Due Date: '.$collection->due_date.'<br/>';*/
         $unpaid_students = FinanceFees::model()->findAll("fee_collection_id=:x and is_paid=:y", array(':x' => $_REQUEST['collection'], ':y' => 0));
         //echo 'Total unpaid students: '.count($unpaid_students).'<br/><br/>';
         foreach ($unpaid_students as $unpaid_student) {
             //echo 'Student ID: '.$unpaid_student->student_id.'<br/>';
             $student = Students::model()->findByAttributes(array('id' => $unpaid_student->student_id));
             $guardian = Guardians::model()->findByAttributes(array('ward_id' => $student->id));
             /*echo 'Name: '.$student->first_name.'<br/>';
             		echo 'Phone 1: '.$student->phone1.'<br/>';*/
             $to_parent = '';
             $to_student = '';
             $message = '';
             if (count($guardian) != 0 and $guardian->mobile_phone != NULL) {
                 // If guardian is added
                 $to_parent = $guardian->mobile_phone;
             }
             if ($student->phone1) {
                 // Checking if phone number is provided
                 $to_student = $student->phone1;
             } elseif ($student->phone2) {
                 $to_student = $student->phone2;
             }
             //echo 'Message To: '.$to.'<br/>';
             $college = Configurations::model()->findByPk(1);
             $from = $college->config_value;
             // Checking the days between the current date and due date. And, the customising the message accordingly
             if ($_REQUEST['date_status'] < 1) {
                 $message = 'Last date for the payment of [' . $collection->name . '] fees was ' . $collection->due_date;
             } elseif ($_REQUEST['date_status'] > 1 and $_REQUEST['date_status'] <= 7) {
                 $message = 'Last date for the payment of [' . $collection->name . '] fees is ' . $collection->due_date;
             } elseif ($_REQUEST['date_status'] == 1) {
                 $message = 'Last date for the payment of [' . $collection->name . '] fees is today. i.e.,' . $collection->due_date;
             }
             //echo 'Message: '.$message.'<br/><br/>';
             if ($message != '' && 0) {
                 // Send SMS if message is set
                 if ($to_parent != '') {
                     // If unpaid and parent phone number is provided, send SMS
                     SmsSettings::model()->sendSms($to_parent, $from, $message);
                 }
                 // End check if parent phone number is provided
                 if ($to_student != '') {
                     // If unpaid and student phone number is provided, send SMS
                     SmsSettings::model()->sendSms($to_student, $from, $message);
                 }
                 // End check if student phone number is provided
                 Yii::app()->user->setFlash('notification', 'SMS send Successfully!');
             }
             // End check if message is set
         }
         // End for each student
         //exit;
     }
     // End check whether SMS is enabled
     $this->redirect(array('unpaid', 'batch' => $_REQUEST['batch_id'], 'course' => $_REQUEST['collection']));
 }
    echo Yii::t('students', 'Name');
    ?>
-->
                <?php 
    $exams = Exams::model()->findAllByAttributes(array('exam_group_id' => $_REQUEST['examid']));
    // foreach($exams as $exam) // Creating subject column(s)
    // {
    //             	$subject=Subjects::model()->findByAttributes(array('id'=>$exam->subject_id));
    //
    //             	<!--<?php if(count($exams)>7){ echo @$subject->code; } else { echo @$subject->name; }
    //                 $subjectnames[] = $subject->name;
    //
    // }
    $final_message = "";
    foreach ($students as $student) {
        $guardian = Guardians::model()->findByAttributes(array('id' => $student->parent_id));
        $to = "";
        $grd = 0;
        if (count($guardian) != 0 && $guardian->mobile_phone && $guardian->mobile_phone != "") {
            $to = $guardian->mobile_phone;
        } else {
            if ($student->phone1) {
                $to = $student->phone1;
            } else {
                if ($student->phone2) {
                    $to = $student->phone2;
                }
            }
        }
        $message = "";
        $student_name = ucfirst($student->first_name) . ' ' . ucfirst($student->middle_name) . ' ' . ucfirst($student->last_name);
 public function actionDeletes()
 {
     $model = Students::model()->findByAttributes(array('id' => $_REQUEST['sid']));
     $model->saveAttributes(array('is_deleted' => '1'));
     if ($model->uid and $model->uid != NULL and $model->uid != 0) {
         $user = User::model()->findByPk($model->uid);
         if ($user) {
             $profile = Profile::model()->findByPk($user->id);
             if ($profile) {
                 $profile->delete();
             }
             $user->delete();
         }
     }
     $guardian = Guardians::model()->findByAttributes(array('ward_id' => $_REQUEST['sid']));
     if ($guardian->uid and $guardian->uid != NULL and $guardian->uid != 0) {
         $parent_user = User::model()->findByPk($guardian->uid);
         if ($parent_user) {
             $profile = Profile::model()->findByPk($parent_user->id);
             if ($profile) {
                 $profile->delete();
             }
             $parent_user->delete();
         }
     }
     $examscores = ExamScores::model()->DeleteAllByAttributes(array('student_id' => $_REQUEST['sid']));
     $this->redirect(array('/courses/batches/batchstudents', 'id' => $_REQUEST['id']));
 }
Example #20
0
    <td class="listbx_subhdng">Religion</td>
    <td class="subhdng_nrmal"><?php 
echo $model->religion;
?>
</td>
  </tr>
  <tr class="listbxtop_hdng">
    <td>Emergeny Contact</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr >
    <td colspan="4" class="listbx_subhdng">In case of emergencies,<br />
      contact : <?php 
$posts = Guardians::model()->findByAttributes(array('ward_id' => $model->id));
if (count($posts) == 0) {
    echo "No Guardians are added" . '&nbsp;&nbsp;' . CHtml::link('Add new', array('guardians/create&id=' . $model->id));
} else {
    echo $posts->first_name . '&nbsp;&nbsp;';
}
?>
</td>
  </tr>
  <tr class="listbxtop_hdng">
    <td>Student Previous Datas</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr class="table_listbxlast">
Example #21
0
        echo ' ' . $feed_type->text;
        ?>
 
												<strong>
													<?php 
        if ($feed->activity_type != 1 and $feed->activity_type != 2) {
            //Student Activities
            if ($feed->activity_type >= 3 and $feed->activity_type <= 10) {
                $goal = Students::model()->findByAttributes(array('id' => $feed->goal_id));
                if ($goal != NULL and $goal->is_deleted != 1) {
                    echo CHtml::link(ucfirst($goal->first_name) . ' ' . ucfirst($goal->middle_name) . ' ' . ucfirst($goal->last_name), array('/students/students/view', 'id' => $goal->id));
                } else {
                    echo $feed->goal_name;
                }
            } elseif ($feed->activity_type >= 14 and $feed->activity_type <= 16) {
                $goal = Guardians::model()->findByAttributes(array('id' => $feed->goal_id));
                if ($goal != NULL) {
                    echo CHtml::link($feed->goal_name, array('/students/guardians/view', 'id' => $goal->id));
                } else {
                    echo $feed->goal_name;
                }
            } elseif ($feed->activity_type >= 11 and $feed->activity_type <= 13) {
                if ($feed->goal_name == $feed->new_field_value) {
                    $feed->goal_name = $feed->initial_field_value;
                }
                $goal = ExamGroups::model()->findByAttributes(array('id' => $feed->goal_id));
                if ($goal != NULL) {
                    echo CHtml::link(ucfirst($feed->goal_name), array('examination/exams/create', 'exam_group_id' => $goal->id, 'id' => $goal->batch_id));
                } else {
                    echo $feed->goal_name;
                }
Example #22
0
			window.location= 'index.php?r=parentportal/default/exams&id='+studentid;	
		}
		else
		{
			window.location= 'index.php?r=parentportal/default/exams';
		}
	}
</script>
<div id="parent_Sect">
	<?php 
$this->renderPartial('leftside');
?>
 
    <?php 
$user = User::model()->findByAttributes(array('id' => Yii::app()->user->id));
$guardian = Guardians::model()->findByAttributes(array('uid' => Yii::app()->user->id));
$students = Students::model()->findAllByAttributes(array('parent_id' => $guardian->id));
if (count($students) == 1) {
    $student = Students::model()->findByAttributes(array('id' => $students[0]->id));
} elseif (isset($_REQUEST['id']) and $_REQUEST['id'] != NULL) {
    $student = Students::model()->findByAttributes(array('id' => $_REQUEST['id']));
} elseif (count($students) > 1) {
    $student = Students::model()->findByAttributes(array('id' => $students[0]->id));
}
$exam = ExamScores::model()->findAll("student_id=:x", array(':x' => $student->id));
?>
    <div id="parent_rightSect">
        <div class="parentright_innercon">
            <h1><?php 
echo Yii::t('parentportal', 'Exams');
?>
Example #23
0
										<td>
											<?php 
            if ($list_1->gender == 'M') {
                echo 'Male';
            } elseif ($list_1->gender == 'F') {
                echo 'Female';
            } else {
                echo '-';
            }
            ?>
										</td>
										
										
										<?php 
            if (isset($flag) && $flag != '0') {
                $guard = Guardians::model()->findByAttributes(array('id' => $list_1->parent_id));
                ?>
										<td>
											<?php 
                if ($guard != NULL) {
                    echo CHtml::link(ucfirst($guard->first_name) . ' ' . ucfirst($guard->last_name), array('/students/guardians/view', 'id' => $guard->id));
                } else {
                    echo '-';
                }
                ?>
 
										</td>
										<?php 
            }
            ?>
										<!--<td style="border-right:none;">Task</td>-->