コード例 #1
0
							foreach($xvalue as $x)
							$xaxis[] = Branch::model()->findByPk($x)->branch_name;			
						}
				}
				if(!empty($_REQUEST['subject']))
				{
					$acdmperiodname=$acdmperiodname.' and sub_id='.$_REQUEST['subject'];
					$xaxis[0] =$xaxis[0].' '. SubjectMaster::model()->findByPk($_REQUEST['subject'])->subject_master_name;					
				}
			}
			else 
			{		
				if(!empty($_REQUEST['subject']))
				{				
					$acdmperiodname=$acdmperiodname.' and sub_id='.$_REQUEST['subject'];
					$xaxis[0]=SubjectMaster::model()->findByPk($_REQUEST['subject'])->subject_master_name;									
					if(!empty($_REQUEST['branch']))
					{
						$acdmperiodname=$acdmperiodname.' and branch_id='.$_REQUEST['branch'].' and div_id='.$_POST['Attendence']['div'];
						$xaxis[0] = $xaxis[0].' '.Branch::model()->findByPk($_REQUEST['branch'])->branch_name;
						$xaxis[0]=$xaxis[0].' '.Division::model()->findByPk($_REQUEST['branch'])->division_name;
					}
				}
				else
				{					
					$acdmperiodname=$acdmperiodname.' and branch_id='.$_REQUEST['branch'].' and div_id='.$_REQUEST['div'];
					$xaxis[0] = Branch::model()->findByPk($_REQUEST['branch'])->branch_name;
					$xaxis[0]=$xaxis[0].' '.Division::model()->findByPk($_REQUEST['branch'])->division_name;
				}			
			}
