<?php
 	/**
 * course_grade_view.php - course_grade Edit file
 *
 * @author $Author: dtong $
 * @version $Id: course_grade_view.php,v 1.9 2011/04/27 05:46:26 dtong Exp $
 * @copyright Copyright (c) 2009, Tiller Software Co., Ltd.
*/



?>
<?php

$href_save 	= base_url().'admin/course/insert_coursegrade/'.$courseid;

$course_grade_col_name =lang('admin_course_col_coursegrade');
$course_grade_name	  =lang('admin_course_name');

$href = base_url();
$refresh= base_url() .'admin/course/';
?>


<form method="POST" name="coursegrade_form" >
<center>
<div id='dhtmlwin_resource'>
<div class="course_grade_head"><?php echo lang('admin_course_grade_head'); ?></div>
<br />
<div class="course_grade_coursename"><?php echo $course_grade_name; ?> <?php echo $coursename; ?></div>

<br/>
<table width="85%" border=0>
<tr >

<td class="course_grade_data"  valign=top>
<center>
<table class="course_grade_table" border=0 >
<tr>
<th class="course_grade_table_header">
<?php echo $course_grade_col_name ?>
</th>
<th class="course_grade_table_header">
</th>
</tr>
<?php
$swap='';
  if (isset($course_gradeall) && is_array($course_gradeall)) {
	foreach ($course_gradeall as $row) {
	if ($swap  == '') {
			$tr_class = "table_body_row";
			$swap = '_none';
		}
		else {
			$tr_class  = "table_body_row_none";
			$swap = '';
		}
	?>


	<tr class="<?php echo $tr_class; ?>">

	<td class="course_grade_col_header_Name" ><?php echo $row->name ; ?></td>

<?php
		$checked="";
        if (isset($course_grade) && is_array($course_grade)) {
        	foreach ($course_grade as $value) {
        		if ($row->id == $value->id){
        			$checked='checked';
        		}
        	}
        }
		?>
<td class="course_grade_col_header_del" >

		<input type="checkbox"  name="data[][gradeid]" <?php  echo $checked; ?>  value="<?php  echo $row->id; ?>" />


</td>

</tr>


<?php
}
}
?>

</table>
<table width="96%">
<tr>
<td>
<div class="course_grade_footer"><?php echo lang('admin_course_grade_footer'); ?></div>
</td>
</tr>
</table>
</center>
</td>

</table>
<div class="reswin_buttons">
<input type="button" value="<?php echo lang('admin_btn_cancel'); ?>" name="cancel" <?php osa_btn()?>
	   onClick="cancelDhtml('course_input');return false;" />

<span style="margin-left:30px">&nbsp;</span>

<input type="button" value="<?php echo lang('admin_btn_save'); ?>" name="save" <?php osa_btn()?>
       onClick="submitDhtml('<?php echo $href_save; ?>','coursegrade_form',
               '<?php echo $refresh; ?>','page_content','course_input');return false;" />
</div>
</div>
</center>
</form>
