<?php
/**
 * goal_list_view.php - View Search file
 *
 * @author $Author: dtong $
 * @version $Id: goal_list_view.php,v 1.4 2011/04/08 13:52:27 dtong Exp $
 * @copyright Copyright (c) 2010, Tiller Software Co., Ltd.
*/
osa_load_lang('goal');
osa_load_lang('unit');
osa_load_lang('admin');

$sortup_url   = osa_imagepath() . 'arrow_up.gif';
$sortdown_url = osa_imagepath() . 'arrow_down.gif';
$update_url   = base_url().'search/sort/get_nohandle/sort/';

$page     = $display->page;
$listitem = $display->listitem;
$selectlistitem = $display->selectlistitem;
$selectentry = $display->selectentry;
$entry = $display->entry;

$href			= base_url();
$refresh	    = base_url().$page.'/refresh/';
$search	        = base_url().$page.'/search/';
$filter	        = base_url().$page.'/filter/';
$imgreq	    = 'search.gif';
$img_req  	= "<img src=". osa_imagepath() . "$imgreq    title='Required field'   alt='Required field'    border='0' >";

$display->reset();
$count = $display->total;

if (isset($display->selectid))
	$selectid = $display->selectid;
else
	$selectid = 0;

if(is_array($display->strand)==FALSE){
$display->strand=array();
}
if(is_array($display->standard)==FALSE){
$display->standard=array();
}

if(is_array($display->data_dep_sch)==FALSE){
$display->data_dep_sch=array();
}
//echo 'filters : ' . $data->enableflag;
//$formname = 'admin_search_form_'.$display->divid.'_'.$display->type;
$formname = 'admin_search_form';

$display->print_page_links();
?>

<form method="POST"  name="<?php echo $formname;?>" >
<center>
<div class="goal_title"><?php echo $display->pagetitle;?></div>

<table cellspacing="0" cellpadding="0" class="admin_list_table"  border="0">

<?php
if ($listitem!=FALSE){
?>
<tr>
<td style='width:15%'><nobr><?php echo lang('goal_list_selectfilter'); ?></nobr></td>
<td class="goal_filer_space">
<?php
	$jscript_sel = "onChange=\"find_filter('$refresh', '$formname', '$display->refresh','$display->type');\" onkeyup=\"this.blur();this.focus();\" return false;";
	echo form_dropdown("filters", $listitem, $selectlistitem, "size=1  " . "  $jscript_sel");
?>
</td>
</tr>
<?php
}
?>
<?php if (isset($display->hide_entrypoint) && $display->hide_entrypoint === FALSE ){?>
<tr>
<td style='width:15%'><nobr><?php echo lang('goal_list_selectentry'); ?></nobr></td>
<td class="goal_filer_space">
<?php
	$jscript_sel = "onChange=\"find_filter('$refresh', '$formname', '$display->refresh','$display->type');\" onkeyup=\"this.blur();this.focus();\" return false; ";
	echo form_dropdown("selected", $entry, $selectentry, "size= 1 " . "  $jscript_sel");
?>
</td>
</tr>
<?php }?>
<tr>
<td style='width:15%'><nobr><?php echo $display->search; ?></nobr></td>
<td valign="middle" >
<table cellspacing="0" cellpadding="0">
<tr>
<td >
<input type=text name=filter value="<?php echo $display->filter;?>" size=40
	onkeydown="if (event.keyCode == 13) { document.getElementById('button_search').focus();  }" />
	<?php
		$jscript_search = "onClick=\"find_filter('$refresh', '$formname', '$display->refresh','$display->type');  return false; \"";
	?>
</td>
<td>
	<input id="button_search" type="button"
					value="<?php echo lang('admin_list_button_search'); ?>"
					name="button_search" <?php osa_btn(); echo $jscript_search; ?> />
</td>
</tr>

</table>

</td></tr>
<tr><td colspan='2' class="goal_filer_space"><nobr>
 <?php echo $count; ?> <?php echo lang('admin_list_count'); ?>
</nobr>
</td></tr>
</table>
<?php
   $display->cssclass_titlerow = 'table_head_col';
   $display->cssclass_datarow1 = 'table_body_row';
   $display->cssclass_datarow2 = 'table_body_row_none';
   //Need to tell which view to load on a full page refresh
   $display->view_file = 'tablelist/goal_list_view';
   //Loads the displaylist for the table generation
   //$this->load->view('mapping/display_list_view');
   $display->load_tableview();
?>
</center>
</form>
<br />
<?php $display->print_page_links()?>
<br /><br />