quiero crear una pagina solo para república dominicana, pero el scrip que he descargado esta basado en la moneda de estados unidos, cuando se ingresan los parámetros altura y ancho el programa calcula automáticamente el precio, pero lo que quiero es que me calcule otro precio...
pueden entrar al siguiente link para que entiendan lo que le explico http://dosmillones.hol.es/buy.php
y reyenen los campos Width y Height automaticamente te tirara el precio al final donde dise price, lo que quiero es modificar ese precio...
aqui les dejo el codigo....
<?php
include("header.php");
include("inner_header.php");
include("includes/configure.php");
include("includes/database_tables.php");
$x1=substr($_POST['x'],0,-1);
$y1=substr($_POST['y'],0,-1);
if($x1=="") $x1=0;
if($y1=="") $y1=0;
$q_block_price = mysql_query("SELECT block_price FROM " . TABLE_CONFIGURATION . " WHERE id=1");
$f_block_price = mysql_fetch_assoc($q_block_price);
$block_price = $f_block_price["block_price"];
?>
<script src="includes/general.js" language="JavaScript">
</script>
<script language="JavaScript">
function chk_form()
{
var flg = 1;
var str = "Please fill the following fields:\t";
str += "\n----------------------------------";
if((document.add_img_frm.name.value)==""){
str += "\n Name";
flg = 0;
}
if((document.add_img_frm.email.value)==""){
str += "\n Email";
flg = 0;
}
if((document.add_img_frm.width.value)==""){
str += "\n Width";
flg = 0;
}
if((document.add_img_frm.height.value)==""){
str += "\n Height";
flg = 0;
}
if((document.add_img_frm.url.value)==""){
str += "\n URL";
flg = 0;
}
if((document.add_img_frm.title.value)==""){
str += "\n Title";
flg = 0;
}
if((document.add_img_frm.upload_img.value)==""){
str += "\n Image";
flg = 0;
}
if(flg == 0){
alert(str);
return false;
}else{
if(!isValidEmail(document.add_img_frm.email.value)){
alert("Please check your email");
document.add_img_frm.email.focus();
return false;
}
if(isNaN(document.add_img_frm.width.value)){
alert("Widht field must be numeric");
return false;
}
if(isNaN(document.add_img_frm.height.value)){
alert("Height field must be numeric");
return false;
}
if(!chk_url(document.add_img_frm.url)){
return false;
}
//--------------------------------------------------------------------
if(document.getElementById('width').value <= 0){
alert("Width must greater than 0");
return false;
}
if(document.getElementById('height').value <= 0){
alert("Height must greater than 0");
return false;
}
var x1_val = document.add_img_frm.x1.value;
var y1_val = document.add_img_frm.y1.value;
var avail_x_dist = 100 - x1_val;
var avail_y_dist = 100 - y1_val;
if(document.add_img_frm.width.value > avail_x_dist){
alert("Horigental Blocks are not available.");
return false;
}
if(document.add_img_frm.height.value > avail_y_dist){
alert("Vertical Blocks are not available.");
return false;
}
var total_block = document.getElementById('width').value*document.getElementById('height').value;
var block_price = document.getElementById('block_price').value;
var total_amount = total_block*block_price;
document.getElementById('price').innerHTML="<b>$"+ total_amount +"</b>";
document.add_img_frm.amount.value = total_amount;
if(document.add_img_frm.amount.value != ""){
if(document.add_img_frm.amount.value <= 0){
alert("Please check width and height properly");
return false;
}
}
//------------------------------------------------------------------------------
}
width=document.add_img_frm.width.value;
height=document.add_img_frm.height.value;
x2=parseInt(document.add_img_frm.x1.value)+parseInt(width);
y2=parseInt(document.add_img_frm.y1.value)+parseInt(height);
document.add_img_frm.x2.value=x2;
document.add_img_frm.y2.value=y2;
}
function set_price()
{
if((document.add_img_frm.width.value!="")&&(document.add_img_frm.height.value!="")){
var flag = 1;
if(isNaN(document.add_img_frm.width.value)){
flag = 1;
}
if(isNaN(document.add_img_frm.height.value)){
flag = 0;
}
if(flag == 1){
//var total_block = document.getElementById('width').value*document.getElementById('height').value;
//var block_price = document.getElementById('block_price').value;
var total_block = document.add_img_frm.width.value*document.add_img_frm.height.value;
//var block_price = document.getElementById('block_price').value;
var block_price = document.add_img_frm.block_price.value;
var total_amount = total_block*block_price;
document.getElementById('price').innerHTML="<b>$"+ total_amount +"</b>";
//document.add_img_frm.price.value="<b>$"+ total_amount +"</b>";
//document.add_img_frm.pp.value=total_amount;
document.add_img_frm.amount.value = total_amount;
}else{
//document.getElementById('price').innerHTML="Not yet calculated";
}
}else{
//document.getElementById('price').innerHTML="Not yet calculated";
}
}
</script>
<form name="add_img_frm" method="post" action="order_confirm.php" enctype="multipart/form-data" >
<table align="center" width="70%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20" bgcolor="#000077" align="center" class="white_text_heading">Add
Your Image Link</td>
</tr>
<tr>
<td >
<table width="100%" border="0" cellpadding="0" cellspacing="6" bgcolor="#DFDFDF" class="black_simple">
<tr>
<td height="10"> </td>
<td height="10"> </td>
</tr>
<tr>
<td width="54%" height="25" > Contact Name</td>
<td width="46%" height="25"><input name="name" type="text" id="name" class="black_simple"></td>
</tr>
<tr>
<td width="54%" height="25"> Email address</td>
<td height="25"><input name="email" type="text" id="email" class="black_simple" ><!--input name="email" type="text" id="email" class="black_simple" onChange="if(!isValidEmail(this.value)) { chng_col(this); }else { back_col(this)};" --></td>
</tr>
<tr>
<td width="54%" height="25"> x1 Position</td>
<td height="25"><?php echo $x1; ?></td>
</tr>
<tr>
<td width="54%" height="25"> y1 Position</td>
<td height="25"><?php echo $y1; ?></td>
</tr>
<tr>
<td width="54%" height="25"> Width</td>
<td height="25"><input name="width" type="text" id="width" class="black_simple" onChange="set_price();" onKeyUp="set_price();">
Block(s) </td>
</tr>
<tr>
<td width="54%" height="25"> Height</td>
<td height="25"><input name="height" type="text" id="height" class="black_simple" onChange="set_price();" onKeyUp="set_price();">
Block(s)</td>
</tr>
<tr>
<td width="54%" height="25"> Link to website</td>
<td height="25"><input name="url" type="text" id="url" class="black_simple"></td>
</tr>
<tr>
<td width="54%" height="25"> Message Box(50 Characters
max) </td>
<td height="25"><input name="title" type="text" id="title" maxlength="50" class="black_simple"></td>
</tr>
<tr>
<td width="54%" height="25"> Pixel(s) Image</td>
<td height="25"><input name="upload_img" type="file" id="upload_img" class="black_simple"></td>
</tr>
<tr>
<td width="54%" height="25"> Price :</td>
<td height="25"><input type="hidden" name="amount" id="amount"><div id=price></div></td>
</tr>
<tr>
<td width="54%" height="25"> </td>
<td height="25"><input type="submit" name="paypal" value="Paypal" class="button" onClick="return chk_form()">
<input type="reset" name="reset" value="Reset" class="button">
<input type="hidden" name="x1" id="x1" value="<?php echo $x1; ?>">
<input type="hidden" name="y1" id="y1" value="<?php echo $y1; ?>">
<input type="hidden" name="x2" id="x2" >
<input type="hidden" name="y2" id="y2" >
<input type="hidden" name="block_price" value="<?php echo $block_price; ?>">
</td>
</tr>
<tr>
<td height="10"> </td>
<td height="10"> </td>
</tr>
</table></td>
</tr>
</table></form>
<script language="JavaScript">
document.getElementById('price').innerHTML="Not yet calculated";
</script>
<?php
include("inner_footer.php");
include("footer.php");
?>