Preview: result.php
                Size: 7.34 KB
              
              
                
              
            
            /home/jambtst2015/public_html/protected/views/user/result.php
            <?php //print_r($allSubjects );?>
<?php $exam_id = Yii::app()->user->getState('user_xam_id'); ?>
<?php //echo '<pre>';print_r(); echo '</pre>'; ?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript">
function open_graph(i)
{
	document.getElementById('container_'+i).style.display = 'table-row';
}
$(document).ready(function(e) {
    $(".close_nw_sec a").click(function(){
		$(".graph_sec").fadeOut(500);
	});
});
</script>                
				<?php if(count($subjectsArray)>0){ ?>
		                <table border="1" cellspacing="0" cellpadding="0" class="table result_table">
		                    <tr>
                            	
		                    	<th>Subject</th>
		                    	<th>Question Paper</th>
                               <!-- <th>Pass Marks(%)</th>-->
		                    	<th>My Score(%)</th>
                                <th>Result</th>
		                    </tr> 
                            <?php 
							$total = 0;
							$inj = 1;
							foreach($subjectsArray as $subjectsArraysingle){ 
							$isSubjectExist = Helpers::getrecord('Questionanswerbody','subject_id',$subjectsArraysingle['subject_id'],'id');	
							$isPaperExist = Helpers::getrecord('Questionanswerbody','paper_id',$subjectsArraysingle['paper_id'],'id');	
							
							if($isSubjectExist>0 && $isPaperExist>0){
							?>
		                    <tr>
                            	
		                    	<td><?php echo Helpers::getrecord('Subjectbody','id',$subjectsArraysingle['subject_id'],'subject'); ?></td>
		                    	<td><?php echo Helpers::getrecord('Questionbody','id',$subjectsArraysingle['paper_id'],'paper_name'); ?></td>
                                <!--<td><?php echo $passMarks = Helpers::getrecord('Questionbody','id',$subjectsArraysingle['paper_id'],'pass_marks'); ?></td>-->
		                    	<td><?php echo $subjectsArraysingle['marks'];?></td>
                                <td><?php /*?><a href="#" onclick="open_graph(<?php echo $inj; ?>)">Score Analysis</a><?php */?>
				<?php				if($subjectsArraysingle['appeared']==0){ echo 'Not Appeared';}else{ ?>
                <a href="javascript:void(0);" onclick="open_graph(<?php echo $inj; ?>)">Score Analysis</a>
                <?php
                 }
				?>
								<?php //if($subjectsArraysingle['appeared']==0){ echo 'Not Appeared';}else{ if($subjectsArraysingle['marks']>=$passMarks){ echo 'Pass'; }else{ echo 'Fail'; } } ?></td>
		                    </tr> 
                            
                           	<?php //$total = $total+$subjectsArraysingle['marks'];
						   	if($subjectsArraysingle['appeared']!=0){ 
						   	$usercriteria = new CDbCriteria();
							$usercriteria->select = "marks, post_date";
							$usercriteria->condition = "exam_user_paper_id=".$subjectsArraysingle['id']." AND status='Active'";
							$usercriteria->order = "id DESC";
							$usercriteria->limit = "25";
							$paperAllMarks = Examuserpapermarks::model()->findAll($usercriteria); 
							?>
                            
        <script type="text/javascript">
		$(function () {
			$('#container<?php echo $inj; ?>').highcharts({
				chart: {
					type: 'column'
				},
				title: {
					text: '<?php echo Helpers::getrecord('Subjectbody','id',$subjectsArraysingle['subject_id'],'subject'); ?>'
				},
				subtitle: {
					text: '<?php echo Helpers::getrecord('Questionbody','id',$subjectsArraysingle['paper_id'],'paper_name'); ?>'
				},
				xAxis: {
					type: 'category',
					categories: [<?php $p = 1; foreach($paperAllMarks as $singlePaperAllMarks){ ?>'<?php echo date('m/d/Y',strtotime($singlePaperAllMarks['post_date'])); ?>'<?php if($p != count($paperAllMarks)){ echo ','; ?><?php } ?><?php $p++; } ?>],
					labels: {
						rotation: -45,
						style: {
							fontSize: '11px',
							fontFamily: 'Verdana, sans-serif'
						}
					}
				},
				yAxis: {
					min: 0,
					max: 100,
					title: {
						text: 'Marks'
					}
				},
				legend: {
					enabled: false
				},
				tooltip: {
					pointFormat: 'Your Marks: <b>{point.y:.2f}</b>'
				},
				series: [{
					name: 'Marks',
					//maxPointWidth: 50,
					pointWidth: 40, //width of the column bars irrespective of the chart size
					data: [
							//['Shanghai', 23.7],
							
						<?php $p = 1; foreach($paperAllMarks as $singlePaperAllMarks){ ?>
						{
								name: '<?php if($singlePaperAllMarks['marks']<40){ echo 'You failed, pls try again'; }elseif($singlePaperAllMarks['marks']>=40 && $singlePaperAllMarks['marks']<50){ echo 'Poor perfomance, pls try harder'; }elseif($singlePaperAllMarks['marks']>=50 && $singlePaperAllMarks['marks']<60){ echo 'Good performance, you can perform better'; }elseif($singlePaperAllMarks['marks']>=60 && $singlePaperAllMarks['marks']<70){ echo 'Very good performance, pls keep it up'; }else{ echo 'Excellent, pls keep it up'; }?>',
								y: <?php echo $singlePaperAllMarks['marks']; ?>,
								color: '<?php if($singlePaperAllMarks['marks']<40){ echo '#E02528'; }elseif($singlePaperAllMarks['marks']>=40 && $singlePaperAllMarks['marks']<50){ echo '#FCD208'; }elseif($singlePaperAllMarks['marks']>=50 && $singlePaperAllMarks['marks']<60){ echo '#F7EAAB'; }elseif($singlePaperAllMarks['marks']>=60 && $singlePaperAllMarks['marks']<70){ echo '#4AB348'; }else{ echo '#006F00'; }?>'
						}
					<?php if($p != count($paperAllMarks)){ echo ','; } ?>	
					<?php $p++;} ?>	
					],
					dataLabels: {
						enabled: true,
						rotation: -0,
						color: '#000000',
						align: 'center',
						x: 4,
						y: 10,
						style: {
							fontSize: '11px',
							fontFamily: 'Verdana, sans-serif'
							//textShadow: '0 0 3px black'
						}
					}
				}]
				
			});
		});
		</script>
	
<script src="<?php echo Yii::app()->request->baseUrl; ?>/graphjs/highcharts.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl; ?>/graphjs/modules/data.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl; ?>/graphjs/modules/drilldown.js"></script>
<tr class="graph_sec" style="display:none;" id="container_<?php echo $inj; ?>" >
<td colspan="4" width="850px" >
<div>
<div class="close_nw_sec"><a href="javascript:void(0);"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/close-nw.png" alt="Close" title="Close"></a></div>
<div class="graph_sec_inner" id="container<?php echo $inj; ?>"></div>
</div>
<!--<div  style="min-width: 310px; height: 400px; margin: 0 auto; display:none;"></div>-->
</td>
</tr>
		                    <?php $inj++;}} 
							}?>
		                    
		                    <!--<tr class="total">
		                    	<td colspan="2">total</td>
		                    	<td><?php echo $total;?></td>
		                    </tr>--> 
		                </table>
                <div class="clear"></div>
                <?php }else{ ?>
                 <h2 class="qusHeader">Sorry You have not attend any examination yet.. </h2>
                 <div class="clear"></div>
                <?php } ?>
		                
		             <!-- <img src="images/marksheet-chart.jpg" alt="chart" width="100%" />-->  
		                
<script type="text/javascript">
function open_graph(i)
{
	for(var a = 1; a<<?php echo $inj; ?>; a++)
	{
		document.getElementById('container_'+a).style.display = 'none';
	}
	document.getElementById('container_'+i).style.display = 'table-row';
}
</script>		                
		                
		              
		                
                                          Directory Contents
Dirs: 0 × Files: 24