wolvrinez Posted February 10, 2005 Share Posted February 10, 2005 I want to know how do i get a list of my dvd movies that I have on my website? I have them all entered into the database but I would like to print out a list of movies that I have. Link to comment Share on other sites More sharing options...
bobg7 Posted February 10, 2005 Share Posted February 10, 2005 You can try this script I call "inventory.php": <head> <script Language="Javascript"> function printit(){ if (window.print) { window.print(); } else { var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>'; document.body.insertAdjacentHTML('beforeEnd', WebBrowser); WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = ""; } } </script> <script Language="Javascript"> var NS = (navigator.appName == "Netscape"); var VERSION = parseInt(navigator.appVersion); if (VERSION > 3) { document.write('<form><input type=button value="Print this Page" name="Print" onClick="printit()"></form>'); } </script> </head> <B>INVENTORY<br><br></b> <?php require('includes/application_top.php'); //$product_query = tep_db_query("select pd.products_name, pd.products_id, p.products_id, p.products_model, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_query = tep_db_query("select pd.products_name, pd.products_id, p.products_id, p.products_model, p.products_price, p.products_quantity from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'"); while ($product = tep_db_fetch_array($product_query)) { echo 'Model: ' . $product['products_model'] . '<br>' . 'Name: ' . $product['products_name'] . '<br>' . 'Quantity: ' . $product['products_quantity'] . '<br>' . 'Price:<b> $' . $product['products_price'] . '</b><br><br>'; } ?> It will give you: Model: (Item Number) Name: (Product Name) Quantity: (In Stock) Price: ($nnn.nn) With a [PRINT] Button at the top. I didn't write the script, I had a lot of help from Jack_mcs, all I did was add the Print button. Bob G. Installed Contributions: CCGV, Close Popup, Dynamic Meta Tags, Easy Populate, Froogle Data Feeder, Google Position, Infobox Header Entire Row, Live Support for OSC, PayPal Seal with CC images, Report_m Sales, Shop by Price Revised, SQL Updater, Who's Online Enhancement, Footer, GNA EP Assistant and still going. Link to comment Share on other sites More sharing options...
wolvrinez Posted February 12, 2005 Author Share Posted February 12, 2005 Sweet thanks man, works like a charm. Link to comment Share on other sites More sharing options...
bobg7 Posted February 13, 2005 Share Posted February 13, 2005 Kool, glad it worked for you. Something I forgot to add in the comments before. If you want to create a list to print lables, change this: $product_query = tep_db_query("select pd.products_name, pd.products_id, p.products_id, p.products_model, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'"); //$product_query = tep_db_query("select pd.products_name, pd.products_id, p.products_id, p.products_model, p.products_price, p.products_quantity from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'"); And it will drop the Quantity field, just copy/paste to your label maker program and get to printing. Installed Contributions: CCGV, Close Popup, Dynamic Meta Tags, Easy Populate, Froogle Data Feeder, Google Position, Infobox Header Entire Row, Live Support for OSC, PayPal Seal with CC images, Report_m Sales, Shop by Price Revised, SQL Updater, Who's Online Enhancement, Footer, GNA EP Assistant and still going. Link to comment Share on other sites More sharing options...
aladdin Posted February 13, 2005 Share Posted February 13, 2005 great! for some reason I?m getting 4 decimals in the price (example : 15 dollars is 15.00000) . would only require 2 (=15.00) :-" how to change this? Link to comment Share on other sites More sharing options...
Guest Posted February 13, 2005 Share Posted February 13, 2005 Where does this go? Link to comment Share on other sites More sharing options...
wolvrinez Posted February 14, 2005 Author Share Posted February 14, 2005 it's its own page. create a new php page and put it somehwere on the root directory. then just type it's address in. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.