コード例 #2
0
ファイル: User.php プロジェクト: aoopvn/EduSec4.0.0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSubjectMasters()
 {
     return $this->hasMany(SubjectMaster::className(), ['updated_by' => 'user_id']);
 }
    protected function renderContent()
    {
        $day = array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
        if (Yii::app()->user->getState('stud_id')) {
            $date = date('Y-m-d');
            $ts = strtotime($date);
            $week_number = date('W', $ts);
            $year = date('Y');
            for ($day1 = 1; $day1 < 7; $day1++) {
                $alldate[] = date('d-m-Y', strtotime($year . "W" . $week_number . $day1));
            }
            $criteria = new CDbCriteria();
            //$criteria->select = 'academic_term_id'; // select fields which you want in output
            $criteria->condition = 'current_sem = 1 AND academic_term_organization_id = ' . Yii::app()->user->getState('org_id');
            $semname = AcademicTerm::model()->findAll($criteria);
            $data = CHtml::listData($semname, 'academic_term_id', 'academic_term_id');
            $stud_model = StudentTransaction::model()->findByPk(Yii::app()->user->getState('stud_id'));
            $check_sem = in_array($stud_model->student_academic_term_name_id, $data);
            //var_dump($check_sem); exit;
            $timetableid = 0;
            if (!$check_sem) {
                echo "<h3 align=center style=color:red>Sorry, No timetable available for this student.</h3>";
            } else {
                $check_timetable = TimeTableDetail::model()->findByAttributes(array('acdm_name_id' => $stud_model->student_academic_term_name_id, 'division_id' => $stud_model->student_transaction_division_id));
                if (empty($check_timetable)) {
                    echo "<h3 align=center style=color:red>Sorry, No timetable available for this student.</h3>";
                } else {
                    $timetableid = $check_timetable->timetable_id;
                    $model = TimeTable::model()->findByPk($timetableid);
                    $nooflec = $model->No_of_Lec;
                    $sum = $nooflec;
                    $lec_duration = LecDuration::model()->findAllByAttributes(array(), $condition = 'timetable_id = :table_id ', $params = array(':table_id' => $timetableid));
                    $lec = array();
                    foreach ($lec_duration as $l) {
                        $lec[] = $l['duration'];
                    }
                    $createdate = date_create($model->creation_date);
                    $starti = 1;
                    if ($model->zero_lec == 1) {
                        $starti = 0;
                    }
                    $time = $model->clg_start_time;
                    $time = date('H:i A', strtotime($time));
                    $timestamp = strtotime($time);
                    $time = date('g:i A', $timestamp);
                    ?>

			<table id="time-table-struc" bgcolor="#CBE7ED"  border="2" style= width:auto;font-size:8px;border-collapse:collapse; height:auto;"  align="center">
			<th  align=center>
				Day/Time
			</th>

<?php 
                    $i = 0;
                    while ($i < 6) {
                        echo "<th>" . $day[$i] . "</br>(" . $alldate[$i] . ")</th>";
                        $i++;
                    }
                    $break = "";
                    $l = 0;
                    $count = array(1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0);
                    for ($i = $starti; $i <= $nooflec; $i++) {
                        $days = count($day);
                        echo "<tr>";
                        $duration = NoOfBreakTable::model()->findByAttributes(array('timetable_id' => $timetableid, 'after_lec_break' => $i));
                        $dur = $duration['duration'];
                        if ($dur) {
                            $dur1 = date('i', strtotime($dur));
                        }
                        if ($break) {
                            echo "<td style=width:100px;>" . $time . "-</br>" . date('g:i A', strtotime($time) + $dur1 * 60) . "</td><td colspan=7 align=center><font color='green'><b>Break</b></font></td></tr>";
                            $break = "";
                            $timestamp = strtotime($time) + $dur1 * 60;
                            $time = date('g:i A', $timestamp);
                            $i--;
                            continue;
                        } else {
                            echo "<td style=width:100px;>" . $time . "-</br>" . date('g:i A', strtotime($time) + 60 * $lec[$l]) . "</td>";
                            $timestamp = strtotime($time) + 60 * $lec[$l];
                            $l++;
                            $time = date('g:i A', $timestamp);
                        }
                        for ($j = 1; $j <= $days; ++$j) {
                            $subname = "";
                            $room = "";
                            $faculty = "";
                            $batch = "";
                            if ($count[$j] > 0) {
                                $count[$j]--;
                                continue;
                            }
                            $result = TimeTableDetail::model()->findAllByAttributes(array(), $condition = 'timetable_id = :table_id AND day = :day AND lec = :lec AND division_id = :div_id AND lecture_date = :lecdate and proxy_status <> :proxy_status', $params = array(':table_id' => $timetableid, ':day' => $j, ':lec' => $i, ':div_id' => $stud_model->student_transaction_division_id, ':lecdate' => date('Y-m-d', strtotime($alldate[$j - 1])), ':proxy_status' => 2));
                            $break = NoOfBreakTable::model()->findAllByAttributes(array(), $condition = 'timetable_id = :table_id  AND after_lec_break = :lec', $params = array(':table_id' => $timetableid, ':lec' => $i));
                            if ($result) {
                                foreach ($result as $list) {
                                    if ($list['lect_hour'] > 1) {
                                        $count[$j] = $list['lect_hour'] - 1;
                                    }
                                    echo "<td rowspan=" . $list['lect_hour'] . " align=center style=background:#C0CCCC; width:100px;>";
                                    break;
                                }
                                foreach ($result as $check) {
                                    if ($check->batch_id != 0) {
                                        $batch = "(" . Batch::model()->findByPk($check->batch_id)->batch_name . ")";
                                    }
                                    $subname = SubjectMaster::model()->findByPk($check->subject_id)->subject_master_alias;
                                    $room = "(" . RoomDetailsMaster::model()->findByPk($check->room_id)->room_name . ")";
                                    $faculty = "(" . EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id' => $check->faculty_emp_id))->employee_name_alias . ")";
                                    if ($batch) {
                                        echo "</br>" . $subname . "</br>" . $batch . "</br>" . $room . "</br>" . $faculty;
                                    } else {
                                        echo "</br>" . $subname . "</br>" . $room . "</br>" . $faculty;
                                    }
                                }
                                echo "</td>";
                            } else {
                                echo "<td style=width:100px;>" . $subname . "</br>" . $batch . "</br>" . $room . "</br>" . $faculty . "</td>";
                            }
                        }
                        echo "</tr>";
                    }
                    echo "</table>";
                    ?>
<h5>Proxy details</h5>

<table id="time-table-struc" style="font-size:10px;">
<tr>
<th>Sr. No.</th>
<th>Employee Name</th>
<th>Proxy Employee Name</th>
<th>Subject</th>
<th>Lecture No.</th>
<th>Date</th>
</tr>
<?php 
                    $proxy_data = TimeTableDetail::model()->findAllByAttributes(array(), $condition = 'timetable_id = :timetable_id and division_id = :div_id and lecture_date >= :start and lecture_date< :end and proxy_status = :proxy order by lec', $params = array(':timetable_id' => $timetableid, ':div_id' => $stud_model->student_transaction_division_id, ':start' => date('Y-m-d', strtotime($alldate[0])), ':end' => date('Y-m-d', strtotime($alldate[5])), ':proxy' => 1));
                    $n = 0;
                    foreach ($proxy_data as $list) {
                        $result = TimeTableDetail::model()->findByPk($list->proxy_id);
                        ?>

<tr>
<td><?php 
                        echo ++$n;
                        ?>
</td>
<td><?php 
                        echo EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id' => $list->faculty_emp_id))->employee_first_name;
                        ?>
</td>
<td><?php 
                        echo EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id' => $result->faculty_emp_id))->employee_first_name;
                        ?>
</td>
<td><?php 
                        echo SubjectMaster::model()->findByPk($result->subject_id)->subject_master_alias;
                        ?>
</td>
<td><?php 
                        echo $result->lec;
                        ?>
</td>
<td><?php 
                        echo date('d-m-Y', strtotime($result->lecture_date));
                        ?>
</td>
</tr>
<?php 
                    }
                    ?>
</table>
<?php 
                }
                //ELSE END
            }
        } else {
            if (Yii::app()->user->getState('emp_id')) {
                $timetableid = 0;
                $date = date('Y-m-d');
                $ts = strtotime($date);
                $week_number = date('W', $ts);
                $alldate[0] = 'No';
                $year = date('Y');
                for ($day2 = 1; $day2 < 7; $day2++) {
                    $alldate[$day2] = date('d-m-Y', strtotime($year . "W" . $week_number . $day2));
                }
                $semname = AcademicTerm::model()->findAllByAttributes(array(), $condition = 'current_sem = :current_sem and academic_term_organization_id=:org_id', $params = array(':current_sem' => 1, ':org_id' => Yii::app()->user->getState('org_id')));
                foreach ($semname as $s) {
                    $semid = $s['academic_term_id'];
                    $check = TimeTableDetail::model()->findByAttributes(array('acdm_name_id' => $semid, 'faculty_emp_id' => Yii::app()->user->getState('emp_id')));
                    if ($check) {
                        $timetableid = $check['timetable_id'];
                        break;
                    }
                }
                if (!empty($timetableid)) {
                    $day = array(" ", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
                    $model = TimeTable::model()->findByPk($timetableid);
                    $nooflec = $model->No_of_Lec;
                    $sum = $nooflec;
                    $lec_duration = LecDuration::model()->findAllByAttributes(array(), $condition = 'timetable_id = :table_id ', $params = array(':table_id' => $timetableid));
                    $lec = array();
                    foreach ($lec_duration as $l) {
                        $lec[] = $l['duration'];
                    }
                    $starti = 1;
                    if ($model->zero_lec == 1) {
                        $starti = 0;
                    }
                    $time = $model->clg_start_time;
                    $time = date('H:i A', strtotime($time));
                    $createdate = date_create($model->creation_date);
                    ?>

			<table id="time-table-struc" bgcolor="#CBE7ED" border="2" style="width:auto;font-size:9px;border-collapse:collapse; height:auto;" >
			<th>
				Day/Time
			</th>

			<?php 
                    $i = 0;
                    while ($i < 7) {
                        echo "<th style='font-size:8px'>" . $day[$i] . "</br>(" . $alldate[$i] . ")</th>";
                        $i++;
                    }
                    $l = 0;
                    $break = "";
                    $dur1 = 0;
                    $count = array(1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0);
                    for ($i = $starti; $i <= $nooflec; $i++) {
                        $days = count($day);
                        echo "<tr>";
                        $duration = NoOfBreakTable::model()->findByAttributes(array('timetable_id' => $timetableid, 'after_lec_break' => $i));
                        if ($duration) {
                            $dur = $duration['duration'];
                            $dur1 = date('i', strtotime($dur));
                        }
                        if ($break) {
                            echo "<td style=width:100px;>" . $time . "-</br>" . date('g:i A', strtotime($time) + $dur1 * 60) . "</td><td colspan=7 align=center ><font color='green'><b>Break</b></font></td></tr>";
                            $break = "";
                            $timestamp = strtotime($time) + $dur1 * 60;
                            $time = date('g:i A', $timestamp);
                            $i--;
                            continue;
                        } else {
                            echo "<td style=width:100px;>" . $time . "-</br>" . date('g:i A', strtotime($time) + 60 * $lec[$l]) . "</td><td style=width:25px;><b>" . $i . "</b></td>";
                            $timestamp = strtotime($time) + 60 * $lec[$l];
                            $l++;
                            $time = date('g:i A', $timestamp);
                        }
                        for ($j = 1; $j <= $days - 1; ++$j) {
                            $subname = "";
                            $room = "";
                            $faculty = "";
                            $batch = "";
                            if ($count[$j] > 0) {
                                $count[$j]--;
                                continue;
                            }
                            $result = TimeTableDetail::model()->findAllByAttributes(array(), $condition = 'day = :day AND lec = :lec AND faculty_emp_id = :emp_id AND timetable_id=:table_id AND lecture_date =:lecdate and proxy_status <> :status', $params = array(':table_id' => $timetableid, ':day' => $j, ':lec' => $i, ':emp_id' => Yii::app()->user->getState('emp_id'), ':lecdate' => date('Y-m-d', strtotime($alldate[$j])), ':status' => 2));
                            $break = NoOfBreakTable::model()->findAllByAttributes(array(), $condition = 'after_lec_break = :lec AND timetable_id=:table_id', $params = array(':table_id' => $timetableid, ':lec' => $i));
                            if ($result) {
                                foreach ($result as $list) {
                                    if ($list['lect_hour'] > 1) {
                                        $count[$j] = $list['lect_hour'] - 1;
                                    }
                                    echo "<td rowspan=" . $list['lect_hour'] . " align=center style=background:#C0CCCC; border-color:black; width:150px;>";
                                    break;
                                }
                                foreach ($result as $check) {
                                    if ($check->batch_id != 0) {
                                        $batch = "(" . Batch::model()->findByPk($check->batch_id)->batch_name . ")";
                                    }
                                    $subname = SubjectMaster::model()->findByPk($check->subject_id)->subject_master_alias;
                                    $room = "(" . RoomDetailsMaster::model()->findByPk($check->room_id)->room_name . ")";
                                    $div = Division::model()->findByPk($check->division_id)->division_code;
                                    //$faculty="(".EmployeeInfo::model()->findByPk($check->faculty_emp_id)->employee_name_alias.")";
                                    if ($batch) {
                                        echo $subname . "</br>" . $batch . "</br>" . $room;
                                    } else {
                                        echo $subname . "</br>" . "(" . $div . ")" . "</br>" . $room;
                                    }
                                }
                                echo "</td>";
                            } else {
                                echo "<td style=width:150px;>" . $subname . "</br>" . $batch . "</br>" . $room . "</td>";
                            }
                        }
                        //for j end
                        echo "</tr>";
                    }
                    //for i end
                    echo "</table>";
                    ?>
<h5>Proxy Lectures</h5>

<table id="time-table-struc" border="1" style="font-size:10px;">
<tr>
<th>Sr. No.</th>
<th>Employee Name</th>
<th>Division</th>
<th>Subject</th>
<th>Room</th>
<th>Lecture No.</th>
<th>Date</th>
</tr>
<?php 
                    $proxy_data = TimeTableDetail::model()->findAllByAttributes(array(), $condition = 'timetable_id = :timetable_id and proxy_employee_id = :emp_id and lecture_date >= :start and lecture_date< :end and proxy_status = :proxy order by lec', $params = array(':timetable_id' => $timetableid, ':emp_id' => Yii::app()->user->getState('emp_id'), ':start' => date('Y-m-d', strtotime($alldate[0])), ':end' => date('Y-m-d', strtotime($alldate[5])), ':proxy' => 1));
                    $n = 0;
                    foreach ($proxy_data as $list) {
                        $result = TimeTableDetail::model()->findByPk($list->proxy_id);
                        ?>

<tr>
<td><?php 
                        echo ++$n;
                        ?>
</td>
<td><?php 
                        echo EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id' => $list->faculty_emp_id))->employee_first_name;
                        ?>
</td>
<td><?php 
                        echo Division::model()->findByPk($result->division_id)->division_code;
                        ?>
</td>
<td><?php 
                        echo SubjectMaster::model()->findByPk($result->subject_id)->subject_master_alias;
                        ?>
</td>
<td><?php 
                        echo RoomDetailsMaster::model()->findByPk($result->room_id)->room_name;
                        ?>
</td>
<td><?php 
                        echo $result->lec;
                        ?>
</td>
<td><?php 
                        echo date('d-m-Y', strtotime($result->lecture_date));
                        ?>
</td>
</tr>
<?php 
                    }
                    ?>
</table>		

<?php 
                } else {
                    echo "<h3 align=center style=color:red>Sorry, No timetable available.</h3>";
                }
            }
        }
    }
コード例 #4
0
</div>
<?php
 $form=$this->beginWidget('CActiveForm', array(
	'id'=>'attendence-form',
	'htmlOptions'=>array('enctype'=>'multipart/form-data'),
	//'enableAjaxValidation'=>false,
	 'stateful'=>true,
	//'clientOptions'=>array('validateOnSubmit'=>true),
)); ?>

</style>
<table  class="report-table" width = 100%>
	<tr>
	<th><input type="checkbox" class="checkall"></th>
	<th  colspan = 3>Batch : <?php if($_REQUEST['batch'] != 0) echo Batch::model()->findByPk($_REQUEST['batch'])->batch_code ;?> </br>
	Subject : <?php echo SubjectMaster::model()->findByPk($_REQUEST['subject_id'])->subject_master_name ;?> </th></tr>
	 <tr class="table_header">
	    <th>P/A</th>
	    <th> Roll No </th>
	    <th> Name </th>

	</tr>	
<?php 
	$count = 0;
	$count = count($row1);
	
	for($i=0;$i<count($row1);$i++)
	{
	   $stud_id = $row1[$i]['student_transaction_id'];
	   $name_lable = $row1[$i]['student_first_name'].' '.$row1[$i]['student_middle_name'].' '.$row1[$i]['student_last_name'];
	   if(($i%2) == 0)
コード例 #5
0
ファイル: std2DayTT.php プロジェクト: rinodung/EduSec3.0.0
				}
			   }

			   print '<table id="time-table-struc" style="font-size:10px;">';
			   print '<tr>';
			   print '<th>Lecture No.</th>';
			   print '<th>Subject</th>';
			   print '<th>Faculty Name</th>';
			   print '<th>Room No.</th>';
			   print '<th>Time</th>';
			   foreach($check_timetable as $list) {
			   if($list->subject_type != 1 && $list->batch_id !=$stud_model->student_transaction_batch_id)
			   {
				continue;
			   }

			   print '<tr>';
			   print '<td>'.$list->lec.'</td>';	
			   print '<td>'.SubjectMaster::model()->findByPk($list->subject_id)->subject_master_alias.'</td>';	
			   print '<td>'.EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>$list->faculty_emp_id))->employee_first_name.'</td>';	

			   print '<td>'.RoomDetailsMaster::model()->findByPk($list->room_id)->room_name.'</td>';	
			   print '<td>'.$time[$list->lec].'</td></tr>';			
			
	          	   }
		print '</table>';?>
