Solved

300 Points to help debug my page

Posted on 2003-11-16
14
288 Views
Last Modified: 2006-11-17
I have been working on this page off and on for a while now.  It was continuous until I got stuck on writing the final values at the bottom of the page.  All of my code works except reiterating the prices in the final cells on the page.  I am pasting my code here, but I can also send you a zipped version of the page if you request it.  I am at my wits end trying to figure this one out.  (It doesn't help that I am also a ASP/.Net programmer, not usually a PHP programer.)

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<body onLoad="MM_preloadImages('../images/order.gif')"><div align="center">
  <table width="450" border="0" cellspacing="2" cellpadding="4">
    <tr>
      <td align="left" class="currentPath"><span class="currentPath">&nbsp; Strohl
        Site Design &gt; Packages &gt; Web Design</span></td>
      </tr>
    <tr>
      <td align="left" valign="top"><p align="justify"><span class="pHead">Web
          Site Design Packages</span></p>
        <table width="100%" border="0" align="center" cellpadding="3" cellspacing="0" id="tblDesign" class="packages">
          <tr>
            <td style="border-bottom: 1px solid #800000; border-right: 1px solid #800000;">&nbsp;</td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #800000;"><div align="center"><strong>Value</strong></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #800000;"><div align="center"><strong>Web
                Starter</strong></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #800000;"><div align="center"><strong>Advanced</strong></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #800000;"><div align="center"><strong>Corporate</strong></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #800000;"><div align="center"><strong>Corporate
                Plus</strong></div></td>
          </tr>
          <tr>
            <td colspan="6" bgcolor="#FFFF91" style="border-bottom: 1px solid #800000;"><div align="center"><strong>Basics</strong></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Hosting
              Available</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Customer
              Service</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Training<font color="#FF0000">*</font><font color="#FF0000">*</font></strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Min
              / Max Pages</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">5
                /10</div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center">5
                / 25</div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">10
                / 75</div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center">10
                / 150</div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">Unlimited</div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>e-Mail
              Accounts</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">1</div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center">3</div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">6</div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center">50</div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">100+</div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000;"><strong>Custom
              Graphics</strong></td>
            <td bgcolor="#DFDFFF"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
          </tr>
          <tr>
            <td colspan="6" bgcolor="#FFFF91" style="border-bottom: 1px solid #800000; border-top: 1px solid #800000;"><div align="center"><strong>Technologies</strong></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>HTML
              4.0</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="22" height="19" /></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>XHTML
              1.1</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Javascript</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>CSS</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Cookies</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>ASP
              or PHP</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>ASP.Net</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000;"><strong>Dynamic
              Content</strong></td>
            <td bgcolor="#DFDFFF"><div align="center">&nbsp;</div></td>
            <td bgcolor="#FFFFFF"><div align="center">&nbsp;</div></td>
            <td bgcolor="#DFDFFF"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
          </tr>
          <tr>
            <td colspan="6" bgcolor="#FFFF91" style="border-bottom: 1px solid #800000; border-top: 1px solid #800000;">
              <div align="center"><strong>Extras</strong></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Feedback
              Forms</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Guestbook(s),
              Counters, etc.</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>e-Commerce</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;<img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /><br>
                limited </div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /><br>
                limited </div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /><br>
                unlimited</div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Site
              Search Engine</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Search
              Engine Submission</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center">&nbsp;</div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000;"><strong>Custom
              / Company Logo</strong> </td>
            <td bgcolor="#DFDFFF"><div align="center">&nbsp;</div></td>
            <td bgcolor="#FFFFFF"><div align="center">&nbsp;</div></td>
            <td bgcolor="#DFDFFF"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#FFFFFF"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
            <td bgcolor="#DFDFFF"><div align="center"><img src="../images/checkmark_blue_sm.gif" alt="Yes" name="imgCheck" width="20" height="19" /></div></td>
          </tr>
          <tr>
            <td colspan="6" bgcolor="#FFFF91" style="border-top: 1px solid #800000; border-bottom: 1px solid #800000;">
              <div align="center"><strong>Costs</strong></div></td>
          </tr>
<?php
setlocale(LC_MONETARY, 'en_US');
$dbh=mysql_pconnect("localhost","DBNAME","PASSWORD") or die('I cannot connect to the database because: ' . mysql_error());
mysql_select_db("DBNAME");
?>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Monthly
              Maintenance Fee(s)<font color="#FF0000">*</font></strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd01ann01=RunQuery("wd01ann",2,0); echo($wd01ann01); ?></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd02ann01=RunQuery("wd02ann",2,0); echo($wd02ann01); ?></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd03ann01=RunQuery("wd03ann",2,0); echo($wd03ann01); ?></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd04ann01=RunQuery("wd04ann",2,0); echo($wd04ann01); ?></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd05ann01=RunQuery("wd05ann",2,0); echo($wd05ann01); ?></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Set-Up
              Fee</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd01ann02=RunQuery("wd01ann",1,0); echo($wd01ann02); ?></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd02ann02=RunQuery("wd02ann",1,0); echo($wd02ann02); ?></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd03ann02=RunQuery("wd03ann",1,0); echo($wd03ann02); ?></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd04ann02=RunQuery("wd04ann",1,0); echo($wd04ann02); ?></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd05ann02=RunQuery("wd05ann",1,0); echo($wd05ann02); ?></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Annual
              Cost<font color="#FF0000">*</font></strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd01ann03=RunQuery("wd01ann",0,0); echo($wd01ann03); ?></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd02ann03=RunQuery("wd02ann",0,0); echo($wd02ann03); ?></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd03ann03=RunQuery("wd03ann",0,0); echo($wd03ann03); ?></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd04ann03=RunQuery("wd04ann",0,0); echo($wd04ann03); ?></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd05ann03=RunQuery("wd05ann",0,0); echo($wd05ann03); ?></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Minimum
              Initial Cost<font color="#FF0000">*</font></strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php FigureTotal($wd01ann01,$wd01ann02,$wd01ann03,0,1); ?></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php FigureTotal($wd02ann01,$wd02ann02,$wd02ann03,0,1); ?></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php FigureTotal($wd03ann01,$wd03ann02,$wd03ann03,1,0); ?></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php FigureTotal($wd04ann01,$wd04ann02,$wd04ann03,1,0); ?></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php FigureTotal($wd05ann01,$wd05ann02,$wd05ann03,1,0); ?></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Order
              Now </strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><a href="?inc=47&package=wd01" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('imgOrder1','','../images/order.gif',1)"><img src="../images/order_rollover.gif" alt="Order Now" name="imgOrder1" width="44" height="12" border="0"></a></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><a href="?inc=47&package=wd02" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('imgOrder11','','../images/order.gif',1)"><img src="../images/order_rollover.gif" alt="Order Now" name="imgOrder11" width="44" height="12" border="0" id="imgOrder11"></a></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><a href="?inc=47&package=wd03" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('imgOrder12','','../images/order.gif',1)"><img src="../images/order_rollover.gif" alt="Order Now" name="imgOrder12" width="44" height="12" border="0" id="imgOrder12"></a></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><a href="?inc=47&package=wd04" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('imgOrder13','','../images/order.gif',1)"><img src="../images/order_rollover.gif" alt="Order Now" name="imgOrder13" width="44" height="12" border="0" id="imgOrder13"></a></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><a href="?inc=47&package=wd05" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('imgOrder14','','../images/order.gif',1)"><img src="../images/order_rollover.gif" alt="Order Now" name="imgOrder14" width="44" height="12" border="0" id="imgOrder14"></a></div></td>
          </tr>
        </table>
        <p align="justify"><em>Ordering any package or service constitutes your
          knowledge and agreement of this site's <a href="?inc=23">Terms and Agreements</a>.</em></p>
        <p align="justify"><strong><font color="#FF0000">*</font></strong> These
          are starting fees. More complicated development requests may cost more.
          All Business and Corporate Plans require a minimum of 50% deposit of
          your total cost prior to any development project initializes. Annual
          cost is your initial payment for creation of your web site. This will
          not be charged to you every year.</p>
        <p align="justify"><strong><font color="#FF0000">*</font></strong><strong><font color="#FF0000">*</font></strong>
          Training only applies to those customers in the Central Florida area
          and some other areas of Florida. Clients outside the state of Florida
          will be required to pay travel and lodging expenses to take advantage
          of the training feature. This may also apply to some Florida Clients
          as well.</p>
        <p align="center"><a href="#top">^ top</a></p>
        </td>
    </tr>
  </table>
</div>
<?php
function RunQuery($varQuery,$varWhich=0,$varWrite=0){
      $varempty=money_format('%#4n',0.00);
      if ($varWhich==1){
            # Find Set-Up Fee
            $sql=mysql_query("SELECT pl_sku,pl_assoc_sku
                  FROM ssd_pricelist
                  WHERE pl_sku = '$varQuery'")or die("Invalid Query: ".mysql_error());
            while ($dataset=mysql_fetch_row($sql)){
                  $varQuery=$dataset[1];
                  # The returned value is used below
            }
      }elseif($varWhich==2){
            # Find Monthly Maintenance Fee
            $sql=mysql_query("SELECT pl_sku,pl_mon_maint
                  FROM ssd_pricelist
                  WHERE pl_sku = '$varQuery'")or die("Invalid Query: ".mysql_error());
            while ($dataset=mysql_fetch_row($sql)){
                  if ($varWrite==1){
                        $returnVar=money_format('%#4n',$dataset[1]);
                        return $returnVar;
                  }else{
                        echo money_format('%#4n',$dataset[1]);
                        return;
                  }
            }
      }
      if ($varQuery!="none"){
            $sql=mysql_query("SELECT pl_sku,pl_price
                  FROM ssd_pricelist
                  WHERE pl_sku = '$varQuery'") or die("Invalid Query:".mysql_error());
            while ($dataset=mysql_fetch_row($sql)){
                  if ($varWrite==1){
                        $returnVar=money_format('%#4n',$dataset[1]);
                        return $returnVar;
                  }else{
                        echo money_format('%#4n',$dataset[1]);
                  }
            }
      }else{
            if ($varWrite==1){
                  return $varempty;
            }else{
                  echo $varempty;
            }
      }
} # End Function

function FigureTotal($varMaintFee,$varSetUpFee,$varPkgPrice,$varCost,$varIncMaint){
      #FigureTotal("wd01ann",0,1);
      #$varPkgPrice=$varAnnFee;
            #echo "\$varPkgPrice=".$varPkgPrice."<br />";
            #echo "<b>Package Price:</b> ";
            #print_r($varPkgPrice);
            #echo "<br />";
      #$varSetUpFee=$varSUFee;
            #echo "\$varSetupFee=".$varSetUpFee."<br />";
            #echo "<b>Set Up Fee:</b> ";
            #print_r($varSetUpFee);
            #echo "<br />";
      if ($varIncMaint==1){
            $varMaintFee=$varMaintFee;
            #echo "\$varMaintFee=".$varMaintFee."<br />";
      }else{
            $varMaintFee=0.00;
      }
            #echo "<b>Maint Fee:</b> ";
            #print_r($varMaintFee);
            #echo "<br />";
      $TotalDue=($varPkgPrice+$varSetUpFee+$varMaintFee);
            #echo "\$TotalDue=".$TotalDue."<br />";
            #echo "<b>Total Due 1:</b> ";
            #print_r($TotalDue);
            #echo "<br />";
      if ($varCost==1){$TotalDue=($TotalDue/2);}
            #echo "<b>Total Due 2:</b> ";
            #print_r($TotalDue);
            #echo "<br />";
      echo money_format('%#4n',$TotalDue);
} # End Function
#phpinfo();
?>
0
Comment
Question by:hismightiness
14 Comments
 

Expert Comment

by:dewils80
ID: 9762331
Can you paste in the error you are getting, or explain how it is not working.
0
 
LVL 9

Author Comment

by:hismightiness
ID: 9763576
Sorry that I wasn't more specific.  The lines near the end of the page which are similar to the following are not printing the correct totals.  They are instead always printing "$0.00".

<?php FigureTotal($wd01ann01,$wd01ann02,$wd01ann03,0,1); ?>

Everything else is working as expected and intended.
0
 

Expert Comment

by:win3o
ID: 9776079
Is it possible to see the values from the db for your values, $wd01ann01,$wd01ann02,$wd01ann03, and so on ...
0
 
LVL 9

Author Comment

by:hismightiness
ID: 9776098
By the time I get to the first instance of calling the FigureTotal() function, the values of those variables is null or 0.  Why would that be?  Prior to that function call, these variables all have the expected values.
0
 
LVL 1

Expert Comment

by:outerJoin
ID: 9779376
1.  Have you tried printing the values of $wd01ann01, and so on, from the point where FigureTotal() is called?

For example,
<?php echo $wd01ann01, $wd01ann02, $wd01ann03; FigureTotal($wd01ann01, $wd01ann02, $wd01ann03, 0, 1); ?>

2. Have you tried printing from FigureTotal() without using money_format()?

Depending on the results of (1) or (2) above, I might have some other red herrings to chase. :-)


Hope this helps!
   -- outerJoin
0
 
LVL 9

Author Comment

by:hismightiness
ID: 9783420
That's the problem.  The variables appear to have the values prior to the final functions being called.  Once I input those variables into the function, they somehow have either a NULL or 0 value.  The variables already get printed prior to the final functions being called.  However, I tried ECHOing the values with the money format as you suggested, and the printed value is now 0 instead of $0.00.  Thanks for your help though...
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 1

Expert Comment

by:outerJoin
ID: 9799528
I'm sorry, maybe I wasn't being clear enough.  I'm saying there might be a difference between where you are currently echoing the values of the variables, and the point *just outside* the call to the FigureTotal() function.

There *shouldn't* be any difference, but I'd like to eliminate that possibility first.

Also, what version of PHP are running?  And on what platform? (Both the OS and Web Server software names and versions.)  The reason I ask is that it will permit a lookup of any known bugs or quirky behaviors in the release notes.

---

BTW, I was waiting to save this red herring, but I've seen some odd behavior in older versions of PHP with respect to whitespace around operators.  Can't remember which version unfortunately.  Anyway, this is probably *NOT* the problem, but you might try putting whitespace around the operators and punctuation.  I.e. spaces on both sides of '=' and '+', after each comma, on the inside of parens, etc.

You might also try returning a value from FigureTotal instead of echoing from it; try printing the value.  i.e.
<?php echo $wd01ann01, $wd01ann02, $wd01ann03; echo FigureTotal($wd01ann01, $wd01ann02, $wd01ann03, 0, 1); ?>

Try putting *just* print_r()'s at the top of FigureTotal() for *each* of the arguments, and then return a bogus number such as 123.45.  (Leave the rest of the code in FigureTotal below that; the return will prevent it from reaching it.)

If none of that yields any clues, try moving the block containing the setlocale() up to near the top of the file, just under where the JavaScript block ends.  Also move the PHP function definitions to within the same block as the setlocale.  

Insert the following code at the beginning of that setlocale/function definition block:

  // Report all PHP errors (bitwise 63 may be used in PHP 3)
  error_reporting (E_ALL);

Turning on all the error reporting will temporarily allow us to discover if there is a variable used before it is defined, etc.

When a system does something that is just befuddling and doesn't make sense, the best thing is to see if you can prod the system into coughing up some more details about what is wrong.  For example, you might try commenting out *half* of the HTML/PHP where the variables are first set, for example.  You *know* that the FigureTotal calls *will* fail for those variables,  then.  But is there any difference between those calls and the rest of the calls?


Hope this helps!
   -- outerJoin
0
 
LVL 9

Author Comment

by:hismightiness
ID: 9819229
First of all, I would just like to say that I am not a very good debugger.  After trying some of your ideas, I found them to be great ways to find out some more information.  I appreciate your help.  With that being said, I am still stuck without a paddle...

-----------------------------------------------------------------------------------
My hosting server has the following installed:
     PHP ver. 4.3.4
     Red Hat (not sure which version, either newest or next one lower)
------------------------------------------------------------------------------------

After trying your suggestions, I found that the variables from all of the initial function call are not actually getting assigned:

<?php $wd01ann03 = RunQuery("wd01ann", 0, 0); echo($wd01ann03); print_r($wd01ann03); ?>

For instance, the variable above ($wd01ann03) will not have a value following this line of code.  However, the value I want to use is correct and gets printed here.  You wouldn't happen to have an idea why the variable is then empty would you?
0
 
LVL 1

Expert Comment

by:outerJoin
ID: 9822492
Ah HA!

I think I just found your problem!

Every call to RunQuery() has the 3rd argument set to zero.  Read the source code to RunQuery().  It *echoes* the value if the 3rd arg ($varWrite) is zero, and returns nothing.  If the 3rd arg is set to 1, it *returns* the value.

So you weren't seeing the echoes of the variable contents, you were seeing echoes printed from RunQuery!

Try changing the last arg to 1 in all your calls to RunQuery, and see if that fixes things.
0
 
LVL 9

Author Comment

by:hismightiness
ID: 9829757
Wow!  Baby steps...  Hehehe...  I'll get the hang debugging. but thanks for hanging in there with me!

Now the print_r() function reprints the variable values (correctly) following each of the RunQuery() calls and from within the FigureTotal() function as long as nothing is done with them.  However, the FigureTotal() function still does not return anything but the $0.00 it has already.

I cannot believe I missed that function value though.  Do you have any more ideas on the final value problem?

I thought that perhaps due to the numbers being carried into FigureTotal() already formatted as US currency, there was a problem.  Therefore, I attempted to use the number_format() function to convert the variables prior to doing anything else, but that didn't work either.  I still got the $0.00 as a result of the function call.

*Newsflash*
I just did something I should have known to do from the beginning and you even hinted about earlier.  (Thanks by the way, you have been a huge help, and I hope to soon allot the points to you!)  After each step in the FigureTotal() function, I used the print_r() function to follow the values of the variables each step of the way.   I found that the values of the variables are just fine.  However, the final variable which gives the resulting value does not get properly assigned.

It begins at this line (I added a 1 to all of the variables names within the function to ensure uniqe names):

$TotalDue1 = ($varPkgPrice1 + $varSetUpFee1 + $varMaintFee1);

From here on out, the value of $TotalDue1 remains $0.00.  Why is that?
0
 
LVL 1

Expert Comment

by:outerJoin
ID: 9848597
Hi, sorry for the delay, but I haven't been near a computer for a few days.

I don't think you needed to change any of the variable names.

Have you tried removing the parens () from the TotalDue expression?

$TotalDue  =  $varPkgPrice  +  $varSetUpFee  +  $varMaintFee;

Also, check to ensure you haven't got a typo in one of the variable names somewhere in the function.  Unless you've used error_reporting(E_ALL) to turn on the checks, it will silently let you use an uninitialized variable... which could be accidentally created by a typo.
0
 
LVL 9

Author Comment

by:hismightiness
ID: 10193079
Hello everyone.  Thank you very much for trying to help me.  However, I have fixed he problem myself after putting it down for a LONG time and then working on it again today.  I have found that one you take a number and run it through the number_format() function, you can no longer perform math functions on it.  Everytime I did, it would zero out the number immediately.  Here is a snippet to show you (THANKS AGAIN!):

          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Monthly
              Maintenance Fee(s)<font color="#FF0000">*</font></strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd01ann01 = RunQuery("wd01ann", 2, 1); echo(money_format('%#4n', $wd01ann01)); ?></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd02ann01 = RunQuery("wd02ann", 2, 1); echo(money_format('%#4n', $wd02ann01)); ?></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd03ann01 = RunQuery("wd03ann", 2, 1); echo(money_format('%#4n', $wd03ann01)); ?></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd04ann01 = RunQuery("wd04ann", 2, 1); echo(money_format('%#4n', $wd04ann01)); ?></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd05ann01 = RunQuery("wd05ann", 2, 1); echo(money_format('%#4n', $wd05ann01)); ?></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Set-Up
              Fee</strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd01ann02 = RunQuery("wd01ann", 1, 1); echo(money_format('%#4n', $wd01ann02)); ?></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd02ann02 = RunQuery("wd02ann", 1, 1); echo(money_format('%#4n', $wd02ann02)); ?></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd03ann02 = RunQuery("wd03ann", 1, 1); echo(money_format('%#4n', $wd03ann02)); ?></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd04ann02 = RunQuery("wd04ann", 1, 1); echo(money_format('%#4n', $wd04ann02)); ?></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd05ann02 = RunQuery("wd05ann", 1, 1); echo(money_format('%#4n', $wd05ann02)); ?></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Annual
              Cost<font color="#FF0000">*</font></strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd01ann03 = RunQuery("wd01ann", 0, 1); echo(money_format('%#4n', $wd01ann03)); ?></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd02ann03 = RunQuery("wd02ann", 0, 1); echo(money_format('%#4n', $wd02ann03)); ?></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd03ann03 = RunQuery("wd03ann", 0, 1); echo(money_format('%#4n', $wd03ann03)); ?></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd04ann03 = RunQuery("wd04ann", 0, 1); echo(money_format('%#4n', $wd04ann03)); ?></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php $wd05ann03 = RunQuery("wd05ann", 0, 1); echo(money_format('%#4n', $wd05ann03)); ?></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Minimum
              Initial Cost<font color="#FF0000">*</font></strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php FigureTotal( $wd01ann01, $wd01ann02, $wd01ann03, 0, 1 ); ?></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php FigureTotal( $wd02ann01, $wd02ann02, $wd02ann03, 0, 1 ); ?></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php FigureTotal( $wd03ann01, $wd03ann02, $wd03ann03, 1, 0 ); ?></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php FigureTotal( $wd04ann01, $wd04ann02, $wd04ann03, 1, 0 ); ?></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><?php FigureTotal( $wd05ann01, $wd05ann02, $wd05ann03, 1, 0 ); ?></div></td>
          </tr>
          <tr>
            <td bgcolor="#FFFF91" style="border-right: 1px solid #800000; border-bottom: 1px solid #666666;"><strong>Order
              Now </strong></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><a href="?inc=47&package=wd01&payment_plan=ann" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('imgOrder1','','../images/order.gif',1)"><img src="../images/order_rollover.gif" alt="Order Now" name="imgOrder1" width="44" height="12" border="0"></a></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><a href="?inc=47&package=wd02&payment_plan=ann" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('imgOrder11','','../images/order.gif',1)"><img src="../images/order_rollover.gif" alt="Order Now" name="imgOrder11" width="44" height="12" border="0" id="imgOrder11"></a></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><a href="?inc=47&package=wd03&payment_plan=ann" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('imgOrder12','','../images/order.gif',1)"><img src="../images/order_rollover.gif" alt="Order Now" name="imgOrder12" width="44" height="12" border="0" id="imgOrder12"></a></div></td>
            <td bgcolor="#FFFFFF" style="border-bottom: 1px solid #666666;"><div align="center"><a href="?inc=47&package=wd04&payment_plan=ann" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('imgOrder13','','../images/order.gif',1)"><img src="../images/order_rollover.gif" alt="Order Now" name="imgOrder13" width="44" height="12" border="0" id="imgOrder13"></a></div></td>
            <td bgcolor="#DFDFFF" style="border-bottom: 1px solid #666666;"><div align="center"><a href="?inc=47&package=wd05&payment_plan=ann" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('imgOrder14','','../images/order.gif',1)"><img src="../images/order_rollover.gif" alt="Order Now" name="imgOrder14" width="44" height="12" border="0" id="imgOrder14"></a></div></td>
          </tr>
        </table>
        <p align="justify"><em>Ordering any package or service constitutes your
          knowledge and agreement of this site's <a href="?inc=23">Terms and Agreements</a>.</em></p>
        <p align="justify"><strong><font color="#FF0000">*</font></strong> These
          are inital fees. More complicated development requests may cost more.
          All Business and Corporate Plans require a minimum of 50% deposit of
          your total cost prior to any development project initializing. Annual
          cost is your initial payment for creation of your web site. This will
          not be charged to you every year.</p>
        <p align="justify"><strong><font color="#FF0000">*</font></strong><strong><font color="#FF0000">*</font></strong>
          Training only applies to those customers in the Central Florida area
          and some other areas of Florida. Clients outside the state of Florida
          will be required to pay travel and lodging expenses to take advantage
          of the training feature. This may also apply to some Florida Clients
          as well.</p>
        <p align="center"><a href="#top">^ top</a></p>
        </td>
    </tr>
  </table>
</div>
<?php
function RunQuery($varQuery, $varWhich=0, $varWrite=0){
      #$varempty = money_format('%#4n',0.00);
      $varempty = 0.00;
      if ($varWhich == 1){
            # Find Set-Up Fee
            $sql=mysql_query("SELECT pl_sku,pl_assoc_sku
                  FROM ssd_pricelist
                  WHERE pl_sku = '$varQuery'")or die("Invalid Query: " . mysql_error());
            while ($dataset = mysql_fetch_row($sql)){
                  $varQuery = $dataset[1];
                  # The returned value is used below
            }
      }elseif($varWhich == 2){
            # Find Monthly Maintenance Fee
            $sql=mysql_query("SELECT pl_sku,pl_mon_maint
                  FROM ssd_pricelist
                  WHERE pl_sku = '$varQuery'")or die("Invalid Query: " . mysql_error());
            while ($dataset = mysql_fetch_row($sql)){
                  if ($varWrite == 1){
                        #$returnVar = money_format('%#4n', $dataset[1]);
                        $returnVar = $dataset[1];
                        return $returnVar;
                  }else{
                        #echo money_format('%#4n', $dataset[1]);
                        echo $dataset[1];
                        return;
                  }
            }
      }
      if ($varQuery != "none"){
            $sql = mysql_query("SELECT pl_sku,pl_price
                  FROM ssd_pricelist
                  WHERE pl_sku = '$varQuery'") or die("Invalid Query:" . mysql_error());
            while ($dataset = mysql_fetch_row($sql)){
                  if ($varWrite == 1){
                        #$returnVar = money_format('%#4n', $dataset[1]);
                        $returnVar = $dataset[1];
                        return $returnVar;
                  }else{
                        #echo money_format('%#4n', $dataset[1]);
                        echo $dataset[1];
                  }
            }
      }else{
            if ($varWrite == 1){
                  return $varempty;
            }else{
                  echo $varempty;
            }
      }
} # End Function

function FigureTotal($varMaintFee1, $varSetUpFee1, $varPkgPrice1, $varCost1, $varIncMaint1){
      if ($varIncMaint1 != 1){
            $varMaintFee1 = 0.00;
      }

      $TotalDue1 = ($varPkgPrice1 + $varSetUpFee1 + $varMaintFee1);
      
      if ($varCost1 == 1){
            $TotalDue1 = ($TotalDue1 / 2);
      }

      echo money_format('%#4n', $TotalDue1);
} # End Function
?>
0
 
LVL 2

Accepted Solution

by:
Lunchy earned 0 total points
ID: 10213657
PAQed, with points refunded (300)

Lunchy
Friendly Neighbourhood Community Support Admin
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now