TXprogrammer Posted June 23, 2004 Posted June 23, 2004 I tried myself by modifying stats_low_stock.php, but due to my limited knowledge of PHP, was unable to do this and would like to know if anyone would like to give it a shot or if you know of a contribution that does this. A report/form with the following fields for each product: Product Model ? This field should link to categories.php for this product. Non-editable Product Name ? This field should be a text box and be editable. Product Weight ? This field should be a text box and be editable. Product Price ? This field should be a text box, formatted as currency, and be editable. Product Quantity ? This field should be a text box and be editable. Product Update Button ? This button should update any data changed for this product and re-list/refresh the page. This report/form should list at least 20 products on each page and be able to sort by product model or product quantity in ascending or descending order. Thanks in advance for your effort. :D Everybody be quiet, the voices in my head are trying to tell me something!
TXprogrammer Posted June 23, 2004 Author Posted June 23, 2004 Here is how far I got: First problem is that in Product Name nothing is showing up after a quote mark. And second I have no clue how to process when the Update button is clicked. Everybody be quiet, the voices in my head are trying to tell me something!
♥bruyndoncx Posted June 23, 2004 Posted June 23, 2004 Wouldn't the quick updates contribution meet your needs ? It got all the fields you are showing here, looks pretty much the same and some more functionality (edit links; categories and manufacturers filters, show X records, sorting on any field, activate/desactivate, specials ... KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt
ryanf Posted June 23, 2004 Posted June 23, 2004 Hey, I created a page for kindof the same thing. I use it to add values to a certain type of product. Here is a screen shot: and here is my code that I use: <?php /* $Id: diamonds.php,v 1.0 2004/05/13 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License Created By ryanf */ require('includes/application_top.php'); require('includes/database_tables.php'); $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); if($action) { switch($action) { case 'update': while ( list( $key, $val ) = each( $HTTP_POST_VARS ) ) { if ($key != 'x' && $key != 'y') { $name = explode('_', $key); if ($name[1] == 'price') { $price = $val; } if ($name[1] == 'carat') { $carat = $val; } if ($name[1] == 'mmsize') { $mmsize = $val; } if ($name[1] == 'color') { $color = $val; } if ($name[1] == 'shape') { $shape = $val; } if ($name[1] == 'delete') { $delete = $val; } if ($val == 'stop') { $sql_data_array = array('products_price' => $price, 'products_carat' => $carat, 'products_mmsize' => $mmsize, 'products_color' => $color, 'products_shape' => $shape); if ($delete == 'delete') { tep_db_query("delete from " . TABLE_PRODUCTS . " where products_id = '" . $name[0] . "'"); } else { tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', "products_id = '" . $name[0] . "'"); } } } } break; } } ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> <script language="javascript" src="includes/general.js"></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();"> <div id="spiffycalendar" class="text"></div> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"> Diamond Association </td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top"> <?php echo '<form name="diamonds" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=update', 'NONSSL') . '">'; ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent">Delete</td> <td class="dataTableHeadingContent">Diamond Lot</td> <td class="dataTableHeadingContent">Price</td> <td class="dataTableHeadingContent">Carat</td> <td class="dataTableHeadingContent">MM Size</td> <td class="dataTableHeadingContent">Quality</td> <td class="dataTableHeadingContent">Shape</td> </tr> <?php $diamond_query = tep_db_query("select p.products_id, p.products_model, p.products_price, p.products_carat, p.products_mmsize, p.products_color, p.products_shape from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where p.products_id = pc.products_id and pc.categories_id = 67"); while ($diamonds = tep_db_fetch_array($diamond_query)) { echo ' <tr class="dataTableRow">'; echo ' <td align="center"><input type="checkbox" name="' . $diamonds['products_id'] . '_delete" value="delete"></td>'; echo ' <td>' . $diamonds['products_model'] . '</td>'; echo ' <td><input type="text" name="' . $diamonds['products_id'] . '_price" size="9" maxlength="7" value="' . $diamonds['products_price'] . '"></td>'; echo ' <td><input type="text" name="' . $diamonds['products_id'] . '_carat" size="20" maxlength="20" value="' . $diamonds['products_carat'] . '"></td>'; echo ' <td><input type="text" name="' . $diamonds['products_id'] . '_mmsize" size="20" maxlength="64" value="' . $diamonds['products_mmsize'] . '"></td>'; echo ' <td><input type="text" name="' . $diamonds['products_id'] . '_color" size="5" maxlength="1" value="' . $diamonds['products_color'] . '"></td>'; echo ' <td><input type="text" name="' . $diamonds['products_id'] . '_shape" size="20" maxlength="64" value="' . $diamonds['products_shape'] . '">'; echo ' <input type="hidden" name="' . $diamonds['products_id'] . '_end" value="stop"></td></tr>'; } ?> </table> </td> <td align="center" valign="top"> <?php echo tep_image_submit('button_update.gif', IMAGE_NEW_PRODUCT); ?> </form> </td> </table></td> <!-- body_text_eof //--> </tr> </form> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Hopefully that helps. Got no idea about the " though. It makes sense they wouldn't show up but I don't know how to fix it. stripslashes maybe? Ryan If I was crafty, this would be a funny signature.
TXprogrammer Posted June 23, 2004 Author Posted June 23, 2004 The quick updates contribution will work for what I need. BIG THNX! Everybody be quiet, the voices in my head are trying to tell me something!
♥bruyndoncx Posted June 23, 2004 Posted June 23, 2004 you're welcome, I love those kinds of questions :rolleyes: KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt
cali_cobra Posted June 24, 2004 Posted June 24, 2004 My client needs to have buyers be able to enter a size of gemstone and then the price calculates by carat*per_carat_fee = item_price. Is there a contribution for this?
ryanf Posted June 25, 2004 Posted June 25, 2004 you could set the price of the item to be $500/carat and then the user would enter a quantity, say .25 then it would calculate the price 500 * .25 You might have to change a little so that the user can enter the carat quantity ie make it a text field but I don't think it should be too hard. If I was crafty, this would be a funny signature.
kkkqqq Posted July 24, 2004 Posted July 24, 2004 Hi, I am not sure is this the right place to ask. But I am sure there are very comprehansive people works on this thread. My question is: All my products is small items, customer usually order 30-50 item at one time. These products is hard to distinguish by their names ut easily by the model number. I hope in the invoice.php, I can sort the order by the model number. At current time, the invoice is not sorted. Is there a way to sort the invoice? Any comments will be appreciates.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.