<?php
/**
 * goal_create_view.php - View create goal
 *
 * @author $Author: samarth
 * @version $Id: goal_create_view.php
 * @copyright Copyright (c) 2010, Tiller Software Co., Ltd.
*/

$url_up_title = base_url().'goal/goal/save_goal/';
$url_refresh = base_url().'goal/goal/select/0/';
$massage = lang('goal_create_massage_save_complete');
$jscript_up_title ="onclick=\"add_goal('$url_up_title','$url_refresh','frmgoal_create','$massage');return false;\"";
$entry = $item;
?>

<form name="frmgoal_create" method="POST" >
<div class="goal_title"><?php echo $title;?></div><br />
<div class="goal_required_save"><?php echo lang('goal_required_title')?></div>
<div class="goal_team_members"><?php echo lang('goal_create_create_title');?>
<table border="0">
<tr><td>
	<TEXTAREA id="txttitle"  NAME="txttitle" COLS="70" ROWS="2"><?php echo $goal_title ?></TEXTAREA>
</td></tr>
<?php if (isset($hide_entrypoint) && $hide_entrypoint === FALSE ){?>
	<tr><td>
		<div class="create_entry_point">
		<?php echo $entry_title;?><?php echo form_dropdown("selected", $item, $selectitem, "size='1'"); ?>
		</div>
	</td></tr>
<?php }?>
<tr><td class="goal_button_save">
	<input name="btnsave" type="button" value="<?php echo lang('goal_create_button_save'); ?>"
       <?php echo $jscript_up_title;?> <?php osa_btn();?>></input>
</td></tr>
<tr><td>
	<div class="goal_mygoal_title"> <?php echo lang('goal_create_list_mygoal'); ?></div>
	<?php
		foreach ($mygoal as $goal) {
			$nodata = '';
			$width = '1000';
			$height = '750';
			$title = lang('goal_create_mygoal_pop_head') ;
			$url_pdf  = base_url() . 'goal/goal/loadpdfall/' . $goal->id;
			$option = "width=$width,height=$height,status=yes,toolbar=no,menubar=no,location=no,resizable=yes";
			$jscript_pdf="onClick=\"newDhtmlWindow('$url_pdf','$title',$width,$height,'view_goal'); return false;\"";

			$type = '';
			if (isset($goal->type) && $goal->type != FALSE && is_numeric($goal->type)  && is_array($entry) && array_key_exists($goal->type,$entry))
				 $type = ' - '. $entry[$goal->type];

	?>
			<div class="goal_mygoal">
			<?php if ($goal->goalunit == FALSE && $goal->unitid == FALSE){
					$nodata = lang('goal_create_mygoal_nodata');?>
					<span class="goal_mygoal_nodata"><?php echo $goal->title . $type; ?>&nbsp;<?php echo $nodata; ?></span>
			<?php }
					else {?>
					<a class="cmslink" id="mygoal" href="<?php echo $url_pdf;?>" <?php echo $jscript_pdf;?> >
					<?php echo $goal->title . $type; ?>
					<!--
					onClick="newDhtmlWindow('<?php echo $url_refresh;?><?php echo $goal->id; ?>/0/1',
					       '<?php echo lang('goal_create_list_mygoal');?>','1000','750','div_goal');return false;">
					       -->
					</a>
				<?php }?>
			</div>
	<?php } // end for?>
</td></tr>
</table>
</div>
</form>

