<?php
 	/**
 * benchmark_input_view.php - benchmark Edit file
 *
 * @author $Author: dtong $
 * @version $Id: benchmark_input_view.php,v 1.21 2011/05/09 12:33:17 dtong Exp $
 * @copyright Copyright (c) 2009, Tiller Software Co., Ltd.
*/

$href   = base_url();
$refresh= base_url().$page.'/refresh/'.$selectlistitem.'/'.$type.'/'.$update_div.'/'.$dep_schid.'/'.$selectid.'/'.$selectstandardid.'/'.$filter;
$page   = base_url().$page;
$imgreq	    = 'req.gif';
$img_req  	= "<img src=". osa_imagepath() . "$imgreq    title='Required field'   alt='Required field'    border='0' >";

$mode = CMS_ADMIN_UPDATE;
if ($action==CMS_ACTION_ADD) {
 	$row->id  = "";
 	$row->importid = "";
 	$row->data = "";
 	$row->enabled = "1";
 	$mode = CMS_ADMIN_INSERT;
}
elseif ($action==CMS_ACTION_EDIT) {
 	if ( isset($data)==FALSE || count($data) == 0 )  {
		echo lang('admin_benchmark_error_nodata');
		return;
	}
	$row 	    = $data[0];
}
else {
 	return;
}

if(is_array($standard)==FALSE){
$standard=array();
}
$mode = $page.'/'.$mode;
$formname = 'benchmark_input_benchmark';
$forminputname = 'benchmark_form_benchmark';
?>


<form method="POST"  name="<?php   echo $forminputname; ?>" >
<input type="hidden" id="type" name="type" size="30" value="<?php   echo $type; ?>" />
<input type="hidden" id="id" name="id" size="30" value="<?php   echo $row->id; ?>" />
<center>
<div class="benchmark_title"><?php echo $selected_display; ?></div>
<div id="div_strnd" class="benchmark_table">

<table class="benchmark_table_edit" border="0" >
		<tr >
		<td class="benchmark_edit_left" ><?php echo $col_dep_sch; ?></td>
		<td class="benchmark_text_left" >
 		<span ><?php   echo $dep_sch; ?></span>
		</td>
		</tr>

		<tr >
		<td class="benchmark_edit_left" ><?php echo lang('admin_benchmark_col_strand'); ?></td>
		<td class="benchmark_text_left" >
 		<span ><?php   echo $strand_search; ?></span>
		</td>
		</tr>

		<tr >
		<td class="field_req" ><?php echo lang('admin_benchmark_col_standard'); ?><?php echo $img_req; ?></td>
		<td class="benchmark_text_left" >
 		<?php

	    	echo form_dropdown("standardid", $standard, $selected_std, "size=1 style=width:90%");
		?>
		</td>
		</tr>

		<?php
		if ($type==CMS_LEARNING_TARGETS_TYPE){
		?>
				<tr>
				<td class="field_req" ><?php echo lang('admin_benchmark_col_mingradeid'); ?><?php echo $img_req; ?></td>
				<td class="benchmark_text_left" >
		 		<?php

			    	echo form_dropdown("mingradeid", $grade, $selected_gmin, "size=1 style=width:30%");
				?>
				</td>
				</tr>


				<tr>
				<td class="field_req" ><?php echo lang('admin_benchmark_col_maxgradeid'); ?><?php echo $img_req; ?></td>
				<td class="benchmark_text_left" >
		 		<?php
			    	echo form_dropdown("maxgradeid", $grade, $selected_gmax, "size=1 style=width:30%");
				?>
				</td>
				</tr>
		<?php
		}
		?>
		<tr >
		<td class="field_req" ><?php echo lang('admin_benchmark_col_data'); ?><?php echo $img_req;?></td>
		<td class="benchmark_text_left">
			<TEXTAREA id="benchmark_col_data" NAME="data" COLS="80" ROWS="10" ><?php echo $row->data;?></TEXTAREA>
		</tr>
		<?php if ( isset($show_importid) && $show_importid ) { ?>
		<tr>
			<td><?php echo lang('admin_benchmark_sort_number');?></td>
			<td>
				<input type="text" name="importid" size="18" maxlength="20" value="<?php echo $row->importid;?>" />
				<?php
					echo lang('admin_benchmark_sort_number_eg');
					echo '<div style="font-style:italic;font-size:10px">' . lang('admin_benchmark_sort_number_desc') . '</div>';
				?>
			</td>
		</tr>
		<?php } ?>
		<tr >
		<td class="benchmark_edit_left" ><?php echo lang('admin_benchmark_col_enabled'); ?></td>
		<td class="benchmark_text_left" >
		<?php
		$checked="";
		if ($row->enabled =='1') {
			$checked='checked';
		}
		?>
		<input type="checkbox"  name="enabled" <?php echo $checked;?>  />
		</tr>
</table>

</div>
<span class="admin_req"  style="color:red"><?php echo lang('admin_red'); ?></span>
<span class="admin_req" ><?php echo lang('admin_req'); ?></span>
</center>
<div class="reswin_buttons">
		<input type="button" value="<?php echo lang('admin_btn_cancel'); ?>" name="cancel" <?php osa_btn()?>
		onClick="cancelDhtml('benchmark_input_benchmark');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="submit_input('<?php echo $mode; ?>','<?php echo $forminputname; ?>','<?php echo $refresh; ?>','<?php echo $update_div; ?>','<?php echo $formname; ?>');return false;" />
</div>
<br />
</form>