public function actionIndex() { $criteria = new CDbCriteria(); $criteria->condition = '`file`<>:null'; $criteria->params = array(':null' => ''); $roles = Rights::getAssignedRoles(Yii::app()->user->id); // check for single role $user_roles = array(); foreach ($roles as $role) { $user_roles[] = '"' . $role->name . '"'; } $teacher = Employees::model()->findByAttributes(array('uid' => Yii::app()->user->id)); $batches = Batches::model()->findAllByAttributes(array('employee_id' => $teacher->id)); foreach ($batches as $classteacher) { $batch[] = $classteacher->id; } $timetable = TimetableEntries::model()->findAllByAttributes(array('employee_id' => $teacher->id)); foreach ($timetable as $period) { $batch[] = $period->batch_id; } $unique_batch = array_unique($batch); if (count($unique_batch) > 0) { $criteria->condition .= ' AND (`placeholder`=:null OR `created_by`=:user_id OR (`placeholder` IN (' . implode(',', $user_roles) . ')) AND (`batch` IS NULL OR `batch` IN (' . implode(',', $unique_batch) . '))) '; } else { $criteria->condition .= ' AND (`placeholder`=:null OR `created_by`=:user_id) OR (`placeholder` IN (' . implode(',', $user_roles) . '))'; } $criteria->params[':user_id'] = Yii::app()->user->id; $criteria->order = '`created_at` DESC'; $files = FileUploads::model()->findAll($criteria); if (isset($_POST['Downfiles'])) { $selected_files = $_POST['Downfiles']; $slfiles = array(); foreach ($selected_files as $s_file) { $model = FileUploads::model()->findByPk($s_file); if ($model != NULL) { $slfiles[] = 'uploads/shared/' . $model->id . '/' . $model->file; } } $zip = Yii::app()->zip; $fName = $this->generateRandomString(rand(10, 20)) . '.zip'; $zipFile = 'compressed/' . $fName; if ($zip->makeZip($slfiles, $zipFile)) { $fcon = file_get_contents($zipFile); header('Content-type:text/plain'); header('Content-disposition:attachment; filename=' . $fName); header('Pragma:no-cache'); echo $fcon; unlink($zipFile); } else { Yii::app()->user->setFlash('success', 'Can\'t download'); } } $this->render('/fileUploads/index', array('files' => $files)); }
public function Employeenotassigned($id, $sub) { $results = array(); $emp = Employees::model()->findAllByAttributes(array('employee_department_id' => $id)); if ($emp != NULL) { $i = 0; foreach ($emp as $emp1) { if (EmployeesSubjects::model()->findByAttributes(array('employee_id' => $emp1->id, 'subject_id' => $sub)) == NULL) { $results[$i] = $emp1; $i++; } } } return $results; }
/** * 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)); }
<div class="emp_cont_left"> <div class="empleftbx"> <div class="empimgbx" style="height:128px;"> <ul> <li> <?php $employee = Employees::model()->findByAttributes(array('id' => $_REQUEST['id'])); if ($employee->photo_file_name) { echo '<img src="' . $this->createUrl('DisplaySavedImage&id=' . $employee->primaryKey) . '" alt="' . $employee->photo_file_name . '" width="170" height="140" />'; // echo '<img class="imgbrder" src="'.$this->createUrl('DisplaySavedImage&id='.$employee->primaryKey).'" alt="'.$employee->photo_file_name.'" width="170" height="140" />'; } else { echo '<img class="imgbrder" src="images/super_avatar.png" alt=' . $employee->first_name . ' width="170" height="140" />'; } ?> </li> <li class="img_text"> <div style="line-height:9px; margin:20px 0px 5px 0px; font-size:14px"><?php echo ucfirst($employee->first_name) . ' ' . ucfirst($employee->last_name); ?> </div> <a style="font-size:12px; color:#C30; padding-top:6px; display:block" href="#"><?php echo $employee->email; ?> </a> </li> </ul> </div> <div class="clear"></div> <div class="clear"></div>
?> </span><?php echo Yii::t('Batch', 'Employees'); ?> </li> </ul> <div class="clear"></div> </div> <div class="namelist"> <ul> <li><?php echo '<strong>' . Yii::t('Batch', 'Class Teacher : ') . '</strong>'; ?> <?php $employee = Employees::model()->findByAttributes(array('id' => $batch->employee_id)); if ($employee != NULL) { echo $employee->first_name . ' ' . $employee->middle_name . ' ' . $employee->last_name; } ?> </li> <!--<li><strong>Class Teacher:</strong>Mary Symon</li> <li><strong>Class Teacher:</strong>Mary Symon</li>--> </ul> <div class="clear"></div> </div> <?php $time = 'nt_red'; ?> <?php $week = Weekdays::model()->findByAttributes(array('batch_id' => $batch->id));
public function actionEmpindividualpdf() { $employee_name = Employees::model()->findByAttributes(array('id' => $_REQUEST['employee'])); $pdf_name = ucfirst($employee_name->first_name) . ' ' . ucfirst($employee_name->last_name) . ' Employee Attendance Report.pdf'; # HTML2PDF has very similar syntax $html2pdf = Yii::app()->ePdf->HTML2PDF(); $html2pdf->WriteHTML($this->renderPartial('empindividualpdf', array(), true)); $html2pdf->Output($pdf_name); }
public function actionDeleteLeave() { $flag = true; $delete = EmployeeAttendances::model()->findByAttributes(array('id' => $_REQUEST['id'])); $model = EmployeeAttendances::model()->DeleteAllByAttributes(array('id' => $_REQUEST['id'])); $employee = Employees::model()->findByAttributes(array('id' => $delete->employee_id)); $settings = UserSettings::model()->findByAttributes(array('user_id' => 1)); if ($settings != NULL) { $date = date($settings->displaydate, strtotime($delete->attendance_date)); } //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, '28', $delete->employee_id, ucfirst($employee->first_name) . ' ' . ucfirst($employee->middle_name) . ' ' . ucfirst($employee->last_name), $date, NULL, NULL); if ($flag) { Yii::app()->clientScript->scriptMap['jquery.js'] = false; $this->renderPartial('update', array('model' => $model, 'day' => $_GET['day'], 'month' => $_GET['month'], 'year' => $_GET['year'], 'emp_id' => $_GET['emp_id']), false, true); } }
</div> </div>--> <div class="clear"></div> <div class="emp_right_contner"> <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 $employeelist = Employees::model()->findAll(array('condition' => 'uid=:x and is_deleted=:y', 'params' => array(':x' => 0, ':y' => 0), 'limit' => '1000', 'order' => 'id ASC')); ?> <div align="center" style="font-size:16px; font-style:bold; padding:10px 0px;"> <?php if (count($employeelist) != 0) { echo Yii::t('importcsv', 'You have not created user accounts for ') . count($employeelist) . ' employees ' . CHtml::submitButton(Yii::t('importcsv', 'Create Now'), array('confirm' => 'Are you sure?', 'name' => 'employeeuser', 'value' => 'Create Now', 'class' => 'formbut')); } else { echo Yii::t('importcsv', 'No data available'); } ?> </div> </div> </div> </div>
<?php //$data=CHtml::listData(Subjects::model()->findAll(),'id','name'); echo CHtml::activeDropDownList($model, 'subject_id', array(), array('prompt' => 'Select', 'id' => 'subject_id', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('EmployeesSubjects/current'), 'update' => '#current'))); ?> <div id="current"></div> <?php $data = CHtml::listData(EmployeeDepartments::model()->findAll(array('order' => 'name DESC')), 'id', 'name'); echo 'Departments'; echo CHtml::dropDownList('did', '', $data, array('prompt' => 'Select', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('EmployeesSubjects/employee'), 'update' => '#employee_id', 'data' => 'js:$(this).serialize()'))); echo ' '; ?> <?php $data1 = CHtml::listData(Employees::model()->findAll(array('order' => 'first_name DESC')), 'id', 'first_name'); ?> <div class="row"> <?php echo $form->labelEx($model, 'Select Employee'); ?> <?php echo CHtml::activeDropDownList($model, 'employee_id', $data1, array('prompt' => 'Select', 'id' => 'employee_id')); ?> <?php echo $form->error($model, 'employee_id'); ?> </div>
public function actionEmployee() { if (isset($_POST['employeeuser'])) { $employees = Employees::model()->findAll(array('condition' => 'uid=:x and is_deleted=:y', 'params' => array(':x' => 0, ':y' => 0), 'limit' => '1000', 'order' => 'id ASC')); if ($employees != NULL) { foreach ($employees as $employee) { $user = new User(); $profile = new Profile(); if ($employee->email != NULL) { //adding user for current student $user = new User(); $profile = new Profile(); $user->username = substr(md5(uniqid(mt_rand(), true)), 0, 10); $user->email = $employee->email; $user->activkey = UserModule::encrypting(microtime() . $employee->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('teacher', $user->id); //profile $profile->firstname = $employee->first_name; $profile->lastname = $employee->last_name; $profile->user_id = $user->id; $profile->save(); //saving user id to students table. $employee->saveAttributes(array('uid' => $user->id)); UserModule::sendMail($employee->email, UserModule::t("You are 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/employee'); } }
Department</th> <th><?php echo Yii::t('employees', 'Sl. No.'); ?> Action</th> </tr> <?php if (!isset($_REQUEST['dep']) or isset($_REQUEST['dep']) and $_REQUEST['dep'] == NULL) { $_REQUEST['dep'] = ''; } foreach ($emp_electsub as $emp_electsub_1) { ?> <tr> <td><?php $emp_detail = Employees::model()->findByAttributes(array('id' => $emp_electsub_1->employee_id)); echo $emp_detail->first_name . ' ' . $emp_detail->middle_name . ' ' . $emp_detail->last_name; ?> </td> <?php $deptname = EmployeeDepartments::model()->findByAttributes(array('id' => $emp_detail->employee_department_id)); if ($deptname != NULL) { ?> <td><?php echo $deptname->name; ?> </td> <?php } else { ?> <td>-</td> <?php
$empid = EmployeesSubjects::model()->findByAttributes(array('subject_id' => $subject_id->subject_id)); if (count($empid) > 0) { $subject_teacher = Employees::model()->findByAttributes(array('id' => $empid->employee_id)); ?> <td> <strong><?php echo Yii::t('examination', 'Subject Teacher'); ?> : </strong><?php echo $subject_teacher->first_name . ' ' . $subject_teacher->last_name; ?> </td> <?php } $is_classteacher = Batches::model()->findByAttributes(array('id' => $batch_id)); $classteacher = Employees::model()->findByAttributes(array('id' => $is_classteacher->employee_id)); if (Yii::app()->controller->action->id == 'update' and $_REQUEST['allexam'] != 1 and $classteacher->id != $employee_id) { // Redirecting if action ID is classexam and the employee is not classteacher $this->redirect(array('/teachersportal/default/examination')); } if (count($classteacher) > 0) { ?> <td> <strong><?php echo Yii::t('examination', 'Class Teacher'); ?> : </strong><?php echo $classteacher->first_name . ' ' . $classteacher->last_name; ?> </td> <?php
public function actionDynamiccities() { //please enter current controller name because yii send multi dim array $data = EmployeesSubjects::model()->findAll('subject_id=:sub_id', array(':sub_id' => (int) $_POST['TimetableEntries']['subject_id'])); echo CHtml::tag('option', array('value' => ''), CHtml::encode('Select Employee'), true); $data = CHtml::listData($data, 'id', 'employee_id'); foreach ($data as $value => $name) { $emp_name = Employees::model()->findByAttributes(array('id' => $name)); echo CHtml::tag('option', array('value' => $emp_name->id), $emp_name->first_name . ' ' . $emp_name->last_name, true); } }
/** * 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($type, $id) { if ($type == 'Employees') { $model = Employees::model()->findByPk($id); } elseif ($type == 'Hardware') { $model = Hardware::model()->findByPk($id); } elseif ($type == 'Facilities') { $model = Facilities::model()->findByPk($id); } elseif ($type == 'CustomResources') { $model = CustomResources::model()->findByPk($id); } if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public function actionDeletes() { $model = Employees::model()->findByAttributes(array('id' => $_REQUEST['id'])); $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, '25', $model->id, ucfirst($model->first_name) . ' ' . ucfirst($model->middle_name) . ' ' . ucfirst($model->last_name), NULL, NULL, NULL); echo $val; }
</td> <td valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top" width="75%"><div style="padding-left:20px;"> <h1>Reports Dashboard</h1> <div class="clear"></div> <div style="margin-top:20px; width:80%" id="container"></div> <?php if ($list != NULL) { //$sub = Employees::model()->findAll("is_deleted=:x", array(':x'=>0)); $data = ''; $empy = EmployeeDepartments::model()->findAll(); foreach ($empy as $empy_1) { $emp_number = Employees::model()->findAll("employee_department_id=:x", array(':x' => $empy_1->id)); $data .= '{name:"' . $empy_1->name . '", y:' . count($emp_number) . ', sliced: true, selected: true,},'; } //echo $data; ?> <div class="pdtab_Con" style="width:97%"> <div style="font-size:13px; padding:5px 0px"><strong><?php echo '<strong>' . Yii::t('report', 'Recent Employee Admissions') . '</strong>'; ?> </strong></div> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr class="pdtab-h">
public function actionEmanage() { if (Yii::app()->request->isAjaxRequest) { $name = ''; $bat = ''; $ad = ''; $model = new Employees(); $criteria = new CDbCriteria(); $criteria->compare('is_deleted', 0); $criteria->condition = 'is_deleted=:is_del'; $criteria->params = array(':is_del' => 0); if (isset($_REQUEST['val'])) { $criteria->condition = $criteria->condition . ' and ' . 'first_name LIKE :match'; $criteria->params[':match'] = $_REQUEST['val'] . '%'; } if (isset($_REQUEST['ename']) and $_REQUEST['ename'] != NULL) { $criteria->condition = $criteria->condition . ' and ' . 'first_name LIKE :name'; $criteria->params[':name'] = $_REQUEST['ename'] . '%'; $name = $_REQUEST['ename']; } if (isset($_REQUEST['employeenumber']) and $_REQUEST['employeenumber'] != NULL) { $criteria->condition = $criteria->condition . ' and ' . 'employee_number LIKE :employeenumber'; $criteria->params[':employeenumber'] = $_REQUEST['employeenumber'] . '%'; $ad = $_REQUEST['employeenumber']; } if (isset($_REQUEST['Employees']['employee_department_id']) and $_REQUEST['Employees']['employee_department_id'] != NULL) { $model->employee_department_id = $_REQUEST['Employees']['employee_department_id']; $criteria->condition = $criteria->condition . ' and ' . 'employee_department_id = :employee_department_id'; $criteria->params[':employee_department_id'] = $_REQUEST['Employees']['employee_department_id']; $bat = $_REQUEST['Employees']['employee_department_id']; } if (isset($_REQUEST['Employees']['employee_category_id']) and $_REQUEST['Employees']['employee_category_id'] != NULL) { $model->employee_category_id = $_REQUEST['Employees']['employee_category_id']; $criteria->condition = $criteria->condition . ' and ' . 'employee_category_id = :employee_category_id'; $criteria->params[':employee_category_id'] = $_REQUEST['Employees']['employee_category_id']; } if (isset($_REQUEST['Employees']['employee_position_id']) and $_REQUEST['Employees']['employee_position_id'] != NULL) { $model->employee_position_id = $_REQUEST['Employees']['employee_position_id']; $criteria->condition = $criteria->condition . ' and ' . 'employee_position_id = :employee_position_id'; $criteria->params[':employee_position_id'] = $_REQUEST['Employees']['employee_position_id']; } if (isset($_REQUEST['Employees']['employee_grade_id']) and $_REQUEST['Employees']['employee_grade_id'] != NULL) { $model->employee_grade_id = $_REQUEST['Employees']['employee_grade_id']; $criteria->condition = $criteria->condition . ' and ' . 'employee_grade_id = :employee_grade_id'; $criteria->params[':employee_grade_id'] = $_REQUEST['Employees']['employee_grade_id']; } if (isset($_REQUEST['Employees']['gender']) and $_REQUEST['Employees']['gender'] != NULL) { $model->gender = $_REQUEST['Employees']['gender']; $criteria->condition = $criteria->condition . ' and ' . 'gender = :gender'; $criteria->params[':gender'] = $_REQUEST['Employees']['gender']; } if (isset($_REQUEST['Employees']['marital_status']) and $_REQUEST['Employees']['marital_status'] != NULL) { $model->marital_status = $_REQUEST['Employees']['marital_status']; $criteria->condition = $criteria->condition . ' and ' . 'marital_status = :marital_status'; $criteria->params[':marital_status'] = $_REQUEST['Employees']['marital_status']; } if (isset($_REQUEST['Employees']['blood_group']) and $_REQUEST['Employees']['blood_group'] != NULL) { $model->blood_group = $_REQUEST['Employees']['blood_group']; $criteria->condition = $criteria->condition . ' and ' . 'blood_group = :blood_group'; $criteria->params[':blood_group'] = $_REQUEST['Employees']['blood_group']; } if (isset($_REQUEST['Employees']['nationality_id']) and $_REQUEST['Employees']['nationality_id'] != NULL) { $model->nationality_id = $_REQUEST['Employees']['nationality_id']; $criteria->condition = $criteria->condition . ' and ' . 'nationality_id = :nationality_id'; $criteria->params[':nationality_id'] = $_REQUEST['Employees']['nationality_id']; } if (isset($_REQUEST['Employees']['dobrange']) and $_REQUEST['Employees']['dobrange'] != NULL) { $model->dobrange = $_REQUEST['Employees']['dobrange']; if (isset($_REQUEST['Employees']['date_of_birth']) and $_REQUEST['Employees']['date_of_birth'] != NULL) { if ($_REQUEST['Employees']['dobrange'] == '2') { $model->date_of_birth = $_REQUEST['Employees']['date_of_birth']; $criteria->condition = $criteria->condition . ' and ' . 'date_of_birth = :date_of_birth'; $criteria->params[':date_of_birth'] = date('Y-m-d', strtotime($_REQUEST['Employees']['date_of_birth'])); } if ($_REQUEST['Employees']['dobrange'] == '1') { $model->date_of_birth = $_REQUEST['Employees']['date_of_birth']; $criteria->condition = $criteria->condition . ' and ' . 'date_of_birth < :date_of_birth'; $criteria->params[':date_of_birth'] = date('Y-m-d', strtotime($_REQUEST['Employees']['date_of_birth'])); } if ($_REQUEST['Employees']['dobrange'] == '3') { $model->date_of_birth = $_REQUEST['Employees']['date_of_birth']; $criteria->condition = $criteria->condition . ' and ' . 'date_of_birth > :date_of_birth'; $criteria->params[':date_of_birth'] = date('Y-m-d', strtotime($_REQUEST['Employees']['date_of_birth'])); } } } elseif (isset($_REQUEST['Employees']['dobrange']) and $_REQUEST['Employees']['dobrange'] == NULL) { if (isset($_REQUEST['Employees']['date_of_birth']) and $_REQUEST['Employees']['date_of_birth'] != NULL) { $model->date_of_birth = $_REQUEST['Employees']['date_of_birth']; $criteria->condition = $criteria->condition . ' and ' . 'date_of_birth = :date_of_birth'; $criteria->params[':date_of_birth'] = date('Y-m-d', strtotime($_REQUEST['Employees']['date_of_birth'])); } } if (isset($_REQUEST['Employees']['joinrange']) and $_REQUEST['Employees']['joinrange'] != NULL) { $model->joinrange = $_REQUEST['Employees']['joinrange']; if (isset($_REQUEST['Employees']['joining_date']) and $_REQUEST['Employees']['joining_date'] != NULL) { if ($_REQUEST['Employees']['joinrange'] == '2') { $model->joining_date = $_REQUEST['Employees']['joining_date']; $criteria->condition = $criteria->condition . ' and ' . 'joining_date = :joining_date'; $criteria->params[':joining_date'] = date('Y-m-d', strtotime($_REQUEST['Employees']['joining_date'])); } if ($_REQUEST['Employees']['joinrange'] == '1') { $model->joining_date = $_REQUEST['Employees']['joining_date']; $criteria->condition = $criteria->condition . ' and ' . 'joining_date < :joining_date'; $criteria->params[':joining_date'] = date('Y-m-d', strtotime($_REQUEST['Employees']['joining_date'])); } if ($_REQUEST['Employees']['joinrange'] == '3') { $model->joining_date = $_REQUEST['Employees']['joining_date']; $criteria->condition = $criteria->condition . ' and ' . 'joining_date > :joining_date'; $criteria->params[':joining_date'] = date('Y-m-d', strtotime($_REQUEST['Employees']['joining_date'])); } } } elseif (isset($_REQUEST['Employees']['joinrange']) and $_REQUEST['Employees']['joinrange'] == NULL) { if (isset($_REQUEST['Employees']['joining_date']) and $_REQUEST['Employees']['joining_date'] != NULL) { $model->joining_date = $_REQUEST['Employees']['joining_date']; $criteria->condition = $criteria->condition . ' and ' . 'joining_date = :joining_date'; $criteria->params[':joining_date'] = date('Y-m-d', strtotime($_REQUEST['Employees']['joining_date'])); } } if (isset($_REQUEST['Employees']['status']) and $_REQUEST['Employees']['status'] != NULL) { $model->status = $_REQUEST['Employees']['status']; $criteria->condition = $criteria->condition . ' and ' . 'is_active = :status'; $criteria->params[':status'] = $_REQUEST['Employees']['status']; } $criteria->order = 'first_name ASC'; $total = Employees::model()->count($criteria); //$pages = new CPagination($total); //$pages->setPageSize(Yii::app()->params['listPerPage']); //$pages->applyLimit($criteria); // the trick is here! $posts = Employees::model()->findAll($criteria); $this->renderPartial('user_panel', array('model' => $model, 'list' => $posts, 'item_count' => $total, 'name' => $name, 'ad' => $ad, 'bat' => $bat)); } }
</tr> </table> </td> </tr> </table> </div> <!-- End Header --> <?php if (isset($_REQUEST['id'])) { ?> <br /><br /> <span align="center"><h4>INDIVIDUAL EMPLOYEE ATTENDANCE REPORT</h4></span> <?php $individual = Employees::model()->findByAttributes(array('id' => $_REQUEST['employee'], 'employee_department_id' => $_REQUEST['id'])); $department_name = EmployeeDepartments::model()->findByAttributes(array('id' => $_REQUEST['id'])); ?> <!-- Individual Details --> <div style="border:#CCC 1px; width:700px; padding:10px 10px; background:#E1EAEF;"> <table style="font-size:14px;"> <tr> <td style="width:100px;"> <strong><?php echo Yii::t('report', 'Name'); ?> </strong> </td> <td style="width:10px;"> <strong>:</strong>
</tr> </table> </td> </tr> </table> </div> <!-- End Header --> <?php if (isset($_REQUEST['id'])) { ?> <br /><br /> <span align="center"><h4>EMPLOYEES MONTHLY ATTENDANCE REPORT</h4></span> <?php $employees = Employees::model()->findAll("employee_department_id=:x and is_deleted=:y", array(':x' => $_REQUEST['id'], ':y' => 0)); $department_name = EmployeeDepartments::model()->findByAttributes(array('id' => $_REQUEST['id'])); ?> <!-- Department details --> <div style="border:#CCC 1px; width:700px; padding:10px 10px; background:#E1EAEF;"> <table style="font-size:14px;"> <tr> <td style="width:100px;"><b><?php echo Yii::t('report', 'Department'); ?> </b></td> <td style="width:10px;">:</td> <td style="width:250px;"><?php echo ucfirst($department_name->name); ?> </td>
public function actionSearch() { $model = new Students(); $criteria = new CDbCriteria(); $criteria->condition = 'first_name LIKE :match or middle_name LIKE :match or last_name LIKE :match'; $criteria->params = array(':match' => $_POST['char'] . '%'); $criteria->order = 'first_name ASC'; $total = Students::model()->count($criteria); $pages = new CPagination($total); $pages->setPageSize(Yii::app()->params['listPerPage']); $pages->applyLimit($criteria); // the trick is here! $posts = Students::model()->findAll($criteria); $emp = new Employees(); $criteria_1 = new CDbCriteria(); $criteria_1->condition = 'first_name LIKE :match or middle_name LIKE :match or last_name LIKE :match'; $criteria_1->params = array(':match' => $_POST['char'] . '%'); $criteria_1->order = 'first_name ASC'; $tot = Employees::model()->count($criteria_1); $pages_1 = new CPagination($total); $pages_1->setPageSize(Yii::app()->params['listPerPage']); $pages_1->applyLimit($criteria_1); // the trick is here! $posts_1 = Employees::model()->findAll($criteria_1); $this->render('search', array('model' => $model, 'list' => $posts, 'posts' => $posts_1, 'pages' => $pages, 'item_count' => $total, 'page_size' => 10)); //$stud = Students::model()->findAll('first_name LIKE '.$_POST['char']); //echo count($stud); //exit; //print_r($_POST); }
public function scorelabel($data, $row) { $employee = Employees::model()->findByAttributes(array('uid' => Yii::app()->user->id)); $is_teaching = TimetableEntries::model()->countByAttributes(array('subject_id' => $data->subject_id, 'employee_id' => $employee->id)); if ($is_teaching > 0 or Yii::app()->controller->action->id == 'classexam') { return "Manage Scores"; } else { return "View Scores"; } }
echo CHtml::link(ucfirst($feed->goal_name), array('examination/exams/update', 'sid' => $goal->id, 'exam_group_id' => $goal->exam_group_id, 'id' => $examgroup->batch_id)); //echo $feed->goal_name; } else { echo $feed->goal_name; } } elseif ($feed->activity_type >= 20 and $feed->activity_type <= 22) { $goal = ExamScores::model()->findByAttributes(array('id' => $feed->goal_id)); if ($goal != NULL) { $exam = Exams::model()->findByAttributes(array('id' => $goal->exam_id)); $examgroup = ExamGroups::model()->findByAttributes(array('id' => $exam->exam_group_id)); echo CHtml::link(ucfirst($feed->goal_name), array('examination/examScores/update', 'sid' => $goal->id, 'examid' => $goal->exam_id, 'id' => $examgroup->batch_id)); } else { echo $feed->goal_name; } } elseif ($feed->activity_type >= 23 and $feed->activity_type <= 28) { $goal = Employees::model()->findByAttributes(array('id' => $feed->goal_id)); if ($goal != NULL and $goal->is_deleted != 1) { echo CHtml::link($feed->goal_name, array('employees/employees/view', 'id' => $goal->id)); } else { echo $feed->goal_name; } } // End Employee Activities } ?> </strong> <?php // Update values if (in_array($feed->activity_type, $update_array)) { if ($feed->initial_field_value == '' and $feed->new_field_value != '' and $feed->activity_type != 9 and $feed->activity_type != 27) { echo ' as <strong>' . $feed->new_field_value . '</strong>';
?> </td> <td align="center"><?php echo Yii::t('Courses', 'Class Teacher'); ?> </td> <td align="center"><?php echo Yii::t('Courses', 'Actions'); ?> </td> </tr> <?php foreach ($batches_id as $batch_id) { echo '<tr id="batchrow' . $batch_id->id . '">'; echo '<td style="text-align:center; padding-left:10px; font-weight:bold;">' . $batch_id->coursename . '</td>'; $teacher = Employees::model()->findByAttributes(array('id' => $batch_id->employee_id)); echo '<td align="center">'; if ($teacher) { echo $teacher->first_name . ' ' . $teacher->last_name; } else { echo '-'; } // Count if any exam timetables are published in a batch. $exams_published = ExamGroups::model()->countByAttributes(array('batch_id' => $batch_id->id, 'is_published' => 1)); // Count if any exam results are published in a batch. $result_published = ExamGroups::model()->countByAttributes(array('batch_id' => $batch_id->id, 'result_published' => 1)); echo '<td align="center">'; if ($exams_published > 0 or $result_published > 0) { echo CHtml::link(Yii::t('examination', 'View Examinations'), array('/teachersportal/default/classexam', 'bid' => $batch_id->id)); } else { echo Yii::t('examination', 'No Exam Scheduled');
<td> </td> <td> </td> <td> </td> </tr> <td><?php echo $form->labelEx($model, 'Teacher'); ?> </td> <td> </td> <?php $criteria = new CDbCriteria(); $criteria->condition = 'is_deleted=:is_del'; $criteria->params = array(':is_del' => 0); ?> <td><?php echo $form->dropDownList($model, 'employee_id', CHtml::listData(Employees::model()->findAll($criteria), 'id', 'concatened'), array('empty' => Yii::t('Batch', 'Select Class Teacher'))); ?> <?php echo $form->error($model, 'employee_id'); ?> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td><?php
public function actionEmployee() { $data = Employees::model()->findAll(array('order' => 'first_name DESC', 'condition' => 'employee_department_id=:id', 'params' => array(':id' => (int) $_POST['did']))); $data = CHtml::listData($data, 'id', 'first_name'); foreach ($data as $value => $name) { echo CHtml::tag('option', array('value' => $value), CHtml::encode($name), true); } }
<div class="edit_bttns" style="width:550px; top:40px; left:30px;"> <ul> <!-- For attendence --> <li><span> <?php if (Yii::app()->controller->action->id == 'attendance' or Yii::app()->controller->action->id == 'studentattendance') { echo CHtml::link('<span>' . 'View My Attendance' . '</span>', array('/teachersportal/default/employeeattendance')); } ?> </span></li> <li><span> <?php $employee = Employees::model()->findByAttributes(array('uid' => Yii::app()->user->id)); $is_classteacher = Batches::model()->findAllByAttributes(array('employee_id' => $employee->id)); if ($is_classteacher != NULL) { if (Yii::app()->controller->action->id == 'attendance' or Yii::app()->controller->action->id == 'employeeattendance') { echo CHtml::link('<span>' . 'Manage Student Attendance' . '</span>', array('/teachersportal/default/studentattendance')); } } ?> </span></li> <li><span> <?php if (count($is_classteacher) > 1 and Yii::app()->controller->action->id == 'studentattendance' and isset($_REQUEST['id'])) { echo CHtml::link('<span>' . 'Change Batch' . '</span>', array('/teachersportal/default/studentattendance')); } ?> </span></li> <!-- End For attendence --> <li><span> <?php
<div class="tt-subject"> <div class="subject">'; $set = TimetableEntries::model()->findByAttributes(array('batch_id' => $_REQUEST['id'], 'weekday_id' => $weekdays[6]['weekday'], 'class_timing_id' => $timing[$i]['id'])); if (count($set) == 0) { $is_break = ClassTimings::model()->findByAttributes(array('id' => $timing[$i]['id'], 'is_break' => 1)); if ($is_break == NULL) { echo CHtml::ajaxLink(Yii::t('weekdays', 'Assign'), $this->createUrl('TimetableEntries/settime'), array('onclick' => '$("#jobDialog' . $timing[$i]['id'] . $weekdays[6]['weekday'] . '").dialog("open"); return false;', 'update' => '#jobDialog' . $timing[$i]['id'] . $weekdays[6]['weekday'], 'type' => 'GET', 'data' => array('batch_id' => $_REQUEST['id'], 'weekday_id' => $weekdays[6]['weekday'], 'class_timing_id' => $timing[$i]['id']), 'dataType' => 'text'), array('id' => 'showJobDialog' . $timing[$i]['id'] . $weekdays[6]['weekday'])); } else { echo Yii::t('weekdays', 'Break'); } } else { $time_sub = Subjects::model()->findByAttributes(array('id' => $set->subject_id)); if ($time_sub != NULL) { echo $time_sub->name . '<br>'; } $time_emp = Employees::model()->findByAttributes(array('id' => $set->employee_id)); if ($time_emp != NULL) { echo '<div class="employee">' . $time_emp->first_name . '</div>'; } echo CHtml::link('', array('timetableEntries/remove', 'id' => $set->id, 'batch_id' => $_REQUEST['id']), array('confirm' => 'Are you sure?', 'class' => 'delete')); } echo '</div> </div> </div> <div id="jobDialog' . $timing[$i]['id'] . $weekdays[6]['weekday'] . '"></div> </td>'; } ?> <!--timetable_td --> </tr> <?php
<div class="panel" id="user_panel_handler"> <?php $model = new Employees(); $criteria = new CDbCriteria(); $criteria->order = 'first_name ASC'; $_REQUEST['val'] = 'A'; $criteria->condition = 'first_name LIKE :match AND is_deleted=:is_del'; $criteria->params = array(':match' => $_REQUEST['val'] . '%', ':is_del' => 0); $total = Employees::model()->count($criteria); //echo $criteria->condition; //print_r($criteria->params); //$pages = new CPagination($total); //$pages->setPageSize(Yii::app()->params['listPerPage']); //$pages->applyLimit($criteria); // the trick is here! $posts = Employees::model()->findAll($criteria); $this->renderPartial('user_panel', array('model' => $model, 'list' => $posts, 'item_count' => $total, 'name' => '', 'ad' => '', 'bat' => '')); ?> </div> <?php } ?> <?php if (!isset($_REQUEST['widget']) or isset($_REQUEST['widget']) and $_REQUEST['widget'] != NULL and $_REQUEST['widget'] != 1) { ?> <div class="panel"> <?php $this->renderPartial('batch_panel', array()); ?>
<th><?php echo Yii::t('attendance', 'Date'); ?> </th> <th><?php echo Yii::t('attendance', 'Halfday'); ?> </th> <th><?php echo Yii::t('attendance', 'Fullday'); ?> </th> </tr> <?php $data = Employees::model()->findAll("employee_department_id=:x", array(':x' => $_REQUEST['id'])); if ($data) { foreach ($data as $data1) { echo '<tr>'; echo '<td>' . $data1->first_name . '</td>'; echo '<td>'; $date = EmployeeAttendances::model()->findAllByAttributes(array('employee_id' => $data1->id)); $fullday = 0; $halfday = 0; ?> <?php foreach ($date as $date1) { $attd_month = date('m', strtotime($date1->attendance_date)); $attd_year = date('y', strtotime($date1->attendance_date)); $crrnt_month = date('m');
<!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>--> <?php $this->breadcrumbs = array($this->module->id); if ($list != NULL) { //$sub = Employees::model()->findAll("is_deleted=:x", array(':x'=>0)); $data = ''; $empy = EmployeeDepartments::model()->findAll(); foreach ($empy as $empy_1) { $emp_number = Employees::model()->findAll("employee_department_id=:x and is_deleted=:y", array(':x' => $empy_1->id, ':y' => 0)); $data .= '{name:"' . $empy_1->name . '", y:' . count($emp_number) . ', sliced: true, selected: true,},'; } //echo $data; ?> <script type="text/javascript"> var chart; $(document).ready(function() { chart = new Highcharts.Chart({ chart: { renderTo: 'container', plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false }, title: { text: 'Employee Strength' }, tooltip: { formatter: function() {