<?php
/* @var $this ExammanageController */
/* @var $model Exammanage */
/* @var $form CActiveForm */
?>
<script type="text/javascript">
	$(function(){
		$('#tt').tree({
			url:'<?php echo $this->createUrl('category/mytree')?>',
			animate:true,
			lines:true,
			cascadeCheck:false,
			onClick: function(node){
				$(this).tree('check',node.target);
				if(node.checked)
				{$(this).tree('uncheck',node.target);}
				
			},
			onCheck:function(){
				var nodes = $('#tt').tree('getChecked');
				var s = '';  
					for(var i=0; i<nodes.length; i++){  
						if (s != '') s += ',';  
						s += nodes[i].id;  
					}  
					alert(s); 				
			}
		});
	});
	function single_cascade(){
		//$("#tt").tree({'cascadeCheck':true,'onlyLeafCheck':true});这是正确的属性设置写法
		//$("#tt").tree({'cascadeCheck':true});
		($("#tt").tree('options').cascadeCheck)?$("#tt").tree({'cascadeCheck':false}):$("#tt").tree({'cascadeCheck':true});
		($("#single_cascade_").val()=="启用级联选择")?$("#single_cascade_").val("禁用级联选择"):$("#single_cascade_").val("启用级联选择");
	}
	function single_leaf(){
		//$("#tt").tree({'cascadeCheck':true,'onlyLeafCheck':true});这是正确的属性设置写法
		//$("#tt").tree({'onlyLeafCheck':true});
		($("#tt").tree('options').onlyLeafCheck)?$("#tt").tree({'onlyLeafCheck':false}):$("#tt").tree({'onlyLeafCheck':true});
		($("#single_leaf_").val()=="启用仅选择叶子")?$("#single_leaf_").val("禁用仅选择叶子"):$("#single_leaf_").val("启用仅选择叶子");		
	}
</script>
	<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/css/tablesorter/themes/blue/style.css" type="text/css" media="print, projection, screen" />
	<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/css/tablesorter/jquery.tablesorter.pager.css" type="text/css" media="print, projection, screen" />
	<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/css/tablesorter/jquery.tablesorter.min.js"></script>
	<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/css/tablesorter/jquery.tablesorter.pager.js"></script>
	<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/css/tablesorter/check.js"></script>
	<script type="text/javascript">
	$(function() {
		$("#single")
			//.tablesorter({headers: { 0: { sorter: false} ,1: { sorter: false}},widthFixed: true, widgets: ['zebra'],sortList:[[4,1],[5,1]]})//这个是完整的
			.tablesorter({headers: {0:{ sorter: false}},widthFixed: true, widgets: ['zebra'],sortList:[[4,1],[5,1]]})
			.tablesorterPager({container: $("#pager")});
		$("#thead_top").click(function(){
			$("input['chk_list']").attr("checked",$(this).attr("checked"));
		})
		
	$("#checkall1").click(function(){
	$("input[name='chk_list']").check('on');
	})

	$("#checkoff1").click(function(){
	$("input[name='chk_list']").check('off')
	})

	$("#checktog1").click(function(){
	$("input[name='chk_list']").check('toggle')
	})


	$("#checkall2").click(function(){
	$("input[name='chk_list']").check('on');
	})

	$("#checkoff2").click(function(){
	$("input[name='chk_list']").check('off')
	})

	$("#checktog2").click(function(){
	$("input[name='chk_list']").check('toggle')
	})			
		
		
	});
	function output(){
			$("input[name='chk_list']").each(function(){
			if($(this).attr("checked")){
				alert($(this).val());  
			}})
	}
	
	</script>
    <style type="text/css">
<!--
	th,tr>td:first-child{text-align: center; vertical-align: middle;}
	
-->
</style>



