$myrow = MYSQL_FETCH_ARRAY($result); $sqlQuery = $myrow["body"]; // Run report $sql = $sqlQuery; $result = MYSQL_QUERY($sql); $csv = ""; while ($myrow = MYSQL_FETCH_ARRAY($result)) { $csv .= $myrow['name1'] . "," . $myrow['name2'] . "," . $myrow['address1'] . "," . $myrow['city'] . "," . $myrow['state'] . "," . $myrow['zip'] . "," . $myrow['country']; } echo $csv; exit; } // Output emails and exit if ($emails) { require_once "GLOBAL/config.php"; dbConnectMain(1); $sql = "SELECT body FROM objects WHERE objects.id = {$object} AND objects.active = 1 LIMIT 1;"; $result = MYSQL_QUERY($sql); $myrow = MYSQL_FETCH_ARRAY($result); $sqlQuery = $myrow["body"]; // Run report $sql = $sqlQuery; $result = MYSQL_QUERY($sql); $emails = ""; while ($myrow = MYSQL_FETCH_ARRAY($result)) { if ($myrow['email']) { $emails .= $myrow['email'] . "\n\r"; } } echo nl2br($emails); exit;
if ($_SERVER['PHP_AUTH_USER'] == $dbUser1) { $dbUserSelected = 1; } if ($_SERVER['PHP_AUTH_USER'] == $dbUser2) { $dbUserSelected = 2; } if ($_SERVER['PHP_AUTH_USER'] == $dbUser3) { $dbUserSelected = 3; } } } } /////////////////////////////////////////////// // Connect to database as authenticated user// /////////////////////////////////////////////// dbConnectMain($dbUserSelected); /////////////////// // Format Date // /////////////////// function utc2est($date, $time) { // Determine UTC $utc = date(mktime(substr($time, 0, 2), substr($time, 3, 2), substr($time, 6, 2), substr($date, 5, 2), substr($date, 8, 2), substr($date, 0, 4))); //echo date("d F Y h:ia", $utc) ."<br/>"; // Determine Daylight Savings $dst = date("I", $utc) * 3600; //echo $dst ."<br/>"; // Subtract 5 or 6 hours to get EST $est = date($utc - 5 * 3600 - $dst); //echo date("d F Y h:ia", $est) ."<br/>"; return $est;