";
while (list($var, $value) = each($HTTP_POST_VARS)) {
echo "$var = $value
";
if ($var == "bfspecialties") {
while (list($var, $value) = each($bfspecialties)) {
echo "$var = $value
";
}
}
}
while (list($var, $value) = each($HTTP_GET_VARS)) {
echo "$var = $value
";
}
echo "GLOBALS
";
while (list($varname,$varvalue)=each($GLOBALS)) {
echo "$varname = $varvalue
";
}
}
//==================================================================
$qs = getenv("QUERY_STRING");
/* Is mysql server active? */
if (mysql_connect("localhost", "cruser", "cr02wf98") == false) {
echo '
Server too busy - Please try again later (CR001)
';
exit();
}
/* Is REP database available? */
$result = mysql_select_db("client_reach");
if ($result == false){
echo '
Server too busy - Please try again later (CR002-' . $result . ')
';
exit();
}
$tiptype = "B";
$referer = getenv("HTTP_REFERER");
$refwk = $referer;
$ref2 = ereg_replace("http://", "", $refwk);
$ref3 = explode("/", $ref2);
if (substr($ref3[0], 0, 4) != "www.") {
$ws_url_full = "www." . $ref3[0];
$ws_url_short = $ref3[0];
}
else {
$ws_url_full = $ref3[0];
$ws_url_short = substr($ref3[0], 4);
}
$ws_url_full = strtolower($ws_url_full);
$ws_url_short = strtolower($ws_url_short);
if (!$crid) {
if ($referer <= " ") {
?>
$ws_url_full AND !$rectips) {
$violation = "VIOLATION " . date( "Y/m/d h:m a", time() ) . " - CR id: " . $subdata["subid"] . " (URL: " . $subdata["website"] . ") accessed from " . $ws_url_full . "." ;
$filename = "/usr/local/www/vhosts/clientreach.com/cgi-bin/data/crerror.log";
$fp=fopen($filename, 'a');
fwrite($fp,"$violation \n");
fclose($fp);
}
if ($subdata["status"] == "TS") {
$cr_yr = 1;
$cr_wk = 1;
}
else {
$wkdate = $subdata["start_date"];
$jstartyear = substr($wkdate, 0,4);
$jstartday = date("z", mktime(0, 0, 0, substr($wkdate, 5,2), substr($wkdate, 8,2), substr($wkdate, 0,4)));
$jtodayday = date("z");
$jtodayyear = date("Y");
$jtoday = (($jtodayyear - $jstartyear) * 365) + $jtodayday;
$week = ceil(($jtoday - $jstartday) / 7);
$cr_yr = ceil($week/52);
$cr_wk = $week % 52;
}
$cr_yr = 1;
// if ($cr_wk > 42) {
// srand((double)microtime()*100000);
// $week = rand(0,42);
// $cr_wk = $week;
// $cr_wk = $cr_wk - 20;
// }
$colorchoice = $subdata["cr_colorscheme"];
if ($tiptype == "B") {
$buyselltips_result = mysql_query("SELECT * FROM tip WHERE type='Buyer' AND cr_year= $cr_yr AND cr_week=$cr_wk");
if (mysql_numrows($buyselltips_result) == 0) {
echo '
Server too busy - Please try again later (CR003)
';
exit();
}
$tipdata = mysql_fetch_array($buyselltips_result);
if ($subdata["cr_style"] == "Basic") {
include("buyertips_1.phtml");
}
elseif ($subdata["cr_style"] == "Wrought Iron Sign") {
include("buyertips_2.phtml");
}
else {
include("buyertips_3.phtml");
}
}
else {
$buyselltips_result = mysql_query("SELECT * FROM tip WHERE type='Seller' AND cr_year= $cr_yr AND cr_week=$cr_wk");
if (mysql_numrows($buyselltips_result) == 0) {
echo '
Server too busy - Please try again later (CR003)
';
exit();
}
$tipdata = mysql_fetch_array($buyselltips_result);
if ($subdata["cr_style"] == "Basic") {
include("sellertips_1.phtml");
}
elseif ($subdata["cr_style"] == "Wrought Iron Sign") {
include("sellertips_2.phtml");
}
else {
include("sellertips_3.phtml");
}
}
?>