<?php  
echo $this->Html->script('site_js/common'); 
?>
<div class="blocktitle"> Materials - Course Syllabus - Course Schedule</div>
<div class="tar borb">
	<?php echo $this->Html->link('Course Syllabus',array('controller'=>'sections'.'/add'),array('class'=>'btn btn-mini'));?>
	<?php echo $this->Html->link('Course Schedule',array('controller'=>'assignments'.'/view'),array('class'=>'btn btn-mini'));?>
	<?php echo $this->Html->link('Back',array('controller'=>'materials'.'/add'),array('class'=>'btn btn-mini'));?>
</div>
<div class="tar borb">
	<?php 
	echo $this->Html->link('Show All',array('controller'=>'assignments'.'/view'),array('class'=>'btn btn-mini'));
	echo $this->Html->link('Create',array('controller'=>'assignments'.'/simpleassignment'),array('class'=>'btn btn-mini'));
	?>
</div>

<br/>


<div class="w97p pdl10 fnt80">
	<table width="100%" cellpadding="0" cellspacing="0" class="listable">
		<thead>
			<tr> 
				<th align="left">Due Date</th>
				<th align="left">Title</th>
				<th align="left">Description</th>
			</tr>
		</thead>
		<?php foreach ($assignments as $assignment):
			/*$assignment_title = $assignment['Assignment']['title'];
			$assignment_description = $assignment['Assignment']['description'];
			if(strlen($assignment['Assignment']['title'])>20){
				$assignment_title = substr($assignment['Assignment']['title'],0,20).'...';
			}
			
			if(strlen($assignment['Assignment']['description'])>70){
			$assignment_description = substr($assignment['Assignment']['description'],0,70).'...';
			}*/	
		?>
		<tr> 
			<td width="80"><?php echo date('d-m-Y',strtotime($assignment['Assignment']['dueDate']))?></td>
			<td>
			<?php //echo $assignment_title;?>
			<div style="position: relative;">
				<span class="toolTip">
				<?php
				//http://localhost/proj/2014/admin_userv4_sujon2/assignmentfeedbacks/add/2 
				$assignment_title = '';
				if(strlen($assignment['Assignment']['title']) > 20){
					echo $this->Html->link(substr($assignment['Assignment']['title'], 0, 20).'...',array('controller'=>'assignmentfeedbacks','action'=>'add',$assignment['Assignment']['id']));
					$assignment_title = "
						<span class='toolTipTxt' style='display: none;'>
						<span>
						".$assignment['Assignment']['title']."
						</span>
						</span>
					";
				}else{
					//echo $assignment['Assignment']['title'];
					echo $this->Html->link($assignment['Assignment']['title'],array('controller'=>'assignmentfeedbacks','action'=>'add',$assignment['Assignment']['id']));
				}
				?>
				</span>
				<?php 
				echo $assignment_title;
				?>
				</div>
			</td>
			<td>
				<div style="position: relative;">
				<span class="toolTip">
				<?php 
				$quiz_description = strip_tags($assignment['Assignment']['description']);
				if(strlen($quiz_description) > 60){
					echo substr($quiz_description, 0, 60).'...';
					$quiz_description = "
						<span class='toolTipTxt' style='display: none;'>
						<span>
						".$assignment['Assignment']['description']."
						</span>
						</span>
					";
				}else{
					echo $quiz_description;
				}
				?>
				</span>
				<?php 
				echo $quiz_description;
				?>
				</div>
			</td>
		</tr>
		<?php endforeach;?>
	</table>
</div>