function callInformation($call_priority_options, $call_status, $call_priority, $building_options, $building_id, $resnet_call)
 {
     if ($resnet_call == 'resnet') {
         $tpl->assign('is_resnet', 'checked');
     }
     $tpl->assign('call_status', $call_status);
     $tpl->assign('call_priority_select_list', PSUHTML::getSelectOptions($call_priority_options, $call_priority));
     $tpl->assign('building_select_list', PSUHTML::getSelectOptions($building_options, $building_id));
 }
 function restoreRequestFunc($getData = false, $_GET = '')
 {
     global $db;
     $tpl = new XTemplate(TEMPLATE_DIR . '/restore_request.tpl');
     $restore_system_options = PSUHTML::getSelectOptions($this->getRestoreSystemOptions(), $_GET['restore_system']);
     $date_time_month_options = PSUHTML::getSelectOptions($this->getDateTimeOptions('Month'), date("m"));
     $date_time_date_options = PSUHTML::getSelectOptions($this->getDateTimeOptions('Date'), date("d"));
     $date_time_year_options = PSUHTML::getSelectOptions($this->getDateTimeOptions('Year'), date("Y"));
     $date_time_hour_options = PSUHTML::getSelectOptions($this->getDateTimeOptions('Hour'), date("G"));
     $date_time_minute_options = PSUHTML::getSelectOptions($this->getDateTimeOptions('Minute'), date("i"));
     $tpl->assign('restore_system_options', $restore_system_options);
     $tpl->assign('date_time_month_options', $date_time_month_options);
     $tpl->assign('date_time_date_options', $date_time_date_options);
     $tpl->assign('date_time_year_options', $date_time_year_options);
     $tpl->assign('date_time_hour_options', $date_time_hour_options);
     $tpl->assign('date_time_minute_options', $date_time_minute_options);
     $tpl->assign('restore_details', $_GET[restore_details]);
     $tpl->assign('restore_filenames', $_GET[restore_filenames]);
     $tpl->assign('restore_path', $_GET[restore_path]);
     $tpl->parse('main');
     return $tpl->text('main');
 }
