function getCompanyLensesReport($id) { $mysqli = DBAccess::getConnection(); $query = "\n\t\tSELECT `pn_tid` AS tid, `pn_name` AS name, `pn_comp_id` AS comp_id, `pn_poly_id` AS poly_id, pn_fda_grp as fda, pn_h2o as h2o, pn_poly_dk as polydk, pn_poly_name as material, pn_poly_modulus as modulus,\n\t\t`pn_visitint` AS visitint, `pn_ew` AS ew, `pn_ct` AS ct, `pn_dk` AS dk, `pn_oz` AS oz, `pn_process_text` AS \nprocess , `pn_qty` AS qty, `pn_replace_text` AS replace_text, `pn_wear` AS wear, `pn_price` AS price, `pn_markings` AS markings, pn_image AS images,\nconcat ( IF (`pn_fitting_guide` LIKE 'modules/%', 'http://www.eyedock.com/', ''), `pn_fitting_guide`) AS fitting_guide,\n `pn_website` AS website, `pn_other_info` AS other_info, `pn_discontinued` AS discontinued, `pn_bc_all` AS bc_all, `pn_diam_all` AS diam_all, `pn_max_plus` AS max_plus, `pn_max_minus` AS max_minus, `pn_max_diam` AS max_diam, `pn_min_diam` AS min_diam, `pn_toric` AS toric, `pn_toric_type` AS toric_type, `pn_max_cyl_power` AS max_cyl_power, `pn_bifocal` AS bifocal, `pn_bifocal_type` AS bifocal_type, `pn_max_add` AS max_add, `pn_cosmetic` AS cosmetic\nFROM pn_lenses left join pn_lenses_polymers on pn_poly_id = pn_poly_tid\nWHERE pn_comp_id = {$id}\nAND pn_display =1\n\t"; $result = $mysqli->selectQuery($query); $lensListing = ""; $discontinuedArray = array(); while ($row = $result->fetch_assoc()) { if ($row['discontinued'] == 1) { $discontinuedArray[] = $row['name']; continue; } $lensListing .= getLensParamHTMLforRow($row); } $report = $lensListing; $report .= "\n\n\nNEW LENSES? Fill in the following form (copy and paste as needed)\n"; $report .= "____________________________\n\n"; $report .= getBlankLens(); if (count($discontinuedArray) > 0) { $discontinuedList = implode("\n", $discontinuedArray); $report .= "\n\n\nDISCONTINUED LENSES\n"; $report .= "________________________\n"; $report .= $discontinuedList; } return $report; }
function getCompanyLensesReport($id) { global $mysqli; $sql = "\n\t\tSELECT `pn_tid` AS tid, `pn_name` AS name, `pn_comp_id` AS comp_id, `pn_poly_id` AS poly_id, pn_fda_grp as fda, pn_h2o as h2o, pn_poly_dk as polydk, pn_poly_name as material, pn_poly_modulus as modulus,\n\t\t`pn_visitint` AS visitint, `pn_ew` AS ew, `pn_ct` AS ct, `pn_dk` AS dk, `pn_oz` AS oz, `pn_process_text` AS \nprocess , `pn_qty` AS qty, `pn_replace_text` AS replace_text, `pn_wear` AS wear, `pn_price` AS price, `pn_markings` AS markings, pn_image AS images,\nconcat ( IF (`pn_fitting_guide` LIKE 'modules/%', 'http://www.eyedock.com/', ''), `pn_fitting_guide`) AS fitting_guide,\n `pn_website` AS website, `pn_other_info` AS other_info, `pn_discontinued` AS discontinued, `pn_bc_all` AS bc_all, `pn_diam_all` AS diam_all, `pn_max_plus` AS max_plus, `pn_max_minus` AS max_minus, `pn_max_diam` AS max_diam, `pn_min_diam` AS min_diam, `pn_toric` AS toric, `pn_toric_type` AS toric_type, `pn_max_cyl_power` AS max_cyl_power, `pn_bifocal` AS bifocal, `pn_bifocal_type` AS bifocal_type, `pn_max_add` AS max_add, `pn_cosmetic` AS cosmetic\nFROM pn_lenses left join pn_lenses_polymers on pn_poly_id = pn_poly_tid\nWHERE pn_comp_id = {$id}\nAND pn_display =1\n\t"; $result = $mysqli->query($sql); $lensListing = ""; $discontinuedArray = array(); while ($row = $result->fetch_assoc()) { if ($row['discontinued'] == 1) { $discontinuedArray[] = $row['name']; continue; } $lensListing .= getLensParamHTMLforRow($row); } echo $lensListing; $discontinuedList = implode(", ", $discontinuedArray); echo $discontinuedList; }