Пример #1
0
function GetAllGroups()
{
    global $bd;
    $groups = List_Groups('', '', '', '', 0, $bd);
    $groups_aux = array();
    for ($i = 0; $i < count($groups); $i++) {
        $group = $groups[$i];
        $groups_aux[$i]["group.id"] = $group[0];
        $groups_aux[$i]["group.name"] = $group[1];
        $groups_aux[$i]["group.category"] = $group[2];
        $groups_aux[$i]["group.acronym"] = $group[3];
        $groups_aux[$i]["group.description"] = $group[4];
        $members = $groups[$i][5];
        for ($j = 0; $j < count($members); $j++) {
            $groups_aux[$i]["group.members"][$j]["group.member.id"] = $members[$j][0];
            $groups_aux[$i]["group.members"][$j]["group.member.name"] = $members[$j][1];
            $groups_aux[$i]["group.members"][$j]["group.member.membership"] = $members[$j][2];
        }
    }
    $result = array('schedule' => $groups_aux);
    return $result;
}
Пример #2
0
        $days[$num_day - $first_day_week][4] = date('Y', $u_date);
        if (($num_day + 1) % 7 == 0) {
            $num_week++;
            $weeks[$num_week] = $num_week;
        }
        $days[$num_day - $first_day_week][5] = date('w', $u_date);
        $day_of_week = $days[$num_day][5];
        $days[$num_day - $first_day_week][6] = $cfg['days'][$day_of_week];
    }
    $apps[0] = Group_Free_Schedule($group_id, $beg_day, $end_day, '', '', $cfg['time'], $cfg['days'], $bd);
} else {
    $error[$num_errors++] = "Invalid Session ID";
    include "logout.php";
    exit;
}
$groups = List_Groups($group_id, '', '', '', 0, $bd);
$time_count = count($cfg['time']);
for ($i = 0; $i < $time_count - 1; $i++) {
    $new_time[$i] = $cfg['time'][$i];
}
$smarty->assign("nrpTransform", $result_xsl);
$smarty->assign("nrpMainTime", $new_time);
$smarty->assign("nrpMainErrors", $error);
$smarty->assign("nrpMainAlerts", $alert);
$smarty->assign("nrpSpanStart", $span_start);
$smarty->assign("nrpSpanEnd", $span_end);
$smarty->assign("nrpSessId", $complete_sess_id);
$smarty->assign("nrpUserId", $account_id);
$smarty->assign("nrpSchSpan", $span);
$smarty->assign("nrpSpanStartDay", $span_start_day);
$smarty->assign("nrpSpanStartMonth", $span_start_month);
Пример #3
0
                }
                break;
        }
        switch (User_Validate_Simple_Field($groups[0][2], 256)) {
            case -2:
                $error[$num_errors++] = "There are invalid characteres at the group category";
                break;
        }
        switch (User_Validate_Simple_Field($groups[0][3], 256)) {
            case -2:
                $error[$num_errors++] = "There are invalid characteres at the group description";
                break;
        }
        if (empty($error)) {
            Insert_Group($groups[0][1], $groups[0][2], $groups[0][3], $groups[0][4], $bd);
            $groups_new = List_Groups('', $groups[0][1], '', '', 1, $bd);
            Insert_Group_Member($groups_new[0][0], $account_id, 'O', '', $bd);
            $alert[$num_alerts++] = "New Group Inserted Successfully";
            include "groups.php";
            exit;
        }
    }
    $result_xsl = "xsl/" . $default_xsl . "/groups_new.xsl";
} else {
    $error[$num_errors++] = "Invalid Session ID";
    include "logout.php";
    exit;
}
$smarty->assign("nrpTransform", $result_xsl);
$smarty->assign("nrpSchedErrors", $error);
$smarty->assign("nrpSchedAlerts", $alert);
                $error[$num_errors++] = 'This permition already exists';
            }
        } else {
            $error[$num_errors++] = "One (and only one) option of master must be chosen";
        }
        if (empty($error)) {
            Insert_Permission($permissions[0][1], $permissions[0][3], $permissions[0][5], $permissions[0][7], 'room', $bd);
            $alert[$num_alerts++] = "New Permision to Room Inserted Successfully";
            include "adm_permissions.php";
            exit;
        }
    }
    $result_xsl = "xsl/" . $default_xsl . "/adm_permissions_room_new.xsl";
    $categories = List_Categories('', '', $bd);
    $people = List_People('', '', '', '', '', $bd);
    $groups = List_Groups('', '', '', '', '', $bd);
    $rooms = List_Rooms('', '', '', '', '', $bd);
} else {
    $error[$num_errors++] = "Invalid Session ID";
    include "logout.php";
    exit;
}
$smarty->assign("nrpTransform", $result_xsl);
$smarty->assign("nrpSchErrors", $error);
$smarty->assign("nrpSchAlerts", $alert);
$smarty->assign("nrpSessId", $complete_sess_id);
$smarty->assign("nrpUserId", $account_id);
$smarty->assign("nrpCourses", $courses);
$smarty->assign("nrpRooms", $rooms);
$smarty->assign("nrpPeople", $people);
$smarty->assign("nrpCategories", $categories);
            exit;
        } else {
            $result_xsl = "xsl/" . $default_xsl . "/sch_pop_final.xsl";
        }
    }
} else {
    $error[$num_errors++] = "Invalid Session ID";
    include "logout.php";
    exit;
}
$beg_time = $_POST['beg_time'];
$end_time = $_POST['end_time'];
$day = $_POST['day'];
$month = $_POST['month'];
$year = $_POST['year'];
$group = List_Groups($group_id, '', '', '', 1, $bd);
if (empty($submit_ins) && empty($submit_conf_yes) && empty($submit_conf_no) && !$is_pop) {
    $day = date('d');
    $month = date('m');
    $year = date('Y');
}
$smarty->assign("nrpTransform", $result_xsl);
$smarty->assign("nrpSchErrors", $error);
$smarty->assign("nrpSchAlerts", $alert);
$smarty->assign("nrpSessId", $complete_sess_id);
$smarty->assign("nrpSchTypeName", $array_type);
$smarty->assign("nrpSchTypeColor", $array_color);
$smarty->assign("nrpSchTypeImage", $array_image);
$smarty->assign("nrpSchTimes", $cfg['time']);
$smarty->assign("nrpUserId", $account_id);
$smarty->assign("nrpSchSpan", 'all');