Exemplo n.º 1
0
<?php

include __DIR__ . '/../lib/class/Mole.class.php';
include __DIR__ . '/../lib/include.php';
include __DIR__ . '/../sucker/include.php';
$alleys = get_alleys();
function hovselist_print($moles)
{
    echo <<<EOF
\t\t\t<div>
\t\t\t\t<table class="hovselist">
\t\t\t\t\t<thead>
\t\t\t\t\t\t<th>Name</th>
\t\t\t\t\t\t<th>Class</th>
\t\t\t\t\t\t<th>Position</th>
\t\t\t\t\t\t<th>Location</th>
\t\t\t\t\t\t<th>Email</th>
\t\t\t\t\t\t<th>Phone</th>
\t\t\t\t\t</thead>
\t\t\t\t\t<tbody>

EOF;
    foreach ($moles as $mole) {
        $name = htmlentities($mole->name, NULL, 'UTF-8');
        $class = $mole->getClass(false);
        $position = htmlentities($mole->position, NULL, 'UTF-8');
        $location = $mole->getLocation();
        $email = htmlentities($mole->email, NULL, 'UTF-8');
        $phone = htmlentities($mole->phone, NULL, 'UTF-8');
        echo <<<EOF
\t\t\t\t\t\t<tr>
Exemplo n.º 2
0
    return $positions;
}
function hovselist_write($list, $moles)
{
    $handle = popen(__DIR__ . '/mailingset write ' . $list, 'w');
    if (!$handle) {
        throw new UnexpectedValueException($list);
    }
    foreach ($moles as $mole) {
        fwrite($handle, $mole . "\n");
    }
    if (pclose($handle)) {
        throw new UnexpectedValueException($list);
    }
}
$alleys = "('" . implode("', '", array_diff(get_alleys(), array('Fort Knight', 'Munth'))) . "')";
$roles = array('offices' => array('athteam' => array('athteam'), 'damage' => array('damagecontrol'), 'historians' => array('historian'), 'imss' => array('headimssrep', 'imssrep'), 'librarians' => array('librarian'), 'socteam' => array('socteam')), 'people' => array('arc' => array('arcrep'), 'boc' => array('bocrep'), 'bookie' => array('bookie'), 'crc' => array('crcrep'), 'pope' => array('pope'), 'president' => array('president'), 'secretary' => array('secretary'), 'treasurer' => array('treasurer'), 'vp' => array('vicepresident')), 'support' => array('healthad' => array('healthad'), 'ra-prime' => array('ra'), 'ucc-prime' => array('coheaducc', 'ucc')));
$order = 'ORDER BY `class`, `name`';
$president = 'President <*****@*****.**>';
$secretary = 'Secretary <*****@*****.**>';
$pdo = new PDO('sqlite:../hovselist.db');
$year = date('Y') + (date('n') >= 7);
if (array_key_exists('action', $_POST)) {
    header('HTTP/1.1 400 Bad Request');
    header('Status: 400 Bad Request');
    $content = '';
    $format = "`name` || ' ''' || SUBSTR(`class`, 3) || ' <' || `email` || '>'";
    $lists = array();
    try {
        switch ($_POST['action']) {
            case 'delete':