</div>
</div>
</div>
<?php } ?>
			if($cols[$sub]>1)
			{ 
			   $count=$comb_subject[$cs];
			   $cols_sub=$cols[$sub];			
			   print "<th  colspan=".$cols_sub."><table><tr>";	
			   for($c=0;$c<$count;$c++)	
			   {				
			   	print '<th style=width:50px!important;>'.SubjectMaster::model()->findByPk($subject[$sub])->subject_master_alias."</th>";
				$sub++;	
	 		   }	
			   print "</tr></table></th>";
			   $sub--;				
			}			
			else
			{					
			print '<th style=width:50px!important;>'.SubjectMaster::model()->findByPk($subject[$sub])->subject_master_alias.' </th>';
			}			
		}
	  	else 
		{
			print '<th >--</th>';
		}
		$cs++;
	}
	echo "</tr><tr>"; 
	$cs=0;
	for($fac=0;$fac<count($faculty);$fac++)
	{
		if($faculty[$fac]!=0)
		{
			if($cols[$fac]>1)
	$tot_p=0;
	$present=array();
	foreach($subjectid as $sub)
	{
		echo "<th colspan=2>";
		$sub_name = SubjectMaster::model()->findByAttributes(array('subject_master_id'=>$sub));
		echo $sub_name->subject_master_name."(".SubjectType::model()->findByPk($sub_name->subject_master_type_id)->subject_type_name.")";
		echo "</th>";
		$all_attendance = Attendence::model()->findAll(array('condition'=>'month(attendence_date)='.$month_value.' AND branch_id='.$branch.' AND sub_id='.$sub.' AND year(attendence_date)='.$year,'select'=>'attendence_date,student_attendence_period_id','distinct'=>'true'));
	
		$totalT[$sub]=count($all_attendance);
	}
	foreach($subjectidp as $sub)
	{
		echo "<th colspan=2>";
		$sub_name = SubjectMaster::model()->findByAttributes(array('subject_master_id'=>$sub));
		echo $sub_name->subject_master_name."(".SubjectType::model()->findByPk($sub_name->subject_master_type_id)->subject_type_name.")";
		echo "</th>";			
	$all_attendance = Attendence::model()->findAll(array('condition'=>'month(attendence_date)='.$month_value.' AND branch_id='.$branch.' AND sub_id='.$sub.' AND year(attendence_date)='.$year,'select'=>'attendence_date,student_attendence_period_id','distinct'=>'true'));
			$totalP[$sub]=count($all_attendance);
		
	}
		
		foreach($totalT as $t){
			$tot_t=$tot_t+$t;
		}		
		echo "<th rowspan=2> Total Theory Subjects <br> <br>Out <br>Of ".'<br> ( '.$tot_t.')'."</th> ";
		echo "<th rowspan=2> Total Theory Subjects <br><br><br> % </th>";

		foreach($totalP as $t){
			$tot_p=$tot_p+$t;
コード例 #8
0
			':timetable_id' => $timetableid,
			':div_id'=>$stud_model->student_transaction_division_id,
			':start'=>date('Y-m-d',strtotime($alldate[0])),
			':end'=>date('Y-m-d',strtotime($alldate[5])),
			':proxy'=>1,
			));
	$n = 0; 
   foreach($proxy_data as $list) {
	$result = TimeTableDetail::model()->findByPk($list->proxy_id);
?>

<tr>
<td><?php echo ++$n; ?></td>
<td><?php echo EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>$list->faculty_emp_id))->employee_first_name; ?></td>
<td><?php echo EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>$result->faculty_emp_id))->employee_first_name; ?></td>
<td><?php echo SubjectMaster::model()->findByPk($result->subject_id)->subject_master_alias; ?></td>
<td><?php echo $result->lec; ?></td>
<td><?php echo date('d-m-Y',strtotime($result->lecture_date)); ?></td>
</tr>
<?php } ?>
</table></div>
<?php
	}

	   }
	}//if $_REQUEST['student_id'] end
	else
	{
		echo CHtml::link('GO BACK',Yii::app()->createUrl('/site/newdashboard')); 
		echo "No student Login";
	}
コード例 #9
0
		</td>
		<td>
		      <?php 
            echo EmployeeInfo::model()->find(' 	employee_info_transaction_id=' . $v['employee_id'])->employee_first_name;
            ?>
		
		</td>
		<td>
		      <?php 
            echo Branch::model()->findByPk($v['branch_id'])->branch_name;
            ?>
		
		</td>
		<td>
		      <?php 
            echo SubjectMaster::model()->findByPk($v['sub_id'])->subject_master_name;
            ?>
		
		</td>
		
		<td>
		      <?php 
            echo AcademicTermPeriod::model()->findByPk($v['sem_id'])->academic_term_period;
            ?>
		
		</td>
		<td>
		      <?php 
            echo "Sem-" . AcademicTerm::model()->findByPk($v['sem_name_id'])->academic_term_name;
            ?>
		
コード例 #10
0
	public function actionGetsubject()
        {
           
		$sub = array();
		$data1=array();
	
		
		// for update division

	
		$data1=SubjectMaster::model()->findAll();
                  	
		$data1=CHtml::listData($data1, 'subject_master_id' ,'subject_master_name');
		echo "<option value=''>Select Subject</option>";
		foreach($data1 as $value1=>$name1)
		{
			$sub_mas = SubjectMaster::model()->findByPk($value1);
			$type = SubjectType::model()->findByPk($sub_mas->subject_master_type_id)->subject_type_name;
		   echo  CHtml::tag('option',
		                array('value'=>$value1),CHtml::encode($name1.'('.$type.')'),true);
		}
		
		
		
	}
コード例 #11
0
ファイル: month-view.php プロジェクト: rinodung/EduSec3.0.0
<tr class="row">	
	<td class="col1">Enrollment No. </td> 
	<td class="col2"><?php echo $stud_info['student_enroll_no'];?></td>
</tr>	
<tr class="row">
	<td class="col1">Roll No. </td> 
	<td class="col2"> <?php echo $stud_info['student_roll_no'];?></td>
