Skip to content

Instantly share code, notes, and snippets.

View Moketronics's full-sized avatar

Michael Ramsey Moketronics

View GitHub Profile
<?php
/* * * * * * * * * * * * * * * * * * *
*
* Tile Product Management System
* Name: login.php
* Version: DEV
* By: Michael Ramsey (mike@michaelramsey.ca, @moketronics)
*
* Last Updated: March 20, 2012 - Michael Ramsey
@Moketronics
Moketronics / functions.php
Created March 21, 2012 19:42
Functions for tile product management system
<?php
function get_secondary_colours($iTile_id) {
$query_scolour = "SELECT col.colour_name FROM colour AS col, colour_associations AS col_ass WHERE $iTile_id=col_ass.tile_id AND col.colour_id=col_ass.colour_id AND col_ass.b_primary_colour='0'";
$result_scolour = mysql_query($query_scolour);
$aScolours = array();
if ($result_scolour) {
while ($row = mysql_fetch_array($result_scolour)) {
array_push($aScolours, $row['colour_name']);
}
return implode(', ',$aScolours);
@Moketronics
Moketronics / gist:2228349
Created March 28, 2012 17:15
Check update values against existing to populate array of changes
<?php
$query = 'SELECT tile_name, tile_price, quantity, old_lot_qty, nom_height, nom_width, nom_thick, exact_height, exact_width, box_tile_count, local_supply, rating, tile_notes FROM tiles WHERE tile_id=' . $iTile_id;
$result = mysql_fetch_array(mysql_query($query));
$aTile_changes = array();
$aTile_values = array($sTile_name, $iTile_price, $iQuantity, $iOld_lot_qty, $iNom_height, $iNom_width, $iNom_thick, $iExact_height, $iExact_width, $iBox_tile_count, $iLocal_supply, $iRating, $sTile_notes);
$i = 0;
foreach ($result as $key => $row) {
@Moketronics
Moketronics / price-finder.html
Created April 19, 2012 20:49
Quickly displays appropriate prices w/ tax for various publications
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Quick Price Finder | TSI Network</title>
<script src="./jquery-1.7.2.min.js"></script>
<style type="text/css">
body {
font-family: Arial, Helvetica, sans-serif;
background-color: #eee;