Jump to content

DBookatay

Members
  • Posts

    334
  • Joined

  • Last visited

Posts posted by DBookatay

  1. I've been struggling with (what I thought was) a simple query, but I keep getting this error:

     

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '( logo, last_updated ) VALUES ( 'Default', '2008-19-11' )' at line 1

     

    The query is:

    if ($_POST['edit']) {
    
      $logo = $_POST['logo'];
      $updated = '20'.$_POST['lstUpdte3'].'-'.$_POST['lstUpdte2'].'-'.$_POST['lstUpdte1'];
    
    mysql_query("
    UPDATE Website SET (logo, last_updated) 
    VALUES ('$logo', '$updated')"
    )or die(mysql_error()); echo "<meta http-equiv=\"Refresh\" content=\"0; url=edit.php?category=Logos\">";}
    

     

    The query works with just the "logo", but once I add the "updated" values I throw an error. I've tried with the DB field as date and as varchar and continue to get the error.

     

    Anyone have any ideas?

  2. Hello,

     

    I have a script that uses a pulldown menu to send the user to the selected page. I use this script to "filter" items on the page:

    
    function faqRedirect(selectBox) {
    	var faqURL = selectBox.options[selectBox.selectedIndex].value
    		if (faqURL != "")
    	{
    		if (faqURL.substr(0, 4) != "http")
    			faqURL = "../" + faqURL
    		location.href = faqURL
    	}
    }
    
    <select id="filter" name="filter" onChange="faqRedirect(this)">
    <option value="search.php?cat=001&filter=yearDESC">Year: Newest First</option>
    <option value="search.php?cat=001&filter=yearASC">Year: Oldest First</option>
    <option value="search.php?cat=001&filter=priceDESC">Price: Highest First</option>
    <option value="search.php?cat=001&filter=priceASC">Price: Lowest First</option>
    <option value="search.php?cat=001&filter=milesASC">Mileage: Lowest First</option>
    <option value="search.php?cat=001&filter=milesDESC">Mileage: Highest First</option>
    </select>
    

     

     

    Question is: how do I modify the current java section of the script to write a cookie to remember the users selection the next time the page loads?

     

  3. I am looking for someone to build an image upload script that is similar to MySpace.com's for my used car dealerships website.

    I need it to be able to upload between 1 and 10 images at a time, place them into my dB, resize the large images to 365x274 and create a thumbnail 90x68.

     

    The only thing I don't need that MySpace offers is the ability to choose an album. Each upload will be specific to a certain vehicle, based on the stock number.

     

    Please email or PM with any questions, or with a quote...

     

    <b>Step 1:</b><br>

    MySpaceImage01.jpg<br>

    <b>Step 2:</b><br>

    MySpaceImage02.jpg<br>

    <b>Step 3:</b><br>

    MySpaceImage03.jpg<br>

  4. I am rewritting some of my pages to clean them up, and I noticed a display problem that only seems to happen in IE.

    I built an entire page, then split it into 2, header.php and index.php. When the pages are one whole code they display fine, but once I use: <? include ('include/page_files/header.php'); ?> IE puts a top margin on the site, which looks horrible... http://www.carcityofdanbury.com/index2.php

     

    If I put the 2 pages back togather again the problem goes away. I've tested the page in IE, FireFox and Safari, and IE is the only one with this stupid issue. Any ideas.

    body {
    	margin: 0px;
    padding: 0px;
    empty-cells: hide;
    }
    

     

  5. I am redoing the forms on my site and I keep getting an error.

    When a user submits a form on my site the script does 2 things, it inserts the values inti the dB, (for me to view) and sends the user an email at the same time.

     

    Everything works fine, except that I keep getting

    This is the Postfix program at host studebaker.dreamhost.com.
    
    I'm sorry to have to inform you that your message could not be be delivered to one or more recipients. It's attached below.
    
    For further assistance, please send mail to <postmaster>
    
    If you do so, please include this problem report. You can delete your own text from the attached returned message.
    
    		The Postfix program
    
    <unknown>: No recipients specified
    

    error, even though the email still gets sent...

    I've tried the form on several different email addresses, POP3's, Gmail, Yahoo, and AOL. All of which works, but I (the website admin) still gets the error email saying the the email didnt go through.

     

    Anyone have any ideas?

    Here is the code:

    								if ($_POST['infoRequest'] == "Send Request") {
    
    								$name = ($_POST['name']);
    								$subject = $vehicle.' Info Request';
    								$email = ($_POST['email']);
    								$phone = '('.$_POST['ph1'].') '.$_POST['ph2'].'-'.$_POST['ph3'];
    								if ($_POST['replyby'] == "Email") {
    									$response = $email;
    								} else {
    									$response = $phone;
    								}
    								$comments = stripslashes(ucfirst($_POST['comments']));
    								$now = date("Y/m/d");
    								$day = date("m").'/'.date("d").'/'.date("y");
    								$time = time(); $datetime = date("g:ia", $time + (10800));
    								$submitted = $date .' @ '. $datetime;
    								$requestQuery = mysql_query ("INSERT INTO Messages 
    									(recipient, `from`, status, subject, submitted)
    								VALUES 
    									('DBookatay', '$name', 'New', '$subject', '$now' )")
    								or die(mysql_error());  echo '<script language="JavaScript1.1">location.replace("view2.php?stock='.$stock.'&tab=InfoRequest#tabs");</script>';
    							}
    							if ($requestQuery) {
    								$to = $email;
    								$subject = "www.carcityofdanbury.com";
    								$headers = "MIME-Version: 1.0"."\r\n";
    								$headers .= "Content-type: text/html; charset=iso-8859-1"."\r\n";
    								//$headers .= "From: Info Request <brad@carcityofdanbury.com>"."\r\n";
    								$headers .="From: sales@carcityofdanbury.com\r\nReply-To: sales@carcityofdanbury.com";
    								$message = '<html xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><style>body {margin: 0px; padding: 0; empty-cells: hide; background-color: #ffffff;}table {border-collapse: collapse; border-spacing: 0;}td {padding: 0;	margin: 0px; font-family: Arial; font-size: 11px; color: #333333;}a {color: #0000ff; text-decoration: underline;}a:hover {color: #0000ff; text-decoration: none;}</style></head><body><table border="0" cellspacing="0" cellpadding="0" width="600" style="width: 6.25in; mso-cellspacing: 0in; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 0in 0in 0in" class="style1"><tr><td colspan="2"><a href="http://www.carcityofdanbury.com" target="_blank"><img border="0" width="600" height="100" src="http://www.carcityofdanbury.com/Email/header.gif" alt="Quality Used Cars, Trucks, Vans & SUV\'s"></a></td></tr><tr><td colspan="2"><img src="http://www.carcityofdanbury.com/images/Common/spacer.gif" width="1" height="10" border="0" /></td></tr><tr><td align="right" style="text-align: right; font-size: 11px; font-family: Arial; padding: 0 10 0 0" colspan="2">Submitted: <b>'.$submitted.'</b></td></tr><tr><td style="font-size: 20px; font-family: Arial; font-weight: bold; color: #ff0000" colspan="2">   Info Request</td></tr><tr><td width="30"> </td><td style="width: 570px"><table><tr><td width="325" valign="top" style="font-size: 12px; padding: 12 0 0 0">Thank you '.$_POST['name'].',<p>     We have received your request for additional information requarding our '.$vehicle.'and are happy to help you with any questions that you have.<p>     We will be glad to answer your questions:<p><b>"'.$comments.'"</b>, as soon as possible.<p>You should expect to recieve a response at '.$response.'.</td><td width="20"><img src="http://www.carcityofdanbury.com/images/Common/spacer.gif" width="20" height="1" border="0" /></td><td width="225">'.$emailPic.'</td></tr><tr><td width="550" colspan="3"><img src="http://www.carcityofdanbury.com/images/Common/spacer.gif" width="1" height="20" border="0" /></td></tr><tr><td width="325" valign="top"><table width="325" style="font-size:11px;"><tr><td style="height:25px; font-size:12px; color:#ffffff; background-color:#3C3C77" colspan="4"><b>    Vehicle Information</b></td></tr><tr height="25" style="font-size:11px;"><td width="10" rowspan="8"> </td><td width="190">    VIN:</td><td width="205"><b>'.$vin.'</b></td><td width="20" rowspan="8"> </td></tr><tr height="25" style="font-size:11px; background-color: #cccccc;"><td width="190" style="border-top: 1px solid #999999;">    Mileage:</td><td width="205" style="border-top: 1px solid #999999;"><b>'.$mileage.'</b></td></tr><tr height="25"><td width="190" style="border-top: 1px solid #999999;">    Engine:</td><td width="205" style="border-top: 1px solid #999999;"><b>'.$engine.'</b></td></tr><tr height="25" style="background-color: #cccccc;"><td width="190" style="border-top: 1px solid #999999;">    Transmission:</td><td width="205" style="border-top: 1px solid #999999;"><b>'.$trans.'</b></td></tr><tr height="25"><td width="190" style="border-top: 1px solid #999999;">    Drivetrain:</td><td width="205" style="border-top: 1px solid #999999;"><b>'.$drivetrain.'</b></td></tr><tr height="25" style="background-color: #cccccc;"><td width="190" style="border-top: 1px solid #999999;">    M.P.G.\'s:</td><td width="205" style="border-top: 1px solid #999999;">'.$emailGas.'</td></tr>'.$passengers.'<tr><td style="height:20px;" colspan="4">    </td></tr></table><table style="font-size:11px;"><tr><td style="height:25px; font-size:12px; color:#ffffff; background-color:#3C3C77" colspan="4"><b>    Warranty Information</b></td></tr><tr height="25"><td width="10" rowspan="8"> </td><td width="190">    <font color="#ff0000">Included Warranty:</font></td><td width="205"><b>'.$emailWarrIncld.'</b></td><td width="20" rowspan="8"> </td></tr>'.$emailExtnd.'</table></td><td width="20"><img src="http://www.carcityofdanbury.com/images/Common/spacer.gif" width="20" height="1" border="0" /></td>'.$spls.'</tr></table></td></tr><tr><td colspan="2"><img src="http://www.carcityofdanbury.com/images/Common/spacer.gif" width="1" height="20" border="0" /></td></tr><tr><td colspan="2" style="border-bottom: 1px solid #000000" align="center">    <a href="http://www.carcityofdanbury.com/search.php?vehMke=Saab"><img alt="Saab" src="http://www.carcityofdanbury.com/images/Logos/Saab.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Honda"><img alt="Honda" src="http://www.carcityofdanbury.com/images/Logos/Honda.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Oldsmobile"><img alt="Oldsmobile" src="http://www.carcityofdanbury.com/images/Logos/Oldsmobile.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Dodge"><img alt="Dodge" src="http://www.carcityofdanbury.com/images/Logos/Dodge.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Jeep"><img alt="Jeep" src="http://www.carcityofdanbury.com/images/Logos/Jeep.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Mazda"><img alt="Mazda" src="http://www.carcityofdanbury.com/images/Logos/Mazda.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Saturn"><img alt="Saturn" src="http://www.carcityofdanbury.com/images/Logos/Saturn.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Scion"><img alt="Scion" src="http://www.carcityofdanbury.com/images/Logos/Scion.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Kia"><img alt="Kia" src="http://www.carcityofdanbury.com/images/Logos/Kia.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Hyundai"><img alt="Hyundai" src="http://www.carcityofdanbury.com/images/Logos/Hyundai.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Audi"><img alt="Audi" src="http://www.carcityofdanbury.com/images/Logos/Audi.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Chrysler"><img alt="Chrysler" src="http://www.carcityofdanbury.com/images/Logos/Chrysler.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=GMC"><img alt="GMC" src="http://www.carcityofdanbury.com/images/Logos/GMC.gif" border="0"></a><br><a href="http://www.carcityofdanbury.com/search.php?vehMke=Lincoln"><img alt="Lincoln" src="http://www.carcityofdanbury.com/images/Logos/Lincoln.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Nissan"><img alt="Nissan" src="http://www.carcityofdanbury.com/images/Logos/Nissan.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Pontiac"><img alt="Pontiac" src="http://www.carcityofdanbury.com/images/Logos/Pontiac.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Ford"><img alt="Ford" src="http://www.carcityofdanbury.com/images/Logos/Ford.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Lexus"><img alt="Lexus" src="http://www.carcityofdanbury.com/images/Logos/Lexus.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Acura"><img alt="Acura" src="http://www.carcityofdanbury.com/images/Logos/Acura.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Toyota"><img alt="Toyota" src="http://www.carcityofdanbury.com/images/Logos/Toyota.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Volkswagen"><img alt="Volkswagen" src="http://www.carcityofdanbury.com/images/Logos/VW.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=BMW"><img alt="BMW" src="http://www.carcityofdanbury.com/images/Logos/BMW.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Subaru"><img alt="Subaru" src="http://www.carcityofdanbury.com/images/Logos/Subaru.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Buick"><img alt="Buick" src="http://www.carcityofdanbury.com/images/Logos/Buick.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Chevrolet"><img alt="Chevrolet" src="http://www.carcityofdanbury.com/images/Logos/Chevy.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Infiniti"><img alt="Infiniti" src="http://www.carcityofdanbury.com/images/Logos/Infiniti.gif" border="0"></a>  <a href="http://www.carcityofdanbury.com/search.php?vehMke=Mitsubishi"><img alt="Mitsubishi" src="http://www.carcityofdanbury.com/images/Logos/Mitsubishi.gif" border="0"></a></td></tr><tr><td colspan="2"><table><tr><td><img src="http://www.carcityofdanbury.com/images/Common/spacer.gif" width="10" height="1" border="0" /></td><td style="font-size: 9px; color: #999999;"><br />This message and any attachment(s) are intended solely for use by the addressee and may contain information that is privileged, confidential or otherwise exempt from disclosure under applicable law. If you are not the intended recipient or agent thereof responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.<p>If you have received this communication in error, please notify the sender immediately with a \'reply\' message.<br />Thank you for your co-operation.</td><td><img src="http://www.carcityofdanbury.com/images/Common/spacer.gif" width="10" height="1" border="0" /></td></tr></table></td></tr></table></body></html>';							
    							}
    							if (mail($to, $subject, $message, $headers))
    

  6. How do you do an include where it is already in php?

    Meaning:

    if ($_GET['tab'] == "TestDrive"){
    $show = '
    <table class="ftrHldr">
       <tr>
          <td valign="top"><div class="specHdr">Affordability Calculator</div><? include ('include/page_files/affordability_calculator.php'); ?></td>
       </tr>
    </table>';
    }
    

  7. Here is a good/basic example:

    http://www.w3schools.com/js/js_form_validation.asp

     

    You will find that they use an onSubmit for the entire form.  Remove that, and simply do an onChange, to validate the field as they leave it.  When the entire form validates properly you can update your submit button. 

     

    Hint: You can use disabled on the button: <input id="submitButton" type="submit" disable="true"> -- When it validates use: document.getElementbyId('submitButton').disable="false";

     

    Best, Nathan

     

    Thanks for the lead... After reading your post I found this script: http://www.javascriptkit.com/javatutors/deform4.shtml which is exactly what I was trying to do...

  8. I posted a question on the board the other night and can't get an answer, (http://www.phpfreaks.com/forums/index.php/topic,189933.0.html) so I am willing to pay someone to get the job done for me. Sorry if this is in the wrong section, but unlike the php section there is not a forum for "For Hire."

     

    What I need is someone to program a calculator for me, based on the values that a user inputs. Simaliar to the MSN Auto calculator (http://autos.msn.com/loancalc/newloan.aspx) with a few extra inputs.

     

    The layout and fields I want are located here: http://www.carcityofdanbury.com/view2.php?stock=16142 Click the "Affordability" tab...

     

    Please email or PM me with a price to do the job...

  9. I posted a question on the board the other night and can't get an answer, (http://www.phpfreaks.com/forums/index.php/topic,189933.0.html) so I am willing to pay someone to get the job done for me. Sorry if this is in the wrong section, but unlike the php section there is not a forum for "For Hire."

     

    What I need is someone to program a calculator for me, based on the values that a user inputs. Simaliar to the MSN Auto calculator (http://autos.msn.com/loancalc/newloan.aspx) with a few extra inputs.

     

    The layout and fields I want are located here: http://www.carcityofdanbury.com/view2.php?stock=16142 Click the "Affordability" tab...

     

    Please email or PM me with a price to do the job...

  10. Can someone please help?

     

    I completely forgot to include the code:

    <script language="javascript">
    
    var g_fRateStep = 0.05; // The smallest amount the interest rate can be modified by
    var g_nRateMultiple = 120;
    var g_nTermMultiple = 5;
    var g_strMonthly = 0; // Used by UpdateTotalCost (so that we don't need to interrogate the UI when the Monthly Payment is the target value)
    var g_fPurchasePrice = 0;
    
    
    // Install event handlers...
    window.onload = OnFormLoad;
    
    
    function OnFormLoad(event)
        {
        UpdateTargetValue();
        document.LoanCalcForm.elements[2].focus();
        }
    
    
    function OnResize(event)
        {
        document.location.reload(false);
        }
    
    
    function UpdateTargetValue()
        {
        
    	UpdateMonthly();
    
        }
    
    
    function FormatCurrency(strValue)
        {
        var strDecimalSeparator = '.';
        var strThousandSeparator = ',';
        var nPos = strValue.indexOf('.');
        var nLen = parseInt(strValue, 10).toString().length;
    
        if (nPos > 0)
            strValue = strValue.substr(0, nPos) + strDecimalSeparator + strValue.substr(nPos + 1, strValue.length - nPos);
        else
            nPos = strValue.length;
    
        while (nLen > 3)
            {
            nPos -= 3;
            strValue = strValue.substr(0, nPos) + strThousandSeparator + strValue.substr(nPos, strValue.length - nPos + 1);
            nLen -= 3;
            }
    
        return '$' + strValue;
        }
    
    
    function ChangeCalcType(strType)
        {
        var strExtra;
        
        if (strType == 'monthly')
            {
            
            return;
            
            strExtra = '&price=' + g_fPurchasePrice.toString();
            }
        else
            {
            
            strExtra = '&pmt=' + (Math.round(g_strMonthly)).toString();
            }
            
        location.href='/loancalc/newloan.aspx?calc=' + strType + '&dp=' + (document.LoanCalcForm.elements[2].value).toString() + '&trm=' + g_nTermMultiple.toString() + '&int=' + g_nRateMultiple.toString() + strExtra;   
        }
    
    
    function UpdateTotalCost()
        {
        var nDownPayment = isNaN(parseInt(document.LoanCalcForm.elements[2].value, 10)) ? 0 : parseInt(document.LoanCalcForm.elements[2].value, 10);
        var nTerm = g_nTermMultiple * 12;
        
    	var fMonthlyPayment = parseFloat(g_strMonthly);
        
        var fTotalCost = parseFloat(parseInt(nDownPayment, 10) + (fMonthlyPayment * nTerm));
    
        fTotalCost = Math.round(fTotalCost);
    
        
    	document.all.TotalCost.innerHTML = '<span class="bignum"><nobr>' + FormatCurrency(fTotalCost.toString()) + '</nobr></span>';
        
        }
    
    
    function UpdatePrice()
        {
        var fRate = g_nRateMultiple * g_fRateStep;
        var nTerm = g_nTermMultiple * 12;
        var nDownPayment = isNaN(parseInt(document.LoanCalcForm.elements[2].value, 10)) ? 0 : parseInt(document.LoanCalcForm.elements[2].value, 10);
        var nPayment = isNaN(parseInt(document.LoanCalcForm.elements[3].value, 10)) ? 0 : parseInt(document.LoanCalcForm.elements[3].value, 10);
        var fMonthlyRate = (fRate * 0.01) / 12.0;
        var fPower = Math.pow(1.0 + fMonthlyRate, -nTerm);
        var fPrice = parseInt((fMonthlyRate == 0 ? ((nPayment * nTerm) + nDownPayment) :
                                                    ((nPayment * ((1.0 - fPower) / fMonthlyRate)) + nDownPayment)), 10);
    
        
        g_fPurchasePrice = fPrice;
    
        
    	document.all.Price.innerHTML = '<span class="bignum"><nobr>' + FormatCurrency(parseInt(fPrice, 10).toString()) + '</nobr></span>';
        
        UpdateTotalCost();
        }
    
    
    function UpdateMonthly()
    {
        var fRate = g_nRateMultiple * g_fRateStep;
        var nTerm = g_nTermMultiple * 12;
        var nDownPayment = isNaN(parseInt(document.LoanCalcForm.elements[2].value, 10)) ? 0 : parseInt(document.LoanCalcForm.elements[2].value, 10);
        var nPrice = isNaN(parseInt(document.LoanCalcForm.elements[3].value, 10)) ? 0 : parseInt(document.LoanCalcForm.elements[3].value, 10);
    
        if (nDownPayment > nPrice) nDownPayment = nPrice;
        
        var fMonthlyRate = (fRate * 0.01) / 12.0;
        var fPower = Math.pow(1.0 + fMonthlyRate, -nTerm);
        var fMonthly = (fPower == 1.0 ? (nPrice - nDownPayment) / nTerm :
    					            (nPrice - nDownPayment) * (fMonthlyRate / (1.0 - fPower))) ;
    
        if(fMonthly.toString().substr(0, 1) == '.')
            fMonthly = '0' + fMonthly.toString();
    
        
    	g_strMonthly = parseInt(fMonthly, 10).toString() + (Math.round((fMonthly - parseInt(fMonthly, 10)) * 100) / 100).toString().substr(1, 3);
    	if ((g_strMonthly.toString().indexOf('.', 0) > 0) && (g_strMonthly.toString().length - g_strMonthly.toString().indexOf('.', 0) == 2))
    		g_strMonthly = g_strMonthly.toString() + '0';
    	document.all.Monthly.innerHTML = '<span class="bignum"><nobr>' + FormatCurrency(g_strMonthly) + '</nobr></span>';
        
    
        UpdateTotalCost();
        }
    
    
    function UpdateRate(bDoUpdate)
        {
        with (document.LoanCalcForm.elements[4])
            {
            var fTemp = options[selectedIndex].value / 0.05;
            
            g_nRateMultiple = fTemp;
            if (g_nRateMultiple - parseInt(fTemp) > 0) 
                g_nRateMultiple = parseInt(g_nRateMultiple) + 1;
            }
        if (bDoUpdate)
            UpdateTargetValue();
        }
    
    
    function UpdateTerm(bDoUpdate)
        {
        with (document.LoanCalcForm.elements[5])
            {
            var fTemp = options[selectedIndex].value / 12;
    
            g_nTermMultiple = fTemp;
            if (g_nTermMultiple - parseInt(fTemp) > 0) 
                g_nTermMultiple = parseInt(g_nTermMultiple) + 1;
            }
        if (bDoUpdate)
            UpdateTargetValue();
        }
    
    
    function ValidKey(nKeyCode, bShift, bCTRL)
        {
        if (nKeyCode != 37 &&                  // Left cursor
            nKeyCode != 39 &&                  // Right cursor
            nKeyCode != 8  &&                  // Backspace
            nKeyCode != 9  &&                  // Tab
    	nKeyCode != 46 &&                  // Delete
            nKeyCode != 16 &&                  // Shift
            nKeyCode != 35 &&                  // End
            nKeyCode != 36 &&                  // Home
            (nKeyCode < 48 || nKeyCode > 57))  // 0 - 9
            return false;
        else
            return true;
        }
    
    
    function Validate()
        {
    	var nKeyCode = window.event.keyCode;
    	var bShift = window.event.shiftKey;
    	var bCTRL = window.event.ctrlKey;
        
    
        if (!ValidKey(nKeyCode, bShift, bCTRL))
            return false;
        else
            return true; 
        }
    
    
    function UpdateDownPayment()
        {
        
        var nDownPayment = isNaN(parseInt(document.LoanCalcForm.elements[2].value, 10)) ? 0 : parseInt(document.LoanCalcForm.elements[2].value, 10);
        var nPurchasePrice = parseInt(document.LoanCalcForm.elements[3].value, 10);
    
        UpdateMonthly();
        
        }
    
    
    function Update()
        {
        
        var nDownPayment = parseInt(document.LoanCalcForm.elements[2].value, 10);
        var nPurchasePrice = parseInt(document.LoanCalcForm.elements[3].value, 10);
        
        UpdateMonthly();
        
        }
    
    </script>
    
    

     

     

  11. I found (ok ok, stole) a finance calculator script from MSN Auto http://autos.msn.com/loancalc/newloan.aspx, (Bill Gates stole from everyone else, it's just a little payback...) and need to add new fields to it to use form my application. Can someone please help?

     

    I want to add:

          Additional months: 30 and 54, but the script will not allow it

          Sales tax: 1 of 4 percentages: 6.000%, 7.375%, 8.125% or 8.375% (which the user would select based by an <select name="calcTax"></select>)

          Registration: 1 of 6 choices: $45, $60, $85, $120, $160, $210 (again controlled by <select name="calcReg"></select>)

     

    Can someone with java experience please help me with this, it would be greately apprechiated...

  12. I have a query (if a vehicle in inventory gets sold) the when it runs it takes a few items from one table ("Inventory") and moves them to a different table ("Sold") and then deletes the row in "Inventory". In my "Inventory" table there are 10 fields: "pic1" - "pic10" which none are required, but more so than not are all usually used, meaning there are 10 pictures of the vehicle.

     

    I use an image upload script that uploads the images, places them in a folder, creates a thumbnail in a seperate thumbnail folder, and adds the name of the image to the proper field.

     

    Is there a way to now reverse the process? Meaning that if I run my query (code below) and mark the vehicle sold, if any of the 10 fileds has a listing in it, it will delete the actual image from the folder? Can this easily be done?

     

    Here is the 2 queries to mark a vehicle sold:

    if (isset($_POST['sold'])) {
       $insertQuery = mysql_query("INSERT INTO Sold (stock, vin, year, make, model, trim, body, color, mileage)
       VALUES ('$stock', '$veh_VIN', '$veh_Year', '$veh_Mke', '$veh_Mdl',  '$veh_Trm', '$veh_Bdy', '$veh_color', '$veh_Mls')") or die(mysql_error()); echo "<meta http-equiv=\"Refresh\" content=\"0; url=list.php?category=001\">";}
    
    
    // Delete Vehicle (When Marked Sold)
    if ($insertQuery) {$query = "DELETE FROM Inventory where stock = '{$_POST['stock']}'"; $result = mysql_query($query);}
    
    

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