Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ============================= File Controllers : welcome.php ============================
- <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
- class Welcome extends CI_Controller {
- public function __construct() {
- parent::__construct();
- $this->load->database();
- $this->load->helper('url');
- $this->load->library('grocery_CRUD');
- }
- public function _example_output($output = null) {
- $this->load->view('lihat.php',$output);
- }
- public function index() {
- $data['judul'] = "Ini Link CRUD";
- $this->load->view('link.php',$data);
- }
- public function crud() {
- $crud = new grocery_CRUD();
- //$crud->set_relation('customerNumber','customers','{contactLastName} {contactFirstName}');
- //$crud->display_as('customerNumber','Customer');
- $crud->set_table('nama_tabel');
- $crud->set_subject('Data');
- //$crud->unset_add();
- //$crud->unset_delete();
- $output = $crud->render();
- $this->_example_output($output);
- }
- }
- ?>
- ================================ File views : link.php ==================================================
- <h1><?php echo $judul; ?></h1>
- <a href="<?php echo site_url('welcome/crud');?>">Click</a>
- ================================= File Views : lihat.php =================================================
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <?php
- foreach($css_files as $file): ?>
- <link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
- <?php endforeach; ?>
- <?php foreach($js_files as $file): ?>
- <script src="<?php echo $file; ?>"></script>
- <?php endforeach; ?>
- <style type='text/css'>
- body
- {
- font-family: Arial;
- font-size: 14px;
- }
- a {
- color: blue;
- text-decoration: none;
- font-size: 14px;
- }
- a:hover
- {
- text-decoration: underline;
- }
- </style>
- </head>
- <body>
- <div>
- <?php echo $output; ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement