h3dave Posted October 10, 2007 Share Posted October 10, 2007 Hi, I am almost new to osCommerce. I am not the best in PHP neither as I am more flash familiar. I installed succesfully almost everyhting on oscommerce and severals contribs. Suddently I realised there was no way for me to have an area only visible by admins on orders and items where should be described the supplier and the model of the supplier, those that should automate all the process of making orders to my different suppliers. So I used the latest version full version avaiable at this point (2.2MS and 1.2 for the installer guide) actually created the database and everything looks OK to my for that part. Even almost everything was alright except this part of the guide: admin/includes/functions/general.php After: tep_db_query("delete from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "'"); tep_db_query("delete from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'"); Add: // Beginn Suppliers tep_db_query("delete from " . TABLE_SUPPLIERS_PRODUCTS_GROUPS . " where products_id = '" . (int)$product_id . "'"); // End Suppliers For the simple reason that there are no lines like those so I did not find where to add it... There are actually no way for me to access anything... the link that we are creating : admin/includes/boxes/[wherever you want].php Add: // Beginn Suppliers '<a href="' . tep_href_link(FILENAME_SUPPLIERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_SUPPLIERS . '</a><br>' . '<a href="' . tep_href_link(FILENAME_SUPPLIERS_PRODUCTLIST, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_SUPPLIERS_PRODUCTLIST . '</a><br>' . // End Suppliers are useless and lead to an error 404 with as address : http://www.xxxxxxxx.com/catalog/admin/FILENAME_SUPPLIERS_PRODUCTLIST if I try to replace the FILENAME_SUPPLIER_PRODUCTLIST by suppliers_productlist.php i have this answer: Fatal error: Cannot redeclare do_magic_quotes_gpc() (previously declared in /homepages/19/d193895088/htdocs/xxxxx/catalog/admin/includes/functions/compatibility.php:18) in /homepages/19/d193895088/htdocs/xxxxx/catalog/admin/includes/functions/compatibility.php on line 18 I verified /catalog/admin/includes/database_tables.php and filenames.php in the same folder, both of them are correct (if I refer to the guide found with the contrib) Actually lost, no more idea to solve this, I am probably missing something... Any ideas? Thanks for any further help, Dave Quote Light travels faster than sound. Thats why sometimes people look bright until they speak... Link to comment Share on other sites More sharing options...
h3dave Posted October 15, 2007 Author Share Posted October 15, 2007 I am still waiting if someone can help me, I rad almost everyone of the millions topics talking about compatibility.php... I noticed one thing though I didn't pasted the code of the file i am typing in the address bar to obtain such an answer. So here I go: <?php /* $Id: suppliers.php,v 1.55 2003/06/29 22:50:52 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'insert': case 'save': if (isset($HTTP_GET_VARS['hID'])) $suppliers_id = tep_db_prepare_input($HTTP_GET_VARS['hID']); $suppliers_group_name = tep_db_prepare_input($HTTP_POST_VARS['suppliers_group_name']); $sql_data_array = array('suppliers_group_name' => $suppliers_group_name, 'suppliers_group_id' => $suppliers_group_id); if ($action == 'insert') { $insert_sql_data = array('date_added' => 'now()'); $sql_data_array = array_merge($sql_data_array, $insert_sql_data); tep_db_perform(TABLE_SUPPLIERS, $sql_data_array); $suppliers_id = tep_db_insert_id(); } elseif ($action == 'save') { $update_sql_data = array('last_modified' => 'now()'); $sql_data_array = array_merge($sql_data_array, $update_sql_data); tep_db_perform(TABLE_SUPPLIERS, $sql_data_array, 'update', "suppliers_id = '" . (int)$suppliers_id . "'"); } if ($suppliers_image = new upload('suppliers_image', DIR_FS_CATALOG_IMAGES)) { tep_db_query("update " . TABLE_SUPPLIERS . " set suppliers_image = '" . $suppliers_image->filename . "' where suppliers_id = '" . (int)$suppliers_id . "'"); } $languages = tep_get_languages(); for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $suppliers_url_array = $HTTP_POST_VARS['suppliers_url']; $language_id = $languages[$i]['id']; $sql_data_array = array('suppliers_url' => tep_db_prepare_input($suppliers_url_array[$language_id])); if ($action == 'insert') { $insert_sql_data = array('suppliers_id' => $suppliers_id, 'languages_id' => $language_id); $sql_data_array = array_merge($sql_data_array, $insert_sql_data); tep_db_perform(TABLE_SUPPLIERS_INFO, $sql_data_array); } elseif ($action == 'save') { tep_db_perform(TABLE_SUPPLIERS_INFO, $sql_data_array, 'update', "suppliers_id = '" . (int)$suppliers_id . "' and languages_id = '" . (int)$language_id . "'"); } } if (USE_CACHE == 'true') { tep_reset_cache_block('manufacturers'); } tep_redirect(tep_href_link(FILENAME_SUPPLIERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'hID=' . $suppliers_id)); break; case 'deleteconfirm': $suppliers_id = tep_db_prepare_input($HTTP_GET_VARS['hID']); if (isset($HTTP_POST_VARS['delete_image']) && ($HTTP_POST_VARS['delete_image'] == 'on')) { $manufacturer_query = tep_db_query("select suppliers_image from " . TABLE_SUPPLIERS . " where suppliers_id = '" . (int)$suppliers_id . "'"); $manufacturer = tep_db_fetch_array($manufacturer_query); $image_location = DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG_IMAGES . $manufacturer['suppliers_image']; if (file_exists($image_location)) @unlink($image_location); } tep_db_query("delete from " . TABLE_SUPPLIERS . " where suppliers_id = '" . (int)$suppliers_id . "'"); tep_db_query("delete from " . TABLE_SUPPLIERS_INFO . " where suppliers_id = '" . (int)$suppliers_id . "'"); // if (isset($HTTP_POST_VARS['delete_products']) && ($HTTP_POST_VARS['delete_products'] == 'on')) { // $products_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where suppliers_id = '" . (int)$suppliers_id . "'"); // while ($products = tep_db_fetch_array($products_query)) { // tep_remove_product($products['products_id']); // } // } else { // tep_db_query("update " . TABLE_PRODUCTS . " set suppliers_id = '' where suppliers_id = '" . (int)$suppliers_id . "'"); // } if (USE_CACHE == 'true') { tep_reset_cache_block('manufacturers'); } tep_redirect(tep_href_link(FILENAME_SUPPLIERS, 'page=' . $HTTP_GET_VARS['page'])); 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();"> <!-- 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 width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_SUPPLIERS; ?></td> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_SUPPLIERS_GROUP_ID; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td> </tr> <?php $manufacturers_query_raw = "select suppliers_id, suppliers_group_name, suppliers_image, date_added, last_modified, suppliers_group_id from " . TABLE_SUPPLIERS . " order by suppliers_group_name"; $manufacturers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $manufacturers_query_raw, $manufacturers_query_numrows); $manufacturers_query = tep_db_query($manufacturers_query_raw); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { if ((!isset($HTTP_GET_VARS['hID']) || (isset($HTTP_GET_VARS['hID']) && ($HTTP_GET_VARS['hID'] == $manufacturers['suppliers_id']))) && !isset($mInfo) && (substr($action, 0, 3) != 'new')) { // $manufacturer_products_query = tep_db_query("select count(*) as products_count from " . TABLE_PRODUCTS . " where suppliers_id = '" . (int)$manufacturers['suppliers_id'] . "'"); // $manufacturer_products = tep_db_fetch_array($manufacturer_products_query); $mInfo_array = array_merge($manufacturers, $manufacturer_products); $mInfo = new objectInfo($mInfo_array); } if (isset($mInfo) && is_object($mInfo) && ($manufacturers['suppliers_id'] == $mInfo->suppliers_id)) { echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_SUPPLIERS, 'page=' . $HTTP_GET_VARS['page'] . '&hID=' . $manufacturers['suppliers_id'] . '&action=edit') . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_SUPPLIERS, 'page=' . $HTTP_GET_VARS['page'] . '&hID=' . $manufacturers['suppliers_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent"><?php echo $manufacturers['suppliers_group_name']; ?></td> <td class="dataTableContent"><?php echo $manufacturers['suppliers_group_id']; ?></td> <td class="dataTableContent" align="right"><?php if (isset($mInfo) && is_object($mInfo) && ($manufacturers['suppliers_id'] == $mInfo->suppliers_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_SUPPLIERS, 'page=' . $HTTP_GET_VARS['page'] . '&hID=' . $manufacturers['suppliers_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td> </tr> <?php } ?> <tr> <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText" valign="top"><?php echo $manufacturers_split->display_count($manufacturers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_MANUFACTURERS); ?></td> <td class="smallText" align="right"><?php echo $manufacturers_split->display_links($manufacturers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td> </tr> </table></td> </tr> <?php if (empty($action)) { ?> <tr> <td align="right" colspan="2" class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_SUPPLIERS, 'page=' . $HTTP_GET_VARS['page'] . '&hID=' . $mInfo->suppliers_id . '&action=new') . '">' . tep_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td> </tr> <?php } ?> </table></td> <?php $heading = array(); $contents = array(); switch ($action) { case 'new': $heading[] = array('text' => '<b>' . TEXT_HEADING_NEW_SUPPLIERS . '</b>'); $contents = array('form' => tep_draw_form('manufacturers', FILENAME_SUPPLIERS, 'action=insert', 'post', 'enctype="multipart/form-data"')); $contents[] = array('text' => TEXT_NEW_INTRO); $contents[] = array('text' => '<br>' . TEXT_SUPPLIERS_NAME . '<br>' . tep_draw_input_field('suppliers_group_name')); $contents[] = array('text' => '<br>' . TEXT_SUPPLIERS_GROUP_ID . '<br>' . tep_draw_input_field('suppliers_group_id')); $contents[] = array('text' => '<br>' . TEXT_SUPPLIERS_IMAGE . '<br>' . tep_draw_file_field('suppliers_image')); $manufacturer_inputs_string = ''; $languages = tep_get_languages(); for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $manufacturer_inputs_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('suppliers_url[' . $languages[$i]['id'] . ']'); } $contents[] = array('text' => '<br>' . TEXT_SUPPLIERS_URL . $manufacturer_inputs_string); $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_SUPPLIERS, 'page=' . $HTTP_GET_VARS['page'] . '&hID=' . $HTTP_GET_VARS['hID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; case 'edit': $heading[] = array('text' => '<b>' . TEXT_HEADING_EDIT_SUPPLIERS . '</b>'); $contents = array('form' => tep_draw_form('manufacturers', FILENAME_SUPPLIERS, 'page=' . $HTTP_GET_VARS['page'] . '&hID=' . $mInfo->suppliers_id . '&action=save', 'post', 'enctype="multipart/form-data"')); $contents[] = array('text' => TEXT_EDIT_INTRO); $contents[] = array('text' => '<br>' . TEXT_SUPPLIERS_NAME . '<br>' . tep_draw_input_field('suppliers_group_name', $mInfo->suppliers_group_name)); $contents[] = array('text' => '<br>' . TEXT_SUPPLIERS_GROUP_ID . '<br>' . tep_draw_input_field('suppliers_group_id', $mInfo->suppliers_group_id)); $contents[] = array('text' => '<br>' . TEXT_SUPPLIERS_IMAGE . '<br>' . tep_draw_file_field('suppliers_image') . '<br>' . $mInfo->suppliers_image); $manufacturer_inputs_string = ''; $languages = tep_get_languages(); for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $manufacturer_inputs_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('suppliers_url[' . $languages[$i]['id'] . ']', tep_get_manufacturer_url($mInfo->suppliers_id, $languages[$i]['id'])); } $contents[] = array('text' => '<br>' . TEXT_SUPPLIERS_URL . $manufacturer_inputs_string); $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_SUPPLIERS, 'page=' . $HTTP_GET_VARS['page'] . '&hID=' . $mInfo->suppliers_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; case 'delete': $heading[] = array('text' => '<b>' . TEXT_HEADING_DELETE_SUPPLIERS . '</b>'); $contents = array('form' => tep_draw_form('manufacturers', FILENAME_SUPPLIERS, 'page=' . $HTTP_GET_VARS['page'] . '&hID=' . $mInfo->suppliers_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_DELETE_INTRO); $contents[] = array('text' => '<br><b>' . $mInfo->suppliers_group_name . '</b>'); $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('delete_image', '', true) . ' ' . TEXT_DELETE_IMAGE); if ($mInfo->products_count > 0) { $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('delete_products') . ' ' . TEXT_DELETE_PRODUCTS); $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $mInfo->products_count)); } $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_SUPPLIERS, 'page=' . $HTTP_GET_VARS['page'] . '&hID=' . $mInfo->suppliers_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; default: if (isset($mInfo) && is_object($mInfo)) { $heading[] = array('text' => '<b>' . $mInfo->suppliers_group_name . '</b>'); $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_SUPPLIERS, 'page=' . $HTTP_GET_VARS['page'] . '&hID=' . $mInfo->suppliers_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_SUPPLIERS, 'page=' . $HTTP_GET_VARS['page'] . '&hID=' . $mInfo->suppliers_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>'); $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($mInfo->date_added)); if (tep_not_null($mInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($mInfo->last_modified)); $contents[] = array('text' => '<br>' . tep_info_image($mInfo->suppliers_image, $mInfo->suppliers_group_name)); $contents[] = array('text' => '<br>' . TEXT_PRODUCTS . ' ' . $mInfo->products_count); } break; } if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) { echo ' <td width="25%" valign="top">' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo ' </td>' . "\n"; } ?> </tr> </table></td> </tr> </table></td> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> I can't get why this answer comes up everytime there s no do_magic_quotes_gpc() in this at all maybe should I add an: function do_magic_quotes_gpc(&$ar) { if (!is_array($ar)) return false; reset($ar); while (list($key, $value) = each($ar)) { if (is_array($ar[$key])) { do_magic_quotes_gpc($ar[$key]); } else { $ar[$key] = addslashes($value); } } reset($ar); } or an: reset($ar); If yes can you please suggest me where and which of these answers should be good? Thanks for any further help, Dave P.S.:we should be able to post an update to that contrib afterwards so that it would work with new MS2.2 also Quote Light travels faster than sound. Thats why sometimes people look bright until they speak... Link to comment Share on other sites More sharing options...
h3dave Posted October 17, 2007 Author Share Posted October 17, 2007 Am I the only one interested to have the ability to put the supplier model and the supplier itself on hes store? I do believe that any store that have suppliers don't want to use the same model as the one from supplier as it allow everyone to just copy the model name in google, to finally find out the supplier and it prices... Even worster all the customers are actually able to order from them with that method unless each store makes its own database and web access to it just to add supplier model and supplier name to everything into their store... I saw many problems all around a way more difficult to solve, that all had at least one reply from experts. Well still many thanks to anyone that would help me, if there is any at a time... Dave Quote Light travels faster than sound. Thats why sometimes people look bright until they speak... Link to comment Share on other sites More sharing options...
h3dave Posted March 3, 2008 Author Share Posted March 3, 2008 Still up with the : Fatal error: Call to undefined function: tep_not_null() in /homepages/19/d193895088/htdocs/egenius/catalog/admin/suppliers.php on line 19 this is the code it refers to: 11 require('includes/application_top.php'); 12 13 14 15 reset($ar); 16 17 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); 18 19 if (tep_not_null($action)) { 20 switch ($action) { 21 case 'insert': 21 case 'save': 22 if (isset($HTTP_GET_VARS['hID'])) $suppliers_id = tep_db_prepare_input($HTTP_GET_VARS['hID']); 23 $suppliers_group_name = tep_db_prepare_input($HTTP_POST_VARS['suppliers_group_name']); 24 $sql_data_array = array('suppliers_group_name' => $suppliers_group_name, 25 'suppliers_group_id' => $suppliers_group_id); I already verified if 'tep_not_null' was present with grep tep_not_null * -r via SSH panel, anything is ok; apart this supplier module... Would be very appreciated to have any help as I am stuck with it since october with no comments at all yet... Dave Quote Light travels faster than sound. Thats why sometimes people look bright until they speak... Link to comment Share on other sites More sharing options...
h3dave Posted March 25, 2008 Author Share Posted March 25, 2008 (edited) No one is up with this? Any contrib that you should refer me to then? I really want something similar, where I should add the supplier, the price I am paying and the model on their end. Still surprised no one is interested to help me with this, as I did not realized that I am the only one with these needs. Kind regards, Dave Edited March 25, 2008 by Jan Zonjee Quote Light travels faster than sound. Thats why sometimes people look bright until they speak... Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.