</tr>	
<tr class="row">
	<td class="col1">Month </td> 
	<td class="col2"><?php echo strftime( '%B', mktime( 0, 0, 0, $_REQUEST['month'], 1 ) ).'-'.$_REQUEST['year'];?></td>
</tr>	
	
<tr class="row">
	<td class="col1">Subject Name </td> 
	<td class="col2"><?php echo SubjectMaster::model()->findByPk($_REQUEST['sub_id'])->subject_master_name;?></td>
</tr>	
<table><br>
<p class="hint">
	Notice: P=Present, A=Absent, Display multiple attendence records for same block if attendence is taken for more than one time in a same day for same subject.
</p>
<table class="report-table" border="2" >
<th colspan="<?php echo $num+1; ?>" style="font-size: 18px; color: rgb(255, 255, 255);">
		Monthwise Report<br/>
<tr class="table_header">
<th>Day</th>
<?php 
	for($i = 1; $i<=$num; $i++) {
	print '<th>'.$i.'</th>';
	}
?>
コード例 #12
0
 public function actionStudMonthlyAllsubjectAttendenceReport()
 {
     $baseUrl = Yii::app()->baseUrl;
     $cs = Yii::app()->getClientScript();
     $cs->registerCssFile($baseUrl . '/css/report.css');
     $model = new Attendence();
     $this->performAjaxValidation($model);
     $month = null;
     $month_value = null;
     $student = array();
     $subject_data = array();
     $sid = array();
     $subject = 0;
     $subjectp = 0;
     $subjectidp = array();
     $subjectid = array();
     $batch = 0;
     if (!empty($_POST['months']) && !empty($_REQUEST['Attendence']['batch_id']) && isset($_POST['Attendence']) || isset($_REQUEST['batch_id'])) {
         //print_r ($_POST['Attendence']);exit;
         $query = null;
         if (!empty($_REQUEST['batch_id'])) {
             $batch = $_REQUEST['batch_id'];
             $query .= "batch_id=" . $batch . " AND ";
         } else {
             $batch = $_POST['Attendence']['batch_id'];
             $query .= "batch_id=" . $batch . " AND ";
         }
         if (!empty($_POST['months']) || !empty($_REQUEST['month'])) {
             if (!empty($_REQUEST['month'])) {
                 $month = $_REQUEST['month'];
             } else {
                 $month = $_POST['months'];
             }
             $student = Yii::app()->db->createCommand()->selectDistinct('st_id')->from('attendence a')->join('student_transaction st', 'a.st_id=st.student_transaction_student_id')->where($query . '  st.student_transaction_detain_student_flag NOT IN (1,2)')->queryAll();
             //print_r($student);exit;
             foreach ($student as $s) {
                 //student name
                 $data3 = Attendence::model()->findAll(array('condition' => 'st_id=' . $s['st_id']));
                 $stud_name = StudentInfo::model()->findByPk($s['st_id']);
                 $sid[] = $s['st_id'];
             }
             $subject = Yii::app()->db->createCommand()->selectDistinct('sub_id')->from('attendence a')->join('subject_master sub', 'a.sub_id=sub.subject_master_id')->where('subject_master_type_id=1')->queryAll();
             $subject_p = Yii::app()->db->createCommand()->selectDistinct('sub_id')->from('attendence a')->join('subject_master sub', 'a.sub_id=sub.subject_master_id')->where('subject_master_type_id=2')->queryAll();
             foreach ($subject as $sub) {
                 $sub_name = SubjectMaster::model()->findByPk($sub['sub_id']);
                 $subjectid[] = $sub['sub_id'];
             }
             foreach ($subject_p as $sub) {
                 $sub_name = SubjectMaster::model()->findByPk($sub['sub_id']);
                 $subjectidp[] = $sub['sub_id'];
             }
         }
         // .......export excel.....
         if (isset($_REQUEST['excel'])) {
             Yii::app()->request->sendFile(date('YmdHis') . '.xls', $this->renderPartial('stud_monthly_allsubject_attendence_report_excel', array('month' => $month, 'sid' => $sid, 'batch' => $batch, 'subjectid' => $subjectid, 'subjectidp' => $subjectidp), true));
         } else {
             $this->render('stud_monthly_allsubject_attendence_report_view', array('model' => $model, 'month' => $month, 'sid' => $sid, 'batch' => $batch, 'subjectid' => $subjectid, 'subjectidp' => $subjectidp));
         }
     } else {
         $this->render('stud_monthly_allsubject_attendence_report_view', array('model' => $model, 'month' => $month, 'sid' => $sid, 'batch' => $batch, 'subjectid' => $subjectid, 'subjectidp' => $subjectidp));
     }
 }
コード例 #13
0
	public function actionShowallstudentview()
	{
		$model=new Attendence;
		$timetabledetail = new TimeTableDetail;
		$count = 0;
		$row1 = array();
		$div=Division::model()->findByPk($_REQUEST['division_id']);
		$branch_id=$div->branch_id;
		$period_no = $_REQUEST['lec_no'];
		$sub_id=$_REQUEST['subject_id'];
		$sem_id=$div->academic_period_id;
		$date = date('Y-m-d',strtotime($_REQUEST['date']));
		$sem_name = $div->academic_name_id;
		$shift_id=1;
		$div_id=$_REQUEST['division_id'];

		$subject_type = SubjectMaster::model()->findByPk($sub_id)->subject_master_type_id; 
		$subject_type_name = SubjectType::model()->findByPk($subject_type)->subject_type_name;
			
		if($subject_type_name == 'Elective')
		{
			$row1 = Yii::app()->db->createCommand()
			        ->select('student_transaction_id,student_transaction_student_id,student_roll_no, student_enroll_no,student_first_name, student_middle_name, student_last_name')
				->from('student_transaction st')	
				->join('student_info','student_info_transaction_id=student_transaction_id')
				 ->join('elective_subject_details esd','esd.elective_subject_student_id =st.student_transaction_student_id')
				->where('st.student_transaction_division_id='.$div_id.' and esd.elective_subject_sem_id='.$sem_name.' and esd.elective_subject_id='.$sub_id.' order by student_enroll_no')
				->queryAll();
				$all_array = array('branch_id'=>$branch_id,'period_no'=>$period_no,'shift_id'=>$shift_id,'faculty_id'=>$_REQUEST['faculty_id'],'div_id'=>$div_id,'sub_id'=>$sub_id,'sem_id'=>$sem_id,'date'=>$date,'sem_name'=>$sem_name);
				
		}
		else if($_REQUEST['batch']!=0)
		{
			$batch_id=$_REQUEST['batch'];
			$row1 = Yii::app()->db->createCommand()
				->select('student_transaction_id,student_transaction_student_id, student_enroll_no,student_first_name,student_roll_no, student_middle_name, student_last_name')
				->from('student_transaction')
				->join('student_info','student_info_transaction_id=student_transaction_id')
				->where('student_transaction_branch_id='.$branch_id.' and student_transaction_division_id='.$div_id.' and student_transaction_batch_id='.$batch_id.' and student_academic_term_name_id='.$sem_name.' and student_academic_term_period_tran_id ='.$sem_id.' and student_transaction_detain_student_flag in(5, 6) order by student_enroll_no')
				->queryAll();
			$all_array = array('branch_id'=>$branch_id,'period_no'=>$period_no,'shift_id'=>$shift_id,'faculty_id'=>$_REQUEST['faculty_id'],'div_id'=>$div_id,'batch_id'=>$batch_id,'sub_id'=>$sub_id,'sem_id'=>$sem_id,'date'=>$date,'sem_name'=>$sem_name);			
		}
		else
		{
			$row1 = Yii::app()->db->createCommand()
				->select('student_transaction_id,student_transaction_student_id,student_roll_no, student_enroll_no,student_first_name, student_middle_name, student_last_name')
				->from('student_transaction')
				->join('student_info','student_info_transaction_id=student_transaction_id')
				->where('student_transaction_branch_id='.$branch_id.' and student_transaction_division_id='.$div_id.' and student_academic_term_name_id='.$sem_name.' and student_academic_term_period_tran_id ='.$sem_id.' and student_transaction_detain_student_flag in (5, 6) order by student_enroll_no')
				->queryAll();
				$all_array = array('branch_id'=>$branch_id,'shift_id'=>$shift_id,'div_id'=>$div_id,'batch_id'=>"",'sub_id'=>$sub_id,'sem_id'=>$sem_id,'date'=>$date,'sem_name'=>$sem_name,'period_no'=>$period_no,'faculty_id'=>$_REQUEST['faculty_id']);
		}
	
		if($date > date('Y-m-d') || $date < date('Y-m-d', strtotime( '-6 days' )))
		{	
			echo "you can not take attendance of before week date or future date!";
			exit;	
		}
		if($_REQUEST['batch']!=0)
		{
			$check = Attendence::model()->findByAttributes(array('employee_id'=>$_REQUEST['faculty_id'],'batch_id'=>$_REQUEST['batch'],'attendence_date'=>$date,'div_id'=>$div_id,'attendence_organization_id'=>Yii::app()->user->getState('org_id')));
		}
		else
		{			
			$check = Attendence::model()->findByAttributes(array('student_attendence_period_id'=>$period_no,'attendence_date'=>$date,'div_id'=>$div_id,'attendence_organization_id'=>Yii::app()->user->getState('org_id')));
		}
		if($check)
		{
			echo "you can not take attendance more than one time.!";
			exit;	
		}
		$count = count($row1);
			
		if($count == 0)
		{
			Yii::app()->user->setFlash('not-select-attendece', "No Student Found for this Criteria");
		}
		
			Yii::app()->user->setState('stud_array',$row1);	
			Yii::app()->user->setState('all_array',$all_array);	
			

		if(isset($_POST['save']))
		{
			$model->employee_id=$all_array['faculty_id'];				
			$model->branch_id=$all_array['branch_id'];
			$model->shift_id=$all_array['shift_id'];
			$model->div_id=$all_array['div_id'];
			$model->batch_id=$all_array['batch_id'];
			$model->sub_id=$all_array['sub_id'];
			$model->sem_id=$all_array['sem_id'];
			$model->sem_name_id=$all_array['sem_name'];
			$model->attendence_date = $all_array['date'];
			$model->student_attendence_period_id = $all_array['period_no'];			   
			$model->attendence_organization_id = Yii::app()->user->getState('org_id');	
			
			foreach($_POST['Attendence']['st_id'] as $index=>$student_id )
			{
				$model->setIsNewRecord(true);
				$model->attendence = 'A';
				if($student_id!=0)
					$model->attendence = 'P';
				
				$model->st_id = $index;		
				$model->id=null;				
		   		$model->save();	
			}
			$this->redirect(array('admin'));
		}

		$this->render('show_student_view',array(
			'model'=>$model,'row1'=>$row1, 'timetabledetail'=>$timetabledetail,
		));
	}
