Jump to content

jonnyfortis

Members
  • Posts

    41
  • Joined

  • Last visited

Everything posted by jonnyfortis

  1. i added the colons and will try using var_dump() i do not have error reporting turned on.
  2. i tried $ORDERID = $GET['orderID']; $AMOUNT = $GET['amount']; this should give me the results order ID: 969' amount?: 0.01 is that correct as when i echo out <?php echo $ORDERID ?> <?php echo $AMOUNT ?> i am not getting a value
  3. hello, i have a url returned from a payment centre and i need to use the information to make variables out of for example www.website.com/cancel.php?orderID=969&currency=GBP&amount=0%2E01&PM=&ACCEPTANCE=&STATUS=1&CARDNO=&ED=&CN=&TRXDATE=06%2F03%2F13&PAYID=719527322&NCERROR=&BRAND=&IP=86%2E130%2E167%2E99&SHASIGN=8D01371831130CFADEB12345678911391FD8332D6B so i need the $orderID $currency $amount etc.... how is this done? thanks in advance
  4. Does this look acceptable?, it does work but want to make sure its allowed $grandTotal1+= $totalPayment; $sixPoundTotal+= $sixMultiDura; } while ($row_rsTenProp = mysql_fetch_assoc($rsTenProp));
  5. yes i really need to understand what is going on and how to clearly write a loop. Is it where my curly brackets are going? Its would be better if i could write just one query to handle this whole process but i am at a loss on how to do this
  6. i have now fixed it so the issue by creating another variable so this worked for this $grandTotal1 = 0;//total for Total Rent Payment <?php $grandTotal1+= $totalPayment; } while ($row_rsTenProp = mysql_fetch_assoc($rsTenProp)); ?> <?php echo DoFormatCurrency($grandTotal1, 2, ',', '.', '£ ', '');?> this now give me just the total of $totalPayment I do have two other columns i need to make the totals of in the same way but i tried to replicate the above but didn't work i have two more variable $sixMultiDura and $utility that need totals i tried the following $grandTotal1 = 0;//total for Total Rent Payment $sixPoundTotal = 0;//total for £6 for Room <?php $grandTotal1+= $totalPayment; } while ($row_rsTenProp = mysql_fetch_assoc($rsTenProp)); { $sixPoundTotal+= $sixMultiDura; } while ($row_rsTenProp = mysql_fetch_assoc($rsTenProp)); ?> <td class="table-text"><?php echo DoFormatCurrency($grandTotal1, 2, ',', '.', '£ ', '');?></td> <td class="table-text"><?php echo DoFormatCurrency($sixPoundTotal, 2, ',', '.', '£ ', '');?></td> but this is giving me the correct results for $grandTotal1 but the $sixPoundTotal is showing the last record in the $sixMultiDura
  7. to go into more detail the $grandTotal is the total of another column for another table <table width="945" border="1" align="left" cellpadding="0" cellspacing="0"> <tr> <td bgcolor="#B5EC2B" class="table-text">Utility</td> <td bgcolor="#B5EC2B" class="table-text">Date Paid</td> <td bgcolor="#B5EC2B" class="table-text">Start Date</td> <td bgcolor="#B5EC2B" class="table-text">End Date</td> <td bgcolor="#B5EC2B" class="table-text">Amount</td> <td bgcolor="#B5EC2B" class="table-text">Tenants</td> <td bgcolor="#B5EC2B"><span class="table-text">Delete</span></td> <td bgcolor="#B5EC2B"><span class="table-text">Edit</span></td> </tr> <?php do { ?> <tr> <td class="table-text"><a href="utility-breakdown.php?recordID=<?php echo $row_rsProperty['utilityID']; ?>"><?php echo $row_rsProperty['utilName']; ?></a></td> <td class="table-text"><?php echo $row_rsProperty['utilityDatePaid']; ?></td> <td class="table-text"><?php echo $row_rsProperty['utilitySD']; ?></td> <td class="table-text"><?php echo $row_rsProperty['utilityED']; ?></td> <td class="table-text"><?php echo DoFormatCurrency($row_rsProperty['utilityAmount'], 2, ',', '.', '£ '); ?></td> <td class="table-text"><?php echo $row_rsProperty['utilityStudAmount']; ?></td> <td class="table-text"><a href="delete-utility.php?utilityID=<?php echo $row_rsProperty['utilityID']; ?>">Delete </a></td> <td class="table-text"><a href="edit-utility.php?utilityID=<?php echo $row_rsProperty['utilityID']; ?>">Edit</a></td> </tr> <?php } while ($row_rsProperty = mysql_fetch_assoc($rsProperty)); ?> </table> so to reiterate you code you showed me is showing the total of $totalPayment and the total of $row_rsProperty['utilityAmount'] but i just need the total of $totalPayment
  8. hello, thanks, this does show another figure but it isnt the total of all the $totalPayment that are echoed out. Are we using $grandTotal = 0; // use a loop here while ($row_rsSum = mysql_fetch_assoc($rsSum)) { $grandTotal += $row_rsSum['utilityAmount']; $row['utilityAmount'];// and display the contents of the row //$row['SUM(utilityAmount)'];// and display the contents of the row } as this is referencing the recordset mysql_select_db($database_hostprop, $hostprop); $query_rsSum = sprintf("SELECT host_editpropUtil.utilityAmount, host_editprop.prop_id, host_editpropUtil.prop_id FROM host_editpropUtil, host_editprop WHERE host_editpropUtil.prop_id = host_editprop.prop_id AND host_editprop.prop_id = %s", GetSQLValueString($colname_rsProperty, "text")); $rsSum = mysql_query($query_rsSum, $hostprop) or die(mysql_error()); $totalRows_rsSum = mysql_num_rows($rsSum); if so this i dont think is correct because all i need to the total of the variable $totalPayment hang on..i know why it isnt adding up. it is also adding the $grandTotal to the equation aswell... all i need it the total of the $totalPayment
  9. hello the variable i am trying to multiply not coming from a database it is a variable resulting from other variable equations. the only variable coming from the DB is $weeklyToStudent = $row_rsTenProp['rental_price']; here is all the code from the page <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $colname_rsProperty = "-1"; if (isset($_GET['recordID'])) { $colname_rsProperty = $_GET['recordID']; } mysql_select_db($database_hostprop, $hostprop); $query_rsProperty = sprintf("SELECT * FROM host_editprop, host_editpropUtil, host_editpropUtilComp WHERE host_editprop.prop_id = %s AND host_editpropUtil.prop_id = host_editprop.prop_id AND host_editpropUtilComp.utilID = host_editpropUtil.UtilPropNameID", GetSQLValueString($colname_rsProperty, "text")); $rsProperty = mysql_query($query_rsProperty, $hostprop) or die(mysql_error()); $row_rsProperty = mysql_fetch_assoc($rsProperty); $totalRows_rsProperty = mysql_num_rows($rsProperty); mysql_select_db($database_hostprop, $hostprop); $query_rsTenants = sprintf("SELECT * FROM host_editprop, plus_signup WHERE host_editprop.prop_id = plus_signup.propFull AND plus_signup.propFull = %s", GetSQLValueString($colname_rsProperty, "text")); $rsTenants = mysql_query($query_rsTenants, $hostprop) or die(mysql_error()); $row_rsTenants = mysql_fetch_assoc($rsTenants); $totalRows_rsTenants = mysql_num_rows($rsTenants); mysql_select_db($database_hostprop, $hostprop); $query_rsTenProp = sprintf("SELECT * FROM host_editprop, plus_signup WHERE host_editprop.prop_id = plus_signup.prop_id AND plus_signup.propFull = %s", GetSQLValueString($colname_rsProperty, "text")); $rsTenProp = mysql_query($query_rsTenProp, $hostprop) or die(mysql_error()); $row_rsTenProp = mysql_fetch_assoc($rsTenProp); $totalRows_rsTenProp = mysql_num_rows($rsTenProp); mysql_select_db($database_hostprop, $hostprop); $query_rsSum = sprintf("SELECT host_editpropUtil.utilityAmount, host_editprop.prop_id, host_editpropUtil.prop_id FROM host_editpropUtil, host_editprop WHERE host_editpropUtil.prop_id = host_editprop.prop_id AND host_editprop.prop_id = %s", GetSQLValueString($colname_rsProperty, "text")); $rsSum = mysql_query($query_rsSum, $hostprop) or die(mysql_error()); $totalRows_rsSum = mysql_num_rows($rsSum); $grandTotal = 0; // use a loop here while ($row_rsSum = mysql_fetch_assoc($rsSum)) { $grandTotal += $row_rsSum['utilityAmount']; $row['utilityAmount'];// and display the contents of the row //$row['SUM(utilityAmount)'];// and display the contents of the row } function DoFormatCurrency($theObject,$NumDigitsAfterDecimal,$DecimalSeparator,$GroupDigits,$CurrencySymbol) { $currencyFormat=$CurrencySymbol.number_format($theObject,$NumDigitsAfterDecimal,$DecimalSeparator,$GroupDigits); return ($currencyFormat); } ?> and here is the ALL the code in the BODY <table width="945" border="1" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#B5EC2B" class="table-text"> </td> <td bgcolor="#B5EC2B" class="table-text"> </td> <td bgcolor="#B5EC2B" class="table-text"> </td> <td bgcolor="#B5EC2B" class="table-text"> </td> <td bgcolor="#B5EC2B" class="table-text"> </td> <td colspan="3" align="center" bgcolor="#B5EC2B" class="table-text"><div align="center">TOTALS FOR THE YEAR</div></td> </tr> <tr> <td bgcolor="#B5EC2B" class="table-text">Tenant Name</td> <td bgcolor="#B5EC2B" class="table-text">Duration</td> <td bgcolor="#B5EC2B" class="table-text"><p>Payment </p> <p>Option</p></td> <td bgcolor="#B5EC2B" class="table-text">Rent</td> <td bgcolor="#B5EC2B" class="table-text">Room</td> <td bgcolor="#B5EC2B" class="table-text">Total Rent Payment</td> <td bgcolor="#B5EC2B" class="table-text">£6 for Room</td> <td bgcolor="#B5EC2B" class="table-text">Utility for Room</td> </tr> <?php do { ?> <tr> <?php //option 1 52 weeks NEW ///////DO NOT TOUCH AS EQUATION WILL NOT WORK AS HAS TO BE IN LOOP////////////////// $weeklyToStudent = $row_rsTenProp['rental_price']; $fourWeeksSecurityDep = 4 * $weeklyToStudent; $fivetwoWeeksPayable = $weeklyToStudent * 52; $fee = 184.80; $resFee = 250; $fivetwoPayIncFeedSecDep = $fourWeeksSecurityDep + $fivetwoWeeksPayable + $fee; $initPay15Wks = $weeklyToStudent*15; $initPay15WksFeeSecDep = $initPay15Wks + $fee + $fourWeeksSecurityDep; $balanceB4MovingIn = $initPay15WksFeeSecDep - $resFee; $second14Wks = $weeklyToStudent * 14; $third14Wks = $weeklyToStudent * 14; $fourth9Wks = $weeklyToStudent * 9; $totalPayment = $initPay15WksFeeSecDep + $second14Wks + $third14Wks + $fourth9Wks; ?> <?php // host £6 equation for option 1 $utilTotal = $totalPayment; $LessFeeCol2 = $utilTotal - $fee; $securityDeposit = $row_rsTenProp['rental_price'] * 4; $lessSecurityDepsoit = $LessFeeCol2 - $securityDeposit; $weekCon = $row_rsTenProp['weeks'] / 7; $rentLess21 = $row_rsTenProp['rental_price'] - 21; $weekTerm = $rentLess21 * $weekCon; $lessFees = $fee - $fourWeeksSecurityDep - $weekTerm; $utilTotalLessFees = $utilTotal - $lessFees; $totalB4Divide = $lessSecurityDepsoit - $weekTerm; $sixMultiDura = 6 * $weekCon; $utility = $totalB4Divide - $sixMultiDura; ?> <td class="table-text"><a href="customer-info.php?recordID=<?php echo $row_rsTenProp['userid']; ?>"><?php echo $row_rsTenProp['userid']; ?></a></td> <td class="table-text"><?php echo $row_rsTenProp['weeks'] / 7; ?> weeks</td> <td class="table-text"><?php echo $row_rsTenProp['payment_option']; ?></td> <td class="table-text"><?php echo DoFormatCurrency($row_rsTenProp['rental_price'], 2, ',', '.', '£ '); ?></td> <td class="table-text"><?php echo $row_rsTenProp['prop_id']; ?></td> <td class="table-text"><?php echo DoFormatCurrency($totalPayment, 2, ',', '.', '£ '); ?></td> <td class="table-text"><?php echo DoFormatCurrency($sixMultiDura, 2, ',', '.', '£ '); ?></td> <td class="table-text"><?php echo DoFormatCurrency($utility, 2, ',', '.', '£ ', ''); ?></td> </tr> <?php } while ($row_rsTenProp = mysql_fetch_assoc($rsTenProp)); ?> <tr> <td class="table-text"> </td> <td class="table-text"> </td> <td class="table-text"> </td> <td class="table-text"> </td> <td class="table-text">Totals</td> <td class="table-text"><?php //$totalPaymentTot = 0; //while //($row_totalPayment = $totalPayment);{ //$totalPaymentTot += $row_totalPayment; //$totalPayment; //} //echo $totalPaymentTot; ?> <?php //$totalPaymentTot = 0; //while //($totalPayment = ($row_totalPayment)); //$totalPaymentTot += $row_totalPayment;{ //$row_totalPayment; //} //echo $totalPaymentTot; { $row_totalPayment = $totalPayment; $final = $row_totalPayment += $totalPayment; } echo $final;?></td> <td class="table-text"> </td> <td class="table-text"> </td> </tr> </table>
  10. thanks my trouble. i need to create a loop and dont know how to do it.
  11. my code is returning the value of 0 and not the total
  12. I have a set rental amount with some variable making an equation. The final variable is the TOTAL of all the equations, i need the total of this variable <?php //option 1 52 weeks $weeklyToStudent = $row_rsTenProp['rental_price']; $fourWeeksSecurityDep = 4 * $weeklyToStudent; $fivetwoWeeksPayable = $weeklyToStudent * 52; $fee = 184.80; $resFee = 250; $fivetwoPayIncFeedSecDep = $fourWeeksSecurityDep + $fivetwoWeeksPayable + $fee; $initPay15Wks = $weeklyToStudent*15; $initPay15WksFeeSecDep = $initPay15Wks + $fee + $fourWeeksSecurityDep; $balanceB4MovingIn = $initPay15WksFeeSecDep - $resFee; $second14Wks = $weeklyToStudent * 14; $third14Wks = $weeklyToStudent * 14; $fourth9Wks = $weeklyToStudent * 9; $totalPayment = $initPay15WksFeeSecDep + $second14Wks + $third14Wks + $fourth9Wks; ?> <?php do { ?> <tr> <td class="table-text"><a href="customer-info.php?recordID=<?php echo $row_rsTenProp['userid']; ?>"><?php echo $row_rsTenProp['userid']; ?></a></td> <td class="table-text"><?php echo $row_rsTenProp['weeks'] / 7; ?> weeks</td> <td class="table-text"><?php echo $row_rsTenProp['payment_option']; ?></td> <td class="table-text"><?php echo $row_rsTenProp['rental_price']; ?></td> <td class="table-text"><?php echo $row_rsTenProp['prop_id']; ?></td> <td class="table-text"><?php echo DoFormatCurrency($totalPayment, 2, ',', '.', '£ '); ?></td> <td> </td> <td> </td> </tr> <?php } while ($row_rsTenProp = mysql_fetch_assoc($rsTenProp)); ?> i need to multiple the $totalPayment to get the TOTAL of this variable <?php $totalPaymentTot = 0; while ($totalPayment = ($row_totalPayment)); $totalPaymentTot += $row_totalPayment;{ $row_totalPayment; } echo $totalPaymentTot;?>
  13. Also on each product page i need to call a product size table that is joined to the product table via a prodSizeID (the feild is also in the size table to create a join)
  14. OK i will try and explain more clearly, want just the products in that category to be displayed. From the main product page i am linking to the detail page via the product ID but when i am on that product page i need to call all other products in a select list from the same category. When a new product is selected from the select list i need to send it to that said product.
  15. ok this is good i need to learn. can you just answer. can this be fixed or am i going about this the wrong way?
  16. Hello I am really desperate for help can someone look at my code and see where i am going wrong. I have three tables in a PHP Mysql database all joined. I will show the joined feilds Catagory Table catID catname Product Table ID catID SizeProdID and a Size Table SizeID SizeProdID catname I have a product page showing all products (by images) from a product table. mysql_select_db($database_beau, $beau); $query_Recordset1 = "SELECT * FROM beauProd ORDER BY name ASC"; $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1); $Recordset1 = mysql_query($query_limit_Recordset1, $beau) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); <a href="product-description.php?ID=<?php echo $row_Recordset1['ID']; ?>"><img src="../images/AW/thumbs/<?php echo $row_Recordset1['imageSmall']; ?>"/></a> on the detail page i need to get information from ALL the tables the first part is I need to have a select list that shows all the products from that catagory and when another product is select form the list and submitted is shows the new product so here is this script $colname_Recordset1 = "-1"; if (isset($_GET['ID'])) { $colname_Recordset1 = $_GET['ID']; } mysql_select_db($database_beau, $beau); $query_Recordset1 = sprintf("SELECT * FROM beauProd WHERE ID = %s", GetSQLValueString($colname_Recordset1, "int")); $Recordset1 = mysql_query($query_Recordset1, $beau) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = "-1"; if (isset($_GET['ID'])) { $totalRows_Recordset1 = $_GET['ID']; } <select name="name" class="text" id="selectName"> <option value="Select Design">Select Design</option> <?php do { ?> <option value="<?php echo $row_Recordset1['ID']; ?>"><?php echo $row_Recordset1['name']; ?></option> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); $rows = mysql_num_rows($Recordset1); if($rows > 0) { mysql_data_seek($Recordset1, 0); $row_Recordset1 = mysql_fetch_assoc($Recordset1); } ?> </select> i then need to show in another select list the sizes from the product selected in the previous select list $colname_Recordset2 = "-1"; if (isset($_GET['SizeProdID'])) { $colname_Recordset2 = $_GET['SizeProdID']; } mysql_select_db($database_beau, $beau); $query_Recordset2 = sprintf("SELECT * FROM beauProd, beauSizes WHERE beauSizes.SizeProdID = beauProd.SizeProdID AND beauProd.SizeProdID = %s", GetSQLValueString($colname_Recordset2, "int")); $Recordset2 = mysql_query($query_Recordset2, $beau) or die(mysql_error()); $row_Recordset2 = mysql_fetch_assoc($Recordset2); $totalRows_Recordset2 = mysql_num_rows($Recordset2); <select name="os0" class="text" id="Cos0"> <option value="select Category">Select Size</option> <?php do { ?> <option value="<?php echo $row_Recordset2['SizeProdID']; ?>"><?php echo $row_Recordset2['from'] . " - " . $row_Recordset2['to'] ; ?></option> <?php } while ($row_Recordset2 = mysql_fetch_assoc($Recordset2)); $rows = mysql_num_rows($Recordset1); if($rows > 0) { mysql_data_seek($Recordset2, 0); $row_Recordset2 = mysql_fetch_assoc($Recordset2); } ?> </select> this is basically what i need to achieve but currently the select list looking for the produts is just showing the product the page is for and the size list is showing nothing any help would be greatly appreciated
×
×
  • 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.