function getLensParamHTMLforRow($lens) { $html = "<p> </p>"; $html .= "<p><table border='1' cellspacing='0' width='400px' bordercolor='#cae0eb'>"; $html .= "<tr><td colspan='2'><h2>" . $lens['name'] . "</h2></td></tr>"; if ($lens['images'] != "") { $images = explode(",", $lens['images']); $html .= "<tr><td colspan='2'>"; foreach ($images as $image) { $image = trim($image, " \\s"); $html .= "<img src='http://www.eyedock.com/modules/Lenses/pnimages/lens_images/" . $image . "' />"; } $html .= "</td></tr>"; } else { $html .= "<tr><td colspan='2'>[No images available for this lens]</td></tr>"; } $html .= "<tr><td>Material</td><td>" . $lens['material'] . "<br/>"; $html .= " - FDA group: " . checkForNull($lens['fda']) . "<br/>"; $html .= " - Water content: " . checkForNull($lens['h2o']) . "<br/>"; $html .= " - Modulus: " . checkForNull($lens['modulus']) . "<br/>"; $html .= " - dk:"; if ($lens['polydk'] > 0) { $html .= checkForNull($lens['polydk']); } else { $html .= checkForNull($lens['dk']); } $html .= "</td></tr>"; $html .= "<tr><td>Visibility Tint?</td><td> " . yesOrNo($lens['visitint']) . "</td></tr> "; $html .= "<tr><td>OK for extended wear?</td><td> " . yesOrNo($lens['ew']) . "</td></tr> "; $html .= "<tr><td>Center thickness: </td><td> " . checkForNull($lens['ct']) . "</td></tr> "; $html .= "<tr><td>DK: </td><td> " . checkForNull($lens['dk']) . "</td></tr> "; $html .= "<tr><td>OZ:</td><td> " . checkForNull($lens['oz']) . "</td></tr> "; $html .= "<tr><td>Quantity : </td><td> " . checkForNull($lens['qty']) . "</td></tr> "; $html .= "<tr><td>Replacement: </td><td> " . checkForNull($lens['replace_text']) . "</td></tr> "; $html .= "<tr><td>Wear type: </td><td> " . checkForNull($lens['wear']) . "</td></tr> "; $html .= "<tr><td>Wholesale price :</td><td> " . checkForNull($lens['price']) . "</td></tr> "; $html .= "<tr><td>Appearance: </td><td> " . checkForNull($lens['markings']) . "</td></tr> "; $html .= "<tr><td>Fitting guide:</td><td> <a href='" . $lens['fitting_guide'] . "'>" . $lens['fitting_guide'] . " </a></td></tr> "; $html .= "<tr><td>Lens Website:</td><td> <a href='" . $lens['website'] . "'>" . $lens['website'] . " </a></td></tr> "; $html .= "<tr><td>Other info:</td><td> " . checkForNull($lens['other_info']) . "</td></tr>"; $html .= "<tr><td colspan='2'>Parameters:<br/>"; $html .= getPowerHTMLforLens($lens); $html .= "</td></tr>"; $html .= "</table></p>"; return $html; }
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; }
echo "Class Number: " . $class['classNum'] . "<br>"; echo "Class Id: " . $class['classId'] . "<br>"; echo "Semester: " . $class['semester'] . " " . $class['year'] . "<br>"; echo "Capacity: " . $class['maxEnrollment'] . "<br>"; echo "<h2>Prerequisites</h2>\n\t<ul>"; if ($prereqs->num_rows == 0) { echo "<li>None</li>"; } while ($required = $prereqs->fetch_array(MYSQLI_ASSOC)) { echo "<li>" . $required['requiredClassNum'] . " - " . $required['className'] . "</li>"; } echo "</ul>"; } else { // List all instructors $classList = $db->query("SELECT Class.classId, className, classNum, sectionNum, semester, year, open, finished, Instructor.name, Instructor.userId FROM Class\n\tLEFT JOIN Teaches ON Class.classId=Teaches.classId\n\tLEFT JOIN Instructor ON Teaches.userId=Instructor.userId\n\tORDER BY Class.classId"); echo "<table><tr><th>ID#</th><th>Name</th><th>Class Number</th><th>Section</th><th>Semester</th><th>Open?</th><th>Finished?</th><th>Instructor</th><th>More info</th></tr>"; while ($class = $classList->fetch_array(MYSQLI_ASSOC)) { echo "<tr><td>" . $class['classId'] . "</td><td>" . $class['className'] . "</td><td>" . $class['classNum'] . "</td><td>" . $class['sectionNum'] . "</td>"; echo "<td>" . $class['semester'] . " " . $class['year'] . "</td>"; echo "<td>" . yesOrNo($class['open']) . "</td>" . "<td>" . yesOrNo($class['finished']) . "</td>"; if (empty($class['name'])) { echo "<td>None. <a href='admin_teaches.php?classId=" . $class['classId'] . "'>(Add)</a></td>"; } else { echo "<td>" . $class['name'] . " <a href='admin_teaches.php?classId=" . $class['classId'] . "&userId=" . $class['userId'] . "'>(Remove)</a></td>"; } echo "<td><a href='admin_classes.php?classId=" . $class['classId'] . "'>More info</a></td>"; echo "</tr>"; } echo "</table>"; } printFooter("admin");
} else { echo checkForNull($lens['dk']); } ?> </td></tr> <tr><td>Visibility Tint?</td><td> <?php echo yesOrNo($lens['visitint']); ?> </td></tr> <tr><td>OK for extended wear?</td><td> <?php echo yesOrNo($lens['ew']); ?> </td></tr> <tr><td>Center thickness: </td><td> <?php echo checkForNull($lens['ct']); ?> </td></tr> <tr><td>DK: </td><td> <?php echo checkForNull($lens['dk']); ?> </td></tr> <tr><td>OZ:</td><td> <?php echo checkForNull($lens['oz']); ?> </td></tr> <tr><td>Quantity : </td><td> <?php
$infoText .= "<tr><td colspan='2'>"; foreach ($images as $image) { $image = trim($image, " \\s"); $infoText .= "<img src='http://www.eyedock.com/modules/Lenses/pnimages/lens_images/" . $image . "' />"; } $infoText .= "</td></tr>"; } $infoText .= "<tr><td>Material</td><td>" . $lens['material'] . "<br/>"; $infoText .= " - FDA group: " . checkForNull($lens['fda']) . "<br/>"; $infoText .= " - Water content: " . checkForNull($lens['h2o']) . "<br/>"; $infoText .= " - Modulus: " . checkForNull($lens['modulus']) . "<br/>"; if ($lens['polydk'] > 0) { $infoText .= " : - dk: " . checkForNull($lens['polydk']) . "</td></tr>"; } $infoText .= "<tr><td>Visibility Tint?</td><td> " . yesOrNo($lens['visitint']) . "</td></tr>"; $infoText .= "<tr><td>OK for extended wear?</td><td> " . yesOrNo($lens['ew']) . "</td></tr>"; $infoText .= "<tr><td>Center thickness: </td><td>" . checkForNull($lens['ct']) . "</td></tr>"; $infoText .= "<tr><td>DK: </td><td>" . checkForNull($lens['dk']) . "</td></tr>"; $infoText .= "<tr><td>OZ:</td><td> " . checkForNull($lens['oz']) . "</td></tr>"; $infoText .= "<tr><td>Quantity : </td><td>" . checkForNull($lens['qty']) . "</td></tr>"; $infoText .= "<tr><td>Replacement: </td><td>" . checkForNull($lens['replace_text']) . "</td></tr>"; $infoText .= "<tr><td>Wear type: </td><td>" . checkForNull($lens['wear']) . "</td></tr>"; $infoText .= "<tr><td>Wholesale price :</td><td> " . checkForNull($lens['price']) . "</td></tr>"; $infoText .= "<tr><td>Appearance: </td><td>" . checkForNull($lens['markings']) . "</td></tr>"; $infoText .= "<tr><td>Fitting guide:</td><td> <a href='" . $lens['fitting_guide'] . "'>" . $lens['fitting_guide'] . " </a></td></tr>"; $infoText .= "<tr><td>Lens Website:</td><td> <a href='" . $lens['website'] . "'>" . $lens['website'] . " </a></td></tr>"; $infoText .= "<tr><td>Other info:</td><td> " . checkForNull($lens['other_info']) . "</td></tr>"; $infoText .= "<tr><td colspan='2'>Parameters:<br/>"; $powers = $lens['powers']; $variation = 1; $pwrCount = count($powers);
$where = $where . " AND status = 10 "; } if ($_POST['type'] == 0 || isset($_SESSION['opt6'])) { } else { $where = $where . " AND Notifications.ntype = " . $_POST['type'] . " "; } if (isset($_SESSION['opt6'])) { unset($_SESSION['opt6']); } echo "Notifications\n"; echo "From," . $_SESSION['dateFrom'] . ",To," . $_SESSION['dateTo'] . "\n\n"; echo "Email,Issue Date,Problem,Read By User,Read by Admin\n"; $query = "SELECT * FROM Notifications, NotificationDescription, Mothers \n\t\t\t\t\t\tLEFT JOIN MotherInfo ON (Mothers.mid=MotherInfo.mid) \n\t WHERE \n\t\t\t\t\t\tNotifications.ntype = NotificationDescription.ntype AND \n\t\t\t\t\t\tMothers.mid = Notifications.mid AND \n\t\t\t\t\t\tstatus != 8 AND {$where} \n\t\t\t\t\t\tORDER BY Notifications.mid ASC, astatus ASC, NotificationIssued DESC, status ASC;"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { $line = $row['email'] . "," . getDateTime($row['NotificationIssued']) . "," . $row['Problem'] . "," . yesOrNo($row['status']) . "," . yesOrNo($row['astatus']) . "\n"; echo $line; } exit; } function yesOrNo($t) { if ($t == 1) { return "No"; } else { return "Yes"; } } initialize(); ?>