Jump to content

jwwceo

Members
  • Posts

    212
  • Joined

  • Last visited

Everything posted by jwwceo

  1. <?php include('http://www.soulgear.net/inc/initialize.php'); $shirtselected = 'NULL'; $longsleeveselected = 'NULL'; $tankselected = 'NULL'; $crewselected = 'NULL'; $hoodieselected = 'NULL'; $whiteselected = 'NULL'; $colorselected = 'NULL'; $fc1 = 'NULL'; $fc2 = 'NULL'; $fc3 = 'NULL'; $fc4 = 'NULL'; $fc5 = 'NULL'; $fc6 = 'NULL'; $fc7 = 'NULL'; $fc8 = 'NULL'; $bc1 = 'NULL'; $bc2 = 'NULL'; $bc3 = 'NULL'; $bc4 = 'NULL'; $bc5 = 'NULL'; $bc6 = 'NULL'; $bc7 = 'NULL'; $bc8 = 'NULL'; $rc1 = 'NULL'; $rc2 = 'NULL'; $rc3 = 'NULL'; $rc4 = 'NULL'; $rc5 = 'NULL'; $rc6 = 'NULL'; $rc7 = 'NULL'; $rc8 = 'NULL'; $lc1 = 'NULL'; $lc2 = 'NULL'; $lc3 = 'NULL'; $lc4 = 'NULL'; $lc5 = 'NULL'; $lc6 = 'NULL'; $lc7 = 'NULL'; $lc8 = 'NULL'; $q1 = 'NULL'; $q2 = 'NULL'; $q3 = 'NULL'; $q4 = 'NULL'; $q5 = 'NULL'; $q6 = 'NULL'; $q7 = 'NULL'; $q8 = 'NULL'; $jw = '0'; if(isset($_POST['submit'])) { $garment=$_POST['garment']; $color=$_POST['color']; $frontcolors=$_POST['frontcolors']; $backcolors=$_POST['backcolors']; $rightcolors=$_POST['rightcolors']; $leftcolors=$_POST['leftcolors']; $quantity=$_POST['quantity']; $sql = "SELECT * FROM garment WHERE garment_id = '$garment'"; $sql_result = mysql_query($sql,$connection) or die(mysql_error()); $row = mysql_fetch_array($sql_resultjw); $baseprice = $row[base_cost]; $sql = "SELECT * FROM garment_price WHERE garment_id = $productid[$garment] AND quantity = '$quantity'"; $sql_result = mysql_query($sql,$connection); $row = mysql_fetch_array($sql_result); $markupamount = $row[markup]; $sql2 = "SELECT * FROM imprint_price WHERE quantity = '$quantity'"; $sql2_result = mysql_query($sql2,$connection); $row2 = mysql_fetch_array($sql2_result); { $firstlocation = $row2[price]; $additionalcolor = $row2[color_price]; $additionallocation = $row2[location_price]; } $sql3 = "SELECT * FROM garment_color WHERE color_id = '$color'"; $sql3_result = mysql_query($sql3,$connection); $row3 = mysql_fetch_array($sql3_result); $colorcost = $row3[color_option_cost]; $cost2XL = $row3['2XL_option_cost'] * $quantity_2XL; $cost3XL = $row3['3XL_option_cost'] * $quantity_3XL; $cost4XL = $row3['4XL_option_cost'] * $quantity_4XL; $cost5XL = $row3['5XL_option_cost'] * $quantity_5XL; if ($frontcolors) { if (!$locations) { $locations ++; } else { $additionallocations ++; } if ($frontcolors>1) { $additionalcolors += ($frontcolors -1); } } if ($backcolors) { if (!$locations) { $locations ++; } else { $additionallocations ++; } if ($backcolors>1) { $additionalcolors += ($backcolors -1); } } if ($leftcolors) { if (!$locations) { $locations ++; } else { $additionallocations ++; } if ($leftcolors>1) { $additionalcolors += ($leftcolors -1); } } if ($rightcolors) { if (!$locations) { $locations ++; } else { $additionallocations ++; } if ($rightcolors>1) { $additionalcolors += ($rightcolors -1); } } $thisprice = $baseprice + ($baseprice * $markupamount/100) + $colorcost; $thisprice += ($locations * $firstlocation) + ($additionallocations * $additionallocation) + ($additionalcolors * $additionalcolor); $thissubtotal = $thisprice * $quantity; $sizeprices = $cost2XL + $cost3XL + $cost4XL + $cost5XL; $thistotalprice = ($thisprice * $quantity) + $sizeprices; $thisprice = number_format(round($thisprice, 2),2); $sizeprices = number_format(round($sizeprices, 2),2); $thissubtotal = number_format(round($thissubtotal, 2),2); $thistotalprice = number_format(round($thistotalprice, 2),2); echo $garment; echo $color; echo $frontcolors; echo $backcolors; echo $rightcolors; echo $leftcolors; echo $quantity; echo $baseprice; } if ($garment =='1'){$shirtselected = 'SELECTED';} if ($garment =='2'){$longsleeveselected = 'SELECTED';} if ($garment =='5'){$tankselected = 'SELECTED';} if ($garment =='4'){$crewselected = 'SELECTED';} if ($garment =='3'){$hoodieselected = 'SELECTED';} if ($color =='50'){$whiteselected = 'SELECTED';} if ($color =='34'){$coloredselected = 'SELECTED';} if ($frontcolors == '1'){$fc1 = 'SELECTED';} if ($frontcolors == '2'){$fc2 = 'SELECTED';} if ($frontcolors == '3'){$fc3 = 'SELECTED';} if ($frontcolors == '4'){$fc4 = 'SELECTED';} if ($frontcolors == '5'){$fc5 = 'SELECTED';} if ($frontcolors == '6'){$fc6 = 'SELECTED';} if ($frontcolors == '7'){$fc7 = 'SELECTED';} if ($frontcolors == '8'){$fc8 = 'SELECTED';} if ($backcolors == '1'){$bc1 = 'SELECTED';} if ($backcolors == '2'){$bc2 = 'SELECTED';} if ($backcolors == '3'){$bc3 = 'SELECTED';} if ($backcolors == '4'){$bc4 = 'SELECTED';} if ($backcolors == '5'){$bc5 = 'SELECTED';} if ($backcolors == '6'){$bc6 = 'SELECTED';} if ($backcolors == '7'){$bc7 = 'SELECTED';} if ($backcolors == '8'){$bc8 = 'SELECTED';} if ($rightcolors == '1'){$rc1 = 'SELECTED';} if ($rightcolors == '2'){$rc2 = 'SELECTED';} if ($rightcolors == '3'){$rc3 = 'SELECTED';} if ($rightcolors == '4'){$rc4 = 'SELECTED';} if ($rightcolors == '5'){$rc5 = 'SELECTED';} if ($rightcolors == '6'){$rc6 = 'SELECTED';} if ($rightcolors == '7'){$rc7 = 'SELECTED';} if ($rightcolors == '8'){$rc8 = 'SELECTED';} if ($leftcolors == '1'){$lc1 = 'SELECTED';} if ($leftcolors == '2'){$lc2 = 'SELECTED';} if ($leftcolors == '3'){$lc3 = 'SELECTED';} if ($leftcolors == '4'){$lc4 = 'SELECTED';} if ($leftcolors == '5'){$lc5 = 'SELECTED';} if ($leftcolors == '6'){$lc6 = 'SELECTED';} if ($leftcolors == '7'){$lc7 = 'SELECTED';} if ($leftcolors == '8'){$lc8 = 'SELECTED';} if ($quantity == '144'){$q1 = 'SELECTED';} if ($quantity == '250'){$q2 = 'SELECTED';} if ($quantity == '500'){$q3 = 'SELECTED';} if ($quantity == '1000'){$q4 = 'SELECTED';} if ($quantity == '2000'){$q5 = 'SELECTED';} if ($quantity == '3000'){$q6 = 'SELECTED';} if ($quantity == '5000'){$q7 = 'SELECTED';} if ($quantity == '10000'){$q8 = 'SELECTED';} echo $garment; echo $color; echo $frontcolors; echo $backcolors; echo $rightcolors; echo $leftcolors; echo $quantity; print<<<EOF <html> <head> <title>SoulGear.com -Fast Quote</title> <link href="http://www.soulgear.net/inc/style.css" rel="stylesheet" type="text/css"> <script language="JavaScript"> <!-- focus(); //--> </script> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#FFFFFF" background="http://www.vectortees.com/images/popupbg.gif"> <script language="JavaScript"> <!-- function ChooseSize(id) { window.opener.document.productForm.elements["options[2]"].selectedIndex = id; self.close(); } //--> </script> <center> <table border=0 cellpadding=0 cellspacing=0 width=480> <tr> <td colspan='2'><img src="images/clear.gif" width=1 height=15></td> </tr> <tr valign=top> <td><img src="http://www.vectortees.com/images/title_sizing_chart.gif" width=204 height=22></td> <td align=right><a href="javascript:self.close()"><img src="http://www.vectortees.com/images/closewindow.gif" width=84 height=11 border=0></td> </tr> <tr> <td colspan='2'><img src="images/clear.gif" width=1 height=8></td> </tr> <tr> <td colspan=2 align=center> <table border=0 cellpadding=3 cellspacing=0 width=450> <tr> <td> <table border=0 cellpadding=4 cellspacing=1> <tr> <td class="sizingwhite" colspan='4'>MEASUREMENT (INCHES)</td> </tr> <tr> <form name="quoteform" method="post" action="http://www.soulgear.net/popups/quote.php"> <td class="sizingblue"> Style</td> <td class="sizingblue"> <select name="garment"> <option value="1" {$shirtselected}>Basic 6.1 oz Tee</option> <option value="2" {$longsleeveselected}>6.1 oz Long Sleeve Tee</option> <option value="5" {$tankselected}>6.1 oz Tank Top</option> <option value="3" {$hoodieselected}>10 oz. Hooded Sweatshirt</option> <option value="4" {$crewselected}>10. oz Crew Neck Sweatshirt</option> </select></td> <td class="sizingblue">Color</td> <td> <select name="color"> <option value="50" {$whiteselected}>White</option> <option value="34" {$coloredselected}>Colored</option> </select></td> </tr> <tr > <td class="sizingblue" colspan='4'>Please enter the number of ink colors for each location</td> </tr> <tr > <td class="sizingblue" colspan='4'> <table border='1'> <tr> <td>Front:</td> <td>Back:</td> <td>Right Sleeve:</td> <td>Left Sleeve:</td> </tr> <tr> <td width="25%"> <select name="frontcolors"> <option value="1" {$fc1}>1</option> <option value="2" {$fc2}>2</option> <option value="3" {$fc3}>3</option> <option value="4" {$fc4}>4</option> <option value="5" {$fc5}>5</option> <option value="6" {$fc6}>6</option> <option value="7" {$fc7}>7</option> <option value="8" {$fc8}>8</option> </select> </td> <td width="25%"> <select name="backcolors"> <option value="1" {$bc1}>1</option> <option value="2" {$bc2}>2</option> <option value="3" {$bc3}>3</option> <option value="4" {$bc4}>4</option> <option value="5" {$bc5}>5</option> <option value="6" {$bc6}>6</option> <option value="7" {$bc7}>7</option> <option value="8" {$bc8}>8</option> </select> </td> <td width="25%"> <select name="rightcolors"> <option value="1" {$rc1}>1</option> <option value="2" {$rc2}>2</option> <option value="3" {$rc3}>3</option> <option value="4" {$rc4}>4</option> <option value="5" {$rc5}>5</option> <option value="6" {$rc6}>6</option> <option value="7" {$rc7}>7</option> <option value="8" {$rc8}>8</option> </select> </td> <td width="25%"> <select name="leftcolors"> <option value="1" {$lc1}>1</option> <option value="2" {$lc2}>2</option> <option value="3" {$lc3}>3</option> <option value="4" {$lc4}>4</option> <option value="5" {$lc5}>5</option> <option value="6" {$lc6}>6</option> <option value="7" {$lc7}>7</option> <option value="8" {$lc8}>8</option> </select> </td> </tr> </table> </td> </tr> <tr> <td class="sizingblue" colspan='4'>Quantity: <select name="quantity"> <option value="144" {$q1}>144</option> <option value="250" {$q2}>250</option> <option value="500" {$q3}>500</option> <option value="1000" {$q4}>1000</option> <option value="2000" {$q5}>2000</option> <option value="3000" {$q6}>3000</option> <option value="5000" {$q7}>5,000</option> <option value="10000" {$q8}>10,000</option> </select><input type="submit" name="submit" value="submit" ></td> </tr> </table></td> </tr> </form> <tr> <td> Your Price: $0.00 </td> </tr> <tr> <td class="sizingblue" colspan='2'> <p><img src="http://www.vectortees.com/images/bluearrow.gif" width=8 height=10>Free Professional Custom Artwork<br> <img src="http://www.vectortees.com/images/bluearrow.gif" width=8 height=10>Free Shipping in the USA<br> <img src="http://www.vectortees.com/images/bluearrow.gif" width=8 height=10>Free PDF Proof<br> <img src="http://www.vectortees.com/images/bluearrow.gif" width=8 height=10>Low Price Guarantee</p> </td> </tr> </table></td> </tr> </table> </body> </html> EOF; ?>
  2. I get the same error... Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/jwwceo/www.soulgear.net/popups/quote.php on line 75 there is something weird going on...I'm not getting normal errors... could it be anything wrong with the connection or something????
  3. I know...it's bizarre... see for yourself...the form is on this page: http://www.soulgear.net/index.php?option=com_content&task=view&id=2&Itemid= Go to the bottom....click on fast quote.... hit submit...see if you get the same thing... there is something bizarre going on here because the same query is used later in the page to figure out the price...
  4. Does it matter? The quotes don't seem to matter..the query works fine the way it is written, just in another location on my site...exactly the same....is it possible something else is going on here.... I tried removing the quotes and both ways I get the same error....
  5. I don't understand.... isn 't the variable $sql just the string that includes the whole Select query?????
  6. $sql = "SELECT * FROM garment WHERE garment_id = '$garment'"; $sql_result = mysql_query($sql,$connection) or die(mysql_error()); $row = mysql_fetch_array($sql_result); $baseprice = $row[base_cost]; but it doesn't make sense...this is the same query I use later in my page and it works fine...
  7. Hello, I am making a pop up to give my customers a fast price quote..to do this I am using the same query that I use at another point in my site. However, when I run the query from the pop up, I get this error: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in The query is exactly the same as I've used in another part of my site. Everything should work fine. Any ideas? James
  8. I just built a series of pulldowns to send data to my homepage. It works fine...but I also have affiliates who link to my site...and their links go first to another directory and then forwarded to my home page. I want to offer my affiliates the chance to put these pulldowns on their site to increase their sales. When I point the "action" part of the form to the affiliate url, I need the form values from the pulldowns to automatically get passed through to my home page where they can be read. But heres the tricky, part. I can't see the affiliate code because it's encoded in base 64... I decoded it, but it's still pretty cryptic code...uses all their own functions and things. So I want to build a script that will catch the post data and then forward it on to the the next page without interfering with the affiliate script. Is this possible. It all needs to happen automatically...
  9. For some reason I don't really understand RSS yet, so I have a bunch of dumb questions about RSS/atom and how it relates to php. It seems like feed readers can be all sorts of applications; web based, stand alone, embedded in other software? Is this true? If I want to make a web page with a section on news, and have this section fed by a RSS feed, are there any scripts for php that can do this? I'm sorry if this post is incredibly stupid and naive... I am trying to wrap my head around feeds and Digg's and Feedburner and have gotten some conflicting info. Best Regards, James
  10. I have a text area being outputted by php. The items in the textarea need to all be listed on their own line. so my text has "/n" in it. Im using the PRINT<<< EOF EOF; method of outputting. any ideas on how to get the text area to have breaks in it??? Jame
  11. I solved the problem. your post was helpful. It made me look closer and I figured it out. THANK YOU!!!!
  12. hey all. I have a page with no alt tags, so I went though and added alt tags to all my images, so that it's better for the search engine... but when I load the page the images don't show up at al...just the alt tags in their place...it also disables the style sheet for EVERYTHING on th page. I'm thnking this is CSS related, but am not sure where to start. thanks!! James
  13. thanks. that's what I was looking for...it looks like you just have to specify which connection to use for each query. seems easy enough... I'll give it a try...
  14. Hello all, I have 4 businesses online right now. They each use a custom shopping cart designed to the needs of that specific site. They each have their own database associated with the site. I would like to make a master corporate page that simply pulls stats and displays them on a big executive dashboard. Can I connect to more than 1 database at a time??? how do I do this. how is the syntax for a particular table noted? thanks in advance. James
  15. I don' think there is any text generated before this.... here is my code...for the top part of that page... [code]<?php include 'inc/header.php'; if (isset($_POST['deletetext'])) { $deletetext =($_POST['deletetext']); if ($deletetext == 'yes'){ $updatestatus = "DELETE FROM orders WHERE ordernum ='$ordernum'"; mysql_query($updatestatus) or die("Error: ". mysql_error(). " with query ". $updatestatus); header("Location: /index.php");}[/code]
  16. Hello, I have a function to delete a record from a databse. Once it's done I need to redorect to the main index page of my admin system, because the deleted record is no longer there to look at. I'm using this: header("Location: /index.php"); The delete works but I get his error: Warning: Cannot modify header information - headers already sent by (output started at /home/jwwceo/www.vectortees.com/admin/inc/header.php:24) in /home/jwwceo/www.vectortees.com/admin/orderpage.php on line 47 I've read about not having any html output before the header command, but I'm not exactly sure what this means. I've used this command a ton of time sbefore and it always works. any tips?  Thanks in advance.
  17. It's kinda wierd situation...kinda hard to explain..... I have dynamically generated delete buttons. One for each entry in my database. In order to get the delete buttons to work I need to make each within it's own form. When they are not within their own form they don't work...I'm not sure why. I think because some of the data that is being deleted is also dynamic and shares the same field name as other records. Anyway, the way this is layed out is ina  scetion of my page where there are other form fields and the flow of the HTML has these delete forms within the main form for the page. I think I can structure it so theres no form within a form, I'll just have to use more than 1 for the main page. Just chop it in 2 with the delete forms in the middle...this should work...
  18. I have a POST form that is very basic. I have used it many times. It is not working. I think the problem may be that due to the structure of the HTML, I have a form within a form. Is this allowed?? I have a table within a table, and one form is in this table. The larger table has it's own form elements. I am thinking of just removing the table within the table and replacing it with a DIV that is positioned in the same place. That way, the DIV can be anywhere in the HTML and won't be within another form. Any other ideas to solve this????
  19. I have a bunch of dynamic form fields which are posted on my php page. The field names are being posted with a variable in them like this <input type ='checkbox'......name='color{$colorid}'....> so each checkbox has it's own id. I think this is working ok, but when I try to get this value on the next page I am having a hard time retrieving the value. I am trying this: if(isset($_POST['color$colorid'])) and if(isset($_POST['color.$colorid'])), but I can't get the right syntax. what am I doing wrong??? James
  20. I am building a page for adding a product to a database. The product can come in many many colors. The ADD PRODUCT page has fields at the top of the page which are pretty standard, size, price, etc. At the bottom of the page are a list of colors available. With a checkbox for each color the product comes in. However, there are other features that are unique to each color/product combination. For example there is another set of form fields next to each color..to indicate if the color/product combo comes in certain sizes or if there is an additional cost for each size/color/product combo. Kinda complicated. you can look at it here... [url=http://www.vectortees.com/admin/addgarment.php]www.vectortees.com/admin/addgarment.php[/url] Anyway, all the data about the colors is in a seperate table that links the product id with the color id as well as all the other info. I have my main query set up to add the main product info to the product table, but I don't know how to name my form fields so that I can add everything to the product/color table. I assume all the info, the 2x, 3x,  etc...will all be lised in an array and then some kind of foreach statement...I just can't get the exact syntax... Any ideas....?? I hope this makes sense...
  21. This is what I'm trying to dispay on my page. The 'I'm huge in Japan" needs to be inside the form when the page loads so the user can edit it... but it just put the "I" in the text box.. <INPUT TYPE='TEXT' NAME='name'  class='cartForm' size=50 value='I'm Huge in Japan'></TD>
  22. I have a product in my database with an apostrophe. It works fine on the website, however, when I go to the edit product page, where there is a form to edit the product, the current value is supposed to be in the text field already. The only data being displayed in the text box is the info before the apostrophe. This is more of an annoyance, instead of a major problem, since this is only on the back end...but there must be a way around it...
  23. That looks like the tutorial from this site. I just used it yesterday. I had to tweak the SQL statement a little bit. I changed mine to something like this SELECT COUNT(unique_id_from_venue_table) FROM venues WHERE auth = 1 where unique_id_from_venue_table is your primary key from your table.  this worked for me.
×
×
  • 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.