コード例 #14
0
    $form = $this->beginWidget('CActiveForm', array('id' => 'attendence-form', 'enableAjaxValidation' => false, 'clientOptions' => array('validateOnSubmit' => true)));
    ?>


<?php 
    $count = 0;
    $count = count($row1);
    for ($i = 0; $i < count($row1); $i++) {
        //$stud_id = $row1[$i]['st_id'];
        $attendence = $row1[$i]['attendence'];
        $date = $row1[$i]['attendence_date'];
        $name_lable = StudentInfo::model()->findByPk($row1[$i]['st_id'])->student_first_name;
        $branch_name = Branch::model()->findByPk($row1[$i]['branch_id'])->branch_name;
        $academic_name = AcademicTerm::model()->findByPk($row1[$i]['sem_name_id'])->academic_term_name;
        $academic_term = AcademicTermPeriod::model()->findByPk($row1[$i]['sem_id'])->academic_term_period;
        $subject_name = SubjectMaster::model()->findByPk($row1[$i]['sub_id'])->subject_master_name;
        //			   $attendence = model()->attendence;
        //			echo $name_lable;
        //			echo $branch_name;
        //			echo $academic_name;
        //			echo $academic_term;
        //			echo $subject_name;
        //			echo $attendence;
        //			echo $date;
        ?>
		<div class="row">
			<?php 
        echo $form->labelEx($model, $name_lable);
        ?>
		   				<?php 
        echo $form->labelEx($model, $branch_name);
コード例 #15
0
<span class="status">&nbsp;</span>
		<?php 
echo $form->error($model, 'div_id');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'sub_id');
?>
		<?php 
//echo $form->dropDownList($model,'sub_id',SubjectMaster::items(), array('empty' => '---------------Select-------------','tabindex'=>6));
?>
		<?php 
if (isset($model->sub_id)) {
    echo $form->dropDownList($model, 'sub_id', CHtml::listData(SubjectMaster::model()->findAll(array('condition' => 'subject_master_branch_id=' . $model->branch_id . ' and subject_master_organization_id=' . $org_id)), 'subject_master_id', 'subject_master_name'));
} else {
    echo $form->dropDownList($model, 'sub_id', array('prompt' => 'Select Subject'), array('tabindex' => 6));
}
?>
<span class="status">&nbsp;</span>
		<?php 
echo $form->error($model, 'sub_id');
?>
	</div>

</div>
<div class="first-row" >
	<div class="row">
        <?php 
