Jump to content

Wierd Problem


savagenoob

Recommended Posts

For some odd reason, when I add a snippet of PHP code to a certain page, it whitespaces the whole thing. I have other PHP snippets scattered around already. When I delete it, page is ok, with it, nothing but a grey border, all content is white. Freakin wierd. Here is the code...

 

$day = date('d');
                $month = date('m');
                $year = date('Y');
                $last = last_business_day($year,$month);
                $lastday = date('d', strtotime($last));
                if($day > "15"){
                    $date2 = date("Y-m-" . $lastday);
                }
                else
                {
                    $date2 = date("Y-m-15");
                }
			$date1= date('Y-m-d');
			$time = " 23:59:59";
			$date3 = $date2 . $time;
			$agency = $_SESSION['AGENCY'];
			$agent = $_SESSION['AGENTNAME'];
			$query = "SELECT Amount1RS, SUM(BrokerFee), SUM(TotalCollected), SUM(Commission), AVG(BrokerFee),  COUNT(ID) FROM accounting WHERE agency = '$agency' AND agent = '$agent' AND Amount1RS = 'New Business' AND Date BETWEEN '$newdate1' AND '$date3'";
			$result = mysql_query($query);
			while($myrow = mysql_fetch_assoc($result)) 
                    {//begin of loop 
                    $totbroker = $myrow['SUM(BrokerFee)'];
                    $avgbroker = $myrow['AVG(BrokerFee)'];
                    $totcommission = $myrow['SUM(Commission)'];
                    $totproduction = $myrow['SUM(Commission)'] + $myrow['SUM(BrokerFee)'];
                    }
                $proquery = mysql_query("SELECT COUNT(ID) FROM clients WHERE Status = 'Prospect' AND Agency = '$agency' AND agentname = '$agent'") or die(mysql_error());
                $prospects = mysql_fetch_array($proquery);
                $insquery = mysql_query("SELECT COUNT(ID) FROM clients WHERE Status = 'Insured' AND Agency = '$agency' AND agentname = '$agent'") or die(mysql_error());
                $insureds = mysql_fetch_array($insquery);
                $closing  = ($insureds / $prospects) * 100;
                $closing = floatval($closing);

I even put it in teh <head> tag, same result. Anyone encountered this before?

Link to comment
https://forums.phpfreaks.com/topic/218828-wierd-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.