This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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; | |
NewerOlder