Jump to content

Form that calculates States and price in PHP


JimKI

Recommended Posts

I need help this form was already created and now I want to be able to calculate the amount of states checked off times prices and then total it there are prices for 1-9 states and 10-24 states the 25-52 and there is also a logo price. I tried to figure it out and below is my code 1st part is the form and the second part is processing code for the new part whic is calculating the amount states and a log with a price and getting a total that will be brought over to paypal.Form<?php print "\n<!-- begin " . __FILE__ . " -->\n" ; global $lowerStateCode; // Pick list of B2B categories require_once($_SERVER['DOCUMENT_ROOT'] . '/8.0/lib/_b2b_svc_types_array.php')?> <div id="netFormTitle">Biz Partners Referral Registration</div> <div class="blockSubtitle netTextColor">Promote Your Business-to-Business Product and Services</div> <div>Leverage the BUZGate business-to-business referral network to generate leads and increase sales among small and medium-sized business. An interactive listing is less than $8.00 per month, per state.</div> <div>Use the form below to choose what state(s) you want your listing to appear in and our marketing team will publish your business information and email you for content/link confirmation. </div> <div><strong> Pricing:</strong> $89.95 per state per year, plus $29.95 w/logo. Multiple state discounts available.</div> <div><span class="bold">*</span>Required Fields are marked with an asterisk and highlighted</div> <div id="registerFH"> <form action="orderprocess.php <?php ($_SERVER['QUERY_STRING'])? print $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'] : print $_SERVER['PHP_SELF'] ; ?>" method="POST" name="dgf" onsubmit="return validateForm(this,requiredTextFields,requiredSelectFields,requiredCheckboxFields);"> <fieldset><legend>Contact and Listing Information</legend> <br/><div class="fhFormLeft2"> <!-- HACK: HAD TO USE MARGIN TOP, VERTICAL-ALIGN:MIDDLE; DOESN'T WORK --> <label for="dgfCategory" class="dgfLabel">*Industry Category</label> </div> <div class="fhFormRight2"> <select name="dgfCategory" id="dgfCategory" value="<?php print $dgfCategory; ?>" class="required"> <?php $b2bCategories = $b2b_types_short; asort($b2bCategories); // use custom sort algorithm from lib main #$sortedList = array_sort($b2bCategories,1); //if ($sortedList) print 'true'; $optionList = ''; foreach ($b2bCategories as $k => $v) { $optionList .= '<option value="' . $k . '"'; $optionList .= (strtolower($k)==strtolower($_POST['dgfCategory']))? ' selected="selected" ':''; $optionList .= '>' . $v . '</option>'. "\n"; } #$optionList = makeOptionsListFromArray($b2bCategories, $_POST['dgfCategory'] ); print ($optionList); ?> </select> <?php #print_r($b2bCategories); ?> <!-- reuse this for 'other' <input type="text" name="dgfCategory" id="dgfCategory" value="<?php print $dgfCategory; ?>" size="40" maxlength="100" class="required" /> --> </div> <br clear="all" /> <div class="fhFormLeft2"> <label for="dgfCompanyName" class="dgfLabel">*Company Name</label> <?php print $dgfError['dgfCompanyName'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfCompanyName" id="dgfCompanyName" value="<?php print $dgfCompanyName; ?>" size="40" maxlength="100" onfocus="statusBarMsg('What is your Company?');" onblur="window.status='';" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfAddress1" class="dgfLabel">*Address 1</label> <?php print $dgfError['dgfAddress1'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfAddress1" id="dgfAddress1" value="<?php print $dgfAddress1; ?>" size="40" maxlength="50" onfocus="statusBarMsg('What is your Address?');" onblur="window.status='';" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfAddress2" class="dgfLabel">Address 2</label> <?php print $dgfError['dgfAddress2'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfAddress2" id="dgfAddress2" value="<?php print $dgfAddress2; ?>" size="40" maxlength="50" onfocus="statusBarMsg('Enter additional address information if needed.');" onblur="window.status='';" /> </div> <div class="fhFormLeft2"> <label for="dgfCity" class="dgfLabel">*City</label> <?php print $dgfError['dgfCity'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfCity" id="dgfCity" value="<?php print $dgfCity; ?>" size="40" maxlength="50" onfocus="statusBarMsg('What is your city?');" onblur="window.status='';" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfState" class="dgfLabel">*State</label> <?php print $dgfError['dgfState'] ; ?> </div> <div class="fhFormRight2"> <select name="dgfState" id="dgfState" size="1" onfocus="statusBarMsg('Choose \'other\' if not applicable.')" onblur="window.status='';" class="required"> <?php $stateList = file2Array($_SERVER['DOCUMENT_ROOT'] . '/8.0/lib/forms/_codes_50states.txt',':::'); asort($stateList); $stateOptions = makeOptionsListFromArray($stateList, $GLOBALS['stateCode']); print $stateOptions; ?> </select> </div> <div class="fhFormLeft2"> <label for="dgfZip" class="dgfLabel">*Zip/Postal Code</label> <?php print $dgfError['dgfZip'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfZip" id="dgfZip" value="<?php print $dgfZip; ?>" size="10" maxlength="15" onfocus="statusBarMsg(sWorldPostalCode)" onblur="window.status='';" onchange="if(!isZIPCode(stripCharsInBag(this.value, ZIPCodeDelimiters))){checkPostalCode(this, false)};" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfWebAddress" class="dgfLabel">Web Address:</label> <?php print $dgfError['dgfWebAddress'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfWebAddress" id="dgfWebAddress" value="<?php if (empty($dgfWebAddress)) {print 'http://';} else {print $dgfWebAddress;} ?>" size="40" onfocus="statusBarMsg('If more than one, you can enter multiple addresses separated by commas.')" onblur="window.status='';" > </div> <div class="fhFormLeft2"> <label for="dgfFirstName" class="dgfLabel">*First Name</label> <?php print $dgfError['dgfFirstName'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfFirstName" id="dgfFirstName" value="<?php print $dgfFirstName; ?>" size="40" maxlength="50" onchange="if(isItEmpty(this.value)) { alertMsg(this.form.name,this.name,'Please tell us your first name (given name).');}" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfLastName" class="dgfLabel">*Last Name</label> <?php print $dgfError['dgfLastName'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfLastName" id="dgfLastName" value="<?php print $dgfLastName; ?>" size="40" maxlength="50" onchange="if(isItEmpty(this.value)) { alertMsg(this.form.name, this.name, 'Please tell us your last name (family name).');}" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfTitle" class="dgfLabel">Title</label> <?php print $dgfError['dgfTitle'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfTitle" id="dgfTitle" value="<?php print $dgfTitle; ?>" size="40" maxlength="50" /> </div> <div class="fhFormLeft2"> <label for="dgfEmail" class="dgfLabel">*Email</label> <?php print $dgfError['dgfEmail'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfEmail" id="dgfEmail" value="<?php print $dgfEmail; ?>" size="40" maxlength="50" onfocus="statusBarMsg('Please enter your work email address.')" onblur="window.status='';" onchange="checkEmail(this,false);" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfPhoneBiz" class="dgfLabel">*Business Phone</label> <?php print $dgfError['dgfPhoneBiz'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfPhoneBiz" id="dgfPhoneBiz" value="<?php print $dgfPhoneBiz; ?>" size="15" maxlength="30" onfocus="statusBarMsg('Enter a 10-digit US phone, or an International phone number starting with +.')" onblur="window.status='';" onchange="normalizedPhone = stripCharsInBag (this.value, phoneNumberDelimiters); if (isUSPhoneNumber (normalizedPhone, false)) { this.value = reformatUSPhone (normalizedPhone); }" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfPhoneFax" class="dgfLabel">Fax</label> <?php print $dgfError['dgfPhoneFax'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfPhoneFax" id="dgfPhoneFax" value="<?php print $dgfPhoneFax; ?>" size="15" onfocus="statusBarMsg('Enter a 10-digit US phone, or an International phone number starting with +.')" onblur="window.status='';" onchange="normalizedPhone = stripCharsInBag (this.value, phoneNumberDelimiters); if (isUSPhoneNumber (normalizedPhone, false)) { this.value = reformatUSPhone (normalizedPhone); }" maxlength="30" /> </div> </fieldset> <div>Briefly describe your business offerings. This information will be used as a reference by our professional marketing team to create the interactive listing copy.</div> <div> <label for="dgfComments" class="dgfLabel"> *Description<br />(limit 1,000 words)<br /> <textarea name="dgfComments" id="dgfComments" onfocus="statusBarMsg('Additional Comments')" onblur="window.status='';" rows="3" cols="60" onchange="limitWords(this.form.dgfComments, 1000);" class="required"><?php print $dgfComments ; ?> </textarea> </label> </div> <div> Pricing per State:<br/> $89.95 per state up to 9 states<br/> $59.95 per state up to 24 states<br/> 24 and national listings (All 50 states plus DC and Puerto Rico), $39.95 per state </p> </div> <div> <fieldset class="required"> <legend>*Check State(s) Served</legend> <table border="0" cellpadding="0"> <tr> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="AK" /> AK<br /> <input type="checkbox" name="dgfRegion[]" value="AL" /> AL<br /> <input type="checkbox" name="dgfRegion[]" value="AR" /> AR<br /> <input type="checkbox" name="dgfRegion[]" value="AZ" /> AZ<br /> <input type="checkbox" name="dgfRegion[]" value="CA" /> CA</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="CO" /> CO<br /> <input type="checkbox" name="dgfRegion[]" value="CT" /> CT<br /> <input type="checkbox" name="dgfRegion[]" value="DC" /> DC<br /> <input type="checkbox" name="dgfRegion[]" value="DE" /> DE<br /> <input type="checkbox" name="dgfRegion[]" value="FL" /> FL</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="GA" /> GA<br /> <input type="checkbox" name="dgfRegion[]" value="HI" /> HI<br /> <input type="checkbox" name="dgfRegion[]" value="IA" /> IA<br /> <input type="checkbox" name="dgfRegion[]" value="ID" /> ID<br /> <input type="checkbox" name="dgfRegion[]" value="IL" /> IL</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="IN" /> IN<br /> <input type="checkbox" name="dgfRegion[]" value="KS" /> KS<br /> <input type="checkbox" name="dgfRegion[]" value="KY" /> KY<br /> <input type="checkbox" name="dgfRegion[]" value="LA" /> LA<br /> <input type="checkbox" name="dgfRegion[]" value="MA" /> MA</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="MD" /> MD<br /> <input type="checkbox" name="dgfRegion[]" value="ME" /> ME<br /> <input type="checkbox" name="dgfRegion[]" value="MI" /> MI<br /> <input type="checkbox" name="dgfRegion[]" value="MN" /> MN<br /> <input type="checkbox" name="dgfRegion[]" value="MO" /> MO</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="MS" /> MS<br /> <input type="checkbox" name="dgfRegion[]" value="MT" /> MT<br /> <input type="checkbox" name="dgfRegion[]" value="NC" /> NC<br /> <input type="checkbox" name="dgfRegion[]" value="ND" /> ND<br /> <input type="checkbox" name="dgfRegion[]" value="NE" /> NE</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="NH" /> NH<br /> <input type="checkbox" name="dgfRegion[]" value="NJ" /> NJ<br /> <input type="checkbox" name="dgfRegion[]" value="NM" /> NM<br /> <input type="checkbox" name="dgfRegion[]" value="NV" /> NV<br /> <input type="checkbox" name="dgfRegion[]" value="NY" /> NY</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="OH" /> OH<br /> <input type="checkbox" name="dgfRegion[]" value="OK" /> OK<br /> <input type="checkbox" name="dgfRegion[]" value="OR" /> OR<br /> <input type="checkbox" name="dgfRegion[]" value="PA" /> PA<br /> <input type="checkbox" name="dgfRegion[]" value="PR" /> PR</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="RI" /> RI<br /> <input type="checkbox" name="dgfRegion[]" value="SC" /> SC<br /> <input type="checkbox" name="dgfRegion[]" value="SD" /> SD<br /> <input type="checkbox" name="dgfRegion[]" value="TN" /> TN<br /> <input type="checkbox" name="dgfRegion[]" value="TX" /> TX</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="UT" /> UT<br /> <input type="checkbox" name="dgfRegion[]" value="VA" /> VA<br /> <input type="checkbox" name="dgfRegion[]" value="VT" /> VT<br /> <input type="checkbox" name="dgfRegion[]" value="WA" /> WA<br /> <input type="checkbox" name="dgfRegion[]" value="WI" /> WI</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="WV" /> WV<br /> <input type="checkbox" name="dgfRegion[]" value="WY" /> WY</p></td> </tr> </table> </fieldset> </div> <div> <input type="checkbox" name="logo" id="logo" /> Check box if to include optional logo placement $24.95 per year</div> <label>Your total States = </label><input name="totalProducts" type="text" value="" maxlength="18" /> <br /> <label>Your total order = </label><input name="total" type="text" value="" maxlength="12" /> <br /> <div class="fhFormLeft2"><label for="dgfSecureCode" class="dgfLabel">*Anti-Spam code</label> <?php print $dgfError['dgfSecureCode'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfSecureCode" id="dgfSecureCode" value="" size="6" maxlength="6" class="required" onChange="if(isItEmpty(this.value)) {alertMsg(this.form.name,this.name,'Please enter the anti-spam code to submit this form.');}"> <?php if ($_SESSION['secureImages'] > '') { print '  ' . $_SESSION['secureImages']; } ?> <br /> </div> <div> <br /><br /> </div> <div> <label for="dgfCC" class="dgfLabel"> <input type="checkbox" name="dgfCC" id="dgfCC" value="sentCarbonCopy" checked> Check here to receive a copy of this form (at the above email address). </label> </div> <div> <label for="dgfReset" class="dgfLabel"> <input type="reset" name="dgfReset" id="dgfReset" value="Clear" /> </label> <input name="dgfAction" type="hidden" value="processForm" /> <label for="dgfSubmit" class="dgfLabel"> <input type="submit" name="dgfSubmit" id="dgfSubmit" value="Submit Form" /> </label> </div></form></div>****2nd part<?php $totalProducts = count($_post['dgfRegion']);$productPrice = 89.95;$discountfor10to24 = 30.00;$discountfor25to52 = 50.00;$discount = ($totalProducts = 10 && $totalProducts < 25) ? $discountfor10to24 : (($totalProducts > 24) ? $discountfor25to52 : 0);$total = ($productPrice * $totalProducts) - $discount;?>

