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 | |
| // Connect to database | |
| $hDB = pg_connect("connection_parms_go_here"); | |
| // Grab list of tags | |
| $hRes = pg_query($hDB, "SELECT sTag FROM tags WHERE bActive ='t' ORDER BY sTag"); | |
| pg_close($hDB); | |
| // Store dataset in an array | |
| $aRes = pg_fetch_all($hRes); |
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 | |
| // Define your DB table and application name. | |
| define("sTABLE", "IP"); | |
| define("sAPP", "FooBar"); | |
| // Define SQL query to pull data from the IP table. | |
| $sSQL = sprintf("SELECT * FROM %s WHERE (IP='%s' and sApp='%s') ORDER BY dRev DESC", | |
| sTABLE, $_SERVER['REMOTE_ADDR'], sAPP); | |
| // Example connection string. |
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
| <!DOCTYPE HTML> | |
| <head> | |
| <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> | |
| <script type="text/javascript"> | |
| function fnSetCookie(sName, sMode) | |
| { | |
| document.cookie=""+sName+"="+sMode + "; Expires=Wed, 09 Jun 2021 23:59:00 GMT;"; | |
| } | |
| function fnGetCookie(sName) |
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 | |
| fnDate_Modify($sModification) | |
| { | |
| /* | |
| $sModification can be any incrementing | |
| or decrementing string accepted by the | |
| strtotime() function. | |
| */ |
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.display_employee, e.first_name, e.last_name, e.display_employee empid, | |
| e.other_string3 employee_type, e.other_number3, | |
| e.other_number1 salary, e.full_time_equiv_pct fte, sy.other_number1 serviceyears, | |
| sum(case when bos.bank='DRI_ANNUAL' | |
| then bos.balance | |
| else 0 | |
| end) AL, | |
| sum(case when bos.bank='T_SICK' | |
| then bos.balance | |
| else 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 | |
| function fnProcess_File($aFile, $hDB=NULL) | |
| { | |
| // Function process a single uploaded file | |
| // Define file upload path | |
| $sFile_Path = "/home/nicholas/Develop/PHP/FileUpload/Uploads"; | |
| // If no files uploaded return to caller |
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 fnValidate() | |
| { | |
| var aFields = | |
| {"First Name":"sFirst", | |
| "Last Name":"sLast", | |
| "DRI Affiliation":"sAffil1", | |
| "DRI Email":"sEmail_DRI"}; | |
| var bValid = 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
| <?php | |
| function fnDisplay_DropDown($aFields, $sName, $sSel=NULL, $sClass=NULL, $sID=NULL) | |
| { | |
| if(empty($aFields) || empty($sName)) | |
| die("Parameter missing in call to fnDisplay_DropDown()"); | |
| if(!(is_array($aFields))) | |
| die("Array passed to fnDisplay_DropDown() is in invalid format."); | |
| $sHTML = sprintf(" <select name=\"%s\"%s%s>\n", $sName, |
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 | |
| /* | |
| dbfix.php | |
| A function used to do a global string replacement in a | |
| specific database table/column. | |
| $aReplacements = array("search"=>"home.dri.edu", "replace="=>"oldintranet.dri.edu"); | |
| Sample usage: fnDB_Fix($hDB, "hr_menu_entries", $aReplacements); | |
| Written: 10/17/2011, 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
| <!DOCTYPE html> | |
| <html> | |
| <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]--> | |
| <!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]--> | |
| <!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]--> | |
| <!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]--> | |
| <!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]--> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Simple Page Scraping</title> |