Example #1
0
				<p><small>Manage the subjects.</small></p>
			</div>
			<div class="entry">
			<p><?php 
echo $msg;
?>
</p>
				<?php 
if (isset($_GET['edit'])) {
    ?>
				<fieldset>
					<legend>Edit</legend>
					<form action="subjects.php" method="post">
						<label for="edit">Subject name:</label><br><br>
						<input type="text" id="edit" name="edit" value="<?php 
    echo $subject->idToName($_GET['edit']);
    ?>
"/><br><br>
						<input type="hidden" name="id" value="<?php 
    echo $_GET['edit'];
    ?>
"/>
						<input type="submit" value="Edit"/>
					</form>
				</fieldset>
				<?php 
}
?>
				<fieldset>
					<legend>Create</legend>
					<form action="subjects.php" method="post">
Example #2
0
 function lastCalls()
 {
     global $db;
     $query = $db->query("SELECT * FROM {$db->table['calls']} ORDER BY `id` DESC LIMIT 5");
     //require_once('inc/classes/customer.php');
     require_once 'inc/classes/web.php';
     require_once 'inc/classes/subject.php';
     //$customer = new customer;
     $web = new web();
     $subject = new subject();
     while ($row = $db->newRow($query)) {
         if ($row['type'] == 'Incoming') {
             $type = 'red';
         } else {
             if ($row['type'] == 'Outgoing') {
                 $type = 'green';
             } else {
                 if ($row['type'] == 'Outgoing') {
                     $type = 'blue';
                 }
             }
         }
         echo '<li><a href="edit.php?id=' . $row['id'] . '"><font color="' . $type . '">[' . $web->idToName($row['web']) . '] ' . $subject->idToName($row['subject']) . '</font></a></li>';
     }
 }