This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Load eloquent | |
require 'vendor/autoload.php'; | |
// Setting eloquent | |
use Illuminate\Database\Capsule\Manager as Capsule; | |
$capsule = new Capsule; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* UserIdentity represents the data needed to identity a user. | |
* It contains the authentication method that checks if the provided | |
* data can identity the user. | |
*/ | |
class UserIdentity extends CUserIdentity | |
{ | |
private $id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class WebUser extends CWebUser { | |
public function checkAccess($operation, $params = array()) { | |
if (empty($this->id)) { | |
return false; | |
} | |
$role = $this->getState("roles"); | |
if ($role === 'admin') { | |
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
var track_load = 0; //total loaded record group(s) | |
var loading = false; //to prevents multipal ajax loads | |
var total_groups = 10; //total record group(s) | |
$('#results').load("autoload_process.php", {'group_no':track_load}, function() {track_load++;}); //load first group | |
$(window).scroll(function() { //detect page scroll | |
if($(window).scrollTop() + $(window).height() == $(document).height()) //user scrolled to bottom of the page? | |
{ | |
if(track_load <= total_groups && loading==false) //there's more data to load | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- view --> | |
<input type="file" class="form-control" id="image" name="image" required> | |
<?php | |
// Controller | |
// fungsi insert | |
public function store(){ | |
$config['upload_path'] = './assets/produk/'; | |
$config['allowed_types'] = 'gif|jpg|png'; | |
$config['max_size'] = '20000'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!-- Based on HTML5 Bones | http://html5bones.com --> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Page Title</title> | |
<meta name="description" content=""> | |
<!-- Mobile-friendly viewport --> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!-- Style sheet link --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Auth | |
-simple (Access Control List) | |
-advanced (Role Based Access Control) | |
-hand made Authentication | |
Caching | |
-DB Caching | |
-File Caching | |
-Mem Caching | |
-Image Caching |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minification of files | |
zipping css / js files | |
pulling all css files into one | |
pulling all js files into one | |
creating image sprites that combined many images into one big sprite | |
avoid using IE specific css expressions | |
using a cdn to serve files | |
loading js at bottom of page | |
serving files from a different domain | |
serving files asynchronously after page has loaded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minification of files | |
zipping css / js files | |
pulling all css files into one | |
pulling all js files into one | |
creating image sprites that combined many images into one big sprite | |
avoid using IE specific css expressions | |
using a cdn to serve files | |
loading js at bottom of page | |
serving files from a different domain | |
serving files asynchronously after page has loaded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Kabupaten_Model extends CI_Model{ | |
public function __construct(){ | |
parent:: __construct(); | |
} | |
// Pagination biasa | |
public function countAll(){ | |
return $this->db->count_all('kabupaten'); |
OlderNewer