Exemple #1
0
function setup_selects()
{
    global $smarty;
    $beginDateSelect = '<select name="bMonth">' . select_month("0") . '<select name="bDay">' . select_day("0") . '<select name="bYear">' . select_year("0");
    $smarty->assign('announcementbegindate', $beginDateSelect);
    $endDateSelect = '<select name="eMonth">' . select_month("0") . '<select name="eDay">' . select_day("0") . '<select name="eYear">' . select_year("0");
    $smarty->assign('announcementenddate', $endDateSelect);
}
            $month = _AUGUST;
        } elseif ($getdate[2] == "09") {
            $month = _SEPTEMBER;
        } elseif ($getdate[2] == "10") {
            $month = _OCTOBER;
        } elseif ($getdate[2] == "11") {
            $month = _NOVEMBER;
        } elseif ($getdate[2] == "12") {
            $month = _DECEMBER;
        }
        if ($month != $thismonth) {
            $year = $getdate[1];
            echo "<li><a href=\"modules.php?name={$module_name}&amp;sa=show_month&amp;year={$year}&amp;month={$getdate['2']}&amp;month_l={$month}\">{$month}, {$year}</a>";
            $thismonth = $month;
        }
    }
    echo "</ul><br><br><center>" . "<form action=\"modules.php?name=Search\" method=\"post\">" . "<input type=\"text\" name=\"query\" size=\"30\">&nbsp;" . "<input type=\"submit\" value=\"" . _SEARCH . "\">" . "</form>" . "[ <a href=\"modules.php?name={$module_name}\">Stories Archive Index</a> ]</center>";
    CloseTable();
    include "footer.php";
}
switch ($sa) {
    case "show_all":
        show_all($min);
        break;
    case "show_month":
        show_month($year, $month, $month_l);
        break;
    default:
        select_month();
        break;
}
function set_game_info_selects()
{
    global $smarty;
    global $MONTH_SELECTED;
    global $DAY_SELECTED;
    global $YEAR_SELECTED;
    global $HOUR_SELECTED;
    global $MINUTE_SELECTED;
    global $AMPM_SELECTED;
    $smarty->assign('monthSelect', select_month('1'));
    $smarty->assign('daySelect', select_day('1'));
    $smarty->assign('yearSelect', select_year('1'));
    $smarty->assign('hourSelect', select_hour('1'));
    $smarty->assign('minuteSelect', select_minute('1'));
    $smarty->assign('ampmSelect', select_ampm('1'));
}
Exemple #4
0
 /**
  *  Test select_month() function
  *
  *  Test the {@link select_month()} function in procedural file
  *  {@link date_helper.php}
  */
 public function testSelect_month_function()
 {
     //  Test generation with November selected, default output format
     $this->assertEquals('<select name="month">' . "\n" . '<option value="01">January</option>' . "\n" . '<option value="02">February</option>' . "\n" . '<option value="03">March</option>' . "\n" . '<option value="04">April</option>' . "\n" . '<option value="05">May</option>' . "\n" . '<option value="06">June</option>' . "\n" . '<option value="07">July</option>' . "\n" . '<option value="08">August</option>' . "\n" . '<option value="09">September</option>' . "\n" . '<option value="10">October</option>' . "\n" . '<option value="11" selected="selected">November</option>' . "\n" . '<option value="12">December</option>' . "\n" . '</select>' . "\n", select_month('11'));
 }
    public function testSelectMonthWithAbbrvsAndNames()
    {
        $expect = <<<EOT
        <select name="date[month]">
        <option value="1">1 - Jan</option><option value="2">2 - Feb</option>
        <option value="3" selected="selected">3 - Mar</option><option value="4">4 - Apr</option>
        <option value="5">5 - May</option><option value="6">6 - Jun</option>
        <option value="7">7 - Jul</option><option value="8">8 - Aug</option>
        <option value="9">9 - Sep</option><option value="10">10 - Oct</option>
        <option value="11">11 - Nov</option><option value="12">12 - Dec</option>
        </select>
EOT;
        $this->assertDomEqual($expect, select_month(3, array('use_abbrv' => true, 'add_numbers' => true)));
    }
Exemple #6
0
function select_date($name, $date)
{
    if ($date == null) {
        $date = '0000-00-00';
    }
    $dates = explode('-', $date);
    if (DATE_FORMAT == 'mm-dd-yyyy') {
        return select_month($name, '2', $dates[1]) . select_day($name, '3', $dates[2]) . select_year($name, '1', $dates[0]);
    } else {
        if (DATE_FORMAT == 'dd-mm-yyyy') {
            return select_day($name, '3', $dates[2]) . select_month($name, '2', $dates[1]) . select_year($name, '1', $dates[0]);
        } else {
            return select_year($name, '1', $dates[0]) . select_month($name, '2', $dates[1]) . select_day($name, '3', $dates[2]);
        }
    }
}