Link to comment
Share on other sites

<?$num_st_checked=sizeof($_POST['dgfRegion']);switch (TRUE) {	case $num_st_checked<=9: // if less than /or equal to 9		echo "you chose ".$num_st_checked. "states .", this means a price of XXX";		break;	case $num_st_checked<=24: //if less than /or equal to 24 (but more than 9)		echo "you chose ".$num_st_checked. "states .", this means a price of XXX";		break;	case $num_st_checked<=52: //if less than /or equal to 52 (but more than 24)		echo "you chose ".$num_st_checked. "states .", this means a price of XXX this is the supper promo";		break;}?>

something like the above

Link to comment
Share on other sites

maybe something like this, building upon the switch statement

$totalStates = count($_POST['dgfRegion']);switch ($totalStates) {	case $totalStates<=9:		$productPrice = 89.95;		break;	case $totalStates<=24:		$productPrice = 30.00;		break;	case $num_st_checked<=52:		$productPrice = 50.00;		break;	default:		$productPrice = 89.95;};$total = ($productPrice * $totalProducts);echo "You chose " . $totalStates . " states.  This comes to a product price of $" . $productPrice;echo "<br>";echo "Your total is: " . $total; ?>

Link to comment
Share on other sites

the real problem I am having is how to implament the code without messing up what currenly works for forms imake i usually have an html page and the php page this is the only page with the form on it the post make it show up so how do I added the new code to the existing code do I have to have two forms one that already exists and a new one so my new code for the states and logo pricing work?

Link to comment
Share on other sites

This is the Php for the form it still won't add the selections and total but some how it is able to put a 1 in the product box and $59.95 in the total but for 1 Item it is 89.95 so that isn't even correct. Help<?php print "\n<!-- begin " . __FILE__ . " -->\n" ; global $lowerStateCode; // Pick list of B2B categories require_once($_SERVER['DOCUMENT_ROOT'] . '/8.0/lib/_b2b_svc_types_array.php')?> <div id="netFormTitle">Biz Partners Referral Registration</div> <div class="blockSubtitle netTextColor">Promote Your Business-to-Business Product and Services</div> <div>Leverage the BUZGate business-to-business referral network to generate leads and increase sales among small and medium-sized business. An interactive listing is less than $8.00 per month, per state.</div> <div>Use the form below to choose what state(s) you want your listing to appear in and our marketing team will publish your business information and email you for content/link confirmation. </div> <div><strong> Pricing:</strong> $89.95 per state per year, plus $29.95 w/logo. Multiple state discounts available.</div> <div><span class="bold">*</span>Required Fields are marked with an asterisk and highlighted</div> <div id="registerFH"> <form action=" <?php ($_SERVER['QUERY_STRING'])? print $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'] : print $_SERVER['PHP_SELF'] ; ?>" method="POST" name="dgf" onsubmit="return validateForm(this,requiredTextFields,requiredSelectFields,requiredCheckboxFields);"> <fieldset><legend>Contact and Listing Information</legend> <br/><div class="fhFormLeft2"> <!-- HACK: HAD TO USE MARGIN TOP, VERTICAL-ALIGN:MIDDLE; DOESN'T WORK --> <label for="dgfCategory" class="dgfLabel">*Industry Category</label> </div> <div class="fhFormRight2"> <select name="dgfCategory" id="dgfCategory" value="<?php print $dgfCategory; ?>" class="required"> <?php $b2bCategories = $b2b_types_short; asort($b2bCategories); // use custom sort algorithm from lib main #$sortedList = array_sort($b2bCategories,1); //if ($sortedList) print 'true'; $optionList = ''; foreach ($b2bCategories as $k => $v) { $optionList .= '<option value="' . $k . '"'; $optionList .= (strtolower($k)==strtolower($_POST['dgfCategory']))? ' selected="selected" ':''; $optionList .= '>' . $v . '</option>'. "\n"; } #$optionList = makeOptionsListFromArray($b2bCategories, $_POST['dgfCategory'] ); print ($optionList); ?> </select> <?php #print_r($b2bCategories); ?> <!-- reuse this for 'other' <input type="text" name="dgfCategory" id="dgfCategory" value="<?php print $dgfCategory; ?>" size="40" maxlength="100" class="required" /> --> </div> <br clear="all" /> <div class="fhFormLeft2"> <label for="dgfCompanyName" class="dgfLabel">*Company Name</label> <?php print $dgfError['dgfCompanyName'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfCompanyName" id="dgfCompanyName" value="<?php print $dgfCompanyName; ?>" size="40" maxlength="100" onfocus="statusBarMsg('What is your Company?');" onblur="window.status='';" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfAddress1" class="dgfLabel">*Address 1</label> <?php print $dgfError['dgfAddress1'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfAddress1" id="dgfAddress1" value="<?php print $dgfAddress1; ?>" size="40" maxlength="50" onfocus="statusBarMsg('What is your Address?');" onblur="window.status='';" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfAddress2" class="dgfLabel">Address 2</label> <?php print $dgfError['dgfAddress2'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfAddress2" id="dgfAddress2" value="<?php print $dgfAddress2; ?>" size="40" maxlength="50" onfocus="statusBarMsg('Enter additional address information if needed.');" onblur="window.status='';" /> </div> <div class="fhFormLeft2"> <label for="dgfCity" class="dgfLabel">*City</label> <?php print $dgfError['dgfCity'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfCity" id="dgfCity" value="<?php print $dgfCity; ?>" size="40" maxlength="50" onfocus="statusBarMsg('What is your city?');" onblur="window.status='';" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfState" class="dgfLabel">*State</label> <?php print $dgfError['dgfState'] ; ?> </div> <div class="fhFormRight2"> <select name="dgfState" id="dgfState" size="1" onfocus="statusBarMsg('Choose \'other\' if not applicable.')" onblur="window.status='';" class="required"> <?php $stateList = file2Array($_SERVER['DOCUMENT_ROOT'] . '/8.0/lib/forms/_codes_50states.txt',':::'); asort($stateList); $stateOptions = makeOptionsListFromArray($stateList, $GLOBALS['stateCode']); print $stateOptions; ?> </select> </div> <div class="fhFormLeft2"> <label for="dgfZip" class="dgfLabel">*Zip/Postal Code</label> <?php print $dgfError['dgfZip'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfZip" id="dgfZip" value="<?php print $dgfZip; ?>" size="10" maxlength="15" onfocus="statusBarMsg(sWorldPostalCode)" onblur="window.status='';" onchange="if(!isZIPCode(stripCharsInBag(this.value, ZIPCodeDelimiters))){checkPostalCode(this, false)};" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfWebAddress" class="dgfLabel">Web Address:</label> <?php print $dgfError['dgfWebAddress'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfWebAddress" id="dgfWebAddress" value="<?php if (empty($dgfWebAddress)) {print 'http://';} else {print $dgfWebAddress;} ?>" size="40" onfocus="statusBarMsg('If more than one, you can enter multiple addresses separated by commas.')" onblur="window.status='';" > </div> <div class="fhFormLeft2"> <label for="dgfFirstName" class="dgfLabel">*First Name</label> <?php print $dgfError['dgfFirstName'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfFirstName" id="dgfFirstName" value="<?php print $dgfFirstName; ?>" size="40" maxlength="50" onchange="if(isItEmpty(this.value)) { alertMsg(this.form.name,this.name,'Please tell us your first name (given name).');}" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfLastName" class="dgfLabel">*Last Name</label> <?php print $dgfError['dgfLastName'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfLastName" id="dgfLastName" value="<?php print $dgfLastName; ?>" size="40" maxlength="50" onchange="if(isItEmpty(this.value)) { alertMsg(this.form.name, this.name, 'Please tell us your last name (family name).');}" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfTitle" class="dgfLabel">Title</label> <?php print $dgfError['dgfTitle'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfTitle" id="dgfTitle" value="<?php print $dgfTitle; ?>" size="40" maxlength="50" /> </div> <div class="fhFormLeft2"> <label for="dgfEmail" class="dgfLabel">*Email</label> <?php print $dgfError['dgfEmail'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfEmail" id="dgfEmail" value="<?php print $dgfEmail; ?>" size="40" maxlength="50" onfocus="statusBarMsg('Please enter your work email address.')" onblur="window.status='';" onchange="checkEmail(this,false);" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfPhoneBiz" class="dgfLabel">*Business Phone</label> <?php print $dgfError['dgfPhoneBiz'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfPhoneBiz" id="dgfPhoneBiz" value="<?php print $dgfPhoneBiz; ?>" size="15" maxlength="30" onfocus="statusBarMsg('Enter a 10-digit US phone, or an International phone number starting with +.')" onblur="window.status='';" onchange="normalizedPhone = stripCharsInBag (this.value, phoneNumberDelimiters); if (isUSPhoneNumber (normalizedPhone, false)) { this.value = reformatUSPhone (normalizedPhone); }" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfPhoneFax" class="dgfLabel">Fax</label> <?php print $dgfError['dgfPhoneFax'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfPhoneFax" id="dgfPhoneFax" value="<?php print $dgfPhoneFax; ?>" size="15" onfocus="statusBarMsg('Enter a 10-digit US phone, or an International phone number starting with +.')" onblur="window.status='';" onchange="normalizedPhone = stripCharsInBag (this.value, phoneNumberDelimiters); if (isUSPhoneNumber (normalizedPhone, false)) { this.value = reformatUSPhone (normalizedPhone); }" maxlength="30" /> </div> </fieldset> <div>Briefly describe your business offerings. This information will be used as a reference by our professional marketing team to create the interactive listing copy.</div> <div> <label for="dgfComments" class="dgfLabel"> *Description<br />(limit 1,000 words)<br /> <textarea name="dgfComments" id="dgfComments" onfocus="statusBarMsg('Additional Comments')" onblur="window.status='';" rows="3" cols="60" onchange="limitWords(this.form.dgfComments, 1000);" class="required"><?php print $dgfComments ; ?> </textarea> </label> </div> <div> Pricing per State:<br/> $89.95 per state up to 9 states<br/> $59.95 per state up to 24 states<br/> 24 and national listings (All 50 states plus DC and Puerto Rico), $39.95 per state </p> </div> <div> <fieldset class="required"> <legend>*Check State(s) Served</legend> <?php $totalProducts = count($_post['dgfRegion']);$productPrice = 89.95;$discountfor10to24 = 30.00;$discountfor25to52 = 50.00;$discount = ($totalProducts = 10 && $totalProducts < 25) ? $discountfor10to24 : (($totalProducts > 24) ? $discountfor25to52 : 0);$total = ($productPrice * $totalProducts) - $discount;?> <table border="0" cellpadding="0"> <tr> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="AK" /> AK<br /> <input type="checkbox" name="dgfRegion[]" value="AL" /> AL<br /> <input type="checkbox" name="dgfRegion[]" value="AR" /> AR<br /> <input type="checkbox" name="dgfRegion[]" value="AZ" /> AZ<br /> <input type="checkbox" name="dgfRegion[]" value="CA" /> CA</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="CO" /> CO<br /> <input type="checkbox" name="dgfRegion[]" value="CT" /> CT<br /> <input type="checkbox" name="dgfRegion[]" value="DC" /> DC<br /> <input type="checkbox" name="dgfRegion[]" value="DE" /> DE<br /> <input type="checkbox" name="dgfRegion[]" value="FL" /> FL</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="GA" /> GA<br /> <input type="checkbox" name="dgfRegion[]" value="HI" /> HI<br /> <input type="checkbox" name="dgfRegion[]" value="IA" /> IA<br /> <input type="checkbox" name="dgfRegion[]" value="ID" /> ID<br /> <input type="checkbox" name="dgfRegion[]" value="IL" /> IL</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="IN" /> IN<br /> <input type="checkbox" name="dgfRegion[]" value="KS" /> KS<br /> <input type="checkbox" name="dgfRegion[]" value="KY" /> KY<br /> <input type="checkbox" name="dgfRegion[]" value="LA" /> LA<br /> <input type="checkbox" name="dgfRegion[]" value="MA" /> MA</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="MD" /> MD<br /> <input type="checkbox" name="dgfRegion[]" value="ME" /> ME<br /> <input type="checkbox" name="dgfRegion[]" value="MI" /> MI<br /> <input type="checkbox" name="dgfRegion[]" value="MN" /> MN<br /> <input type="checkbox" name="dgfRegion[]" value="MO" /> MO</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="MS" /> MS<br /> <input type="checkbox" name="dgfRegion[]" value="MT" /> MT<br /> <input type="checkbox" name="dgfRegion[]" value="NC" /> NC<br /> <input type="checkbox" name="dgfRegion[]" value="ND" /> ND<br /> <input type="checkbox" name="dgfRegion[]" value="NE" /> NE</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="NH" /> NH<br /> <input type="checkbox" name="dgfRegion[]" value="NJ" /> NJ<br /> <input type="checkbox" name="dgfRegion[]" value="NM" /> NM<br /> <input type="checkbox" name="dgfRegion[]" value="NV" /> NV<br /> <input type="checkbox" name="dgfRegion[]" value="NY" /> NY</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="OH" /> OH<br /> <input type="checkbox" name="dgfRegion[]" value="OK" /> OK<br /> <input type="checkbox" name="dgfRegion[]" value="OR" /> OR<br /> <input type="checkbox" name="dgfRegion[]" value="PA" /> PA<br /> <input type="checkbox" name="dgfRegion[]" value="PR" /> PR</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="RI" /> RI<br /> <input type="checkbox" name="dgfRegion[]" value="SC" /> SC<br /> <input type="checkbox" name="dgfRegion[]" value="SD" /> SD<br /> <input type="checkbox" name="dgfRegion[]" value="TN" /> TN<br /> <input type="checkbox" name="dgfRegion[]" value="TX" /> TX</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="UT" /> UT<br /> <input type="checkbox" name="dgfRegion[]" value="VA" /> VA<br /> <input type="checkbox" name="dgfRegion[]" value="VT" /> VT<br /> <input type="checkbox" name="dgfRegion[]" value="WA" /> WA<br /> <input type="checkbox" name="dgfRegion[]" value="WI" /> WI</p></td> <td><p align="center"> <input type="checkbox" name="dgfRegion[]" value="WV" /> WV<br /> <input type="checkbox" name="dgfRegion[]" value="WY" /> WY</p></td> </tr> </table> </fieldset> </div> <div> <input type="checkbox" name="logo" id="logo" /> Check box if to include optional logo placement $24.95 per year</div> <p> <label>Your total States = </label> <input name="totalProducts" type="text" value="<?php print $totalProducts;?>" maxlength="18" /> <br /> <label>Your total order = </label> <input name="total" type="text" value="<?php print $total;?>" maxlength="12" /> </p> <p align="center"> <input type="submit" name="calculate" id="submit" value="calculate" / "> <input name="Clear" type="button" value="Clear" /> <br /> </p><div class="fhFormLeft2"><label for="dgfSecureCode" class="dgfLabel">*Anti-Spam code</label> <?php print $dgfError['dgfSecureCode'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfSecureCode" id="dgfSecureCode" value="" size="6" maxlength="6" class="required" onChange="if(isItEmpty(this.value)) {alertMsg(this.form.name,this.name,'Please enter the anti-spam code to submit this form.');}"> <?php if ($_SESSION['secureImages'] > '') { print '  ' . $_SESSION['secureImages']; } ?> <br /> </div> <div> <br /><br /> </div> <div> <label for="dgfCC" class="dgfLabel"> <input type="checkbox" name="dgfCC" id="dgfCC" value="sentCarbonCopy" checked> Check here to receive a copy of this form (at the above email address). </label> </div> <div> <label for="dgfReset" class="dgfLabel"> <input type="reset" name="dgfReset" id="dgfReset" value="Clear" /> </label> <input name="dgfAction" type="hidden" value="processForm" /> <label for="dgfSubmit" class="dgfLabel"> <input type="submit" name="dgfSubmit" id="dgfSubmit" value="Submit Form" /> </label> </div></form></div>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...