<div>
<table id="single" cellspacing="1" style="border-collapse: collapse;"  class="tablesorter">
	<thead>
		<tr>
			<th style="width: 150px;"><input type="button" id="checkall1" value="全选"/> <input type="button" id="checkoff1" value="取消"/> <input type="button" id="checktog1" value="反选"/></th>
			<th>Name</th>
			<th>Major</th>
			<th>Sex</th>
			<th>English</th>
			<th>Japanese</th>
			<th>Calculus</th>
			<th>Geometry</th>

		</tr>
	</thead>
	<tfoot>
		<tr>
			<th><input type="button" id="checkall2" value="全选"/> <input type="button" id="checkoff2" value="取消"/> <input type="button" id="checktog2" value="反选"/></th>
			<th>Name</th>
			<th>Major</th>
			<th>Sex</th>
			<th>English</th>
			<th>Japanese</th>
			<th>Calculus</th>
			<th>Geometry</th>

		</tr>
	</tfoot>
	<tbody>
	<tr><td><input type="checkbox" name="chk_list" id="1" value="1" /></td><td>student23</td><td>Mathematics</td><td>male</td><td>1</td><td>77</td><td>0</td><td>79</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="2" value="2" /></td><td>student24</td><td>Languages</td><td>female</td><td>2</td><td>91</td><td>13</td><td>82</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="3" value="3" /></td><td>student25</td><td>Mathematics</td><td>male</td><td>3</td><td>96</td><td>82</td><td>53</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="4" value="4" /></td><td>student26</td><td>Languages</td><td>female</td><td>4</td><td>29</td><td>56</td><td>59</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="5" value="5" /></td><td>student27</td><td>Mathematics</td><td>male</td><td>5</td><td>82</td><td>69</td><td>23</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="6" value="6" /></td><td>student28</td><td>Languages</td><td>female</td><td>6</td><td>25</td><td>43</td><td>1</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="7" value="7" /></td><td>student29</td><td>Mathematics</td><td>male</td><td>7</td><td>47</td><td>22</td><td>38</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="8" value="8" /></td><td>student30</td><td>Languages</td><td>female</td><td>8</td><td>35</td><td>23</td><td>10</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="9" value="9" /></td><td>student31</td><td>Mathematics</td><td>male</td><td>9</td><td>27</td><td>17</td><td>50</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="10" value="10" /></td><td>student32</td><td>Languages</td><td>female</td><td>10</td><td>75</td><td>33</td><td>38</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="11" value="11" /></td><td>student33</td><td>Mathematics</td><td>male</td><td>11</td><td>31</td><td>37</td><td>15</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="12" value="12" /></td><td>student34</td><td>Languages</td><td>female</td><td>12</td><td>97</td><td>81</td><td>44</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="13" value="13" /></td><td>student35</td><td>Mathematics</td><td>male</td><td>13</td><td>81</td><td>51</td><td>95</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="14" value="14" /></td><td>student36</td><td>Languages</td><td>female</td><td>14</td><td>61</td><td>70</td><td>94</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="15" value="15" /></td><td>student37</td><td>Mathematics</td><td>male</td><td>15</td><td>3</td><td>61</td><td>84</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="16" value="16" /></td><td>student38</td><td>Languages</td><td>female</td><td>16</td><td>39</td><td>0</td><td>11</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="17" value="17" /></td><td>student39</td><td>Mathematics</td><td>male</td><td>17</td><td>46</td><td>32</td><td>38</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="18" value="18" /></td><td>student40</td><td>Languages</td><td>female</td><td>18</td><td>75</td><td>25</td><td>3</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="19" value="19" /></td><td>student41</td><td>Mathematics</td><td>male</td><td>19</td><td>34</td><td>28</td><td>78</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="20" value="20" /></td><td>student42</td><td>Languages</td><td>female</td><td>20</td><td>89</td><td>60</td><td>95</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="21" value="21" /></td><td>student43</td><td>Mathematics</td><td>male</td><td>21</td><td>92</td><td>18</td><td>88</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="22" value="22" /></td><td>student44</td><td>Languages</td><td>female</td><td>22</td><td>2</td><td>59</td><td>73</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="23" value="23" /></td><td>student45</td><td>Mathematics</td><td>male</td><td>23</td><td>73</td><td>37</td><td>39</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="24" value="24" /></td><td>student46</td><td>Languages</td><td>female</td><td>24</td><td>8</td><td>12</td><td>10</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="25" value="25" /></td><td>student47</td><td>Mathematics</td><td>male</td><td>25</td><td>10</td><td>6</td><td>11</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="26" value="26" /></td><td>student48</td><td>Languages</td><td>female</td><td>26</td><td>32</td><td>21</td><td>18</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="27" value="27" /></td><td>student334</td><td>Languages</td><td>female</td><td>27</td><td>100</td><td>33</td><td>9</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="28" value="28" /></td><td>student392</td><td>Languages</td><td>female</td><td>28</td><td>4</td><td>24</td><td>12</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="29" value="29" /></td><td>student403</td><td>Mathematics</td><td>male</td><td>29</td><td>25</td><td>32</td><td>59</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="30" value="30" /></td><td>student424</td><td>Languages</td><td>female</td><td>30</td><td>46</td><td>45</td><td>38</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="31" value="31" /></td><td>student452</td><td>Languages</td><td>female</td><td>31</td><td>39</td><td>98</td><td>88</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="32" value="32" /></td><td>student481</td><td>Mathematics</td><td>male</td><td>32</td><td>58</td><td>65</td><td>12</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="33" value="33" /></td><td>student509</td><td>Mathematics</td><td>male</td><td>33</td><td>4</td><td>16</td><td>59</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="34" value="34" /></td><td>student531</td><td>Mathematics</td><td>male</td><td>34</td><td>50</td><td>49</td><td>52</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="35" value="35" /></td><td>student799</td><td>Mathematics</td><td>male</td><td>35</td><td>96</td><td>64</td><td>41</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="36" value="36" /></td><td>student800</td><td>Languages</td><td>female</td><td>36</td><td>7</td><td>69</td><td>23</td></tr>
	<tr><td><input type="checkbox" name="chk_list" id="37" value="37" /></td><td>student801</td><td>Mathematics</td><td>male</td><td>37</td><td>83</td><td>32</td><td>55</td></tr>
