Example #1
0
function printContext($context)
{
    if (count($context) > 0) {
        ?>
	<h2>Local Context</h2>
	<table>
		<thead>
			<td>Name</td>
			<td>Type</td>
			<td>Value</td>
		</thead> 
	<?php 
        foreach (array_keys($context) as $key) {
            ?>
		<tr>
			<td>$<?php 
            print $key;
            ?>
</td>
			<td><?php 
            printType($context[$key]);
            ?>
</td>
			<td><?php 
            printValueOf($context[$key]);
            ?>
</td>
		</tr>
		<?php 
        }
        print '</table>';
    }
}
<?php

function printType($variable)
{
    if (is_numeric($variable)) {
        var_dump($variable);
    } else {
        echo gettype($variable) . "\n\r";
    }
}
printType("hello");
printType(15);
printType(1.234);
printType(array(1, 2, 3));
printType((object) [2, 34]);
     } else {
         if ($row->reservation_time < $daylight_noon) {
             echo " class='morning noprint'";
         }
     }
 }
 echo " style='width:10px !important; padding:0px;'>&nbsp;</td>";
 echo "<td id='tb_time'";
 // reservation after maitre message
 if ($row->reservation_timestamp > $maitre['maitre_timestamp'] && $maitre['maitre_comment_day'] != '') {
     echo " class='tautologous' title='" . _sentence_13 . "' ";
 }
 echo ">";
 echo "<strong>" . formatTime($row->reservation_time, $general['timeformat']) . "</strong></td>";
 echo "<td id='tb_pax'><strong class='big'>" . $row->reservation_pax . "</strong>&nbsp;&nbsp;<span class='noprint'>";
 printType($row->reservation_hotelguest_yn);
 //echo "<img src='images/icons/user-silhouette.png' class='middle'/>";
 echo "</span></td><td style='width:20%' id='tb_name'><span class='noprint'>" . printTitle($row->reservation_title) . "</span><strong> <a id='detlbuttontrigger' href='ajax/guest_detail.php?id=" . $id . "'";
 // color guest name if tautologous
 if ($tautologous > 1) {
     echo " class='tautologous tipsy' title='" . _tautologous_booking . "'";
 }
 echo ">" . $row->reservation_guest_name . "</a></strong>";
 // old reservations symbol
 if (strtotime($row->reservation_timestamp) + $general['old_days'] * 86400 <= time()) {
     echo "<img src='images/icons/clock-bolt.png' class='help tipsyold middle smicon' title='" . _sentence_11 . "' />";
 }
 // recurring symbol
 if ($row->repeat_id != 0) {
     echo "&nbsp;<img src='images/icons/loop-alt.png' alt='" . _recurring . "' title='" . _recurring . "' class='tipsy' border='0' >";
 }
				</article>

				<?php 
printFooter(1);
?>
			</div>
		</div>
<!-- MENU PAGE end -->
		
<!-- TYPE PAGE begin -->

			<?php 
$queryType = "SELECT TYPE_ID, NAME FROM TYPE";
if ($r = mysql_query($queryType)) {
    while ($row = mysql_fetch_array($r)) {
        printType($row['TYPE_ID'], $row['NAME']);
    }
}
// INDIVIDUAL ITEM PAGE begin..
$query = "SELECT * FROM MENU_ITEM";
if ($r2 = mysql_query($query)) {
    while ($row2 = mysql_fetch_array($r2)) {
        printItem($row, $row2);
    }
}
// INDIVIDUAL ITEM PAGE end
?>

<!--TYPE PAGE end -->
		
<!-- ABOUT US PAGE begin... -->