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
// each gist | |
$(".gist").each(function() { | |
// reference to this | |
var $gist = $(this); | |
// hide all gist file but the first one | |
$gist.find(".gist-file:not(:first)").hide(); | |
// create the gist header |
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
function downloadFile($fileLocation,$fileName,$maxSpeed = 100,$doStream = false){ | |
if (connection_status()!=0) return(false); | |
$path_parts = pathinfo($fileLocation); | |
$extension = strtolower($path_parts["extension"]); | |
$path_parts["basename"] = $fileName; | |
/* List of File Types */ |
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 | |
// catch form submit | |
if(isset($_POST['submit'])) { | |
// make it safe for mysql | |
$name = mysql_real_escape_string($_POST['name']); | |
$password = mysql_real_escape_string($_POST['password']); | |
// if we found a match |
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
function downloadFile($fileLocation,$fileName,$maxSpeed = 100,$doStream = false){ | |
if (connection_status()!=0) return(false); | |
$path_parts = pathinfo($fileLocation); | |
$extension = strtolower($path_parts["extension"]); | |
$path_parts["basename"] = $fileName; | |
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 | |
// require our class | |
require_once("grid.php"); | |
// load our grid with a table | |
$grid = new Grid("tutorials", array( | |
"joins"=>array( | |
"LEFT JOIN categories ON categories.CategoryID = tutorials.CategoryID" | |
), | |
"fields"=>array( |
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 | |
// require our class | |
require_once("grid.php"); | |
// load our grid with a table | |
$grid = new Grid("tutorials", array( | |
"save"=>true, | |
"select" => 'selectFunction' | |
)); |
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
var $grid = $(".demo6").grid({ | |
rowNumbers: true, | |
checkboxes:true | |
}); | |
$grid.on("rowCheck",function(e, $checkbox, rowData) { | |
// using the checkbox, seeing if were checked or unchecked | |
var checked = $checkbox[0].checked ? "checked" : "unchecked"; | |
// calling the notify method on the grid plugin |
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
<table class="grid demo5" action="ajax.php"> | |
<tr> | |
<th col="Price" type="money">Price</th> | |
<th col="TutorialID" type="hashBang">TutorialID</th> | |
</tr> | |
</table> |
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
<script> | |
$(function(){ | |
var $grid = $(".demo6").grid({ | |
editing: true | |
}).on("loadComplete",function(e) { | |
// the add column | |
$(this).grid("addColumn","Add",{ | |
width: 60, | |
insertAt: "end", // index | column | "end" | "start" |
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
window.Root.Collection = _array.define({ | |
has: function(value) { | |
if ( this.indexOf(value) !== -1 ) { | |
return true; | |
} else { | |
return false; | |
} | |
}, | |
add: function(value) { | |
if ( !this.has(value) ) { |