</table>
</div>
<div id="pager" class="pager">
	<form>
		<img src="<?php echo Yii::app()->request->baseUrl; ?>/css/tablesorter/themes/first.png" class="first"/>
		<img src="<?php echo Yii::app()->request->baseUrl; ?>/css/tablesorter/themes/prev.png" class="prev"/>
		<input type="text" class="pagedisplay"/>
		<img src="<?php echo Yii::app()->request->baseUrl; ?>/css/tablesorter/themes/next.png" class="next"/>
		<img src="<?php echo Yii::app()->request->baseUrl; ?>/css/tablesorter/themes/last.png" class="last"/>
		<select class="pagesize">
			<option selected="selected"  value="10">10</option>
			<option value="20">20</option>
			<option value="30">30</option>
			<option  value="40">40</option>
		</select>
		
	</form>
</div>
<div><br/>
<input onclick="output()" value="输出" type="button" />
</div>













<div>

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'exammanage-form',
	'enableAjaxValidation'=>false,
)); ?>

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

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>256)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
	<input onclick="single_cascade()" id="single_cascade_" type="button" value="启用级联选择" /><input id="single_leaf_" onclick="single_leaf()" type="button" value="启用仅选择叶子" />
	<ul id="tt" checkbox="true"></ul>
		<?php echo $form->labelEx($model,'singlechoicelist'); ?>
		<?php echo $form->textArea($model,'singlechoicelist',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'singlechoicelist'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'multichoicelist'); ?>
		<?php echo $form->textArea($model,'multichoicelist',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'multichoicelist'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'judgelist'); ?>
		<?php echo $form->textArea($model,'judgelist',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'judgelist'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'operatelist'); ?>
		<?php echo $form->textArea($model,'operatelist',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'operatelist'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'testScore'); ?>
		<?php echo $form->textField($model,'testScore',array('size'=>32,'maxlength'=>32)); ?>
		<?php echo $form->error($model,'testScore'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'testCount'); ?>
		<?php echo $form->textField($model,'testCount',array('size'=>32,'maxlength'=>32)); ?>
		<?php echo $form->error($model,'testCount'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'testRand'); ?>
		<?php echo $form->textField($model,'testRand',array('size'=>32,'maxlength'=>32)); ?>
		<?php echo $form->error($model,'testRand'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'summary'); ?>
		<?php echo $form->textArea($model,'summary',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'summary'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'examState'); ?>
		<?php echo $form->checkBox($model,'examState'); ?>
		<?php echo $form->error($model,'examState'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'examMode'); ?>
		<?php echo $form->checkBox($model,'examMode'); ?>
		<?php echo $form->error($model,'examMode'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'examTime'); ?>
		<?php echo $form->textField($model,'examTime'); ?>
		<?php echo $form->error($model,'examTime'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'beforeSubmit'); ?>
		<?php echo $form->textField($model,'beforeSubmit'); ?>
		<?php echo $form->error($model,'beforeSubmit'); ?>
	</div>


	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? '创建' : '保存'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
<script type="text/javascript">
    CKEDITOR.replace("Exammanage[summary]",
      {
        skin: "v2", width:"835", height:"200",color:"#AADC6E",toolbar:"Full",language:'zh-cn',
		filebrowserBrowseUrl : '<?php echo Yii::app()->request->baseUrl?>/ckfinder/ckfinder.html',
		filebrowserImageBrowseUrl : '<?php echo Yii::app()->request->baseUrl?>/ckfinder/ckfinder.html?Type=Images',
		filebrowserFlashBrowseUrl : '<?php echo Yii::app()->request->baseUrl?>/ckfinder/ckfinder.html?Type=Flash',
		filebrowserUploadUrl : '<?php echo Yii::app()->request->baseUrl?>/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
		filebrowserImageUploadUrl : '<?php echo Yii::app()->request->baseUrl?>/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
		filebrowserFlashUploadUrl : '<?php echo Yii::app()->request->baseUrl?>/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash',
      });	  
</script>