function editTLCUser($user_name)
{
    $template_name = TEMPLATE_ADMIN_DIR . '/new_user_form.tpl';
    $tpl = new XTemplate($template_name);
    $tpl->assign('form_action', 'manage_users.html?action=updatetlcuser');
    $getTotalGroupsQuery = PSU::db('calllog')->Execute("SELECT * from itsgroups WHERE itsgroups.deleted = 0");
    $k = 0;
    while ($getTotalGroups = $getTotalGroupsQuery->FetchRow()) {
        $tpl->assign("totalGroups", $k);
        $tpl->parse("main.countTotalGroups");
        $k++;
    }
    $getUserInfoSQL = "SELECT * FROM call_log_employee, its_employee_groups, itsgroups WHERE itsgroups.deleted = 0 and call_log_employee.user_name='{$user_name}' AND call_log_employee.call_log_user_id = its_employee_groups.employee_id AND itsgroups.itsgroupid = its_employee_groups.group_id ORDER BY subgroupName ASC";
    $getUserInfoRes = PSU::db('calllog')->Execute($getUserInfoSQL);
    $i = 0;
    if ($getUserInfoRes->_numOfRows == '0') {
        // ITS Groups Options Array
        $its_group_options = array();
        $its_group_options = getITSGroupOptions();
        $tpl->assign('select_group', $its_group_options);
        $its_select_group_list = PSUHTML::getSelectOptions($its_group_options, $getUserInfo['group_id']);
        $tpl->assign('its_select_group_list', $its_select_group_list);
        $tpl->assign('i', 0);
        // loop over the results, parsing main.group for each
        $tpl->assign('my_group', strtolower($getUserInfo[subgroup]));
        $tpl->assign('my_group_name', $getUserInfo[subgroupName]);
        $tpl->parse('main.ManageITSGroups');
    } else {
        while ($getUserInfo = $getUserInfoRes->FetchRow()) {
            // ITS Groups Options Array
            $its_group_options = array();
            $its_group_options = getITSGroupOptions();
            $its_select_group_list = PSUHTML::getSelectOptions($its_group_options, $getUserInfo['group_id']);
            $tpl->assign('its_select_group_list', $its_select_group_list);
            $tpl->assign('i', $i);
            $i++;
            // loop over the results, parsing main.group for each
            $tpl->assign('my_group', strtolower($getUserInfo[subgroup]));
            $tpl->assign('my_group_name', $getUserInfo[subgroupName]);
            $tpl->parse('main.ManageITSGroups');
        }
    }
    $js_its_select_group_list = str_replace(array("\n", 'selected="selected'), '', $its_select_group_list);
    $tpl->assign('js_its_select_group_list', $js_its_select_group_list);
    $query = PSU::db('calllog')->Execute("SELECT * FROM call_log_employee WHERE user_name = '{$user_name}'");
    $key = $query->FetchRow();
    $tpl->assign('tlc_employee_positions', PSUHTML::getSelectOptions($GLOBALS['tlc_employee_positions'], $key['user_privileges']));
    $tpl->assign('user_status', PSUHTML::getSelectOptions($GLOBALS['user_status'], $key['status']));
    $tpl->assign('class_options', PSUHTML::getSelectOptions($GLOBALS['class_options'], $key['student_class']));
    $tpl->assign('signed_ferpa', PSUHTML::getSelectOptions($GLOBALS['ferpa_options'], $key['ferpa']));
    $tpl->assign('key', $key);
    $tpl->parse('main.update_tlc_user');
    $tpl->parse('main');
    return $tpl->text('main');
}
 function getDateSelect($default = "", $format = "%s", $type = 1, $leading_blank = false, $min_year = false, $max_year = false, $extra = "")
 {
     // types are:
     // 1 - m/d/Y
     // 2 - m/Y
     // 3 - m/d/Y H:m
     // 4 - H:m
     $html = "";
     $min_year = $min_year ? $min_year : date("Y") - 5;
     $max_year = $max_year ? $max_year : date("Y") + 10;
     if (is_numeric($default)) {
         $d_month = date("m", $default);
         $d_day = date("d", $default);
         $d_year = date("Y", $default);
         $d_hour = date("H", $default);
         $d_minute = date("i", $default);
     }
     if ($type <= 3) {
         $months = PSUHTML::_copyValues(range(1, 12));
         $days = PSUHTML::_copyValues(range(1, 31));
         $years = PSUHTML::_copyValues(range($min_year, $max_year));
         $html .= "<select {$extra} name=\"" . str_replace("%s", "month", $format) . "\">\n";
         $html .= PSUHTML::getSelectOptions($months, $d_month, $leading_blank);
         $html .= "</select>";
         if ($type != 2) {
             $html .= "/";
             $html .= "<select {$extra} name=\"" . str_replace("%s", "day", $format) . "\">\n";
             $html .= PSUHTML::getSelectOptions($days, $d_day, $leading_blank);
             $html .= "</select>";
         }
         $html .= "/";
         $html .= "<select {$extra} name=\"" . str_replace("%s", "year", $format) . "\">\n";
         $html .= PSUHTML::getSelectOptions($years, $d_year, $leading_blank);
         $html .= "</select>";
         if ($type == 3) {
             $html .= "&nbsp;";
         }
     }
     if ($type >= 3) {
         $hours = PSUHTML::_copyValues(range(0, 23));
         $minutes = PSUHTML::_copyValues(range(0, 60));
         $html .= "<select {$extra} name=\"" . str_replace("%s", "hour", $format) . "\">\n";
         $html .= PSUHTML::getSelectOptions($hours, $d_hour, $leading_blank);
         $html .= "</select>";
         $html .= ":";
         $html .= "<select {$extra} name=\"" . str_replace("%s", "minute", $format) . "\">\n";
         $html .= PSUHTML::getSelectOptions($minutes, $d_minute, $leading_blank);
         $html .= "</select>";
     }
     return $html;
 }