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 | |
function numToStr($val) { | |
$aLookup = array( | |
0 => "zero", | |
1 => "one", | |
2 => "two", | |
3 => "three", | |
4 => "four", | |
5 => "five", |
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 | |
function buildBaseString($baseURI, $method, $params) { | |
$r = array(); | |
ksort($params); | |
foreach($params as $key=>$value){ | |
$r[] = "$key=" . rawurlencode($value); | |
} | |
return $method."&" . rawurlencode($baseURI) . '&' . rawurlencode(implode('&', $r)); | |
} |
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 | |
// search model for matching key | |
$record = FormDB::find('[email protected]'); | |
if($record) { | |
// record exists, update data | |
$record->text = "Updated"; | |
$record->save(); | |
} else { |
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 checkFile(file) { | |
var extension = file.substr((file.lastIndexOf('.') +1)); | |
if (!/(pdf|zip|doc)$/ig.test(extension)) { | |
alert("Invalid file type: "+extension+". Please use DOC, PDF or Zip."); | |
$("#file").val(""); | |
} | |
} |
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 getParameterByName(param) | |
{ | |
param = param.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); | |
var regexS = "[\\?&]" + param + "=([^&#]*)"; | |
var regex = new RegExp(regexS); | |
var results = regex.exec(window.location.search); | |
if(results == null) | |
return ""; | |
else | |
return decodeURIComponent(results[1].replace(/\+/g, " ")); |
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 | |
// create dummy array for example | |
$array = array("one", "two", "three"); | |
// turn on output buffering | |
ob_start(); | |
// use var_dump to output the contents of the array/object | |
var_dump($array); |
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 Encryption { | |
var $skey = "yourSecretKey"; // change this | |
public function safe_b64encode($string) { | |
$data = base64_encode($string); | |
$data = str_replace(array('+','/','='),array('-','_',''),$data); | |
return $data; | |
} |
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
select | |
e.last_name, | |
e.first_name, | |
e.display_employee, | |
e.other_string3, | |
case when tso.pay_code in ('SICK', 'FURLOUGH_LEAVE', 'ANNUAL') then pc.short_description else ld3.short_description end proj_desc, | |
case when tso.pay_code in ('SICK', 'FURLOUGH_LEAVE', 'ANNUAL') then 'leave' else 'charge' end usage, | |
ld1.ld1 account_id, | |
ld1.short_description account_name, | |
ld3.ld1 project, |
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 | |
/* | |
db_utils.inc | |
Collection of database-related function used | |
by DRI applications. | |
Written: 03/30/2012, Nicholas Kreidberg | |
Revised: 03/30/2012, Nicholas Kreidberg |
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 | |
// database connection/retrieval code removed | |
$sCSV = NULL; | |
while($aRes = pg_fetch_assoc($rRes)) | |
{ | |
// first, middle, last, suffix, company, department, | |
// title, bus. street, bus. city, bus. state, bus. zip, |