Show
Ignore:
Timestamp:
08/09/07 12:55:08 (17 months ago)
Author:
aarkerio
Message:

General update

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/views/lessons/admin_listing.thtml

    r19 r54  
    1 <div class="title_section"><?php echo $othAuth->user('name'); ?> Lessons</div> 
     1<script type="text/javascript"> 
     2   window.onload = timedMsg; 
     3</script> 
     4<?php $session->flash(); ?> 
     5<div class="title_section">Lessons</div> 
    26 
    3 <p> 
    4   <?php echo $html->link($html->image('actions/new.png', array("alt"=>"Add Lesson", "title"=>"Add Lesson")), '/lessons/add/', null, false, false) ?> 
    5 </p> 
     7<p><?php echo $html->link($html->image('actions/new.png', array("alt"=>"Add new", "title"=>"Add new")), '/admin/lessons/add', null, false, false) ?></p> 
    68 
     9<table class="tbadmin"> 
    710 
    8 <table class="main_tabula"> 
    911<?php 
     12//die(print_r($data)); 
    1013 
    11 if ( count($data) > 0 ) 
    12 { 
    13   echo '<tr><td></td>'; 
    14   echo '<td>'. $html->link('Title', '/lessons/listing/title')        .  '</td>'; 
    15   echo '<td>'. $html->link('Created', '/lessons/listing/created')    .  '</td>'; 
    16   echo '<td>'. $html->link('Status', '/lessons/listing/status')      .  '</td>'; 
    17   echo '<td></td></tr>'; 
    18 } 
     14$th = array ('Edit', 'Title', 'Status', 'Delete'); 
    1915 
    20 foreach ($data as $key => $val) { 
    21        
    22       $status = ($data[$key]['Lesson']['status'] == 1 ) ? 'Published' : 'No published'; 
    23        
    24       echo "<tr><td>";  
    25       echo $html->formTag('/lessons/delete/'.$data[$key]['Lesson']['id'], 'get', array("onsubmit"=>"return confirm('Are you sure?')")); 
    26       echo $html->submit('Delete'); 
    27       echo "</form>"; 
    28        
    29       echo '</td><td>'; 
    30       echo $data[$key]['Lesson']['title'] . '</td><td>' . $data[$key]['Lesson']['created'] . '</td>'; 
    31       echo '<td>' . $html->link($status, '/lessons/change/'.$data[$key]['Lesson']['id']); 
    32        
    33       echo "</td><td>"; 
    34        
    35       echo $html->formTag('/lessons/edit/'.$data[$key]['Lesson']['id'], 'get'); 
    36       echo $html->submit('Edit'); 
    37       echo "</form>"; 
    38       echo "</td></tr>"; 
    39 } 
     16echo $html->tableHeaders($th); 
     17 
     18foreach ($data as $val) 
     19{       
     20       $status = $gags->setStatus($val['Lesson']['status']); 
     21        
     22       $tr = array ( 
     23        $gags->sendEdit($val['Lesson']['id'], 'lessons'), 
     24        $html->link($val['Lesson']['title'], '/lessons/display/'.$val['Lesson']['id']), 
     25        $html->link($status, '/admin/lessons/change/'.$val['Lesson']['id'] .'/'. $val['Lesson']['status']), 
     26        $gags->confirmDel($val['Lesson']['id'], 'lessons') 
     27        ); 
     28        
     29    echo $html->tableCells($tr, array("class"=>"altRow", "onmouseover"=>"this.className='highlight'", "onmouseout"=>"this.className='altRow'"),  
     30                                array('class'=>'evenRow',"onmouseover"=>"this.className='highlight'", "onmouseout"=>"this.className='evenRow'")); 
     31     
     32 } 
    4033?> 
    4134</table> 
    4235 
     36<?php //echo $pagination;  
     37?> 
     38