width = '98%'; $table->data = array (); $table->head = array (); $table->head[0] = __('Date'); $table->head[1] = __('Same day of the week'); $table->head[2] = __('Description'); $table->head[3] = __('Group'); $table->head[4] = __('Delete'); $table->style = array (); $table->style[0] = 'font-weight: bold'; $table->size = array (); $table->size[0] = '20%'; $table->size[1] = '15%'; $table->size[2] = '55%'; $table->size[3] = '5%'; $table->size[4] = '5%'; $table->align = array (); $table->align[3] = 'center'; $table->align[4] = 'center'; $filter = array(); if (!is_user_admin($config['id_user'])) $filter['id_group'] = array_keys(users_get_groups(false, "LM")); $special_days = db_get_all_rows_filter ('talert_special_days', $filter); if ($special_days === false) $special_days = array (); foreach ($special_days as $special_day) { $data = array (); $data[0] = ''; # '0001' means every year. $data[0] .= ''. str_replace('0001', '*', $special_day['date']) . ''; $data[0] .= ''; switch ($special_day['same_day']) { case 'monday': $data[1] = __('Monday'); break; case 'tuesday': $data[1] = __('Tuesday'); break; case 'wednesday': $data[1] = __('Wednesday'); break; case 'thursday': $data[1] = __('Thursday'); break; case 'friday': $data[1] = __('Friday'); break; case 'saturday': $data[1] = __('Saturday'); break; case 'sunday': $data[1] = __('Sunday'); break; } $data[2] = $special_day['description']; $data[3] = ui_print_group_icon ($special_day["id_group"], true); $data[4] = ''. html_print_image("images/cross.png", true) . ''; array_push ($table->data, $data); } if(isset($data)) { html_print_table ($table); } else { echo "
".__('No special days configured')."
"; } echo '
'; echo '
'; html_print_submit_button (__('Create'), 'create', false, 'class="sub next"'); html_print_input_hidden ('create_special_day', 1); echo '
'; echo '
'; ?>