Preview: questionbody.php
Size: 4.32 KB
/home/jambtst2015/public_html/protected/views/webadmin/questionbody.php
<?php
/* @var $this SiteController */
/* @var $model ContactForm */
/* @var $form CActiveForm */
?>
<script type="text/javascript">
$('body').on('change', 'select#QuestionbodyForm_exam_name', function(event){
var value = document.getElementById("QuestionbodyForm_exam_name").value;
//alert(value);
$.ajax({
url : '<?php echo Yii::app()->request->baseUrl; ?>/webadmin/ajaxpage',
type : 'POST',
data : 'value=' + value+'&flag='+1,
//dataType : 'json',
beforeSend : function(jqXHR, settings ){
//alert(1);
},
success : function( data, textStatus, jqXHR){
//alert(data);
//var total = data.split("||");
// var creditVal = total[0];
// var inc = total[1];
// $('#credit-container'+inc).html('<input type="text" class="textfield datepicker" name="credit_'+inc+'" id="credit_'+inc+'" value="'+creditVal+'" onkeypress="return goodchars(event,\'1234567890.\');" />');
// $('#credit_'+inc).focus();
// $('#editImg'+inc).hide();
// $('#saveImg'+inc).show("slow");
// $('#refImg'+inc).show("slow");
$('#QuestionbodyForm_subject_name').html(data);
},
error : function( jqXHR, textStatus, errorThrown){
}
});
});
</script>
<div class="exambody-wrapper">
<h1>Setup Exam Year</h1>
<?php if(Yii::app()->user->hasFlash('error')): ?>
<div class="flash-error">
<?php echo Yii::app()->user->getFlash('error'); ?>
</div>
<?php endif; ?>
<?php if(Yii::app()->user->hasFlash('subjectbody')): ?>
<div class="flash-success">
<?php echo Yii::app()->user->getFlash('subjectbody'); ?>
</div>
<?php else: ?>
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'subjectbody-form',
'enableClientValidation'=>true,
'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="row">
<?php echo $form->labelEx($model,'exam_name'); ?>
<?php echo $form->dropDownList($model,'exam_name',$allSubjectarray, array('id'=>'QuestionbodyForm_exam_name','prompt'=>'Select exam body','options' => array($editRecord['exam_id']=>array('selected'=>true))));?>
<?php echo $form->error($model,'exam_name'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'subject_name'); ?>
<?php echo $form->dropDownList($model,'subject_name', $subject , array('prompt'=>'Select exam body','options' => array($editRecord['subject_id']=>array('selected'=>true))));?>
<?php echo $form->error($model,'subject_name'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'question_paper_name'); ?>
<?php echo $form->textField($model,'question_paper_name',array('size'=>60,'maxlength'=>255,'value'=>$editRecord['paper_name'])); ?>
<?php echo $form->error($model,'question_paper_name'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'marks'); ?>
<?php echo $form->textField($model,'marks',array('size'=>60,'maxlength'=>255,'min_range' => 0,'value'=>$editRecord['pass_marks'])); ?>
<?php echo $form->error($model,'marks'); ?>
</div>
<?php /*?> <div class="row rememberMe">
<?php echo $form->labelEx($model,'compulsory'); ?>
<?php echo $form->checkBox($model,'compulsory',array('value' => 1, 'uncheckValue'=>0,'checked'=>($editRecord['compulsory']=="1")?true:$model->compulsory)); ?>
<?php echo $form->error($model,'compulsory'); ?>
</div><?php */?>
<?php /*?> <div class="row">
<?php echo $form->labelEx($model,'image'); ?>
<?php echo CHtml::activeFileField($model, 'image'); ?>
<?php echo $form->error($model,'image'); ?>
</div><?php */?>
<div class="row buttons">
<?php echo CHtml::submitButton('Submit'); ?>
<?php //$link = Yii::app()->request->baseUrl.'/webadmin/subjectlist/'; ?>
<!-- <a href="<?php echo Yii::app()->request->baseUrl; ?>/webadmin/subjectlist/" style="text-decoration:none">-->
<a href="javascript:window.history.back();" style="text-decoration:none">
<?php echo CHtml::Button('Cancel'); ?>
</a>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->
<?php endif; ?>
</div>
Directory Contents
Dirs: 1 × Files: 36