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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.