echo $form->labelEx($model, 'batch_id');
コード例 #16
0
			$all = Yii::app()->db->createCommand()
		        	->select('count(attendence)')
				->from('attendence att')
				->join('academic_term ac','ac.academic_term_id = att.sem_name_id')
				->where('ac.current_sem=1 AND att.attendence_organization_id='.$id.' and att.sub_id='.$subid['sub_id'])
				->queryScalar();	
		$yaxis[] = round($attendence*100/$all);

			}
		                            
			//print_r($all[0]['count(attendence)']);
		
			foreach($Subject as $xvalue)
			{ 
				foreach($xvalue as $x)
				$xaxis[] = SubjectMaster::model()->findByPk($x)->subject_master_alias;			
			}
			
	if(!empty($Subject)) {?>
<div class="box">
<div class="box-header">
<h1>Attendance Chart</h1>
</div>
<?php
	echo "<div id=\"container\" style=\"min-width: 00px; height: 230px; margin: 0 auto\"></div>";

for($i=0;$i<count($xaxis);$i++)
{
	$t=0;
	$n[$i][$t]=$xaxis[$i];
	$n[$i][$t+1]= $yaxis[$i];	
コード例 #17
0
     	public function actionMysubjects()
     	{
	   $org = Yii::app()->user->getState('org_id');
	   $sub_model = array();
	   $emp_str = array();
	   if(Yii::app()->user->getState('stud_id')){
	   $trans_id = Yii::app()->user->getState('stud_id');
	   $trans_model = StudentTransaction::model()->findByPk($trans_id);
	
	   $sub_model = SubjectMaster::model()->findAll(array('condition'=>'subject_master_academic_terms_name_id='.$trans_model->student_academic_term_name_id.' and subject_master_branch_id='.$trans_model->student_transaction_branch_id.' and subject_master_organization_id='.$org));

	
	   foreach($sub_model as $list){

	   $subject_data = Yii::app()->db->createCommand()
			->select('employee_first_name')
			->from('assign_subject')
			->join('employee_info','employee_info_transaction_id=subject_faculty_id')
			->where('subject_id='.$list['subject_master_id'])
			->queryAll();
		$data = CHtml::listData($subject_data,'employee_first_name','employee_first_name');
		if($data)
		$emp_str[$list['subject_master_id']] = implode(',',$data);
		else
		$emp_str[$list['subject_master_id']] = "<i>Not Assigned<i>";
	   }

	}
	$this->render('my_subjects',array('sub_model'=>$sub_model,'emp_str_array'=>$emp_str));
	
        }
コード例 #18
0
 public function actionGetsubject()
 {
     $org_id = Yii::app()->user->getState('org_id');
     $sub = array();
     $data1 = array();
     // for update division
     $data1 = SubjectMaster::model()->findAll(array('condition' => 'subject_master_branch_id=' . (int) $_REQUEST['FeedbackMaster']['feedback_branch_id'] . ' and subject_master_academic_terms_name_id=' . (int) $_REQUEST['FeedbackMaster']['feedback_academic_term_id'] . ' and subject_master_organization_id=' . $org_id));
     $data1 = CHtml::listData($data1, 'subject_master_id', 'subject_master_name');
     echo "<option value=''>Select Subject</option>";
     foreach ($data1 as $value1 => $name1) {
         $sub_mas = SubjectMaster::model()->findByPk($value1);
         $type = SubjectType::model()->findByPk($sub_mas->subject_master_type_id)->subject_type_name;
         echo CHtml::tag('option', array('value' => $value1), CHtml::encode($name1 . '(' . $type . ')'), true);
     }
 }
コード例 #19
0
?>
</td>
</tr>
<tr class="row">
	<td class="col1">Batch</td> 
	<td class="col2"> <?php 
if ($_REQUEST['batch'] != 0) {
    echo Batch::model()->findByPk($_REQUEST['batch'])->batch_code;
}
?>
</td>
</tr>
<tr class="row">
	<td class="col1">Subject </td> 
	<td class="col2"> <?php 
echo SubjectMaster::model()->findByPk($_REQUEST['subject_id'])->subject_master_name;
?>
</td>
</tr>	
<tr class="row">
	<td class="col1">Date </td> 
	<td class="col2"> <?php 
echo $_REQUEST['date'];
?>
</td>
</tr>
</table>
</br>
<script>
$(function () {
    $('.checkall').click(function () {
コード例 #20
0
		$substr = implode(',',$sub_array);
		$syll = SubjectSyllabus::model()->findAll(array('condition'=>'sub_id in ('.$substr.') and start_date<="'.$sy_date.'" and end_date >="'.$sy_date.'"'));
		print '<div>&nbsp;</div>';
		print '<table class="gradienttable" id="time-table-struc" style="font-size:15px;margin-top:50px;">';
		   print '<tr>';
		   print '<tr><td colspan=4 style="background:white"><b>Topics to be taught on '.$date.'</b></td></tr>';
		   print '<th>SI No.</th>';
		   print '<th>Subject Name</th>';
		   print '<th>Topic</th>';
		   print '<th>Description</th></tr>';
		$t = 0;   
		foreach($syll as $listdata)
		{
			echo "<tr>";
			echo "<td>".++$t."</td>";
			echo "<td>".SubjectMaster::model()->findByPk($listdata['sub_id'])->subject_master_name."</td>";
			echo "<td>".$listdata['topic_name']."</td>";
			echo "<td>".$listdata['topic_description']."</td>";			
			echo "</tr>";
		}
		echo "</table>";
		}

		
	    }

	}
	else
	{
		echo CHtml::link('GO BACK',Yii::app()->createUrl('/site/newdashboard')); 
		echo "<h3 align=center style=color:red>Sorry, No Student Login.</h3>";
コード例 #21
0
 public function actionAttendencedivisionreport()
 {
     $model = new Attendence();
     $model->scenario = 'attendencedivisionreport';
     $this->performAjaxValidation($model);
     if (isset($_POST['Attendence']) || isset($_REQUEST['div_id'])) {
         if (isset($_REQUEST['div_id'])) {
             $div = $_REQUEST['div_id'];
         } else {
             $div = $_POST['Attendence']['div_id'];
         }
         $subject = Attendence::model()->findAll(array('select' => 'sub_id', 'distinct' => true, 'condition' => 'div_id=' . $div));
         $all_data = Attendence::model()->findAll(array('select' => 'st_id', 'distinct' => true, 'condition' => 'div_id=' . $div));
         $subjectid = array();
         $total = array();
         $sub = array();
         $present = array();
         foreach ($subject as $list) {
             $data1 = Attendence::model()->findAll(array('condition' => 'sub_id=' . $list['sub_id']));
             $total[] = count($data1);
             $data2 = Attendence::model()->findAll(array('condition' => 'sub_id=' . $list['sub_id'] . " AND attendence='P'"));
             $present[] = count($data2);
             $sub_mod = SubjectMaster::model()->findByPk($list['sub_id']);
             $sub[] = $sub_mod->subject_master_name . "(" . SubjectType::model()->findByPk($sub_mod->subject_master_type_id)->subject_type_name . ")";
             $subjectid[] = $list['sub_id'];
         }
         if (isset($_REQUEST['pdf'])) {
             Yii::import('application.extensions.tcpdf.*');
             require_once 'tcpdf/tcpdf.php';
             require_once 'tcpdf/config/lang/eng.php';
             $html = $this->renderPartial('attendence_division_pdf', array('total' => $total, 'present' => $present, 'subject' => $sub, 'div_id' => $div), true);
             //$session->close();
             //die($html);
             ob_clean();
             $pdf = new TCPDF();
             $pdf->SetCreator(PDF_CREATOR);
             $pdf->SetAuthor(Yii::app()->name);
             $pdf->SetTitle('Division Attendence Report');
             $pdf->SetSubject('Division Attendence Report');
             $pdf->SetKeywords('example, text, report');
             $pdf->SetHeaderData('', 0, "Division Attendence", '');
             //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, "Example Report by ".Yii::app()->name, "");
             $pdf->setHeaderFont(array('helvetica', '', 8));
             $pdf->setFooterFont(array('helvetica', '', 6));
             $pdf->SetMargins(15, 18, 15);
             $pdf->SetHeaderMargin(5);
             $pdf->SetFooterMargin(10);
             $pdf->SetAutoPageBreak(TRUE, 15);
             $pdf->SetFont('dejavusans', '', 7);
             $resolution = array(150, 150);
             $pdf->AddPage('P', $resolution);
             $pdf->writeHTML($html, true, false, true, false, '');
             $pdf->LastPage();
             $pdf->Output("attendenceDivision.pdf", "I");
         } else {
             if (isset($_REQUEST['excel'])) {
                 Yii::app()->request->sendFile(date('YmdHis') . '.xls', $this->renderPartial('attendence_division_pdf', array('total' => $total, 'present' => $present, 'subject' => $sub, 'div_id' => $div), true));
             } else {
                 if (isset($_REQUEST['studentpdf'])) {
                     Yii::import('application.extensions.tcpdf.*');
                     require_once 'tcpdf/tcpdf.php';
                     require_once 'tcpdf/config/lang/eng.php';
                     $html = $this->renderPartial('divisionwise_student_attendance_pdfexcel', array('total' => $total, 'present' => $present, 'subject' => $sub, 'div_id' => $div, 'sub_id' => $subject, 'all_data' => $all_data, 'subjectid' => $subjectid), true);
                     //$session->close();
                     //die($html);
                     ob_clean();
                     $pdf = new TCPDF();
                     $pdf->SetCreator(PDF_CREATOR);
                     $pdf->SetAuthor(Yii::app()->name);
                     $pdf->SetTitle('Division Attendence Report');
                     $pdf->SetSubject('Division Attendence Report');
                     $pdf->SetKeywords('example, text, report');
                     $pdf->SetHeaderData('', 0, "Division Attendence", '');
                     //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, "Example Report by ".Yii::app()->name, "");
                     $pdf->setHeaderFont(array('helvetica', '', 8));
                     $pdf->setFooterFont(array('helvetica', '', 6));
                     $pdf->SetMargins(15, 18, 15);
                     $pdf->SetHeaderMargin(5);
                     $pdf->SetFooterMargin(10);
                     $pdf->SetAutoPageBreak(TRUE, 15);
                     $pdf->SetFont('dejavusans', '', 7);
                     $resolution = array(150, 150);
                     $pdf->AddPage('P', $resolution);
                     $pdf->writeHTML($html, true, false, true, false, '');
                     $pdf->LastPage();
                     $pdf->Output("StudentAttendance.pdf", "I");
                 } else {
                     if (isset($_REQUEST['studentexcel'])) {
                         Yii::app()->request->sendFile(date('YmdHis') . '.xls', $this->renderPartial('divisionwise_student_attendance_pdfexcel', array('total' => $total, 'present' => $present, 'subject' => $sub, 'div_id' => $div, 'sub_id' => $subject, 'all_data' => $all_data, 'subjectid' => $subjectid), true));
                     } else {
                         if (isset($_REQUEST['subject'])) {
                             $this->render('student_subjectwise', array('subject' => $sub, 'sub_id' => $subject, 'all_data' => $all_data, 'subjectid' => $subjectid));
                         } else {
                             $this->render('attendence_division_report_view', array('total' => $total, 'present' => $present, 'subject' => $sub, 'div_id' => $div, 'sub_id' => $subject, 'all_data' => $all_data, 'subjectid' => $subjectid));
                         }
                     }
                 }
             }
         }
     } else {
         $this->render('attendence_division_report', array('model' => $model));
     }
 }
コード例 #22
0
 protected function renderContent()
 {
     $current_date = date('Y-m-d');
     if (Yii::app()->user->getState('stud_id')) {
         $criteria = new CDbCriteria();
         //$criteria->select = 'academic_term_id'; // select fields which you want in output
         $criteria->condition = 'current_sem = 1 AND academic_term_organization_id = ' . Yii::app()->user->getState('org_id');
         $semname = AcademicTerm::model()->findAll($criteria);
         $data = CHtml::listData($semname, 'academic_term_id', 'academic_term_id');
         $stud_model = StudentTransaction::model()->findByPk(Yii::app()->user->getState('stud_id'));
         $check_sem = in_array($stud_model->student_academic_term_name_id, $data);
         $timetableid = 0;
         if (!$check_sem) {
             echo "<h3 align=center style=color:red>Sorry, No timetable available for this student.</h3>";
         } else {
             $check_timetable = TimeTableDetail::model()->findAllByAttributes(array('acdm_name_id' => $stud_model->student_academic_term_name_id, 'division_id' => $stud_model->student_transaction_division_id, 'lecture_date' => $current_date), 'proxy_status <> :status', array(':status' => 1));
             if (empty($check_timetable)) {
                 echo "<h3 align=center style=color:red>Sorry, No timetable available for this student.</h3>";
             } else {
                 $timetable = TimeTable::model()->findByPk($check_timetable[0]->timetable_id);
                 $time1 = date('H:i A', strtotime($timetable['clg_start_time']));
                 if ($timetable->zero_lec == 1) {
                     $time[] = $time1;
                 } else {
                     $time[1] = $time1;
                 }
                 $lec_dur = LecDuration::model()->findAll(array('condition' => 'timetable_id=' . $timetable['timetable_id']));
                 foreach ($lec_dur as $list) {
                     $break = NoOfBreakTable::model()->findByAttributes(array('after_lec_break' => $list['lecture'], 'timetable_id' => $timetable['timetable_id']));
                     if ($break) {
                         $dur1 = date('i', strtotime($break['duration']));
                         $timestamp = strtotime($time1) + 60 * $dur1;
                         $time1 = date('g:i A', $timestamp);
                         $timestamp = strtotime($time1) + 60 * $list['duration'];
                         $time1 = date('g:i A', $timestamp);
                         $time[] = $time1;
                     } else {
                         $timestamp = strtotime($time1) + 60 * $list['duration'];
                         $time1 = date('g:i A', $timestamp);
                         $time[] = $time1;
                     }
                 }
                 print '<table id="time-table-struc" style="font-size:10px;">';
                 print '<tr>';
                 print '<th>Lecture No.</th>';
                 print '<th>Subject</th>';
                 print '<th>Faculty Name</th>';
                 print '<th>Room No.</th>';
                 print '<th>Time</th>';
                 foreach ($check_timetable as $list) {
                     if ($list->subject_type != 1 && $list->batch_id != $stud_model->student_transaction_batch_id) {
                         continue;
                     }
                     print '<tr>';
                     print '<td>' . $list->lec . '</td>';
                     print '<td>' . SubjectMaster::model()->findByPk($list->subject_id)->subject_master_alias . '</td>';
                     print '<td>' . EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id' => $list->faculty_emp_id))->employee_first_name . '</td>';
                     print '<td>' . RoomDetailsMaster::model()->findByPk($list->room_id)->room_name . '</td>';
                     print '<td>' . $time[$list->lec] . '</td></tr>';
                 }
                 print '</table>';
             }
         }
     } else {
         if (Yii::app()->user->getState('emp_id')) {
             $criteria = new CDbCriteria();
             //$criteria->select = 'academic_term_id';
             $criteria->condition = 'current_sem = 1 AND academic_term_organization_id = ' . Yii::app()->user->getState('org_id');
             $semname = AcademicTerm::model()->findAll($criteria);
             $data = CHtml::listData($semname, 'academic_term_id', 'academic_term_id');
             $data_arr = implode(',', $data);
             $timetable_criteria = new CDbCriteria();
             $timetable_criteria->condition = 'acdm_name_id in (' . $data_arr . ') AND faculty_emp_id = ' . Yii::app()->user->getState('emp_id') . ' AND lecture_date = "' . date('Y-m-d') . '"';
             $time_table_details = TimeTableDetail::model()->findAll($timetable_criteria);
             if ($time_table_details) {
                 $timetable = TimeTable::model()->findByPk($time_table_details[0]->timetable_id);
                 $time1 = date('H:i A', strtotime($timetable['clg_start_time']));
                 if ($timetable->zero_lec == 1) {
                     $time[] = $time1;
                 } else {
                     $time[1] = $time1;
                 }
                 $lec_dur = LecDuration::model()->findAll(array('condition' => 'timetable_id=' . $timetable['timetable_id']));
                 foreach ($lec_dur as $list) {
                     $break = NoOfBreakTable::model()->findByAttributes(array('after_lec_break' => $list['lecture'], 'timetable_id' => $timetable['timetable_id']));
                     if ($break) {
                         $dur1 = date('i', strtotime($break['duration']));
                         $timestamp = strtotime($time1) + 60 * $dur1;
                         $time1 = date('g:i A', $timestamp);
                         $timestamp = strtotime($time1) + 60 * $list['duration'];
                         $time1 = date('g:i A', $timestamp);
                         $time[] = $time1;
                     } else {
                         $timestamp = strtotime($time1) + 60 * $list['duration'];
                         $time1 = date('g:i A', $timestamp);
                         $time[] = $time1;
                     }
                 }
                 print '<table id="time-table-struc" style="font-size:10px;">';
                 print '<tr>';
                 print '<th>Lecture No.</th>';
                 print '<th>Branch</th>';
                 print '<th>Sem</th>';
                 print '<th>Division</th>';
                 print '<th>Subject</th>';
                 print '<th>Room No.</th>';
                 print '<th>Time</th>';
                 foreach ($time_table_details as $list) {
                     print '<tr>';
                     print '<td>' . $list->lec . '</td>';
                     print '<td>' . Branch::model()->findByPk($list->branch_id)->branch_name . '</td>';
                     print '<td>' . AcademicTerm::model()->findByPk($list->acdm_name_id)->academic_term_name . '</td>';
                     print '<td>' . Division::model()->findByPk($list->division_id)->division_code . '</td>';
                     print '<td>' . SubjectMaster::model()->findByPk($list->subject_id)->subject_master_alias . '</td>';
                     print '<td>' . RoomDetailsMaster::model()->findByPk($list->room_id)->room_name . '</td>';
                     print '<td>' . $time[$list->lec] . '</td></tr>';
                 }
                 print '</table>';
             } else {
                 echo "<h3 align=center style=color:red>Sorry, No timetable available.</h3>";
             }
         }
     }
 }
コード例 #23
0
?>

<?php //echo "<td colspan=$colspan>";
echo "<tr><th colspan=20><h3> Branch  of ".$branch_model->branch_name." Students of Semester-".$acd_model->academic_term_name." , Subject-".$sub->subject_master_name ."  In Month - ". date("F", mktime(0,0,0,$month)) ." Attendence Report</h3></th> </tr>";


 }?>


<?php 
$i=0;
$m=1;
if($month)
{
$year=date('Y');
$sub = SubjectMaster::model()->findByPk($selsub);

?>
<tr>

<tr class="topic-covered"  style="height:220px;background:#FFF;">
       <th colspan=6 style="color:#990A10;"><b>Topic Covered</b></th>
      <?php

        for($i = 1; $i<=$num; $i++) {
		   if(strlen($i) == 1)
		   	$i = "0".$i;	
		   if(strlen($month_value) == 1) 
			$month_value="0".$month_value;	
		   $date = date('Y').'-'.$month_value.'-'.$i;	
		   if(array_key_exists($date,$deleivered_topic))
コード例 #24
0
//$this->renderPartial('_search',array(
//'model'=>$model,
//));
?>
</div>
<?php 
$dataProvider = $model->search();
if (Yii::app()->user->getState("pageSize", @$_GET["pageSize"])) {
    $pageSize = Yii::app()->user->getState("pageSize", @$_GET["pageSize"]);
} else {
    $pageSize = Yii::app()->params['pageSize'];
}
$dataProvider->getPagination()->setPageSize($pageSize);
$acdm_terms = AcademicTerm::model()->findAll('current_sem=1 and academic_term_organization_id=' . Yii::app()->user->getState('org_id'));
$data = array();
foreach ($acdm_terms as $list) {
    $data[] = $list['academic_term_id'];
}
$str = 0;
if (!empty($data)) {
    $str = implode(',', $data);
}
?>


<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'attendence-grid', 'dataProvider' => $dataProvider, 'filter' => $model, 'afterAjaxUpdate' => 'reInstallDatepicker', 'columns' => array(array('header' => 'SI No', 'class' => 'IndexColumn'), array('name' => 'student_enroll_no', 'value' => '$data->rel_atd_student->student_enroll_no'), array('name' => 'student_first_name', 'value' => '$data->rel_atd_student->student_first_name'), 'attendence', array('name' => 'employee_first_name', 'value' => '$data->rel_atd_employee->employee_first_name'), array('name' => 'branch_id', 'value' => 'Branch::model()->findByPk($data->branch_id)->branch_name', 'filter' => CHtml::listData(Branch::model()->findAll(array('condition' => 'branch_organization_id=' . Yii::app()->user->getState('org_id'))), 'branch_id', 'branch_name')), array('name' => 'sub_id', 'value' => 'SubjectMaster::model()->findByPk($data->sub_id)->subject_master_name', 'filter' => CHtml::listData(SubjectMaster::model()->findAll(array('condition' => 'subject_master_organization_id=' . Yii::app()->user->getState('org_id') . ' and subject_master_academic_terms_name_id IN(' . $str . ')')), 'subject_master_id', 'subject', 'Rel_branch_id.branch_name')), array('name' => 'subject_type_name', 'value' => '$data->rel_atd_subject->Rel_sub_type->subject_type_name'), array('name' => 'sem_name_id', 'value' => 'AcademicTerm::model()->findByPk($data->sem_name_id)->academic_term_name', 'filter' => CHtml::listData(AcademicTerm::model()->findAll(array('condition' => 'current_sem=1 and academic_term_organization_id=' . Yii::app()->user->getState('org_id'))), 'academic_term_id', 'academic_term_name')), array('name' => 'sem_id', 'value' => 'AcademicTermPeriod::model()->findByPk($data->sem_id)->academic_term_period'), array('name' => 'attendence_date', 'value' => '($data->attendence_date == 0000-00-00) ? "Not Set" : date_format(new DateTime($data->attendence_date), "d-m-Y")', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'attendence_date', 'options' => array('dateFormat' => 'dd-mm-yy', 'changeYear' => 'true', 'changeMonth' => 'true', 'showAnim' => 'slide', 'yearRange' => '1900:' . (date('Y') + 1), 'buttonImage' => Yii::app()->request->baseUrl . '/images/calendar.png'), 'htmlOptions' => array('id' => 'attendence_date')), true)), array('class' => 'MyCButtonColumn', 'template' => '{update}', 'buttons' => array('update' => array('url' => 'Yii::app()->createUrl("Attendence/update", array("id"=>$data->id))')))), 'pager' => array('class' => 'AjaxList', 'maxButtonCount' => $model->count(), 'header' => '')));
Yii::app()->clientScript->registerScript('for-date-picker', "\nfunction reInstallDatepicker(id, data){\n        \$('#attendence_date').datepicker({'dateFormat':'dd-mm-yy'});\n\t  \n}\n");
?>

コード例 #25
0
echo $form->error($model, 'div_id');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'sub_id');
?>
		<?php 
