Ejemplo n.º 1
0
        $comments->add($mod, $login->currentUserID(), $_POST['text'], $contactid);
    }
    $smarty->assign('comments', $comments->get($mod, $contactid));
    if ($request['read'] == 0) {
        $request['read'] = 1;
        $db->update($tbl_contact, "`read`=1", "`contactid`=" . $contactid);
    }
    if (isset($_POST['done'])) {
        $db->update($tbl_contact, "`done`=" . $login->currentUserID(), "`contactid`=" . $contactid);
        $request['done'] = $login->currentUserID();
        $log->add($mod, 'contact entry ' . $contactid . ' marked as done');
    }
    if (isset($_POST['move_to_groupware'])) {
        $end = strtotime("+1 Hour");
        $db->insert($tbl_groupware, array('title', 'description', 'state', 'end', 'priority', 'contactid', 'userid'), array("'" . $request['subject'] . "'", "'" . $request['text'] . "'", 0, $end, 1, $contactid, 0));
        $notify->add($lang->get('groupware'), $lang->get('copy_to_groupware_done'));
        $request['isInGroupware'] = true;
    }
    $u = $user->getUserByID($request['userid']);
    $request['sender'] = makeHTMLURL($u['nickname'], makeURL('profile', array('userid' => $request['userid'])));
    $request['timestamp'] = timeLeft($request['timestamp']);
    $request['text'] = $bbcode->parse($request['text']);
    $request['read'] = intToYesNo($request['read']);
    if ($request['done'] > 0) {
        $u = $user->getUserByID($request['done']);
        $request['done_by'] = makeHTMLURL($u['nickname'], makeURL('profile', array('userid' => $u['userid'])));
    }
    $smarty->assign('delete_url', makeURL($mod, array('mode' => 'contact')));
    $smarty->assign('request', $request);
}
$smarty->assign('path', $template_dir . "/contact.tpl");
Ejemplo n.º 2
0
        foreach ($ingredients as $i => $ingredient) {
            $ingredients[$i]['url'] = 'ajax_request.php?mod=catering&file=edit.ingredients.ajax&ingredientid=' . $ingredient['ingredientid'];
            $ingredients[$i]['available'] = intToYesNo($ingredient['available']);
        }
        $smarty->assign('ingredients', $ingredients);
        break;
    case 'categories':
    default:
        $breadcrumbs->addElement($lang->get('categories'), makeURL($mod, array('mode' => 'admin', 'action' => 'categories')));
        $smarty->assign('path', $template_dir . '/categories.admin.tpl');
        if (isset($_POST['NewCategorySubmitButton'])) {
            @$db->insert('catering_categories', array('rank', 'name', 'visible'), array((int) $_POST['OrderTextBox'], "'" . $_POST['NameTextBox'] . "'", (int) $_POST['VisibleCheckBox']));
        }
        if (isset($_POST['EditCategorySubmitButton'])) {
            @$db->update('catering_categories', "`rank`=" . (int) $_POST['OrderTextBox'] . ",\r\n\t\t\t\t\t`name`='" . secureMySQL($_POST['NameTextBox']) . "',\r\n\t\t\t\t\t`visible`=" . (int) $_POST['VisibleCheckBox'], "`categoryid`=" . (int) $_POST['categoryid']);
        }
        if (isset($_POST['DeleteCategorySubmitButton'])) {
            $db->delete('catering_categories', "`categoryid`=" . (int) $_POST['categoryid']);
        }
        $categories = $db->selectList('catering_categories', '*', '1', '`rank` ASC');
        foreach ($categories as $i => $category) {
            $categories[$i]['url'] = 'ajax_request.php?mod=catering&file=edit.categories.ajax&categoryid=' . $category['categoryid'];
            $categories[$i]['visible'] = intToYesNo($category['visible']);
        }
        $smarty->assign('categories', $categories);
        break;
}
$url['AddCategory'] = 'ajax_request.php?mod=' . $mod . '&file=add.categories.ajax';
$url['AddIngredient'] = 'ajax_request.php?mod=' . $mod . '&file=add.ingredients.ajax';
$url['AddProduct'] = 'ajax_request.php?mod=' . $mod . '&file=add.products.ajax';
$smarty->assign('url', $url);
Ejemplo n.º 3
0
        $users[] = $row;
    }
    $sort['payed'] = makeURL($mod, array('eventid' => (int) $_GET['eventid'], 'page' => $page, 'order' => 'payed', 'dir' => $other_dir));
    $sort['appeared'] = makeURL($mod, array('eventid' => (int) $_GET['eventid'], 'page' => $page, 'order' => 'appeared', 'dir' => $other_dir));
    $e['registered'] = $db->num_rows($tbl_register, "`eventid`=" . (int) $_GET['eventid']);
    $e['payed'] = $db->num_rows($tbl_register, "`eventid`=" . (int) $_GET['eventid'] . " AND `payed` > 0");
    $e['payed_pre'] = $db->num_rows($tbl_register, "`eventid`=" . (int) $_GET['eventid'] . " AND `payed`!=0 AND `payed`!=2");
    $e['payed_box_office'] = $db->num_rows($tbl_register, "`eventid`=" . (int) $_GET['eventid'] . " AND `payed`=2");
    $smarty->assign('event', $e);
}
// page management
@$smarty->assign('pages', $pages->get($mod, array("eventid" => (int) $_GET['eventid'])));
// order by - urls
@($sort['nickname'] = makeURL($mod, array('eventid' => (int) $_GET['eventid'], 'page' => $page, 'order' => 'nickname', 'dir' => $other_dir)));
@($sort['prename'] = makeURL($mod, array('eventid' => (int) $_GET['eventid'], 'page' => $page, 'order' => 'prename', 'dir' => $other_dir)));
@($sort['paystate'] = makeURL($mod, array('eventid' => (int) $_GET['eventid'], 'page' => $page, 'order' => 'payed', 'dir' => $other_dir)));
@($sort['appeared'] = makeURL($mod, array('eventid' => (int) $_GET['eventid'], 'page' => $page, 'order' => 'appeared', 'dir' => $other_dir)));
$smarty->assign('sort', $sort);
if (@count($users) > 0) {
    foreach ($users as $i => $u) {
        $users[$i]['url'] = makeURL('profile', array('userid' => $u['userid']));
        @($users[$i]['payed_str'] = $paystates[$u['payed']]);
        if (@(int) $_GET['eventid'] > 0) {
            $users[$i]['appeared_str'] = intToYesNo($u['appeared']);
        } else {
            $users[$i]['appeared_str'] = '-';
        }
    }
}
@$smarty->assign('users', $users);
@$smarty->assign('eventid', (int) $_GET['eventid']);