コード例 #1
0
                <td>No Data</td>
                <td>Nama Data</td>
                <td>Jenis Data</td>
                <td>Semester</td>
                <td>Jenis Data</td>
                <td>Ukuran Data</td>
                <td>Tanggal Upload</td>
                <td>Lokasi Upload</td>
                <td>Delete</td>
                <td>Edit</td>
                <td>Download</td>
                </tr>
                <?php 
require "Library.php";
$Lib = new Library();
$show = $Lib->showBooks();
while ($data = $show->fetch(PDO::FETCH_OBJ)) {
    echo "\n                <tr>\n                <td>{$data->no_data}</td>\n                <td>{$data->nama_data}</td>\n                <td>{$data->mata_kuliah}</td>\n                <td>{$data->semester}</td>\n                <td>{$data->type_file}</td>\n                <td>{$data->ukuran}</td>\n                <td>{$data->tanggal}</td>\n                <td>{$data->file}</td>  \n                <td><a class='btn btn-danger' href='list.php?delete={$data->no_data}'>Delete</a></td>\n                <td><a class='btn btn-info' href='edit.php?kode={$data->no_data}'>Edit</td>\n                <td><a class='btn btn-info' href='list.php?download={$data->no_data}'>Download</td>\n                </tr>";
}
?>
            </table>
            <a href="tambah.php" class="btn btn-success">Tambah file</a>
        </div>
    </body>
</html>
 
<?php 
if (isset($_GET['delete'])) {
    $del = $Lib->deleteBook($_GET['delete']);
}
if (isset($_GET['download'])) {