//echo $form->textField($model,'sub_id');
?>
		<?php 
//echo $form->dropDownList($model,'sub_id', CHtml::listData(SubjectMaster::model()->findAll(), 'subject_master_id', 'subject_master_name'));
?>
		<?php 
echo $form->dropDownList($model, 'sub_id', SubjectMaster::items(), array('empty' => '---------------Select-------------', 'tabindex' => 6));
?>
<span class="status">&nbsp;</span>
		<?php 
echo $form->error($model, 'sub_id');
?>
	</div>

	<div class="row">
        <?php 
echo $form->labelEx($model, 'batch_id');
?>
        <?php 
//echo $form->textField($model,'batch_id');
?>
        <?php 
コード例 #26
0
ファイル: _form.php プロジェクト: rinodung/EduSec3.0.0
	'clientOptions'=>array('validateOnSubmit'=>true),
	//'htmlOptions'=>array('enctype'=>'multipart/form-data'),
)); 
?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php //echo $form->errorSummary($model); ?>

	<div class="block-error">
		<?php echo Yii::app()->user->getFlash('not-select-attendece'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'sub_id'); ?>
		<?php echo $form->dropDownList($model,'sub_id', CHtml::listData(SubjectMaster::model()->findAll(), 'subject_master_id', 'subject_master_name'),array('prompt'=>'Select Subject'));
		?><span class="status">&nbsp;</span>
		<?php echo $form->error($model,'sub_id'); ?>
	</div>
