<% /********************************************************************************* * Filename: search.php * Generated with CodeCharge 2.0.1 * PHP 4.0 & Templates build 10/09/2001 *********************************************************************************/ //------------------------------- // search CustomIncludes begin include ("./common.php"); include ("./header.php"); include ("./footer.php"); // search CustomIncludes end //------------------------------- session_start(); //=============================== // Save Page and File Name available into variables //------------------------------- $filename = "search.php"; $template_filename = "search.html"; //=============================== //=============================== // search PageSecurity begin // search PageSecurity end //=============================== //=============================== // search Open Event begin // search Open Event end //=============================== //=============================== // search OpenAnyPage Event start // search OpenAnyPage Event end //=============================== //=============================== //Save the name of the form and type of action into the variables //------------------------------- $sAction = get_param("FormAction"); $sForm = get_param("FormName"); //=============================== // search Show begin //=============================== // Display page //------------------------------- // Load HTML template for this page //------------------------------- $tpl = new Template($app_path); $tpl->load_file($template_filename, "main"); //------------------------------- // Load HTML template of Header and Footer //------------------------------- $tpl->load_file($header_filename, "Header"); $tpl->load_file($footer_filename, "Footer"); //------------------------------- $tpl->set_var("FileName", $filename); //------------------------------- // Step through each form //------------------------------- Menu_show();Footer_show();Search_show();Printer_show();infosearch_show(); //------------------------------- // Process page templates //------------------------------- $tpl->parse("Header", false); $tpl->parse("Footer", false); //------------------------------- // Output the page to the browser //------------------------------- $tpl->pparse("main", false); // search Show end //=============================== // search Close Event begin // search Close Event end //=============================== //******************************************************************************** //=============================== // Display Search Form //------------------------------- function Search_show() { global $db; global $tpl; global $sForm; $sFormTitle = "Advanced Product Search"; $sActionFileName = "advsearchresults.php"; //------------------------------- // Search Open Event begin // Search Open Event end //------------------------------- $tpl->set_var("FormTitle", $sFormTitle); $tpl->set_var("ActionPage", $sActionFileName); //------------------------------- // Set variables with search parameters //------------------------------- $fldCATEGORY = strip(get_param("CATEGORY")); $fldPARTNO = strip(get_param("PARTNO")); //-----Added by Michael $fldMFRCODE = strip(get_param("MFRCODE")); //-----End of Added by Michael $fldDESCRIP2 = strip(get_param("DESCRIP2")); $fldpricemin = strip(get_param("pricemin")); $fldpricemax = strip(get_param("pricemax")); //------------------------------- // Search Show begin //------------------------------- //------------------------------- // Search Show Event begin // Search Show Event end //------------------------------- $tpl->set_var("SearchLBCATEGORY", ""); //-----Added by Michael to default to ALL categories $tpl->set_var("ID", ""); $tpl->set_var("Value", "All"); $tpl->set_var("Selected", ""); $tpl->parse("SearchLBCATEGORY", ""); //-----End of Added by Michael $lookup_CATEGORY = db_fill_array("select distinct CATEGORY,CATEGORY from items_detail order by CATEGORY ASC"); if(is_array($lookup_CATEGORY)) { reset($lookup_CATEGORY); while(list($key, $value) = each($lookup_CATEGORY)) { $tpl->set_var("ID", $key); $tpl->set_var("Value", $value); if($key == $fldCATEGORY) $tpl->set_var("Selected", "SELECTED" ); else $tpl->set_var("Selected", ""); $tpl->parse("SearchLBCATEGORY", true); } } $tpl->set_var("items_detailLBMFRCODE", ""); $tpl->set_var("ID3", ""); $tpl->set_var("Value", "All"); $tpl->set_var("Selected", ""); $tpl->parse("items_detailLBMFRCODE", true); $lookup_MFRCODE = db_fill_array("select M_ID, M_Label from manufacturers order by 2"); if(is_array($lookup_MFRCODE)) { reset($lookup_MFRCODE); while(list($key, $value) = each($lookup_MFRCODE)) { $tpl->set_var("ID3", $key); $tpl->set_var("Value", $value); if($key == $fldMFRCODE) $tpl->set_var("Selected", "SELECTED" ); else $tpl->set_var("Selected", ""); $tpl->parse("items_detailLBMFRCODE", true); } } $tpl->set_var("PARTNO", tohtml($fldPARTNO)); $tpl->set_var("DESCRIP2", tohtml($fldDESCRIP2)); $tpl->set_var("pricemin", tohtml($fldpricemin)); $tpl->set_var("pricemax", tohtml($fldpricemax)); //------------------------------- // Search Show end //------------------------------- //------------------------------- // Search Close Event begin // Search Close Event end //------------------------------- $tpl->parse("FormSearch", false); //=============================== } //=============================== // Display Search Form //------------------------------- function Printer_show() { global $db; global $tpl; global $sForm; $sFormTitle = "Search by Printer or OEM Cartridge"; $sActionFileName = "modelsearch.php"; //------------------------------- // Printer Open Event begin // Printer Open Event end //------------------------------- $tpl->set_var("FormTitle", $sFormTitle); $tpl->set_var("ActionPage", $sActionFileName); //------------------------------- // Set variables with search parameters //------------------------------- $fldOEM_Brand = strip(get_param("OEM_Brand")); //------------------------------- // Printer Show begin //------------------------------- //------------------------------- // Printer Show Event begin // Printer Show Event end //------------------------------- $tpl->set_var("PrinterLBOEM_Brand", ""); $lookup_OEM_Brand = db_fill_array("select OEM_Brand, OEM_Brand from printerbrands order by 2"); if(is_array($lookup_OEM_Brand)) { reset($lookup_OEM_Brand); while(list($key, $value) = each($lookup_OEM_Brand)) { $tpl->set_var("ID", $key); $tpl->set_var("Value", $value); if($key == $fldOEM_Brand) $tpl->set_var("Selected", "SELECTED" ); else $tpl->set_var("Selected", ""); $tpl->parse("PrinterLBOEM_Brand", true); } } //------------------------------- // Printer Show end //------------------------------- //------------------------------- // Printer Close Event begin // Printer Close Event end //------------------------------- $tpl->parse("FormPrinter", false); //=============================== } //=============================== // Display Menu Form //------------------------------- function infosearch_show() { global $tpl; global $db; $sFormTitle = ""; //------------------------------- // infosearch Open Event begin // infosearch Open Event end //------------------------------- //------------------------------- // Set URLs //------------------------------- //------------------------------- // infosearch Show begin //------------------------------- $tpl->set_var("FormTitle", $sFormTitle); //------------------------------- // infosearch BeforeShow Event begin // infosearch BeforeShow Event end //------------------------------- //------------------------------- // Show fields //------------------------------- $tpl->parse("Forminfosearch", false); //------------------------------- // infosearch Show end //------------------------------- } //=============================== %>