PHP Classes

File: example/app/views/data.php

Recommend this page to a friend!
  Classes of Dony   Kecik   example/app/views/data.php   Download  
File: example/app/views/data.php
Role: Auxiliary script
Content type: text/plain
Description: Example script
Class: Kecik
MVC framework library as single PHP file
Author: By
Last change: custom template engine
update to version 1.1
Date: 9 years ago
Size: 811 bytes
 

Contents

Class file image Download
<br />
<a href="<?php $this->url->to('tambah') ?>" class="btn btn-success">Tambah Data</a><br />

<table class="table table-striped table-hover">
    <thead>
        <tr>
            <th>NO</th>
            <th>NAMA</th>
            <th>EMAIL</th>
            <th>AKSI</th>
        </tr>
    </thead>

    <tbody>
        <?php
        $sql
= "SELECT * FROM data";
       
$res = mysqli_query($this->dbcon, $sql);
       
$no = 1;
        while(
$data = mysqli_fetch_object($res) ) {
       
?>
<tr>
            <td><?php echo $no; ?></td>
            <td><?php echo $data->nama; ?></td>
            <td><?php echo $data->email; ?></td>
            <td>
                <a href="<?php $this->url->to('edit/'.$data->id) ?>" class="btn btn-primary">Ubah</a>
                <a href="<?php $this->url->to('delete/'.$data->id) ?>" class="btn btn-danger">Hapus</a>
            </td>
        </tr>
        <?php
            $no
++;
        }
       
?>

    </tbody>
</table>