| 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 | | } |
| | 16 | echo $html->tableHeaders($th); |
| | 17 | |
| | 18 | foreach ($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 | } |