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
function index() | |
{ | |
$data = array( | |
'members' => array() | |
); | |
if (!$this->Users->table_exists()){ | |
$this->load->view('no_table', $data); | |
} else { | |
$members = $this->Users->getAll(5); // Find all members, limit by 5 | |
if (count($members) != 0){ |
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
function __construct() | |
{ | |
parent::__construct(); | |
$this->load->helper('url'); | |
$this->load->helper('date'); | |
$this->load->model('Users','',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
function index() | |
{ | |
$data = array( | |
'members' => array() | |
); | |
if (!$this->Users->table_exists()){ | |
$this->load->view('no_table', $data); | |
} else { | |
$members = $this->Users->getAll(5); // Find all members, limit by 5 | |
if (count($members) != 0){ |
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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class Users extends CI_Model { | |
protected $primaryKey = 'id'; | |
protected $tableName = 'users'; | |
function __construct() { | |
parent::__construct(); | |
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 | |
if(count($members) > 0): | |
foreach($members as $member => $fields):?> | |
<h1><a href="<?php echo site_url(array('welcome','view', $fields['id'])); ?>"><?php echo $fields['name']; ?></a> | |
<a href="<?php echo site_url(array('welcome','edit', $fields['id'])); ?>" style="font-size:12px;">Edit</a> <a href="<?php echo site_url(array('welcome','delete', $fields['id'])); ?>" style="font-size:12px;">Delete</a></h1> | |
<p><?php echo ($fields['address']); ?><br /> | |
<em>Phone: <?php echo $fields['phone']; ?><br /> | |
Added on <?php echo unix_to_human( $fields['date'] ); ?></em></p> | |
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
class Welcome extends CI_Controller { | |
function __construct() | |
{ | |
parent::__construct(); | |
$this->load->helper('url'); | |
$this->load->library('redis'); | |
$this->load->model('Buttons','',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
class Buttons extends CI_Model { | |
function __construct() { | |
parent::__construct(); | |
} | |
function checkDB(){ | |
$result = $this->redis->command('PING'); | |
if($result == 'PONG'){ | |
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
<VirtualHost *:80> | |
DocumentRoot "c:/wamp/www/example1.sdev/" | |
ServerName example1.sdev | |
<directory "c:/wamp/www/example1.sdev/"> | |
Options Indexes FollowSymLinks | |
AllowOverride all | |
Order Deny,Allow | |
Deny from all | |
Allow from 127.0.0.1 | |
</directory> |
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
127.0.0.1 example1.sdev |
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
#!/usr/bin/python | |
import subprocess | |
import time | |
import usblamp | |
checkTime = 1 | |
arr = ("white", "yellow", "red", "blue", "green") | |
for i in arr: |