<div class="w97p pdl10">
<div class="transactions index">
	<h2><?php echo __('Pending Course'); ?></h2>
	<table cellpadding="0" cellspacing="0" class="table table-bordered table-strped">
	<tr>
			<th><?php echo 'courseId'; ?></th>
			<th><?php echo 'courseTitle'; ?></th>
			<th><?php echo 'courseName'; ?></th>
			<th><?php echo 'startDate'; ?></th>
			<th><?php echo 'endDate'; ?></th>
			
			<th><?php echo 'status'; ?></th>
			
	</tr>
	<?php foreach ($pendingcourses as $pendingcourse): 
	//pr($pendingcourse);
	?>
	<tr>
		<td><?php echo h($pendingcourse['Course']['id']); ?>&nbsp;</td>
		<td><?php echo h($pendingcourse['Course']['courseShortName']); ?>&nbsp;</td>
		<td><?php echo h($pendingcourse['Course']['courseName']); ?>&nbsp;</td>
		<td><?php echo h($pendingcourse['Course']['startDate']); ?>&nbsp;</td>
		<td><?php echo h($pendingcourse['Course']['endDate']); ?>&nbsp;</td>
		
		<td><?php echo $this->Form->input('Activate',array('type'=>'button','class'=>'btn','label'=>false,'div'=>false,'onclick'=>'updateStatus('.$pendingcourse['Course']['id'].');')); ?>&nbsp;</td>
		
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<!--<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
	));
	?>	</p>-->
	<div class="paging">
	<!--<?php
		echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
		echo $this->Paginator->numbers(array('separator' => ''));
		echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
	?>
	--></div>
</div>
    </div>

  <script type="text/javascript">
     var path='<?php echo $this->webroot;?>';
		function updateStatus(id){

			var con=confirm('Are you sure to activate this course?');
			if(con==true){
			 $.ajax({
			     	type: 'POST',
			     	url: path +'courses/updatestatus',
			     	data: {id:id},
			     	success: function(data){
				     	location.href="<?php echo $this->here?>";
			     	}
		     	});
			}
		}
	</script>

