Location: PHPKode > projects > SecurityAdmin for PHP > psa-4.0.3/include/expdate.form.php
<?php
    if(isset($PSA_edate)){
        $PSA_edate2=date('Y-m-d',strtotime($PSA_edate));
        // get the date components w/o leading 0's
        $year=substr($PSA_edate2,0,4);

        if(substr($PSA_edate2,5,1)=='0')
            $month=substr($PSA_edate2,6,1);
        else
            $month=substr($PSA_edate2,5,2);

        if(substr($PSA_edate2,8,1)=='0')
            $day=substr($PSA_edate2,9);
        else
            $day=substr($PSA_edate2,8);
    }else{
        $month=0;
        $day=0;
        $year=date('Y');
    }

    // Make the month select menu
    echo '<select name="PSA_emonth">'."\n";
    for($i=1;$i<13;$i++){
        if($i==1)
            echo '<option value="0"> </option>'."\n";

        // start the option tag
        echo '<option ';

        // if this is the selected month
        if($month==$i)
            echo 'selected ';

        // finish the option tag
        switch($i){
            case 1: echo  'value="1">',_("January"),'</option>'."\n";break;
            case 2: echo  'value="2">',_("February"),'</option>'."\n";break;
            case 3: echo  'value="3">',_("March"),'</option>'."\n";break;
            case 4: echo  'value="4">',_("April"),'</option>'."\n";break;
            case 5: echo  'value="5">',_("May"),'</option>'."\n";break;
            case 6: echo  'value="6">',_("June"),'</option>'."\n";break;
            case 7: echo  'value="7">',_("July"),'</option>'."\n";break;
            case 8: echo  'value="8">',_("August"),'</option>'."\n";break;
            case 9: echo  'value="9">',_("September"),'</option>'."\n";break;
            case 10: echo 'value="10">',_("October"),'</option>'."\n";break;
            case 11: echo 'value="11">',_("November"),'</option>'."\n";break;
            case 12: echo 'value="12">',_("December"),'</option>'."\n";break;
        }
    }
    echo '</select>'."\n\n";

    // Make the day select menu
    echo '<select name="PSA_eday">'."\n";
    for($i=1;$i<32;$i++){
        if($i==1)
            echo '<option> </option>'."\n";
        if($day==$i)
            echo '<option value="'.$i.'" selected>'.$i.'</option>'."\n";
        else
            echo '<option value="'.$i.'">'.$i.'</option>'."\n";
    }
    echo '</select>,'."\n\n";

    // Make the year select menu
    echo '<select name="PSA_eyear">'."\n";

    for($i=$year-4;$i<$year+5;$i++){
        if($i==$year){
            echo '<option value="'.$year.'" selected>'.$year.'</option>'."\n";
        }else{
            if($year==$i)
                echo '<option selected value="'.$i.'">'.$i.'</option>'."\n";
            else
                echo '<option value="'.$i.'">'.$i.'</option>'."\n";
        }
    }
    echo '</select>'."\n";
?>
Return current item: SecurityAdmin for PHP