<?php TPL::output('admin/global/header.tpl.htm'); ?>

<!--left-->
<?php TPL::output('admin/global/left.tpl.htm'); ?>
<!--left-->

<!-- main -->
<div id="main-content">
	<div class="clear"></div>
	<div class="content-box">
		<div class="content-box-header">
			<h3><?php echo $this->crumb['last']['name']; ?></h3>
			<ul class="content-box-tabs">
			</ul>
			<div class="clear"></div>
		</div>
		
		<div style="width:950px; margin:5px;">
		
		<div class="content-box-content" style="width:400px; float:left;">
			<div class="tab-content default-tab" id="tab1">
				<?php if(!$this->job_list){ ?>
				<div class="notification attention png_bg"> <a href="javascript:;" class="close"><img src="<?php echo GET_STATIC_URL;?>/admin/images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
					<div> No Content </div>
				</div>
				<?php }else{ ?>
				<form id="_job_form" action="admin/user_manage/save_job_ajax/" method="post">
					<table class="list">
						<thead>
							<tr>
								<!--th><input class="check-all" type="checkbox" /></th-->
								<th>ID</th>
								<th>Job name</th>
								<th></th>
							</tr>
						</thead>
						<tbody style="border-bottom: 1px solid #ddd; height:20px;">
							<?php foreach ($this->job_list AS $key => $val) { ?>
							<tr>
								<th><?php echo $key; ?></td>
								</div>
								<td><input class="text-input normal-input" style="width:90%;" name="job_list[<?php echo $key; ?>]" value="<?php echo $val; ?>" /></td>
								<td><a href="javascript:;" onClick="if(confirm('OK to delete?')){ajax_request(GET_BASE_URL + '/admin/user_manage/remove_job/job_id-<?php echo $key; ?>');}" title="Delete">Delete</a></td>
							</tr>
							<?php } ?>
						</tbody>
					</table>
					
					<p>
						<input class="button" type="button" onClick="ajax_post($('#_job_form'), _form_process);" value="Save" />
					</p>
				</form>
				<?php } ?>
			</div>
			</div>
			
			<div class="content-box-content" style="width:300px; float:left;">
				<div class="tab-content default-tab" id="tab1">
					
					<form id="_save_form" action="admin/user_manage/add_job_ajax/" method="post">
						<fieldset>
						<p style="width:250px;">
							<label>Add new job: <span style="font-weight:normal;">(One job name on each line)</span></label>
							<textarea name="jobs" cols="30" rows="10" id="jobs"></textarea>
						</p>
						<p>
							<input class="button" type="button" onClick="ajax_post($('#_save_form'), _form_process);" value="Save" />
						</p>
						</fieldset>
						<div class="clear"></div>
					</form>
					
				</div>
			</div>
			

		</div>
		<div class="clear"></div>
		<div id="notf_tip" style="display:none;" class="notification png_bg"> <a href="javascript:;" class="close"><img src="<?php echo GET_STATIC_URL;?>/admin/images/icons/cross_grey_small.png" alt="Close" /></a>
			<div id="notf_cont"></div>
		</div>
	</div>

<!-- footer -->
<?php TPL::output('admin/global/footer.tpl.htm'); ?>
<!-- footer -->

</div>
<!-- main -->

</div>

</body>
</html>