Esempio n. 1
0
<?php

/**
 * @Project NUKEVIET 3.x
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2012 VINADES.,JSC. All rights reserved
 * @Createdate 2-1-2010 15:5
 */
if (!defined('NV_IS_FILE_ADMIN')) {
    die('Stop!!!');
}
$page_title = $lang_global['mod_groups'];
$contents = "";
//Lay danh sach nhom
$groupsList = groupList();
$groupcount = sizeof($groupsList);
//Neu khong co nhom => chuyen den trang tao nhom
if (!$groupcount and !$nv_Request->isset_request('add', 'get')) {
    Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $op . "&add");
    die;
}
//Thay doi thu tu nhom
if ($nv_Request->isset_request('cWeight, id', 'post')) {
    $id = $nv_Request->get_int('id', 'post');
    $cWeight = $nv_Request->get_int('cWeight', 'post');
    if (!isset($groupsList[$id])) {
        die("ERROR");
    }
    $cWeight = min($cWeight, $groupcount);
    $query = array();
    $query[] = "WHEN `group_id` = " . $id . " THEN " . $cWeight;
Esempio n. 2
0
function searchForm()
{
    global $xx, $set, $schText, $eF, $grpName, $catName, $fromDda, $tillDda;
    echo "<form action='index.php?lc' method='post'>\n\t\t<input type='hidden' name='token' value='{$_SESSION['token']}'>\n\t\t<fieldset><legend>{$xx['sch_define_search']}</legend>\n\n\t\t<table class='list'>\n\n\t\t<tr>\n<td class='label'>{$xx['sch_search_text']}:</td>\n\t\t<td><input type='text' name='schText' id='schText' value=\"{$schText}\" maxlength='50' size='30'></td>\n</tr>\n\t\t<tr><td colspan='2'><hr></td></tr>\n\t\t<tr>\n<td class='label'>{$xx['sch_event_fields']}:</td>\n\t\t<td><input type='checkbox' id='eF0' name='eF[]' value='0' onclick=\"checkZ('eF',this);\"" . (in_array(0, $eF) ? " checked='checked'" : '') . "> \n\t\t<label for='eF0'>{$xx['sch_all_fields']}</label></td>\n</tr>\n\t\t<tr>\n<td></td><td><input type='checkbox' id='eF1' name='eF[]' value='1' onclick=\"checkN('eF',this);\"" . (in_array(1, $eF) ? " checked='checked'" : '') . "> \n\t\t<label for='eF1'>{$xx['sch_title']}</label></td>\n</tr>\n";
    foreach (str_split($set['evtTemplGen']) as $fieldNr) {
        if (strpos('1345', $fieldNr) !== false) {
            switch ($fieldNr) {
                case '1':
                    echo "<tr>\n<td></td><td><input type='checkbox' id='eF2' name='eF[]' value='2' onclick=\"checkN('eF',this);\"" . (in_array(2, $eF) ? " checked='checked'" : '') . "> <label for='eF2'>{$xx['sch_venue']}</label></td>\n</tr>\n";
                    break;
                case '3':
                    echo "<tr>\n<td></td><td><input type='checkbox' id='eF3' name='eF[]' value='3' onclick=\"checkN('eF',this);\"" . (in_array(3, $eF) ? " checked='checked'" : '') . "> <label for='eF3'>{$xx['sch_description']}</label></td>\n</tr>\n";
                    break;
                case '4':
                    echo "<tr>\n<td></td><td><input type='checkbox' id='eF4' name='eF[]' value='4' onclick=\"checkN('eF',this);\"" . (in_array(4, $eF) ? " checked='checked'" : '') . "> <label for='eF4'>" . ($set['xField1Label'] ? "{$set['xField1Label']}" : $xx['sch_extra_field1']) . "</label></td>\n</tr>\n";
                    break;
                case '5':
                    echo "<tr>\n<td></td><td><input type='checkbox' id='eF5' name='eF[]' value='5' onclick=\"checkN('eF',this);\"" . (in_array(5, $eF) ? " checked='checked'" : '') . "> <label for='eF5'>" . ($set['xField2Label'] ? "{$set['xField2Label']}" : $xx['sch_extra_field2']) . "</label></td>\n</tr>\n";
            }
        }
    }
    echo "<tr><td class='label'>{$xx['sch_user_group']}:</td><td><select name='grpName'>\n";
    groupList($grpName);
    echo "</select></td></tr>\n";
    echo "<tr><td class='label'>{$xx['sch_event_cat']}:</td><td><select name='catName'>\n";
    catList($catName);
    echo "</select></td></tr>\n";
    echo "<tr>\n<td class='label'>{$xx['sch_occurring_between']}:</td><td>\n\t\t<input type='text' name='fromDda' id='fromDda' value='" . IDtoDD($fromDda) . "' size='8'>\n\t\t<button title=\"{$xx['sch_select_start_date']}\" onclick=\"dPicker(1,'nill','fromDda');return false;\">&larr;</button> &#8211;\n\t\t<input type='text' name='tillDda' id='tillDda' value='" . IDtoDD($tillDda) . "' size='8'>\n\t\t<button title=\"{$xx['sch_select_end_date']}\" onclick=\"dPicker(1,'nill','tillDda');return false;\">&larr;</button></td>\n</tr>\n\t\t</table>\n\n\t\t</fieldset>\n\n\t\t<input type='submit' name='search' value=\"{$xx['sch_search']}\">\n\n\t\t</form>\n\n\t\t<div style='clear:right'></div>\n\n\t\t<script>document.getElementById('schText').focus();</script>";
}