function getLensParamHTMLforRow($lens) { $html = "\n\n"; $html .= "\n_____________________________________________\n\n"; $html .= $lens['name']; $html .= "\n_____________________________________________\n\n"; $html .= "EyeDock listing: http://www.eyedock.com/index.php?option=com_pnlenses#view=detail&id=" . $lens['tid'] . "\n"; $html .= "Fitting guide: " . $lens['fitting_guide'] . "\n"; $html .= "Lens Website: " . $lens['website'] . " \n "; $html .= "Image: "; if ($lens['images'] != "") { $images = explode(",", $lens['images']); $html .= "image on file (see listing)\n"; } else { $html .= "no image - could you provide one?\n"; } $html .= "Material: " . $lens['material']; $html .= "\n --> (FDA group: " . checkForNull($lens['fda']); $html .= ", Water content: " . checkForNull($lens['h2o']); $html .= ", Modulus: " . checkForNull($lens['modulus']); $html .= ", dk: "; if ($lens['polydk'] > 0) { $html .= checkForNull($lens['polydk']); } else { $html .= checkForNull($lens['dk']); } $html .= ")\n"; $html .= "Visibility Tint? " . yesOrNo($lens['visitint']) . "\n"; $html .= "Extended wear? " . yesOrNo($lens['ew']) . "\n"; $html .= "Center thickness: " . checkForNull($lens['ct']) . "\n"; $html .= "DK: " . checkForNull($lens['dk']) . "\n"; $html .= "OZ: " . checkForNull($lens['oz']) . "\n"; $html .= "Quantity : " . checkForNull($lens['qty']) . "\n"; $html .= "Replacement: " . checkForNull($lens['replace_text']) . "\n"; $html .= "Wear type: " . checkForNull($lens['wear']) . "\n"; $html .= "Appearance: " . checkForNull($lens['markings']) . "\n"; if ($lens['toric'] == 1) { $html .= "Toric type: " . checkForNull($lens['toric_type']) . "\n"; } if ($lens['bifocal'] == 1) { $html .= "Bifocal type: " . checkForNull($lens['bifocal_type']) . "\n"; } $html .= "\n------Parameters--------\n"; $html .= getPowerHTMLforLens($lens); $html .= "\n-- Wholesale price -- \n" . clearHTML(checkForNull($lens['price'])); $html .= "\n -> note: wholesale prices are not visible to the public"; $html .= "\n\n-- Other info: --\n" . clearHTML(checkForNull($lens['other_info'])) . "\n"; //$html .= "\n"; return $html; }
function runTrackingScript($textToInsert, $conn, $key) { //SEARCHING DATABASE WITH KEY TO GET LONGLINK $jQueryAPI = "<script src='//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'></script>"; $link = selectDataFromDatabase($key, $conn); $htmlFileName = duplicateHtml($link); $html = downloadAndCreateImage($link, $htmlFileName); clearHTML($html); $contents = file_get_contents("{$htmlFileName}"); $text = $jQueryAPI . $textToInsert; $newContent = preg_replace("</head>", $text . "</head", $contents); file_put_contents($htmlFileName, $newContent); }