/** * This function is used to get the price compare page * * . * * @return string */ function showPriceComparePage() { $obj = new Bin_Query(); $sql = "select set_value from admin_settings_table where set_name='www.pricerunner.com Affiliate ID'"; if ($obj->executeQuery($sql)) { $pricerunnerid = $obj->records[0]['set_value']; } $output = Display_DPriceCompare::showPriceComparePage($pricerunnerid); return $output; }
/** * This function is used to Display the Price Compare Page * @param int $pricerunnerid * @return string */ function showPriceComparePage($pricerunnerid) { $keyword = $_GET[keyword]; $server_ip = $_SERVER['SERVER_ADDR']; $pr_error = 0; // pricerunner error flag $fname = 'http://cgi.vcss.search123.uk.com/cgi-bin/prfeed.cgi?aid="' . $pricerunnerid . '"&cp1=query&co=us&query="' . $keyword . '"&ip=' . $server_ip; $data = @file($fname); if (is_array($data) and count($data) > 0) { $content = implode('', $data); $products = Display_DPriceCompare::readCSEContent($content); $products = $products[0]; for ($i = 0; $i < 5; $i++) { if ($i < round($products[product_num_ratings])) { $img .= '<img src="images/starf.png" />'; } else { $img .= '<img src="images/stare.png" />'; } } $noof_retailers = $products[product_number_of_retailers]; $output['priceList'] = ''; $output['priceList'] = '<div><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="100%" colspan="2" class="serachresult">Compare Price </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"><div> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="33%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="' . $_SESSION['base_url'] . '/' . $products['product_image_url0'] . '" alt="camera" width="213" height="153" /></td> </tr> </table></td> <td width="67%" valign="top" class="itemDETAIL"> <ul>' . $products['product_name'] . ' <li><div>$ ' . $products['product_lowest_price'] . ' <a href="#"></a></div> </li> <li>User Rating : ' . $img . '</li> <li>Manufaturer : ' . $products['product_manufacturer'] . '</li> </ul></td> </tr> </table> </div></td> </tr> <tr> <td colspan="2" class="line"> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2" class="compare_txt">' . $noof_retailers . ' Store(s) Found</td> </tr> <tr> <td colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td width="26%" bgcolor="#FFFFFF" class="viewcartTITLE" style="padding-left:10px;">Retailer</td> <td width="39%" bgcolor="#FFFFFF" class="viewcartTITLE" style="padding-left:10px;">Availability</td> <td width="17%" bgcolor="#FFFFFF" class="viewcartTITLE" style="padding-left:10px;">Price</td> <td width="18%" bgcolor="#FFFFFF" class="viewcartTITLE" style="padding-left:10px;">Store Link</td> </tr>'; for ($i = 0; $i < $noof_retailers; $i++) { $output['priceList'] .= '<tr><td bgcolor="#FFFFFF" class="compare_txt2">'; $link = 'Not Available'; if ($products['retailer' . $i]['link'] != '') { $link = '<a href="' . str_replace('"', '"', $products['retailer' . $i]['link']) . '">Go to Store</a>'; $output['priceList'] .= '<a href="' . str_replace('"', '"', $products['retailer' . $i]['link']) . '"><img src="' . $products['retailer' . $i]['logo'] . '" alt="' . $products['retailer' . $i]['name'] . '" width="110" height="28" border=0/></a>'; } else { $output['priceList'] .= '<img src="' . $products['retailer' . $i]['logo'] . '" alt="' . $products['retailer' . $i]['name'] . '" width="110" height="28" border=0/>'; } $output['priceList'] .= '</td> <td bgcolor="#FFFFFF" class="compare_txt">' . $products['retailer' . $i]['stock-info'] . ' </td> <td bgcolor="#FFFFFF" class="compare_txt">$ ' . $products['retailer' . $i]['price'] . ' </td> <td align="right" valign="middle" bgcolor="#FFFFFF" class="go_store">' . $link . ' </td> </tr>'; } $output['priceList'] .= '</table></td> </tr> <tr> <td colspan="2"> </td> </tr> </table> </div>'; } else { $output['priceList'] = 'Price comparison service is not available now'; } return $output['priceList']; }