Skip to content

Instantly share code, notes, and snippets.

View Moketronics's full-sized avatar

Michael Ramsey Moketronics

View GitHub Profile
@Moketronics
Moketronics / field-clear-php-fix.php
Created February 8, 2012 21:10
JS field clearing issue PHP side fix
if (stripos($_POST['first_name'], 'first name...') !== false) {
$first_name = str_ireplace('first name...', '', $_POST['first_name']);
$first_name = sanitize_user( $first_name, true );
} else {
$first_name = sanitize_user( $_POST['first_name'], true );
}
if (stripos($_POST['last_name'], 'last name...') !== false) {
$last_name = str_ireplace('last name...', '', $_POST['last_name']);
$last_name = sanitize_user( $last_name );
@Moketronics
Moketronics / gist:1887091
Created February 22, 2012 20:36
Tile store initial DB layout
CREATE TABLE tiles (
tile_id SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
tile_name VARCHAR(80) NOT NULL,
quantity SMALLINT(5) UNSIGNED NOT NULL,
old_lot_qty SMALLINT(5) UNSIGNED,
n_height FLOAT(3) UNSIGNED NOT NULL,
n_width FLOAT(3) UNSIGNED NOT NULL,
n_thick FLOAT(3) UNSIGNED NOT NULL,
e_height FLOAT(5) UNSIGNED,
e_height FLOAT(5) UNSIGNED,
@Moketronics
Moketronics / gist:1892706
Created February 23, 2012 12:59
Tile Store Inventory System in progress db
CREATE TABLE tiles (
tile_id INT(6) UNSIGNED NOT NULL AUTO_INCREMENT,
tile_name VARCHAR(80) NOT NULL,
quantity SMALLINT(5) UNSIGNED NOT NULL,
old_lot_qty SMALLINT(5) UNSIGNED,
n_height FLOAT(3) UNSIGNED NOT NULL,
n_width FLOAT(3) UNSIGNED NOT NULL,
n_thick FLOAT(3) UNSIGNED NOT NULL,
e_height SMALLINT(5) UNSIGNED,
e_width SMALLINT(5) UNSIGNED,
@Moketronics
Moketronics / gist:1894253
Created February 23, 2012 18:34
Tile store initial DB layout revised
CREATE TABLE tiles (
tile_id INT(6) UNSIGNED NOT NULL AUTO_INCREMENT,
tile_name TEXT NOT NULL,
quantity INT(6) UNSIGNED NOT NULL,
old_lot_qty INT(6) UNSIGNED,
nom_height DECIMAL(6,3) UNSIGNED NOT NULL,
nom_width DECIMAL(6,3) UNSIGNED NOT NULL,
nom_thick DECIMAL(6,3) UNSIGNED NOT NULL,
exact_height INT(6) UNSIGNED,
exact_width INT(6) UNSIGNED,
@Moketronics
Moketronics / generator.php
Created February 24, 2012 18:37
Generator for Tile DB
<?php
$sPage_title = 'Random Tile Generator';
include ('./includes/header.html');
if (isset($_POST['submitted'])) {
if (is_numeric($_POST['quantity'])) {
require_once('../../../mysql_connect.php');
@Moketronics
Moketronics / full-inventory.php
Created February 25, 2012 23:01
Inventory page currently printing all information to simple table
<?php
$sPage_title = 'Full Inventory';
include ('./includes/header.html');
require_once('../../../mysql_connect.php');
?>
<table>
<tr>
<th>Tile ID:</th>
<th>Tile name:</th>
@Moketronics
Moketronics / generator.php
Created February 25, 2012 23:09
Basically complete tile product entry generator
<?php
$sPage_title = 'Random Tile Generator';
include ('./includes/header.html');
require_once('../../../mysql_connect.php');
if (isset($_POST['submitted'])) {
if (is_numeric($_POST['quantity'])) {
@Moketronics
Moketronics / full-inventory.php
Created February 27, 2012 19:16
Full inventory display - in progress, currently for testing
<?php
/* * * * * * * * * * * * * * * * * * *
*
* Tile Product Management System
* Name: full-inventory.php
* Version: DEV
* By: Michael Ramsey (mike@michaelramsey.ca, @moketronics)
*
* Last Updated: March 21, 2012 - Michael Ramsey
@Moketronics
Moketronics / add-tile.php
Created February 28, 2012 20:23
Create new tile entry page - in progress
<?php
$sPage_title = 'Add New Tile';
include ('./includes/header.html');
require_once('../../../mysql_connect.php');
?>
<script type="text/javascript">
$("#manufacturer_list").click(function(){ $("#series_list").removeAttr('disabled');});
</script>
<h1 id="mainhead">Use this form to add tiles!</h1>
@Moketronics
Moketronics / user-db.sql
Created March 19, 2012 22:51
User database
# MySQL User DB Schema
CREATE TABLE users(
user_id INT(6) NOT NULL AUTO_INCREMENT,
e_mail TEXT NOT NULL,
first_name TEXT NOT NULL,
last_name TEXT NOT NULL,
password CHAR(40) NOT NULL,
permission TINYINT(1) NOT NULL,
date_created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,