<?php include 'libs/checklogin.php'; require 'libs/functions.php'; ?> <html> <head> <title>Pascal 4fun | Video bài giảng</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="css/main.css"> </head> <body> <header> <a href='index.php' class='Link'></a> </header> <div id="content"> <h2 class="tieude">SLIDE BÀI GIẢNG</h2> <?php echo list_lectures(); ?> </div> </body> </html>
$_SESSION['scope'] = 'lectures'; include 'config.php'; require_once 'class.sqlite.php'; $ds = new DB(); $ds->db = new SQLite3(DBFILE); $error_message = ''; // Подготовим данные function list_lectures() { global $ds; if ($ds->fetch('SELECT id,name,date,teacher FROM lectures;')) { $headers = array('Выбор', 'Название', 'Дата', 'Лектор'); $hclass = array('Выбор' => 'col_select', 'Название' => 'col_name'); echo $ds->draw_table($headers, $hclass, 'lectures'); return true; } } ?> <h3>Занятия</h3> <div class="list"> <?php $fields = array(array('name' => 'name', 'label' => 'Тема', 'mandatory' => 'true'), array('name' => 'date', 'label' => 'Дата', 'mandatory' => 'true'), array('name' => 'teacher', 'label' => 'Ведущий', 'mandatory' => 'true')); list_lectures(); echo render('templates/toolbar.php', array('item' => 'lecture', 'fields' => $fields)); ?> </div>