// Database constants
//prod
define("DB_SERVER", "p50mysql189.secureserver.net");
define("DB_USER", "askthecandidate");
define("DB_PASS", "Politico08");
define("DB_NAME", "askthecandidate");
//dev
/*
define("DB_SERVER", "localhost");
define("DB_USER", "root");
define("DB_PASS", "password");
define("DB_NAME", "ask");
*/
$uploadDir = "content/";
include_once("connection.php");
include_once("header.php");
?>
// This file is the place to store all basic functions
//--------------------------------------------------------------------
// handy widget i wrote for debugging arrays.
function array_dump ($array)
{
foreach ($array as $key=>$x)
{
//this if statement is needed for use with $_SESSION
//PMA-Config is a class object and cannot be converted to string
if(strpos($key, "PMA")===false)
{
//$x = 'Whoa';
echo "[" . $key . "]=>" . $x . "
";
}else{
echo "skip
";
}
}
}
//-------------------------------------------------------------------------------------------------//
//Echos js script tags and code -AM
function fnc_jsScript($code){
echo "";
}
//--------------------------------------------------------------------
//Takes a query string and returns results in a selection box.
//Must be fed a query that retuns a SINGLE col. This means that the displayed
//value and that submitted in $_POST are the same
//$optVal and $optText are used to "hard code" a specific option value pair when that sort of thing is needed
// --AM
//Var Def
// $label = text displayde next to sel box in html form
// $name = DOM name of selection box
// $query = really? (query that feeds sel options...dumbass :) )
// $defaultVal = initial option desplayed when form loads. If left NULL shows "Select"
// $$optVal = optional var sets $_POST value
// $optText = optional var sets displayed value paired with $optVal
function fnc_selctionBoxFromQry($label, $name, $query, $defaultVal = NULL, $optVal = NULL, $optText = NULL)
{
echo $label . " ";
}
//--------------------------------------------------------------------
//Takes a query string and returns results in a selection box.
//Query must return TWO columns: a unique id (primary key) and associated value --AM
// For var definitions see fnc_selctionBoxFromQry above
function fnc_assocSelBoxFrmQry($label, $name, $query, $defaultVal = NULL, $defaultTxt = NULL)
{
echo $label . " ";
}
?>