</div>
<div class="first-row" >
	<div class="row">
        <?php echo $form->labelEx($model,'batch_id'); ?>
      	<?php echo $form->dropDownList($model,'batch_id', CHtml::listData(Batch::model()->findAll(), 'batch_id', 'batch_code'),array('prompt' => 'Select Batch'));
		;?>
	<span class="status">&nbsp;</span>
        <?php echo $form->error($model,'batch_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'employee_id'); ?>
コード例 #27
0
ファイル: admin.php プロジェクト: rinodung/EduSec3.0.0
		'class'=>'IndexColumn',
			),

		array(
		'name'=>'student_first_name',
                'value'=> '$data->rel_atd_student->student_first_name',
	          ),
		'attendence',
		array(
		'name'=>'employee_first_name',
                'value'=> '$data->rel_atd_employee->employee_first_name',
	          ),	
		
		array('name'=>'sub_id',
	'value'=>'SubjectMaster::model()->findByPk($data->sub_id)->subject_master_name',
			'filter' =>CHtml::listData(SubjectMaster::model()->findAll(),
'subject_master_id','subject'),

		),
		array('name'=>'subject_type_name',
			'value'=>'$data->rel_atd_subject->Rel_sub_type->subject_type_name',

		), 
		array(
                        'name' => 'attendence_date',
			'value'=>'($data->attendence_date == 0000-00-00) ? "Not Set" : date_format(new DateTime($data->attendence_date), "d-m-Y")',
                         'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                                'model' => $model, 
                                'attribute' => 'attendence_date',
				//'id'=>'date',
                                'options'=>array(
コード例 #28
0
    $x[] = $list['exam_result_schedule_branch_id'];
}
$sb_id = array_unique($x);
//for
foreach ($sb_id as $list1) {
    $m = 1;
    $sem = ExamScheduleBranch::model()->findByPk($list1);
    $scid = ExamSchedule::model()->findByPk($sem['exam_schedule_id']);
    $name = ExamName::model()->findByPk($scid['exam_schedule_exam_name_id']);
    $sem = AcademicTerm::model()->findByPk($sem['exam_schedule_branch_term_period_id'])->academic_term_name;
    $cat = ExamCategory::model()->findByPk($name['exam_category_id'])->exam_category_name;
    $type = ExamType::model()->findByPk($scid['exam_type_id'])->exam_type_name;
    $data1 = ExamResult::model()->findAll(array('condition' => 'exam_result_schedule_branch_id=' . $list1 . ' AND exam_result_student_id=' . $stu_id));
    echo "<table class='table_data'>";
    echo "<th colspan=\"12\" style=\"font-size:16px;\">";
    echo 'Sem:' . $sem . '    ' . 'Category:' . $cat . '    ' . 'Type:' . $type;
    echo "</th>";
    echo "<tr class='table_header'><th>Subject</th><th>Gain Mark</th><th>Total Mark</th></tr>";
    foreach ($data1 as $list2) {
        if ($m % 2 == 0) {
            $class = "odd";
        } else {
            $class = "even";
        }
        echo "<tr  class=" . $class . "><td>" . SubjectMaster::model()->findByPk($list2['exam_result_subject_id'])->subject_master_name . "</td>";
        echo "<td>" . $list2['exam_result_gain_mark'] . "</td>";
        echo "<td>" . $list2['exam_result_total_mark'] . "</td></tr>";
        $m++;
    }
    echo "</table>";
}
コード例 #29
0
 public function actiongetelectivedivision()
 {
     $subject_id = $_REQUEST['ElectiveSubjectDetails']['elective_subject_id'];
     $subject_branch = SubjectMaster::model()->findByAttributes(array('subject_master_id' => $subject_id));
     $org_id = Yii::app()->user->getState('org_id');
     $data = array();
     $data = Division::model()->findAll(array('condition' => 'division_organization_id=' . $org_id . ' and branch_id=' . $subject_branch['subject_master_branch_id'] . ' and academic_name_id=' . $subject_branch['subject_master_academic_terms_name_id']));
     $data = CHtml::listData($data, 'division_id', 'division_code');
     echo "<option value=''>Select Division</option>";
     foreach ($data as $value => $name) {
         echo CHtml::tag('option', array('value' => $value), CHtml::encode($name), true);
     }
 }
			if($cols[$sub]>1)
			{ 
			   $count=$comb_subject[$cs];
			   $cols_sub=$cols[$sub];			
			   print "<th colspan=".$cols_sub."><table border='1'><tr>";	
			   for($c=0;$c<$count;$c++)	
			   {				
			   	print '<th>'.SubjectMaster::model()->findByPk($subject[$sub])->subject_master_name."</th>";
				$sub++;	
	 		   }	
			   print "</tr></table></th>";
			   $sub--;				
			}			
			else
			{					
			print '<th>'.SubjectMaster::model()->findByPk($subject[$sub])->subject_master_name.' </th>';
			}			
		}
	  	else 
		{
			print '<th >-</th>';
		}
		$cs++;
	}
	echo "</tr><tr>"; 
	$cs=0;
	for($fac=0;$fac<count($faculty);$fac++)
	{
		if($faculty[$fac]!=0)
		{
			if($cols[$fac]>1)