Example #1
0
<h2>MVC Example</h2>
<p>This section shows off a fake MVC example.  Look at the person.php file in controllers to see code commented out on how many of these operations would work.</p>
<h2>People List</h2>
<table><thead><tr><td>Name</td><td></td></tr></thead>
<tbody>
<?
foreach($people as $person) { ?>
  <tr><td><?php 
echo link_to("/person/show/" . $person['id'], $person['name']);
?>
</td>
  <td><?php 
echo delete_link('/person/destroy?id=' . $person["id"], png('delete'), "Are you sure you want to delete " . $person['name'] . "?");
?>
</td></tr>
  <? } ?>
</tbody><table>
    exit;
}
if (isset($_GET["directory-popup"])) {
    directory_popup();
    exit;
}
if (isset($_POST["directory"])) {
    directory_save();
    exit;
}
if (isset($_POST["delete"])) {
    directory_delete();
    exit;
}
if (isset($_GET["png"])) {
    png();
    exit;
}
js();
function js()
{
    header("content-type: application/x-javascript");
    $tpl = new templates();
    $page = CurrentPageName();
    $meta = new mysql_meta();
    $hostname = $meta->uuid_to_host($_GET["uuid"]);
    $title = $tpl->javascript_parse_text("{directories_monitor}");
    echo "YahooWin(900,'{$page}?table=yes&uuid={$_GET["uuid"]}','{$hostname}:{$title}')";
}
function graph_js()
{
Example #3
0
                     if ($argc < 5) {
                         echo "Nombre d'arguments insuffisant.\nUsage:php imagepanel.php [gjlnNps] lien1 [lien2 [...]] base\n";
                         return 0;
                     } else {
                         $l = (int) $argv[2];
                         $d = 3;
                     }
                 }
             }
             $e = Err_Nn($argc, $argv, $dump, $e);
             if (preg_match("/s/", $argv[1], $dump) != FALSE) {
                 $tri = TRUE;
             }
             $allimg = getAllImg($argv, $d);
             if (preg_match("/p/", $argv[1], $dump) != FALSE) {
                 png(panel($allimg, $e, $l, $tri), $argv[$argc - 1]);
             }
             if (preg_match("/g/", $argv[1], $dump) != FALSE) {
                 gif(panel($allimg, $e, $l, $tri), $argv[$argc - 1]);
             }
             if (preg_match("/j/", $argv[1], $dump) != FALSE || preg_match_all("/[jpg]+/", $argv[1], $dump) == FALSE) {
                 jpeg(panel($allimg, $e, $l, $tri), $argv[$argc - 1]);
             }
         } else {
             if ($argv[1][0] != "-") {
                 $allimg = getAllImg($argv, 1);
                 jpeg(panel($allimg), $argv[$argc - 1]);
             }
         }
     }
 }