Location: PHPKode > projects > PHP on Trax > johnpipi-trax-f599562/trax/doc/__filesource/fsource_PHPonTrax__vendortraxaction_viewhelpersdate_helper.php.html
<html>
<head>
<title>File Source for date_helper.php</title>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
    <td class="header_top">PHPonTrax</td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td class="header_menu">
  		  [ <a href="../classtrees_PHPonTrax.html" class="menu">class tree: PHPonTrax</a> ]
		  [ <a href="../elementindex_PHPonTrax.html" class="menu">index: PHPonTrax</a> ]
		  [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="200" class="menu">
	<div id="todolist">
			<p><a href="../todolist.html">Todo List</a></p>
	</div>
      <b>Packages:</b><br />
              <a href="../li_PHPonTrax.html">PHPonTrax</a><br />
              <a href="../li_PHPonTraxTest.html">PHPonTraxTest</a><br />
            <br /><br />
                  
                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1 align="center">Source for file date_helper.php</h1>
<p>Documentation is available at <a href="../PHPonTrax/_vendor_trax_action_view_helpers_date_helper_php.html">date_helper.php</a></p>
<div class="php">
<div class="listing"><pre><ol><li><a name="a1"></a><span class="src-php">&lt;?php</span></li>
<li><a name="a2"></a><span class="src-doc">/**</span></li>
<li><a name="a3"></a><span class="src-doc"> *  File containing the DateHelper class and support functions</span></li>
<li><a name="a4"></a><span class="src-doc"> *</span></li>
<li><a name="a5"></a><span class="src-doc"> *  (PHP 5)</span></li>
<li><a name="a6"></a><span class="src-doc"> *</span></li>
<li><a name="a7"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@package</span><span class="src-doc"> PHPonTrax</span></li>
<li><a name="a8"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@version</span><span class="src-doc"> $Id$</span></li>
<li><a name="a9"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@copyright</span><span class="src-doc"> (c) 2005 John Peterson</span></li>
<li><a name="a10"></a><span class="src-doc"> *</span></li>
<li><a name="a11"></a><span class="src-doc"> *   Permission is hereby granted, free of charge, to any person obtaining</span></li>
<li><a name="a12"></a><span class="src-doc"> *   a copy of this software and associated documentation files (the</span></li>
<li><a name="a13"></a><span class="src-doc"> *   &quot;Software&quot;), to deal in the Software without restriction, including</span></li>
<li><a name="a14"></a><span class="src-doc"> *   without limitation the rights to use, copy, modify, merge, publish,</span></li>
<li><a name="a15"></a><span class="src-doc"> *   distribute, sublicense, and/or sell copies of the Software, and to</span></li>
<li><a name="a16"></a><span class="src-doc"> *   permit persons to whom the Software is furnished to do so, subject to</span></li>
<li><a name="a17"></a><span class="src-doc"> *   the following conditions:</span></li>
<li><a name="a18"></a><span class="src-doc"> *</span></li>
<li><a name="a19"></a><span class="src-doc"> *   The above copyright notice and this permission notice shall be</span></li>
<li><a name="a20"></a><span class="src-doc"> *   included in all copies or substantial portions of the Software.</span></li>
<li><a name="a21"></a><span class="src-doc"> *</span></li>
<li><a name="a22"></a><span class="src-doc"> *   THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,</span></li>
<li><a name="a23"></a><span class="src-doc"> *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF</span></li>
<li><a name="a24"></a><span class="src-doc"> *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</span></li>
<li><a name="a25"></a><span class="src-doc"> *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE</span></li>
<li><a name="a26"></a><span class="src-doc"> *   LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION</span></li>
<li><a name="a27"></a><span class="src-doc"> *   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION</span></li>
<li><a name="a28"></a><span class="src-doc"> *   WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</span></li>
<li><a name="a29"></a><span class="src-doc"> */</span></li>
<li><a name="a30"></a>&nbsp;</li>
<li><a name="a31"></a><span class="src-doc">/**</span></li>
<li><a name="a32"></a><span class="src-doc"> *  Utility to help build HTML pulldown menus for date and time</span></li>
<li><a name="a33"></a><span class="src-doc"> */</span></li>
<li><a name="a34"></a><span class="src-key">class </span><a href="../PHPonTrax/DateHelper.html">DateHelper</a> <span class="src-key">extends </span><a href="../PHPonTrax/Helpers.html">Helpers</a> <span class="src-sym">{</span></li>
<li><a name="a35"></a>&nbsp;</li>
<li><a name="a36"></a>    <span class="src-doc">/**</span></li>
<li><a name="a37"></a><span class="src-doc">     *  Year values parsed from $_REQUEST</span></li>
<li><a name="a38"></a><span class="src-doc">     *</span></li>
<li><a name="a39"></a><span class="src-doc">     *  Set by </span><span class="src-doc-inlinetag">{@link check_request_for_value()}</span><span class="src-doc">.  An array whose keys</span></li>
<li><a name="a40"></a><span class="src-doc">     *  are the names of attributes of the </span><span class="src-doc-inlinetag">{@link ActiveRecord}</span></li>
<li><a name="a41"></a><span class="src-doc">     *  subclass named by </span><span class="src-doc-inlinetag">{@link $object_name}</span><span class="src-doc">, and whose values are</span></li>
<li><a name="a42"></a><span class="src-doc">     *  the strings parsed from $_REQUEST.</span></li>
<li><a name="a43"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string[] </span></li>
<li><a name="a44"></a><span class="src-doc">     */</span></li>
<li><a name="a45"></a>    <span class="src-key">public </span><a href="../PHPonTrax/DateHelper.html#var$request_years">$request_years</a><span class="src-sym">;</span></li>
<li><a name="a46"></a>&nbsp;</li>
<li><a name="a47"></a>    <span class="src-doc">/**</span></li>
<li><a name="a48"></a><span class="src-doc">     *  Month values parsed from $_REQUEST</span></li>
<li><a name="a49"></a><span class="src-doc">     *</span></li>
<li><a name="a50"></a><span class="src-doc">     *  Set by </span><span class="src-doc-inlinetag">{@link check_request_for_value()}</span><span class="src-doc">.  An array whose keys</span></li>
<li><a name="a51"></a><span class="src-doc">     *  are the names of attributes of the </span><span class="src-doc-inlinetag">{@link ActiveRecord}</span></li>
<li><a name="a52"></a><span class="src-doc">     *  subclass named by </span><span class="src-doc-inlinetag">{@link $object_name}</span><span class="src-doc">, and whose values are</span></li>
<li><a name="a53"></a><span class="src-doc">     *  the strings parsed from $_REQUEST.</span></li>
<li><a name="a54"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string[] </span></li>
<li><a name="a55"></a><span class="src-doc">     */</span></li>
<li><a name="a56"></a>    <span class="src-key">public </span><a href="../PHPonTrax/DateHelper.html#var$request_months">$request_months</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a57"></a>&nbsp;</li>
<li><a name="a58"></a>    <span class="src-doc">/**</span></li>
<li><a name="a59"></a><span class="src-doc">     *  Day of month values parsed from $_REQUEST</span></li>
<li><a name="a60"></a><span class="src-doc">     *</span></li>
<li><a name="a61"></a><span class="src-doc">     *  Set by </span><span class="src-doc-inlinetag">{@link check_request_for_value()}</span><span class="src-doc">.  An array whose keys</span></li>
<li><a name="a62"></a><span class="src-doc">     *  are the names of attributes of the </span><span class="src-doc-inlinetag">{@link ActiveRecord}</span></li>
<li><a name="a63"></a><span class="src-doc">     *  subclass named by </span><span class="src-doc-inlinetag">{@link $object_name}</span><span class="src-doc">, and whose values are</span></li>
<li><a name="a64"></a><span class="src-doc">     *  the strings parsed from $_REQUEST.</span></li>
<li><a name="a65"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string[] </span></li>
<li><a name="a66"></a><span class="src-doc">     */</span></li>
<li><a name="a67"></a>    <span class="src-key">public </span><a href="../PHPonTrax/DateHelper.html#var$request_days">$request_days</a><span class="src-sym">;</span></li>
<li><a name="a68"></a>&nbsp;</li>
<li><a name="a69"></a>    <span class="src-doc">/**</span></li>
<li><a name="a70"></a><span class="src-doc">     *  Hour values parsed from $_REQUEST</span></li>
<li><a name="a71"></a><span class="src-doc">     *</span></li>
<li><a name="a72"></a><span class="src-doc">     *  Set by </span><span class="src-doc-inlinetag">{@link check_request_for_value()}</span><span class="src-doc">.  An array whose keys</span></li>
<li><a name="a73"></a><span class="src-doc">     *  are the names of attributes of the </span><span class="src-doc-inlinetag">{@link ActiveRecord}</span></li>
<li><a name="a74"></a><span class="src-doc">     *  subclass named by </span><span class="src-doc-inlinetag">{@link $object_name}</span><span class="src-doc">, and whose values are</span></li>
<li><a name="a75"></a><span class="src-doc">     *  the strings parsed from $_REQUEST.</span></li>
<li><a name="a76"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string[] </span></li>
<li><a name="a77"></a><span class="src-doc">     */</span></li>
<li><a name="a78"></a>    <span class="src-key">public </span><a href="../PHPonTrax/DateHelper.html#var$request_hours">$request_hours</a><span class="src-sym">;</span></li>
<li><a name="a79"></a>&nbsp;</li>
<li><a name="a80"></a>    <span class="src-doc">/**</span></li>
<li><a name="a81"></a><span class="src-doc">     *  Minute values parsed from $_REQUEST</span></li>
<li><a name="a82"></a><span class="src-doc">     *</span></li>
<li><a name="a83"></a><span class="src-doc">     *  Set by </span><span class="src-doc-inlinetag">{@link check_request_for_value()}</span><span class="src-doc">.  An array whose keys</span></li>
<li><a name="a84"></a><span class="src-doc">     *  are the names of attributes of the </span><span class="src-doc-inlinetag">{@link ActiveRecord}</span></li>
<li><a name="a85"></a><span class="src-doc">     *  subclass named by </span><span class="src-doc-inlinetag">{@link $object_name}</span><span class="src-doc">, and whose values are</span></li>
<li><a name="a86"></a><span class="src-doc">     *  the strings parsed from $_REQUEST.</span></li>
<li><a name="a87"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string[] </span></li>
<li><a name="a88"></a><span class="src-doc">     */</span></li>
<li><a name="a89"></a>    <span class="src-key">public </span><a href="../PHPonTrax/DateHelper.html#var$request_minutes">$request_minutes</a><span class="src-sym">;</span></li>
<li><a name="a90"></a>&nbsp;</li>
<li><a name="a91"></a>    <span class="src-doc">/**</span></li>
<li><a name="a92"></a><span class="src-doc">     *  Second values parsed from $_REQUEST</span></li>
<li><a name="a93"></a><span class="src-doc">     *</span></li>
<li><a name="a94"></a><span class="src-doc">     *  Set by </span><span class="src-doc-inlinetag">{@link check_request_for_value()}</span><span class="src-doc">.  An array whose keys</span></li>
<li><a name="a95"></a><span class="src-doc">     *  are the names of attributes of the </span><span class="src-doc-inlinetag">{@link ActiveRecord}</span></li>
<li><a name="a96"></a><span class="src-doc">     *  subclass named by </span><span class="src-doc-inlinetag">{@link $object_name}</span><span class="src-doc">, and whose values are</span></li>
<li><a name="a97"></a><span class="src-doc">     *  the strings parsed from $_REQUEST.</span></li>
<li><a name="a98"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string[] </span></li>
<li><a name="a99"></a><span class="src-doc">     */</span></li>
<li><a name="a100"></a>    <span class="src-key">public </span><a href="../PHPonTrax/DateHelper.html#var$request_seconds">$request_seconds</a><span class="src-sym">;</span></li>
<li><a name="a101"></a>&nbsp;</li>
<li><a name="a102"></a>    <span class="src-doc">/**</span></li>
<li><a name="a103"></a><span class="src-doc">     *  &lt;b&gt;FIXME:&lt;/b&gt;  Dead code?</span></li>
<li><a name="a104"></a><span class="src-doc">     */</span></li>
<li><a name="a105"></a>    <span class="src-key">public </span><a href="../PHPonTrax/DateHelper.html#var$selected_years">$selected_years</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a106"></a>&nbsp;</li>
<li><a name="a107"></a>    <span class="src-doc">/**</span></li>
<li><a name="a108"></a><span class="src-doc">     *  Constructor</span></li>
<li><a name="a109"></a><span class="src-doc">     *</span></li>
<li><a name="a110"></a><span class="src-doc">     *  Construct an instance of Helpers with the same arguments</span></li>
<li><a name="a111"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc">Name of an ActiveRecord subclass</span></li>
<li><a name="a112"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc">Name of an attribute of $object</span></li>
<li><a name="a113"></a><span class="src-doc">     */</span></li>
<li><a name="a114"></a>    <span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-var">$object_name </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$attribute_name </span>= <span class="src-id">null</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a115"></a>        <span class="src-id">parent</span><span class="src-sym">::</span><a href="../PHPonTrax/Helpers.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-var">$object_name</span><span class="src-sym">, </span><span class="src-var">$attribute_name</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a116"></a>    <span class="src-sym">}</span></li>
<li><a name="a117"></a>    </li>
<li><a name="a118"></a>    <span class="src-doc">/**</span></li>
<li><a name="a119"></a><span class="src-doc">     *  Check whether $_REQUEST holds value for this attribute</span></li>
<li><a name="a120"></a><span class="src-doc">     *</span></li>
<li><a name="a121"></a><span class="src-doc">     *  Called with the name of an ActiveRecord subclass in</span></li>
<li><a name="a122"></a><span class="src-doc">     *  $this-&gt;object_name and the name of one of its attributes in</span></li>
<li><a name="a123"></a><span class="src-doc">     *  $this-&gt;attribute_name.  Check whether $_REQUEST contains a</span></li>
<li><a name="a124"></a><span class="src-doc">     *  value for this attribute; if so return it.</span></li>
<li><a name="a125"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">mixed </span><span class="src-doc">String value if attribute was found in</span></li>
<li><a name="a126"></a><span class="src-doc">     *                 $_REQUEST, otherwise false</span></li>
<li><a name="a127"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> attribute_name</span></li>
<li><a name="a128"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> object_name</span></li>
<li><a name="a129"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> request_years</span></li>
<li><a name="a130"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> request_months</span></li>
<li><a name="a131"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> request_days</span></li>
<li><a name="a132"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> request_hours</span></li>
<li><a name="a133"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> request_minutes</span></li>
<li><a name="a134"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> request_seconds</span></li>
<li><a name="a135"></a><span class="src-doc">     */</span></li>
<li><a name="a136"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methodcheck_request_for_value">check_request_for_value</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a137"></a>        <span class="src-comm">//error_log(&quot;check_request_for_value().  object name='&quot;</span></li>
<li><a name="a138"></a>        <span class="src-comm">//          . $this-&gt;object_name .&quot;'  attribute name = '&quot;</span></li>
<li><a name="a139"></a>        <span class="src-comm">//          . $this-&gt;attribute_name .&quot;'&quot;);</span></li>
<li><a name="a140"></a>&nbsp;</li>
<li><a name="a141"></a>        <span class="src-comm">//  If $_REQUEST[$this-&gt;object_name] does not exist,</span></li>
<li><a name="a142"></a>        <span class="src-comm">//  return false immediately</span></li>
<li><a name="a143"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$_REQUEST</span><span class="src-sym">) </span>|| <span class="src-sym">!</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$_REQUEST</span><span class="src-sym">)</span></li>
<li><a name="a144"></a>            || <span class="src-sym">!</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">, </span><span class="src-var">$_REQUEST</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a145"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a146"></a>        <span class="src-sym">}</span></li>
<li><a name="a147"></a>&nbsp;</li>
<li><a name="a148"></a>        <span class="src-comm">//  $_REQUEST[$this-&gt;object_name] exists.</span></li>
<li><a name="a149"></a>        <span class="src-comm">//  Look for the requested attribute</span></li>
<li><a name="a150"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">,</span></li>
<li><a name="a151"></a>                             <span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a152"></a>&nbsp;</li>
<li><a name="a153"></a>            <span class="src-comm">//  Requested attribute found, return it</span></li>
<li><a name="a154"></a>            <span class="src-key">return </span><span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a155"></a>        <span class="src-sym">}</span></li>
<li><a name="a156"></a>&nbsp;</li>
<li><a name="a157"></a>        <span class="src-comm">//  There is an element $_REQUEST[$this-&gt;object_name] but not</span></li>
<li><a name="a158"></a>        <span class="src-comm">//  $_REQUEST[$this-&gt;object_name][$this-&gt;attribute_name] so</span></li>
<li><a name="a159"></a>        <span class="src-comm">//  check for the individual components of a date/time</span></li>
<li><a name="a160"></a>&nbsp;</li>
<li><a name="a161"></a>        <span class="src-comm">//  Keep track of whether we find any components</span></li>
<li><a name="a162"></a>        <span class="src-var">$found </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a163"></a>&nbsp;</li>
<li><a name="a164"></a>        <span class="src-comm">//    Check for year component</span></li>
<li><a name="a165"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a>.<span class="src-str">&quot;(1i)&quot;</span><span class="src-sym">,</span></li>
<li><a name="a166"></a>                             <span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a167"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_years">request_years</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">] </span>=</li>
<li><a name="a168"></a>                <span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a>.<span class="src-str">&quot;(1i)&quot;</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a169"></a>            <span class="src-var">$found </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a170"></a>        <span class="src-sym">}</span></li>
<li><a name="a171"></a>&nbsp;</li>
<li><a name="a172"></a>        <span class="src-comm">//    Check for month component</span></li>
<li><a name="a173"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a>.<span class="src-str">&quot;(2i)&quot;</span><span class="src-sym">,</span></li>
<li><a name="a174"></a>                             <span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a175"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_months">request_months</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">] </span>=</li>
<li><a name="a176"></a>                <span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a>.<span class="src-str">&quot;(2i)&quot;</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a177"></a>            <span class="src-var">$found </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a178"></a>        <span class="src-sym">}</span></li>
<li><a name="a179"></a>&nbsp;</li>
<li><a name="a180"></a>        <span class="src-comm">//    Check for day component</span></li>
<li><a name="a181"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a>.<span class="src-str">&quot;(3i)&quot;</span><span class="src-sym">,</span></li>
<li><a name="a182"></a>                             <span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a183"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_days">request_days</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">] </span>=</li>
<li><a name="a184"></a>                <span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a>.<span class="src-str">&quot;(3i)&quot;</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a185"></a>            <span class="src-var">$found </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a186"></a>        <span class="src-sym">}</span></li>
<li><a name="a187"></a>&nbsp;</li>
<li><a name="a188"></a>        <span class="src-comm">//    Check for hour component</span></li>
<li><a name="a189"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a>.<span class="src-str">&quot;(4i)&quot;</span><span class="src-sym">,</span></li>
<li><a name="a190"></a>                             <span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a191"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_hours">request_hours</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">] </span>=</li>
<li><a name="a192"></a>                <span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a>.<span class="src-str">&quot;(4i)&quot;</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a193"></a>            <span class="src-var">$found </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a194"></a>        <span class="src-sym">}   </span></li>
<li><a name="a195"></a>&nbsp;</li>
<li><a name="a196"></a>        <span class="src-comm">//    Check for minute component</span></li>
<li><a name="a197"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a>.<span class="src-str">&quot;(5i)&quot;</span><span class="src-sym">,</span></li>
<li><a name="a198"></a>                             <span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a199"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_minutes">request_minutes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">] </span>=</li>
<li><a name="a200"></a>                <span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a>.<span class="src-str">&quot;(5i)&quot;</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a201"></a>            <span class="src-var">$found </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a202"></a>        <span class="src-sym">}              </span></li>
<li><a name="a203"></a>&nbsp;</li>
<li><a name="a204"></a>        <span class="src-comm">//    Check for second component</span></li>
<li><a name="a205"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a>.<span class="src-str">&quot;(6i)&quot;</span><span class="src-sym">,</span></li>
<li><a name="a206"></a>                             <span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a207"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_seconds">request_seconds</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">] </span>=</li>
<li><a name="a208"></a>                <span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a>.<span class="src-str">&quot;(6i)&quot;</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a209"></a>            <span class="src-var">$found </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a210"></a>        <span class="src-sym">}                                                                   </span></li>
<li><a name="a211"></a>        <span class="src-key">return </span><span class="src-var">$found</span><span class="src-sym">;</span></li>
<li><a name="a212"></a>    <span class="src-sym">}</span></li>
<li><a name="a213"></a>&nbsp;</li>
<li><a name="a214"></a>    <span class="src-doc">/**</span></li>
<li><a name="a215"></a><span class="src-doc">     *  Generate HTML/XML for select to enclose option list</span></li>
<li><a name="a216"></a><span class="src-doc">     *</span></li>
<li><a name="a217"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc">  Name attribute for &lt;samp&gt;&lt;select name=... &gt;&lt;/samp&gt;</span></li>
<li><a name="a218"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc">  &lt;samp&gt;&lt;option&gt;...&lt;/option&gt;&lt;samp&gt; list</span></li>
<li><a name="a219"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc">  Prefix of name attribute, to be enclosed in</span></li>
<li><a name="a220"></a><span class="src-doc">     *                   square brackets</span></li>
<li><a name="a221"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">boolean </span><span class="src-doc"> Whether to include a blank in the list of</span></li>
<li><a name="a222"></a><span class="src-doc">     *                   select options</span></li>
<li><a name="a223"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">boolean </span><span class="src-doc"> Whether to discard the type</span></li>
<li><a name="a224"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc"> Generated HTML</span></li>
<li><a name="a225"></a><span class="src-doc">     */</span></li>
<li><a name="a226"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methodselect_html">select_html</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">, </span><span class="src-var">$prefix </span>= <span class="src-id">null</span><span class="src-sym">,</span></li>
<li><a name="a227"></a>                                 <span class="src-var">$include_blank </span>= <span class="src-id">false</span><span class="src-sym">,</span></li>
<li><a name="a228"></a>                                 <span class="src-var">$discard_type </span>= <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a229"></a>        <span class="src-var">$select_html  </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-id">select</span> <span class="src-id">name</span>=\&quot;<span class="src-var">$prefix</span></span><span class="src-str">&quot;</span><span class="src-sym">;       </span></li>
<li><a name="a230"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$discard_type</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a231"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$prefix</span><span class="src-sym">) </span><span class="src-var">$select_html </span>.= <span class="src-str">&quot;[&quot;</span><span class="src-sym">; </span></li>
<li><a name="a232"></a>            <span class="src-var">$select_html </span>.= <span class="src-var">$type</span><span class="src-sym">;</span></li>
<li><a name="a233"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$prefix</span><span class="src-sym">) </span><span class="src-var">$select_html </span>.= <span class="src-str">&quot;]&quot;</span><span class="src-sym">; </span></li>
<li><a name="a234"></a>        <span class="src-sym">}</span></li>
<li><a name="a235"></a>        <span class="src-var">$select_html </span>.= <span class="src-str">&quot;\&quot;&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a236"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$include_blank</span><span class="src-sym">) </span><span class="src-var">$select_html </span>.= <span class="src-str">&quot;&lt;option value=\&quot;\&quot;&gt;&lt;/option&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a237"></a>        <span class="src-var">$select_html </span>.= <span class="src-var">$options</span><span class="src-sym">;</span></li>
<li><a name="a238"></a>        <span class="src-var">$select_html </span>.= <span class="src-str">&quot;&lt;/select&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a239"></a>        <span class="src-key">return </span><span class="src-var">$select_html</span><span class="src-sym">;</span></li>
<li><a name="a240"></a>    <span class="src-sym">}</span></li>
<li><a name="a241"></a>&nbsp;</li>
<li><a name="a242"></a>    <span class="src-doc">/**</span></li>
<li><a name="a243"></a><span class="src-doc">     *  Prefix a leading zero to single digit numbers</span></li>
<li><a name="a244"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc">  A number</span></li>
<li><a name="a245"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc"> Number with zero prefix if value &lt;= 9</span></li>
<li><a name="a246"></a><span class="src-doc">     */</span></li>
<li><a name="a247"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$number</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a248"></a>        <span class="src-key">return </span><span class="src-var">$number </span>&gt; <span class="src-num">9 </span>? <span class="src-var">$number </span>: <span class="src-str">&quot;</span><span class="src-str">0<span class="src-var">$number</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a249"></a>    <span class="src-sym">}</span></li>
<li><a name="a250"></a>&nbsp;</li>
<li><a name="a251"></a>    <span class="src-doc">/**</span></li>
<li><a name="a252"></a><span class="src-doc">     *  Get attribute value from $_REQUEST if there, otherwise from database</span></li>
<li><a name="a253"></a><span class="src-doc">     *</span></li>
<li><a name="a254"></a><span class="src-doc">     *  When called, </span><span class="src-doc-inlinetag">{@link $object_name}</span><span class="src-doc"> describes the</span></li>
<li><a name="a255"></a><span class="src-doc">     *  </span><span class="src-doc-inlinetag">{@link ActiveRecord}</span><span class="src-doc"> subclass and </span><span class="src-doc-inlinetag">{@link $attribute_name}</span></li>
<li><a name="a256"></a><span class="src-doc">     *  describes the attribute whose value is desired.</span></li>
<li><a name="a257"></a><span class="src-doc">     *</span></li>
<li><a name="a258"></a><span class="src-doc">     *  An attempt is made to find the value in $_REQUEST, where it</span></li>
<li><a name="a259"></a><span class="src-doc">     *  would be found after the browser POSTed a form.  If no value</span></li>
<li><a name="a260"></a><span class="src-doc">     *  is found there, then the database is accessed for the value.</span></li>
<li><a name="a261"></a><span class="src-doc">     *  When accessing the database, the assumption is made that the</span></li>
<li><a name="a262"></a><span class="src-doc">     *  </span><span class="src-doc-inlinetag">{@link ActionController}</span><span class="src-doc"> object refers to a single</span></li>
<li><a name="a263"></a><span class="src-doc">     *  </span><span class="src-doc-inlinetag">{@link ActiveRecord}</span><span class="src-doc"> subclass object which correctly</span></li>
<li><a name="a264"></a><span class="src-doc">     *  identifies the table and record containing the attribute</span></li>
<li><a name="a265"></a><span class="src-doc">     *  value.</span></li>
<li><a name="a266"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">mixed </span><span class="src-doc">Attribute value if found</span></li>
<li><a name="a267"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> check_request_for_value()</span></li>
<li><a name="a268"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> attribute_name</span></li>
<li><a name="a269"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> object()</span></li>
<li><a name="a270"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> ActiveRecord::send()</span></li>
<li><a name="a271"></a><span class="src-doc">     */</span></li>
<li><a name="a272"></a>    <span class="src-key">protected </span><span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methodvalue">value</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a273"></a>        <span class="src-comm">//error_log(&quot;DateHelper::value()  object name={$this-&gt;object_name}&quot;</span></li>
<li><a name="a274"></a>        <span class="src-comm">//          . &quot;   attribute name={$this-&gt;attribute_name}&quot;);</span></li>
<li><a name="a275"></a>&nbsp;</li>
<li><a name="a276"></a>        <span class="src-comm">//  First try to get attribute value from $_REQUEST</span></li>
<li><a name="a277"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$value </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodcheck_request_for_value">check_request_for_value</a><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a278"></a>&nbsp;</li>
<li><a name="a279"></a>            <span class="src-comm">//  Value not found in $_REQUEST so we need to</span></li>
<li><a name="a280"></a>            <span class="src-comm">//  go to the database.  Assume that the controller</span></li>
<li><a name="a281"></a>            <span class="src-comm">//  points to the right ActiveRecord object</span></li>
<li><a name="a282"></a>            <span class="src-var">$object </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodobject">object</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a283"></a>            <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a284"></a>                <span class="src-var">$value </span>= <span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">send</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a285"></a>            <span class="src-sym">}</span></li>
<li><a name="a286"></a>        <span class="src-sym">}</span></li>
<li><a name="a287"></a>        <span class="src-key">return </span><span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a288"></a>    <span class="src-sym">}</span></li>
<li><a name="a289"></a>    </li>
<li><a name="a290"></a>    <span class="src-doc">/**</span></li>
<li><a name="a291"></a><span class="src-doc">     *  Call to_expiration_date_select_tag()</span></li>
<li><a name="a292"></a><span class="src-doc">     *</span></li>
<li><a name="a293"></a><span class="src-doc">     *  Alias for </span><span class="src-doc-inlinetag">{@link to_expiration_date_select_tag()}</span></li>
<li><a name="a294"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed[] </span><span class="src-doc"> Output format options</span></li>
<li><a name="a295"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">Generated HTML</span></li>
<li><a name="a296"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> to_expiration_date_select_tag()</span></li>
<li><a name="a297"></a><span class="src-doc">     */</span></li>
<li><a name="a298"></a>    <span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methodexpiration_date_select">expiration_date_select</a><span class="src-sym">(</span><span class="src-var">$options </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a299"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodto_expiration_date_select_tag">to_expiration_date_select_tag</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;      </span></li>
<li><a name="a300"></a>    <span class="src-sym">}</span></li>
<li><a name="a301"></a>        </li>
<li><a name="a302"></a>    <span class="src-doc">/**</span></li>
<li><a name="a303"></a><span class="src-doc">     *  Call to_datetime_select_tag()</span></li>
<li><a name="a304"></a><span class="src-doc">     *</span></li>
<li><a name="a305"></a><span class="src-doc">     *  Alias for </span><span class="src-doc-inlinetag">{@link to_datetime_select_tag()}</span></li>
<li><a name="a306"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed[] </span><span class="src-doc"> Output format options</span></li>
<li><a name="a307"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">Generated HTML</span></li>
<li><a name="a308"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> to_datetime_select_tag()</span></li>
<li><a name="a309"></a><span class="src-doc">     */</span></li>
<li><a name="a310"></a>    <span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methoddatetime_select">datetime_select</a><span class="src-sym">(</span><span class="src-var">$options </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{     </span></li>
<li><a name="a311"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodto_datetime_select_tag">to_datetime_select_tag</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a312"></a>    <span class="src-sym">} </span></li>
<li><a name="a313"></a>    </li>
<li><a name="a314"></a>    <span class="src-doc">/**</span></li>
<li><a name="a315"></a><span class="src-doc">     *  Call to_date_select_tag()</span></li>
<li><a name="a316"></a><span class="src-doc">     *</span></li>
<li><a name="a317"></a><span class="src-doc">     *  Alias for </span><span class="src-doc-inlinetag">{@link to_date_select_tag()}</span></li>
<li><a name="a318"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed[] </span><span class="src-doc"> Output format options</span></li>
<li><a name="a319"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">Generated HTML</span></li>
<li><a name="a320"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> to_date_select_tag()</span></li>
<li><a name="a321"></a><span class="src-doc">     */</span></li>
<li><a name="a322"></a>    <span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methoddate_select">date_select</a><span class="src-sym">(</span><span class="src-var">$options </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{   </span></li>
<li><a name="a323"></a>        <span class="src-comm">//error_log(&quot;date_select() object=$this-&gt;object_name&quot;</span></li>
<li><a name="a324"></a>        <span class="src-comm">//          . &quot;   attribute=$this-&gt;attribute_name&quot;);</span></li>
<li><a name="a325"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodto_date_select_tag">to_date_select_tag</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a326"></a>    <span class="src-sym">}  </span></li>
<li><a name="a327"></a>    </li>
<li><a name="a328"></a>    <span class="src-doc">/**</span></li>
<li><a name="a329"></a><span class="src-doc">     *  Generate HTML/XML for expiration month and year selector</span></li>
<li><a name="a330"></a><span class="src-doc">     *  pulldowns</span></li>
<li><a name="a331"></a><span class="src-doc">     *</span></li>
<li><a name="a332"></a><span class="src-doc">     *  Generates HTML for a month and year pulldown.  The year</span></li>
<li><a name="a333"></a><span class="src-doc">     *  pulldown has a range of years from the initially selected year</span></li>
<li><a name="a334"></a><span class="src-doc">     *  to seven years after.</span></li>
<li><a name="a335"></a><span class="src-doc">     *</span></li>
<li><a name="a336"></a><span class="src-doc">     *  When called, $_REQUEST[] may have initial date values in</span></li>
<li><a name="a337"></a><span class="src-doc">     *  fields with default names of 'expiration_month' and</span></li>
<li><a name="a338"></a><span class="src-doc">     *  'expiration_year'.  If these values exist they override the</span></li>
<li><a name="a339"></a><span class="src-doc">     *  first parameter.</span></li>
<li><a name="a340"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc">  Date to display as initially selected if none</span></li>
<li><a name="a341"></a><span class="src-doc">     *     was found in $_REQUEST[].  If omitted, default value is the</span></li>
<li><a name="a342"></a><span class="src-doc">     *     current calendar date.&lt;b&gt;FIXME:&lt;/b&gt; this doesn't work</span></li>
<li><a name="a343"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed[] </span><span class="src-doc"> Output format options:</span></li>
<li><a name="a344"></a><span class="src-doc">     *   &lt;ul&gt;</span></li>
<li><a name="a345"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'field_separator' =&gt; '&lt;/samp&gt;&lt;i&gt;somestring&lt;/i&gt;&lt;samp&gt;'&lt;/samp&gt;&lt;br /&gt;</span></li>
<li><a name="a346"></a><span class="src-doc">     *       String to insert between the month and year selectors.  If</span></li>
<li><a name="a347"></a><span class="src-doc">     *       none is specified, default value is &lt;samp&gt;' / '&lt;/samp&gt;&lt;/li&gt;</span></li>
<li><a name="a348"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'month_before_year' =&gt; 'false'&lt;br /&gt;</span></li>
<li><a name="a349"></a><span class="src-doc">     *       Output year selector first, then month selector.</span></li>
<li><a name="a350"></a><span class="src-doc">     *       If option not specified, the month selector will be output</span></li>
<li><a name="a351"></a><span class="src-doc">     *       first.&lt;/li&gt;</span></li>
<li><a name="a352"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'month_name' =&gt;'&lt;/samp&gt;&lt;i&gt;somestring&lt;/i&gt;&lt;samp&gt;'&lt;/samp&gt;&lt;br /&gt;</span></li>
<li><a name="a353"></a><span class="src-doc">     *       Set the name of the generated month selector to</span></li>
<li><a name="a354"></a><span class="src-doc">     *       &lt;i&gt;somestring&lt;/i&gt;.  If option not specified, default name is</span></li>
<li><a name="a355"></a><span class="src-doc">     *       &lt;samp&gt;expiration_month&lt;/samp&gt;&lt;/li&gt;</span></li>
<li><a name="a356"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'year_name' =&gt; '&lt;/samp&gt;&lt;i&gt;somestring&lt;/i&gt;&lt;samp&gt;'&lt;/samp&gt;&lt;br /&gt;</span></li>
<li><a name="a357"></a><span class="src-doc">     *       Set the name of the generated year selector to</span></li>
<li><a name="a358"></a><span class="src-doc">     *       &lt;i&gt;somestring&lt;/i&gt;.  If option not specified, default name is</span></li>
<li><a name="a359"></a><span class="src-doc">     *       &lt;samp&gt;expiration_year&lt;/samp&gt;&lt;/li&gt;</span></li>
<li><a name="a360"></a><span class="src-doc">     *   &lt;/ul&gt;</span></li>
<li><a name="a361"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">Generated HTML</span></li>
<li><a name="a362"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_html()</span></li>
<li><a name="a363"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_month()</span></li>
<li><a name="a364"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_year()</span></li>
<li><a name="a365"></a><span class="src-doc">     */</span></li>
<li><a name="a366"></a>    <span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methodselect_expiration_date">select_expiration_date</a><span class="src-sym">(</span><span class="src-var">$date </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$options </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a367"></a><span class="src-comm">//        error_log(&quot;select_expiration_date('&quot;</span></li>
<li><a name="a368"></a><span class="src-comm">//                  . (is_null($date) ? 'null' : $date)</span></li>
<li><a name="a369"></a><span class="src-comm">//                  .&quot;', &quot; . var_export($options,true));</span></li>
<li><a name="a370"></a>        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'month_before_year'</span><span class="src-sym">] </span>= <span class="src-id">true</span><span class="src-sym">;      </span></li>
<li><a name="a371"></a>        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'use_month_numbers'</span><span class="src-sym">] </span>= <span class="src-id">true</span><span class="src-sym">;   </span></li>
<li><a name="a372"></a>        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'start_year'</span><span class="src-sym">] </span>= <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;Y&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a373"></a>        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'end_year'</span><span class="src-sym">] </span>= <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;Y&quot;</span><span class="src-sym">) </span>+ <span class="src-num">7</span><span class="src-sym">;</span></li>
<li><a name="a374"></a>        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_separator'</span><span class="src-sym">] </span>= <span class="src-str">&quot; / &quot;</span><span class="src-sym">;        </span></li>
<li><a name="a375"></a>&nbsp;</li>
<li><a name="a376"></a>        <span class="src-comm">//  Find name and initial value of year field,</span></li>
<li><a name="a377"></a>        <span class="src-comm">//  then generate year selector pulldown</span></li>
<li><a name="a378"></a>        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_name'</span><span class="src-sym">] </span>= <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'year_name'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a379"></a>            ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'year_name'</span><span class="src-sym">] </span>: <span class="src-str">&quot;expiration_year&quot;</span><span class="src-sym">; </span></li>
<li><a name="a380"></a>        <span class="src-var">$date </span>= <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_name'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$_REQUEST</span><span class="src-sym">)</span></li>
<li><a name="a381"></a>            ? <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;Y-m-d&quot;</span><span class="src-sym">,</span></li>
<li><a name="a382"></a>                   <a href="http://www.php.net/strtotime">strtotime</a><span class="src-sym">(</span><span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_name'</span><span class="src-sym">]]</span>.<span class="src-str">&quot;-01-01&quot;</span><span class="src-sym">))</span></li>
<li><a name="a383"></a>            : <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;Y-m-d&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a384"></a>        <span class="src-var">$year_select </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_year">select_year</a><span class="src-sym">(</span><span class="src-var">$date</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a385"></a>&nbsp;</li>
<li><a name="a386"></a>        <span class="src-comm">//  Find name and initial value of month field,</span></li>
<li><a name="a387"></a>        <span class="src-comm">//  then generate year selector pulldown</span></li>
<li><a name="a388"></a>        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_name'</span><span class="src-sym">] </span>= <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'month_name'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a389"></a>            ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'month_name'</span><span class="src-sym">] </span>: <span class="src-str">&quot;expiration_month&quot;</span><span class="src-sym">;</span></li>
<li><a name="a390"></a>        <span class="src-var">$date </span>= <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_name'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$_REQUEST</span><span class="src-sym">)</span></li>
<li><a name="a391"></a>            ? <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;Y-m-d&quot;</span><span class="src-sym">,</span></li>
<li><a name="a392"></a>                   <a href="http://www.php.net/strtotime">strtotime</a><span class="src-sym">(</span><span class="src-str">&quot;2006-&quot;</span>.<span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_name'</span><span class="src-sym">]]</span>.<span class="src-str">&quot;-01&quot;</span><span class="src-sym">))</span></li>
<li><a name="a393"></a>            : <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;Y-m-d&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a394"></a>        <span class="src-var">$month_select </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_month">select_month</a><span class="src-sym">(</span><span class="src-var">$date</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a395"></a>&nbsp;</li>
<li><a name="a396"></a>        <span class="src-comm">//  Output month and year selectors in desired order</span></li>
<li><a name="a397"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'month_before_year'</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a398"></a>            <span class="src-var">$select_html </span>=  <span class="src-var">$month_select </span>. <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_separator'</span><span class="src-sym">]</span></li>
<li><a name="a399"></a>                .  <span class="src-var">$year_select</span><span class="src-sym">;     </span></li>
<li><a name="a400"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a401"></a>            <span class="src-var">$select_html </span>=  <span class="src-var">$year_select </span>. <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_separator'</span><span class="src-sym">]</span></li>
<li><a name="a402"></a>                .  <span class="src-var">$month_select</span><span class="src-sym">;</span></li>
<li><a name="a403"></a>        <span class="src-sym">}</span></li>
<li><a name="a404"></a>        <span class="src-key">return </span><span class="src-var">$select_html</span><span class="src-sym">;</span></li>
<li><a name="a405"></a>    <span class="src-sym">}               </span></li>
<li><a name="a406"></a>&nbsp;</li>
<li><a name="a407"></a>    <span class="src-doc">/**</span></li>
<li><a name="a408"></a><span class="src-doc">     *  Generate HTML/XML for year, month and day selector pull-down menus</span></li>
<li><a name="a409"></a><span class="src-doc">     *</span></li>
<li><a name="a410"></a><span class="src-doc">     *  Returns &lt;samp&gt;&lt;select&gt;...&lt;/select&gt;&lt;/samp&gt; HTML with options</span></li>
<li><a name="a411"></a><span class="src-doc">     *  for a number of years, months and days.  The first argument,</span></li>
<li><a name="a412"></a><span class="src-doc">     *  if present, specifies the initially selected date.  The second</span></li>
<li><a name="a413"></a><span class="src-doc">     *  argument controls the format of the generated HTML.</span></li>
<li><a name="a414"></a><span class="src-doc">     *</span></li>
<li><a name="a415"></a><span class="src-doc">     *  Examples:</span></li>
<li><a name="a416"></a><span class="src-doc">     *  &lt;ul&gt;</span></li>
<li><a name="a417"></a><span class="src-doc">     *   &lt;li&gt;&lt;samp&gt;select_date();&lt;/samp&gt;&lt;br /&gt; Generates a group of</span></li>
<li><a name="a418"></a><span class="src-doc">     *     three pulldown menus in the order year, month and day with</span></li>
<li><a name="a419"></a><span class="src-doc">     *     the current date initially selected.&lt;/li&gt;</span></li>
<li><a name="a420"></a><span class="src-doc">     *   &lt;li&gt;</span></li>
<li><a name="a421"></a><span class="src-doc">     *  &lt;samp&gt;select_date('August 4, 1998');&lt;/samp&gt;&lt;br /&gt; Generates a</span></li>
<li><a name="a422"></a><span class="src-doc">     *    group of   three pulldown menus in the order year, month and</span></li>
<li><a name="a423"></a><span class="src-doc">     *    day with the date August 4, 1998 initially selected.&lt;/li&gt;</span></li>
<li><a name="a424"></a><span class="src-doc">     *  &lt;/ul&gt;</span></li>
<li><a name="a425"></a><span class="src-doc">     *</span></li>
<li><a name="a426"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc">  Date to display as initially selected if none</span></li>
<li><a name="a427"></a><span class="src-doc">     *     was found in</span></li>
<li><a name="a428"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link $request_years}</span><span class="src-doc">[</span><span class="src-doc-inlinetag">{@link $attribute_name}</span><span class="src-doc">],</span></li>
<li><a name="a429"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link $request_months}</span><span class="src-doc">[</span><span class="src-doc-inlinetag">{@link $attribute_name}</span><span class="src-doc">] and</span></li>
<li><a name="a430"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link $request_days}</span><span class="src-doc">[</span><span class="src-doc-inlinetag">{@link $attribute_name}</span><span class="src-doc">].</span></li>
<li><a name="a431"></a><span class="src-doc">     *     Character string is any US English date representation</span></li>
<li><a name="a432"></a><span class="src-doc">     *     supported by </span><span class="src-doc-inlinetag">{@link strtotime()}</span><span class="src-doc">.  If omitted, the</span></li>
<li><a name="a433"></a><span class="src-doc">     *     current date is initially selected.</span></li>
<li><a name="a434"></a><span class="src-doc">     *</span></li>
<li><a name="a435"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed[] </span><span class="src-doc">Output format options are all of the options of</span></li>
<li><a name="a436"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link select_year()}</span><span class="src-doc">, </span><span class="src-doc-inlinetag">{@link select_month()}</span><span class="src-doc"> and</span></li>
<li><a name="a437"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link select_day()}</span><span class="src-doc">.</span></li>
<li><a name="a438"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc"> Generated HTML</span></li>
<li><a name="a439"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_day()</span></li>
<li><a name="a440"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_month()</span></li>
<li><a name="a441"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_year()</span></li>
<li><a name="a442"></a><span class="src-doc">     */</span></li>
<li><a name="a443"></a>    <span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methodselect_date">select_date</a><span class="src-sym">(</span><span class="src-var">$date </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$options </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a444"></a>        <span class="src-var">$date </span>= <a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$date</span><span class="src-sym">) </span>? <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;Y-m-d&quot;</span><span class="src-sym">) </span>: <span class="src-var">$date</span><span class="src-sym">;</span></li>
<li><a name="a445"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_year">select_year</a><span class="src-sym">(</span><span class="src-var">$date</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">) </span>.</li>
<li><a name="a446"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_month">select_month</a><span class="src-sym">(</span><span class="src-var">$date</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">) </span>.</li>
<li><a name="a447"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_day">select_day</a><span class="src-sym">(</span><span class="src-var">$date</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a448"></a>    <span class="src-sym">}</span></li>
<li><a name="a449"></a>&nbsp;</li>
<li><a name="a450"></a>    <span class="src-doc">/**</span></li>
<li><a name="a451"></a><span class="src-doc">     *  Generate HTML/XML for year-month-day-hour-minute selector pulldowns</span></li>
<li><a name="a452"></a><span class="src-doc">     *</span></li>
<li><a name="a453"></a><span class="src-doc">     *  Returns &lt;samp&gt;&lt;select&gt;...&lt;/select&gt;&lt;/samp&gt; HTML with options</span></li>
<li><a name="a454"></a><span class="src-doc">     *  for a number of years, months, days, hours and minutes.  The</span></li>
<li><a name="a455"></a><span class="src-doc">     *  first argument, if present, specifies the initially selected</span></li>
<li><a name="a456"></a><span class="src-doc">     *  date.  The second argument controls the format of the</span></li>
<li><a name="a457"></a><span class="src-doc">     *  generated HTML.</span></li>
<li><a name="a458"></a><span class="src-doc">     *</span></li>
<li><a name="a459"></a><span class="src-doc">     *  Examples:</span></li>
<li><a name="a460"></a><span class="src-doc">     *  &lt;ul&gt;</span></li>
<li><a name="a461"></a><span class="src-doc">     *   &lt;li&gt;&lt;samp&gt;select_datetime();&lt;/samp&gt;&lt;br /&gt; Generates a group of</span></li>
<li><a name="a462"></a><span class="src-doc">     *     five pulldown menus in the order year, month, day, hour and</span></li>
<li><a name="a463"></a><span class="src-doc">     *     minute with the current date and time initially</span></li>
<li><a name="a464"></a><span class="src-doc">     *    selected.&lt;/li&gt;</span></li>
<li><a name="a465"></a><span class="src-doc">     *   &lt;li&gt;</span></li>
<li><a name="a466"></a><span class="src-doc">     *  &lt;samp&gt;select_datetime('1998-04-08 13:21:17');&lt;/samp&gt;&lt;br /&gt;</span></li>
<li><a name="a467"></a><span class="src-doc">     *    Generates a group of five pulldown menus in the order year,</span></li>
<li><a name="a468"></a><span class="src-doc">     *    month, day, hour and minute with the date/time</span></li>
<li><a name="a469"></a><span class="src-doc">     *    1998 August 4 13:21 initially selected.&lt;/li&gt;</span></li>
<li><a name="a470"></a><span class="src-doc">     *  &lt;/ul&gt;</span></li>
<li><a name="a471"></a><span class="src-doc">     *</span></li>
<li><a name="a472"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc">  Date/time to display as initially selected.</span></li>
<li><a name="a473"></a><span class="src-doc">     *     Character string is any US English date representation</span></li>
<li><a name="a474"></a><span class="src-doc">     *     supported by </span><span class="src-doc-inlinetag">{@link strtotime()}</span><span class="src-doc">.  If omitted, the</span></li>
<li><a name="a475"></a><span class="src-doc">     *     current date/time is initially selected.</span></li>
<li><a name="a476"></a><span class="src-doc">     *</span></li>
<li><a name="a477"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed[] </span><span class="src-doc">Output format options are all of the options of</span></li>
<li><a name="a478"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link select_year()}</span><span class="src-doc">, </span><span class="src-doc-inlinetag">{@link select_month()}</span><span class="src-doc">,</span></li>
<li><a name="a479"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link select_day()}</span><span class="src-doc">, </span><span class="src-doc-inlinetag">{@link select_hour()}</span><span class="src-doc"> and</span></li>
<li><a name="a480"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link select_minute()}</span><span class="src-doc">.</span></li>
<li><a name="a481"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc"> Generated HTML</span></li>
<li><a name="a482"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_day()</span></li>
<li><a name="a483"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_hour()</span></li>
<li><a name="a484"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_minute()</span></li>
<li><a name="a485"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_month()</span></li>
<li><a name="a486"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_year()</span></li>
<li><a name="a487"></a><span class="src-doc">     */</span></li>
<li><a name="a488"></a>    <span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methodselect_datetime">select_datetime</a><span class="src-sym">(</span><span class="src-var">$datetime </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$options </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a489"></a>        <span class="src-var">$datetime </span>= <a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">) </span>? <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;Y-m-d H:i:s&quot;</span><span class="src-sym">) </span>: <span class="src-var">$datetime</span><span class="src-sym">;</span></li>
<li><a name="a490"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_year">select_year</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">) </span>.</li>
<li><a name="a491"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_month">select_month</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">) </span>.</li>
<li><a name="a492"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_day">select_day</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">) </span>.</li>
<li><a name="a493"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_hour">select_hour</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">) </span>.</li>
<li><a name="a494"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_minute">select_minute</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a495"></a>    <span class="src-sym">}</span></li>
<li><a name="a496"></a>&nbsp;</li>
<li><a name="a497"></a>    <span class="src-doc">/**</span></li>
<li><a name="a498"></a><span class="src-doc">     *  Generate HTML/XML for hour, minute and second selector pull-down menus</span></li>
<li><a name="a499"></a><span class="src-doc">     *</span></li>
<li><a name="a500"></a><span class="src-doc">     *  Returns &lt;samp&gt;&lt;select&gt;...&lt;/select&gt;&lt;/samp&gt; HTML with options</span></li>
<li><a name="a501"></a><span class="src-doc">     *  for a number of hours, minutes and seconds.  The first argument,</span></li>
<li><a name="a502"></a><span class="src-doc">     *  if present, specifies the initially selected time.  The second</span></li>
<li><a name="a503"></a><span class="src-doc">     *  argument controls the format of the generated HTML.</span></li>
<li><a name="a504"></a><span class="src-doc">     *</span></li>
<li><a name="a505"></a><span class="src-doc">     *  Examples:</span></li>
<li><a name="a506"></a><span class="src-doc">     *  &lt;ul&gt;</span></li>
<li><a name="a507"></a><span class="src-doc">     *   &lt;li&gt;&lt;samp&gt;select_time();&lt;/samp&gt;&lt;br /&gt; Generates two pulldown</span></li>
<li><a name="a508"></a><span class="src-doc">     *     menus in the order hour : minute with</span></li>
<li><a name="a509"></a><span class="src-doc">     *     the current time initially selected.&lt;/li&gt;</span></li>
<li><a name="a510"></a><span class="src-doc">     *   &lt;li&gt;</span></li>
<li><a name="a511"></a><span class="src-doc">     *  &lt;samp&gt;select_time('August 4, 1998 8:12');&lt;/samp&gt;&lt;br /&gt; Generates</span></li>
<li><a name="a512"></a><span class="src-doc">     *    two pulldown menus in the order hour : minute with the</span></li>
<li><a name="a513"></a><span class="src-doc">     *    time 8:12 initially selected.&lt;/li&gt;</span></li>
<li><a name="a514"></a><span class="src-doc">     *  &lt;/ul&gt;</span></li>
<li><a name="a515"></a><span class="src-doc">     *</span></li>
<li><a name="a516"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc">  Time to display as initially selected if none</span></li>
<li><a name="a517"></a><span class="src-doc">     *     was found in</span></li>
<li><a name="a518"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link $request_hours}</span><span class="src-doc">[</span><span class="src-doc-inlinetag">{@link $attribute_name}</span><span class="src-doc">],</span></li>
<li><a name="a519"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link $request_minutes}</span><span class="src-doc">[</span><span class="src-doc-inlinetag">{@link $attribute_name}</span><span class="src-doc">] and</span></li>
<li><a name="a520"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link $request_seconds}</span><span class="src-doc">[</span><span class="src-doc-inlinetag">{@link $attribute_name}</span><span class="src-doc">].</span></li>
<li><a name="a521"></a><span class="src-doc">     *     Character string is any US English date/time representation</span></li>
<li><a name="a522"></a><span class="src-doc">     *     supported by </span><span class="src-doc-inlinetag">{@link strtotime()}</span><span class="src-doc">.  If omitted, the</span></li>
<li><a name="a523"></a><span class="src-doc">     *     current time is initially selected.</span></li>
<li><a name="a524"></a><span class="src-doc">     *</span></li>
<li><a name="a525"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed[] </span><span class="src-doc">Output format options are all of the options of</span></li>
<li><a name="a526"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link select_hour()}</span><span class="src-doc">, </span><span class="src-doc-inlinetag">{@link select_minute()}</span><span class="src-doc"> and</span></li>
<li><a name="a527"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link select_second()}</span><span class="src-doc">.</span></li>
<li><a name="a528"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc"> Generated HTML</span></li>
<li><a name="a529"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_hour()</span></li>
<li><a name="a530"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_minute()</span></li>
<li><a name="a531"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_second()</span></li>
<li><a name="a532"></a><span class="src-doc">     */</span></li>
<li><a name="a533"></a>    <span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methodselect_time">select_time</a><span class="src-sym">(</span><span class="src-var">$datetime </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$options </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a534"></a>        <span class="src-var">$datetime </span>= <a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">) </span>? <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;Y-m-d H:i:s&quot;</span><span class="src-sym">) </span>: <span class="src-var">$datetime</span><span class="src-sym">;</span></li>
<li><a name="a535"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_hour">select_hour</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">) </span>.</li>
<li><a name="a536"></a>               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_minute">select_minute</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">) </span>.</li>
<li><a name="a537"></a>            <span class="src-sym">(</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'include_seconds'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a538"></a>             &amp;&amp; <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'include_seconds'</span><span class="src-sym">]</span></li>
<li><a name="a539"></a>             ? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_second">select_second</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">) </span>: <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a540"></a>    <span class="src-sym">}</span></li>
<li><a name="a541"></a>&nbsp;</li>
<li><a name="a542"></a>    <span class="src-doc">/**</span></li>
<li><a name="a543"></a><span class="src-doc">     *  Generate HTML/XML for second selector pull-down menu</span></li>
<li><a name="a544"></a><span class="src-doc">     *</span></li>
<li><a name="a545"></a><span class="src-doc">     *  Returns &lt;samp&gt;&lt;select&gt;...&lt;/select&gt;&lt;/samp&gt; HTML with an option</span></li>
<li><a name="a546"></a><span class="src-doc">     *  for each of the sixty seconds.  The first argument, if</span></li>
<li><a name="a547"></a><span class="src-doc">     *  present, specifies the initially selected second.  The second</span></li>
<li><a name="a548"></a><span class="src-doc">     *  argument controls the format of the generated HTML.</span></li>
<li><a name="a549"></a><span class="src-doc">     *</span></li>
<li><a name="a550"></a><span class="src-doc">     *  Examples:</span></li>
<li><a name="a551"></a><span class="src-doc">     *  &lt;ul&gt;</span></li>
<li><a name="a552"></a><span class="src-doc">     *   &lt;li&gt;&lt;samp&gt;select_second();&lt;/samp&gt;&lt;br /&gt;</span></li>
<li><a name="a553"></a><span class="src-doc">     *     Generates menu '00', '01', ..., '59'.  Initially selected</span></li>
<li><a name="a554"></a><span class="src-doc">     *     second is the second in</span></li>
<li><a name="a555"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link $request_seconds}</span><span class="src-doc">[</span><span class="src-doc-inlinetag">{@link $attribute_name}</span><span class="src-doc">], or if that</span></li>
<li><a name="a556"></a><span class="src-doc">     *     is not defined, the current second.&lt;/li&gt;</span></li>
<li><a name="a557"></a><span class="src-doc">     *   &lt;li&gt;&lt;samp&gt;select_second(null,array('include_blank' =&gt; true));&lt;/samp&gt;</span></li>
<li><a name="a558"></a><span class="src-doc">     *    &lt;br /&gt;Generates menu ' ', '00', '01',..., '59'.  Initially</span></li>
<li><a name="a559"></a><span class="src-doc">     *    selected second same as above.&lt;/li&gt;</span></li>
<li><a name="a560"></a><span class="src-doc">     *  &lt;/ul&gt;</span></li>
<li><a name="a561"></a><span class="src-doc">     *</span></li>
<li><a name="a562"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc"> Initially selected second as two-digit number.</span></li>
<li><a name="a563"></a><span class="src-doc">     *   If a value for this field is specified in</span></li>
<li><a name="a564"></a><span class="src-doc">     *   </span><span class="src-doc-inlinetag">{@link $request_seconds}</span><span class="src-doc">[</span><span class="src-doc-inlinetag">{@link $attribute_name}</span><span class="src-doc">], then that second</span></li>
<li><a name="a565"></a><span class="src-doc">     *   is initially selected regardless of the value of this argument.</span></li>
<li><a name="a566"></a><span class="src-doc">     *   Otherwise, if the first argument is present and is a character</span></li>
<li><a name="a567"></a><span class="src-doc">     *   string of two decimal digits with a value in the range</span></li>
<li><a name="a568"></a><span class="src-doc">     *   '00'..'59' then that second is initially selected.  If this</span></li>
<li><a name="a569"></a><span class="src-doc">     *   argument is absent or invalid, the current second is</span></li>
<li><a name="a570"></a><span class="src-doc">     *   initially selected.</span></li>
<li><a name="a571"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed[] </span><span class="src-doc">Output format options:</span></li>
<li><a name="a572"></a><span class="src-doc">     *   &lt;ul&gt;</span></li>
<li><a name="a573"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'include_blank' =&gt; true&lt;/samp&gt; Show a blank</span></li>
<li><a name="a574"></a><span class="src-doc">     *       as the first option.&lt;/li&gt;</span></li>
<li><a name="a575"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'field_name' =&gt; '&lt;/samp&gt;&lt;i&gt;somestring&lt;/i&gt;&lt;samp&gt;'&lt;/samp&gt;</span></li>
<li><a name="a576"></a><span class="src-doc">     *       Generate output&lt;br /&gt;</span></li>
<li><a name="a577"></a><span class="src-doc">     *       &lt;samp&gt;&lt;select name=&quot;&lt;/samp&gt;&lt;i&gt;somestring&lt;/i&gt;&lt;samp&gt;&quot;&gt;...&lt;/select&gt;&lt;/samp&gt; .</span></li>
<li><a name="a578"></a><span class="src-doc">     *       &lt;br /&gt;If absent, generate output&lt;br /&gt;</span></li>
<li><a name="a579"></a><span class="src-doc">     *       &lt;samp&gt;&lt;select name=&quot;second&quot;&gt;...&lt;/select&gt;&lt;/samp&gt;.&lt;/li&gt;</span></li>
<li><a name="a580"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'discard_type' =&gt; ???&lt;/samp&gt; FIXME&lt;/li&gt;</span></li>
<li><a name="a581"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'prefix' =&gt; ???&lt;/samp&gt; FIXME&lt;/li&gt;</span></li>
<li><a name="a582"></a><span class="src-doc">     *   &lt;/ul&gt;</span></li>
<li><a name="a583"></a><span class="src-doc">     *</span></li>
<li><a name="a584"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc"> Generated HTML</span></li>
<li><a name="a585"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> attribute_name</span></li>
<li><a name="a586"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> leading_zero_on_single_digits()</span></li>
<li><a name="a587"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> request_seconds</span></li>
<li><a name="a588"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_html()</span></li>
<li><a name="a589"></a><span class="src-doc">     */</span></li>
<li><a name="a590"></a>    <span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methodselect_second">select_second</a><span class="src-sym">(</span><span class="src-var">$datetime</span>=<span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$options </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a591"></a>        <span class="src-comm">//error_log(&quot;select_second() \$datetime=$datetime  \$options=&quot;</span></li>
<li><a name="a592"></a>        <span class="src-comm">//          .var_export($options,true));</span></li>
<li><a name="a593"></a>        <span class="src-var">$second_options </span>= <span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a594"></a>        </li>
<li><a name="a595"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_seconds">request_seconds</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a596"></a>            <span class="src-var">$datetime_sec </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_seconds">request_seconds</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">]</span><span class="src-sym">;    </span></li>
<li><a name="a597"></a>        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">) </span>== <span class="src-num">2 </span>&amp;&amp; <a href="http://www.php.net/is_numeric">is_numeric</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a598"></a>            <span class="src-var">$datetime_sec </span>= <span class="src-var">$datetime</span><span class="src-sym">;</span></li>
<li><a name="a599"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{                  </span></li>
<li><a name="a600"></a>            <span class="src-var">$datetime </span>= <span class="src-var">$datetime </span>? <span class="src-var">$datetime </span>: <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;Y-m-d H:i:s&quot;</span><span class="src-sym">)</span><span class="src-sym">; </span></li>
<li><a name="a601"></a>            <span class="src-var">$datetime_sec </span>= <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;s&quot;</span><span class="src-sym">,</span><a href="http://www.php.net/strtotime">strtotime</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a602"></a>        <span class="src-sym">}</span></li>
<li><a name="a603"></a>        </li>
<li><a name="a604"></a>        <span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$second </span>= <span class="src-num">0</span><span class="src-sym">; </span><span class="src-var">$second </span>&lt;= <span class="src-num">59</span><span class="src-sym">; </span><span class="src-var">$second</span>++<span class="src-sym">) </span><span class="src-sym">{          </span></li>
<li><a name="a605"></a>            <span class="src-var">$second_options </span>.= <span class="src-sym">(</span><span class="src-var">$datetime </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$datetime_sec </span>== <span class="src-var">$second</span><span class="src-sym">)) </span>?</li>
<li><a name="a606"></a>            <span class="src-str">&quot;&lt;option value=\&quot;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$second</span><span class="src-sym">)</span>.<span class="src-str">&quot;\&quot;  selected=\&quot;selected\&quot;&gt;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$second</span><span class="src-sym">)</span>.<span class="src-str">&quot;&lt;/option&gt;\n&quot; </span>:</li>
<li><a name="a607"></a>            <span class="src-str">&quot;&lt;option value=\&quot;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$second</span><span class="src-sym">)</span>.<span class="src-str">&quot;\&quot;&gt;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$second</span><span class="src-sym">)</span>.<span class="src-str">&quot;&lt;/option&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a608"></a>        <span class="src-sym">}</span></li>
<li><a name="a609"></a>        <span class="src-var">$field_name </span>= <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'field_name'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a610"></a>                       ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_name'</span><span class="src-sym">] </span>: <span class="src-str">'second'</span><span class="src-sym">;</span></li>
<li><a name="a611"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_html">select_html</a><span class="src-sym">(</span><span class="src-var">$field_name</span><span class="src-sym">, </span><span class="src-var">$second_options</span><span class="src-sym">,</span></li>
<li><a name="a612"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'prefix'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a613"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'prefix'</span><span class="src-sym">] </span>: <span class="src-id">null</span><span class="src-sym">,</span></li>
<li><a name="a614"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'include_blank'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a615"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'include_blank'</span><span class="src-sym">] </span>: <span class="src-id">false</span><span class="src-sym">,</span></li>
<li><a name="a616"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'discard_type'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a617"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_type'</span><span class="src-sym">] </span>: <span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a618"></a>    <span class="src-sym">}</span></li>
<li><a name="a619"></a>&nbsp;</li>
<li><a name="a620"></a>    <span class="src-doc">/**</span></li>
<li><a name="a621"></a><span class="src-doc">     *  Generate HTML/XML for minute selector pull-down menu</span></li>
<li><a name="a622"></a><span class="src-doc">     *</span></li>
<li><a name="a623"></a><span class="src-doc">     *  Returns &lt;samp&gt;&lt;select&gt;...&lt;/select&gt;&lt;/samp&gt; HTML with an option</span></li>
<li><a name="a624"></a><span class="src-doc">     *  for each of the sixty minutes.  The first argument, if</span></li>
<li><a name="a625"></a><span class="src-doc">     *  present, specifies the initially selected minute.  The second</span></li>
<li><a name="a626"></a><span class="src-doc">     *  argument controls the format of the generated HTML.</span></li>
<li><a name="a627"></a><span class="src-doc">     *</span></li>
<li><a name="a628"></a><span class="src-doc">     *  Examples:</span></li>
<li><a name="a629"></a><span class="src-doc">     *  &lt;ul&gt;</span></li>
<li><a name="a630"></a><span class="src-doc">     *   &lt;li&gt;&lt;samp&gt;select_minute();&lt;/samp&gt;&lt;br /&gt;</span></li>
<li><a name="a631"></a><span class="src-doc">     *     Generates menu '00', '01', ..., '59'.  Initially selected</span></li>
<li><a name="a632"></a><span class="src-doc">     *     minute is the minute in</span></li>
<li><a name="a633"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link $request_minutes}</span><span class="src-doc">[</span><span class="src-doc-inlinetag">{@link $attribute_name}</span><span class="src-doc">], or if that</span></li>
<li><a name="a634"></a><span class="src-doc">     *     is not defined, the current minute.&lt;/li&gt;</span></li>
<li><a name="a635"></a><span class="src-doc">     *   &lt;li&gt;&lt;samp&gt;select_minute(null,array('include_blank' =&gt; true));&lt;/samp&gt;</span></li>
<li><a name="a636"></a><span class="src-doc">     *    &lt;br /&gt;Generates menu ' ', '00', '01',..., '59'.  Initially</span></li>
<li><a name="a637"></a><span class="src-doc">     *    selected minute same as above.&lt;/li&gt;</span></li>
<li><a name="a638"></a><span class="src-doc">     *  &lt;/ul&gt;</span></li>
<li><a name="a639"></a><span class="src-doc">     *</span></li>
<li><a name="a640"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc"> Initially selected minute as two-digit number.</span></li>
<li><a name="a641"></a><span class="src-doc">     *   If a value for this field is specified in</span></li>
<li><a name="a642"></a><span class="src-doc">     *   </span><span class="src-doc-inlinetag">{@link $request_minutes}</span><span class="src-doc">[</span><span class="src-doc-inlinetag">{@link $attribute_name}</span><span class="src-doc">], then that minute</span></li>
<li><a name="a643"></a><span class="src-doc">     *   is initially selected regardless of the value of this argument.</span></li>
<li><a name="a644"></a><span class="src-doc">     *   Otherwise, if the first argument is present and is a character</span></li>
<li><a name="a645"></a><span class="src-doc">     *   string of two decimal digits with a value in the range</span></li>
<li><a name="a646"></a><span class="src-doc">     *   '00'..'59' then that minute is initially selected.  If this</span></li>
<li><a name="a647"></a><span class="src-doc">     *   argument is absent or invalid, the current minute is</span></li>
<li><a name="a648"></a><span class="src-doc">     *   initially selected.</span></li>
<li><a name="a649"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed[] </span><span class="src-doc">Output format options:</span></li>
<li><a name="a650"></a><span class="src-doc">     *   &lt;ul&gt;</span></li>
<li><a name="a651"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'include_blank' =&gt; true&lt;/samp&gt; Show a blank</span></li>
<li><a name="a652"></a><span class="src-doc">     *       as the first option.&lt;/li&gt;</span></li>
<li><a name="a653"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'field_name' =&gt; '&lt;/samp&gt;&lt;i&gt;somestring&lt;/i&gt;&lt;samp&gt;'&lt;/samp&gt;</span></li>
<li><a name="a654"></a><span class="src-doc">     *       Generate output&lt;br /&gt;</span></li>
<li><a name="a655"></a><span class="src-doc">     *       &lt;samp&gt;&lt;select name=&quot;&lt;/samp&gt;&lt;i&gt;somestring&lt;/i&gt;&lt;samp&gt;&quot;&gt;...&lt;/select&gt;&lt;/samp&gt; .</span></li>
<li><a name="a656"></a><span class="src-doc">     *       &lt;br /&gt;If absent, generate output&lt;br /&gt;</span></li>
<li><a name="a657"></a><span class="src-doc">     *       &lt;samp&gt;&lt;select name=&quot;minute&quot;&gt;...&lt;/select&gt;&lt;/samp&gt;.&lt;/li&gt;</span></li>
<li><a name="a658"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'discard_type' =&gt; ???&lt;/samp&gt; FIXME&lt;/li&gt;</span></li>
<li><a name="a659"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'prefix' =&gt; ???&lt;/samp&gt; FIXME&lt;/li&gt;</span></li>
<li><a name="a660"></a><span class="src-doc">     *   &lt;/ul&gt;</span></li>
<li><a name="a661"></a><span class="src-doc">     *</span></li>
<li><a name="a662"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc"> Generated HTML</span></li>
<li><a name="a663"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> attribute_name</span></li>
<li><a name="a664"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> leading_zero_on_single_digits()</span></li>
<li><a name="a665"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> request_minutes</span></li>
<li><a name="a666"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_html()</span></li>
<li><a name="a667"></a><span class="src-doc">     */</span></li>
<li><a name="a668"></a>    <span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methodselect_minute">select_minute</a><span class="src-sym">(</span><span class="src-var">$datetime</span>=<span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$options </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a669"></a>        <span class="src-var">$minute_options </span>= <span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a670"></a>        </li>
<li><a name="a671"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_minutes">request_minutes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a672"></a>            <span class="src-var">$datetime_min </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_minutes">request_minutes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">]</span><span class="src-sym">;    </span></li>
<li><a name="a673"></a>        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">) </span>== <span class="src-num">2 </span>&amp;&amp; <a href="http://www.php.net/is_numeric">is_numeric</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a674"></a>            <span class="src-var">$datetime_min </span>= <span class="src-var">$datetime</span><span class="src-sym">;</span></li>
<li><a name="a675"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{                  </span></li>
<li><a name="a676"></a>            <span class="src-var">$datetime </span>= <span class="src-var">$datetime </span>? <span class="src-var">$datetime </span>: <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;Y-m-d H:i:s&quot;</span><span class="src-sym">)</span><span class="src-sym">; </span></li>
<li><a name="a677"></a>            <span class="src-var">$datetime_min </span>= <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;i&quot;</span><span class="src-sym">,</span><a href="http://www.php.net/strtotime">strtotime</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a678"></a>        <span class="src-sym">}</span></li>
<li><a name="a679"></a>        </li>
<li><a name="a680"></a>        <span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$minute </span>= <span class="src-num">0</span><span class="src-sym">; </span><span class="src-var">$minute </span>&lt;= <span class="src-num">59</span><span class="src-sym">; </span><span class="src-var">$minute</span>++<span class="src-sym">) </span><span class="src-sym">{        </span></li>
<li><a name="a681"></a>            <span class="src-var">$minute_options </span>.= <span class="src-sym">(</span><span class="src-var">$datetime </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$datetime_min </span>== <span class="src-var">$minute</span><span class="src-sym">)) </span>?</li>
<li><a name="a682"></a>            <span class="src-str">&quot;&lt;option value=\&quot;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$minute</span><span class="src-sym">)</span>.<span class="src-str">&quot;\&quot;  selected=\&quot;selected\&quot;&gt;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$minute</span><span class="src-sym">)</span>.<span class="src-str">&quot;&lt;/option&gt;\n&quot; </span>:</li>
<li><a name="a683"></a>            <span class="src-str">&quot;&lt;option value=\&quot;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$minute</span><span class="src-sym">)</span>.<span class="src-str">&quot;\&quot;&gt;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$minute</span><span class="src-sym">)</span>.<span class="src-str">&quot;&lt;/option&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a684"></a>        <span class="src-sym">}</span></li>
<li><a name="a685"></a>        <span class="src-var">$field_name </span>= <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'field_name'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a686"></a>            ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_name'</span><span class="src-sym">] </span>: <span class="src-str">'minute'</span><span class="src-sym">;</span></li>
<li><a name="a687"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_html">select_html</a><span class="src-sym">(</span><span class="src-var">$field_name</span><span class="src-sym">, </span><span class="src-var">$minute_options</span><span class="src-sym">,</span></li>
<li><a name="a688"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'prefix'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a689"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'prefix'</span><span class="src-sym">] </span>: <span class="src-id">null</span><span class="src-sym">,</span></li>
<li><a name="a690"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'include_blank'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a691"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'include_blank'</span><span class="src-sym">] </span>: <span class="src-id">false</span><span class="src-sym">,</span></li>
<li><a name="a692"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'discard_type'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a693"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_type'</span><span class="src-sym">] </span>: <span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a694"></a>    <span class="src-sym">}</span></li>
<li><a name="a695"></a>&nbsp;</li>
<li><a name="a696"></a>    <span class="src-doc">/**</span></li>
<li><a name="a697"></a><span class="src-doc">     *  Generate HTML/XML for hour selector pull-down menu</span></li>
<li><a name="a698"></a><span class="src-doc">     *</span></li>
<li><a name="a699"></a><span class="src-doc">     *  Returns &lt;samp&gt;&lt;select&gt;...&lt;/select&gt;&lt;/samp&gt; HTML with an option</span></li>
<li><a name="a700"></a><span class="src-doc">     *  for each of the twenty-four hours.  The first argument, if</span></li>
<li><a name="a701"></a><span class="src-doc">     *  present, specifies the initially selected hour.  The second</span></li>
<li><a name="a702"></a><span class="src-doc">     *  argument controls the format of the generated HTML.</span></li>
<li><a name="a703"></a><span class="src-doc">     *</span></li>
<li><a name="a704"></a><span class="src-doc">     *  Examples:</span></li>
<li><a name="a705"></a><span class="src-doc">     *  &lt;ul&gt;</span></li>
<li><a name="a706"></a><span class="src-doc">     *   &lt;li&gt;&lt;samp&gt;select_hour();&lt;/samp&gt;&lt;br /&gt;</span></li>
<li><a name="a707"></a><span class="src-doc">     *     Generates menu '00', '01', ..., '23'.  Initially selected</span></li>
<li><a name="a708"></a><span class="src-doc">     *     hour is the hour in</span></li>
<li><a name="a709"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link $request_hours}</span><span class="src-doc">[</span><span class="src-doc-inlinetag">{@link $attribute_name}</span><span class="src-doc">], or if that</span></li>
<li><a name="a710"></a><span class="src-doc">     *     is not defined, the current hour.&lt;/li&gt;</span></li>
<li><a name="a711"></a><span class="src-doc">     *   &lt;li&gt;&lt;samp&gt;select_hour(null,array('include_blank' =&gt; true));&lt;/samp&gt;</span></li>
<li><a name="a712"></a><span class="src-doc">     *    &lt;br /&gt;Generates menu ' ', '00', '01',..., '23'.  Initially</span></li>
<li><a name="a713"></a><span class="src-doc">     *    selected hour same as above.&lt;/li&gt;</span></li>
<li><a name="a714"></a><span class="src-doc">     *  &lt;/ul&gt;</span></li>
<li><a name="a715"></a><span class="src-doc">     *</span></li>
<li><a name="a716"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc"> Initially selected hour as two-digit number.</span></li>
<li><a name="a717"></a><span class="src-doc">     *   If a value for this field is specified in</span></li>
<li><a name="a718"></a><span class="src-doc">     *   </span><span class="src-doc-inlinetag">{@link $request_hours}</span><span class="src-doc">[</span><span class="src-doc-inlinetag">{@link $attribute_name}</span><span class="src-doc">], then that hour</span></li>
<li><a name="a719"></a><span class="src-doc">     *   is initially selected regardless of the value of this argument.</span></li>
<li><a name="a720"></a><span class="src-doc">     *   Otherwise, if the first argument is present and is a character</span></li>
<li><a name="a721"></a><span class="src-doc">     *   string of two decimal digits with a value in the range</span></li>
<li><a name="a722"></a><span class="src-doc">     *   '00'..'23' then that hour is initially selected.  If this</span></li>
<li><a name="a723"></a><span class="src-doc">     *   argument is absent or invalid, the current hour is</span></li>
<li><a name="a724"></a><span class="src-doc">     *   initially selected.</span></li>
<li><a name="a725"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed[] </span><span class="src-doc">Output format options:</span></li>
<li><a name="a726"></a><span class="src-doc">     *   &lt;ul&gt;</span></li>
<li><a name="a727"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'include_blank' =&gt; true&lt;/samp&gt; Show a blank</span></li>
<li><a name="a728"></a><span class="src-doc">     *       as the first option.&lt;/li&gt;</span></li>
<li><a name="a729"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'field_name' =&gt; '&lt;/samp&gt;&lt;i&gt;somestring&lt;/i&gt;&lt;samp&gt;'&lt;/samp&gt;</span></li>
<li><a name="a730"></a><span class="src-doc">     *       Generate output&lt;br /&gt;</span></li>
<li><a name="a731"></a><span class="src-doc">     *       &lt;samp&gt;&lt;select name=&quot;&lt;/samp&gt;&lt;i&gt;somestring&lt;/i&gt;&lt;samp&gt;&quot;&gt;...&lt;/select&gt;&lt;/samp&gt; .</span></li>
<li><a name="a732"></a><span class="src-doc">     *       &lt;br /&gt;If absent, generate output&lt;br /&gt;</span></li>
<li><a name="a733"></a><span class="src-doc">     *       &lt;samp&gt;&lt;select name=&quot;hour&quot;&gt;...&lt;/select&gt;&lt;/samp&gt;.&lt;/li&gt;</span></li>
<li><a name="a734"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'discard_type' =&gt; ???&lt;/samp&gt; FIXME&lt;/li&gt;</span></li>
<li><a name="a735"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'prefix' =&gt; ???&lt;/samp&gt; FIXME&lt;/li&gt;</span></li>
<li><a name="a736"></a><span class="src-doc">     *   &lt;/ul&gt;</span></li>
<li><a name="a737"></a><span class="src-doc">     *</span></li>
<li><a name="a738"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc"> Generated HTML</span></li>
<li><a name="a739"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> attribute_name</span></li>
<li><a name="a740"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> leading_zero_on_single_digits()</span></li>
<li><a name="a741"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> request_hours</span></li>
<li><a name="a742"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_html()</span></li>
<li><a name="a743"></a><span class="src-doc">     */</span></li>
<li><a name="a744"></a>    <span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methodselect_hour">select_hour</a><span class="src-sym">(</span><span class="src-var">$datetime</span>=<span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$options </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a745"></a>        <span class="src-comm">//error_log(&quot;DateTime::select_hour() \$datetime=$datetime \$options=&quot;</span></li>
<li><a name="a746"></a>        <span class="src-comm">//          .var_export($options,true));</span></li>
<li><a name="a747"></a>        <span class="src-var">$hour_options </span>= <span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a748"></a>        </li>
<li><a name="a749"></a>        <span class="src-comm">//  If a value for this attribute was parsed from $_REQUEST,</span></li>
<li><a name="a750"></a>        <span class="src-comm">//  use it as initially selected and ignore first argument</span></li>
<li><a name="a751"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_hours">request_hours</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a752"></a>            <span class="src-var">$datetime_hour </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_hours">request_hours</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">]</span><span class="src-sym">;    </span></li>
<li><a name="a753"></a>        <span class="src-sym">}</span></li>
<li><a name="a754"></a>&nbsp;</li>
<li><a name="a755"></a>        <span class="src-comm">//  No value in $_REQUEST so look at the first argument.</span></li>
<li><a name="a756"></a>        <span class="src-comm">//  If it is valid use it as initially selected</span></li>
<li><a name="a757"></a>        <span class="src-key">elseif</span><span class="src-sym">(</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">) </span>== <span class="src-num">2 </span>&amp;&amp; <a href="http://www.php.net/is_numeric">is_numeric</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a758"></a>            <span class="src-var">$datetime_hour </span>= <span class="src-var">$datetime</span><span class="src-sym">;</span></li>
<li><a name="a759"></a>        <span class="src-sym">}</span></li>
<li><a name="a760"></a>&nbsp;</li>
<li><a name="a761"></a>        <span class="src-comm">//  First argument is missing or invalid,</span></li>
<li><a name="a762"></a>        <span class="src-comm">//  initially select current hour</span></li>
<li><a name="a763"></a>        <span class="src-key">else </span><span class="src-sym">{                  </span></li>
<li><a name="a764"></a>            <span class="src-var">$datetime </span>= <span class="src-var">$datetime </span>? <span class="src-var">$datetime </span>: <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;Y-m-d H:i:s&quot;</span><span class="src-sym">)</span><span class="src-sym">; </span></li>
<li><a name="a765"></a>            <span class="src-var">$datetime_hour </span>= <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;H&quot;</span><span class="src-sym">,</span><a href="http://www.php.net/strtotime">strtotime</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">))</span><span class="src-sym">; </span></li>
<li><a name="a766"></a>        <span class="src-sym">}</span></li>
<li><a name="a767"></a>&nbsp;</li>
<li><a name="a768"></a>        <span class="src-comm">//  Generate &lt;option&gt;...&lt;/option&gt; HTML for each hour</span></li>
<li><a name="a769"></a>        <span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$hour </span>= <span class="src-num">0</span><span class="src-sym">; </span><span class="src-var">$hour </span>&lt;= <span class="src-num">23</span><span class="src-sym">; </span><span class="src-var">$hour</span>++<span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a770"></a>            <span class="src-var">$hour_options </span>.= <span class="src-sym">(</span><span class="src-var">$datetime </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$datetime_hour </span>== <span class="src-var">$hour</span><span class="src-sym">)) </span>?</li>
<li><a name="a771"></a>            <span class="src-str">&quot;&lt;option value=\&quot;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$hour</span><span class="src-sym">)</span>.<span class="src-str">&quot;\&quot;  selected=\&quot;selected\&quot;&gt;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$hour</span><span class="src-sym">)</span>.<span class="src-str">&quot;&lt;/option&gt;\n&quot; </span>:</li>
<li><a name="a772"></a>            <span class="src-str">&quot;&lt;option value=\&quot;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$hour</span><span class="src-sym">)</span>.<span class="src-str">&quot;\&quot;&gt;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$hour</span><span class="src-sym">)</span>.<span class="src-str">&quot;&lt;/option&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a773"></a>        <span class="src-sym">}</span></li>
<li><a name="a774"></a>&nbsp;</li>
<li><a name="a775"></a>        <span class="src-comm">//  Return finished HTML</span></li>
<li><a name="a776"></a>        <span class="src-var">$field_name </span>= <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'field_name'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a777"></a>            ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_name'</span><span class="src-sym">] </span>: <span class="src-str">'hour'</span><span class="src-sym">;</span></li>
<li><a name="a778"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_html">select_html</a><span class="src-sym">(</span><span class="src-var">$field_name</span><span class="src-sym">, </span><span class="src-var">$hour_options</span><span class="src-sym">,</span></li>
<li><a name="a779"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'prefix'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a780"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'prefix'</span><span class="src-sym">] </span>: <span class="src-id">null</span><span class="src-sym">,</span></li>
<li><a name="a781"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'include_blank'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a782"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'include_blank'</span><span class="src-sym">] </span>: <span class="src-id">false</span><span class="src-sym">,</span></li>
<li><a name="a783"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'discard_type'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a784"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_type'</span><span class="src-sym">] </span>: <span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a785"></a>    <span class="src-sym">}</span></li>
<li><a name="a786"></a>&nbsp;</li>
<li><a name="a787"></a>    <span class="src-doc">/**</span></li>
<li><a name="a788"></a><span class="src-doc">     *  Generate HTML/XML for day selector pull-down menu</span></li>
<li><a name="a789"></a><span class="src-doc">     *</span></li>
<li><a name="a790"></a><span class="src-doc">     *  Returns &lt;samp&gt;&lt;select&gt;...&lt;/select&gt;&lt;/samp&gt; HTML with an option</span></li>
<li><a name="a791"></a><span class="src-doc">     *  for each of the thirty-one days.  The first argument, if</span></li>
<li><a name="a792"></a><span class="src-doc">     *  present, specifies the initially selected day.  The second</span></li>
<li><a name="a793"></a><span class="src-doc">     *  argument controls the format of the generated HTML.</span></li>
<li><a name="a794"></a><span class="src-doc">     *</span></li>
<li><a name="a795"></a><span class="src-doc">     *</span></li>
<li><a name="a796"></a><span class="src-doc">     *  Examples:</span></li>
<li><a name="a797"></a><span class="src-doc">     *  &lt;ul&gt;</span></li>
<li><a name="a798"></a><span class="src-doc">     *   &lt;li&gt;&lt;samp&gt;select_day();&lt;/samp&gt;&lt;br /&gt;</span></li>
<li><a name="a799"></a><span class="src-doc">     *     Generates menu '01', '02', ..., '31'.  Initially selected</span></li>
<li><a name="a800"></a><span class="src-doc">     *     day is the day in</span></li>
<li><a name="a801"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link $request_days}</span><span class="src-doc">[</span><span class="src-doc-inlinetag">{@link $attribute_name}</span><span class="src-doc">], or if that</span></li>
<li><a name="a802"></a><span class="src-doc">     *     is not defined, the current calendar day.&lt;/li&gt;</span></li>
<li><a name="a803"></a><span class="src-doc">     *   &lt;li&gt;&lt;samp&gt;select_day(null,array('include_blank' =&gt; true));&lt;/samp&gt;</span></li>
<li><a name="a804"></a><span class="src-doc">     *    &lt;br /&gt;Generates menu ' ', '01', '02',..., '31'.  Initially</span></li>
<li><a name="a805"></a><span class="src-doc">     *    selected day same as above.&lt;/li&gt;</span></li>
<li><a name="a806"></a><span class="src-doc">     *  &lt;/ul&gt;</span></li>
<li><a name="a807"></a><span class="src-doc">     *</span></li>
<li><a name="a808"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc"> Initially selected day as two-digit number.</span></li>
<li><a name="a809"></a><span class="src-doc">     *   If a value for this field is specified in</span></li>
<li><a name="a810"></a><span class="src-doc">     *   </span><span class="src-doc-inlinetag">{@link $request_days}</span><span class="src-doc">[</span><span class="src-doc-inlinetag">{@link $attribute_name}</span><span class="src-doc">], then that day</span></li>
<li><a name="a811"></a><span class="src-doc">     *   is initially selected regardless of the value of this argument.</span></li>
<li><a name="a812"></a><span class="src-doc">     *   Otherwise, if the first argument is present and is a character</span></li>
<li><a name="a813"></a><span class="src-doc">     *   string of two decimal digits with a value in the range</span></li>
<li><a name="a814"></a><span class="src-doc">     *   '01'..'31' then that day is initially selected.  Otherwise, if</span></li>
<li><a name="a815"></a><span class="src-doc">     *   the first argument is a date in some US English date format,</span></li>
<li><a name="a816"></a><span class="src-doc">     *   the day of the month from that date is initially selected.  If</span></li>
<li><a name="a817"></a><span class="src-doc">     *   this argument is absent or invalid, the current calendar day</span></li>
<li><a name="a818"></a><span class="src-doc">     *   is initially selected.</span></li>
<li><a name="a819"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed[] </span><span class="src-doc">Output format options:</span></li>
<li><a name="a820"></a><span class="src-doc">     *   &lt;ul&gt;</span></li>
<li><a name="a821"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'include_blank' =&gt; true&lt;/samp&gt; Show a blank</span></li>
<li><a name="a822"></a><span class="src-doc">     *       as the first option.&lt;/li&gt;</span></li>
<li><a name="a823"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'field_name' =&gt; '&lt;/samp&gt;&lt;i&gt;somestring&lt;/i&gt;&lt;samp&gt;'&lt;/samp&gt;</span></li>
<li><a name="a824"></a><span class="src-doc">     *       Generate output&lt;br /&gt;</span></li>
<li><a name="a825"></a><span class="src-doc">     *       &lt;samp&gt;&lt;select name=&quot;&lt;/samp&gt;&lt;i&gt;somestring&lt;/i&gt;&lt;samp&gt;&quot;&gt;...&lt;/select&gt;&lt;/samp&gt; .</span></li>
<li><a name="a826"></a><span class="src-doc">     *       &lt;br /&gt;If absent, generate output&lt;br /&gt;</span></li>
<li><a name="a827"></a><span class="src-doc">     *       &lt;samp&gt;&lt;select name=&quot;day&quot;&gt;...&lt;/select&gt;&lt;/samp&gt;.&lt;/li&gt;</span></li>
<li><a name="a828"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'discard_type' =&gt; ???&lt;/samp&gt; FIXME&lt;/li&gt;</span></li>
<li><a name="a829"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'prefix' =&gt; ???&lt;/samp&gt; FIXME&lt;/li&gt;</span></li>
<li><a name="a830"></a><span class="src-doc">     *   &lt;/ul&gt;</span></li>
<li><a name="a831"></a><span class="src-doc">     *</span></li>
<li><a name="a832"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc"> Generated HTML</span></li>
<li><a name="a833"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> attribute_name</span></li>
<li><a name="a834"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> leading_zero_on_single_digits()</span></li>
<li><a name="a835"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> request_days</span></li>
<li><a name="a836"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_html()</span></li>
<li><a name="a837"></a><span class="src-doc">     */</span></li>
<li><a name="a838"></a>    <span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methodselect_day">select_day</a><span class="src-sym">(</span><span class="src-var">$datetime</span>=<span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$options </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a839"></a>        <span class="src-var">$day_options </span>= <span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a840"></a>        </li>
<li><a name="a841"></a>        <span class="src-comm">//  If a value for this attribute was parsed from $_REQUEST,</span></li>
<li><a name="a842"></a>        <span class="src-comm">//  use it as initially selected and ignore first argument</span></li>
<li><a name="a843"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_days">request_days</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a844"></a>            <span class="src-var">$datetime_day </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_days">request_days</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">]</span><span class="src-sym">;    </span></li>
<li><a name="a845"></a>        <span class="src-sym">}</span></li>
<li><a name="a846"></a>&nbsp;</li>
<li><a name="a847"></a>        <span class="src-comm">//  No value in $_REQUEST so look at the first argument.</span></li>
<li><a name="a848"></a>        <span class="src-comm">//  If it is valid use it as initially selected</span></li>
<li><a name="a849"></a>        <span class="src-key">elseif</span><span class="src-sym">(</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">) </span>== <span class="src-num">2 </span>&amp;&amp; <a href="http://www.php.net/is_numeric">is_numeric</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a850"></a>            <span class="src-var">$datetime_day </span>= <span class="src-var">$datetime</span><span class="src-sym">;</span></li>
<li><a name="a851"></a>        <span class="src-sym">}</span></li>
<li><a name="a852"></a>&nbsp;</li>
<li><a name="a853"></a>        <span class="src-comm">//  First argument is missing or invalid,</span></li>
<li><a name="a854"></a>        <span class="src-comm">//  initially select current day</span></li>
<li><a name="a855"></a>        <span class="src-key">else </span><span class="src-sym">{                  </span></li>
<li><a name="a856"></a>            <span class="src-var">$datetime </span>= <span class="src-var">$datetime </span>? <span class="src-var">$datetime </span>: <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;Y-m-d H:i:s&quot;</span><span class="src-sym">)</span><span class="src-sym">; </span></li>
<li><a name="a857"></a>            <span class="src-var">$datetime_day </span>= <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;d&quot;</span><span class="src-sym">,</span><a href="http://www.php.net/strtotime">strtotime</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">))</span><span class="src-sym">;  </span></li>
<li><a name="a858"></a>        <span class="src-sym">}</span></li>
<li><a name="a859"></a>        </li>
<li><a name="a860"></a>        <span class="src-comm">//  Generate &lt;option&gt;...&lt;/option&gt; HTML for each day</span></li>
<li><a name="a861"></a>        <span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$day </span>= <span class="src-num">1</span><span class="src-sym">; </span><span class="src-var">$day </span>&lt;= <span class="src-num">31</span><span class="src-sym">; </span><span class="src-var">$day</span>++<span class="src-sym">) </span><span class="src-sym">{        </span></li>
<li><a name="a862"></a>            <span class="src-var">$day_options </span>.= <span class="src-sym">(</span><span class="src-var">$datetime </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$datetime_day </span>== <span class="src-var">$day</span><span class="src-sym">)) </span>?</li>
<li><a name="a863"></a>            <span class="src-str">&quot;&lt;option value=\&quot;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$day</span><span class="src-sym">)</span>.<span class="src-str">&quot;\&quot;  selected=\&quot;selected\&quot;&gt;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$day</span><span class="src-sym">)</span>.<span class="src-str">&quot;&lt;/option&gt;\n&quot; </span>:</li>
<li><a name="a864"></a>            <span class="src-str">&quot;&lt;option value=\&quot;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$day</span><span class="src-sym">)</span>.<span class="src-str">&quot;\&quot;&gt;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$day</span><span class="src-sym">)</span>.<span class="src-str">&quot;&lt;/option&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a865"></a>        <span class="src-sym">}</span></li>
<li><a name="a866"></a>&nbsp;</li>
<li><a name="a867"></a>        <span class="src-comm">//  Return finished HTML</span></li>
<li><a name="a868"></a>        <span class="src-var">$field_name </span>= <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'field_name'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a869"></a>            ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_name'</span><span class="src-sym">] </span>: <span class="src-str">'day'</span><span class="src-sym">;</span></li>
<li><a name="a870"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_html">select_html</a><span class="src-sym">(</span><span class="src-var">$field_name</span><span class="src-sym">, </span><span class="src-var">$day_options</span><span class="src-sym">,</span></li>
<li><a name="a871"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'prefix'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a872"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'prefix'</span><span class="src-sym">] </span>: <span class="src-id">null</span><span class="src-sym">,</span></li>
<li><a name="a873"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'include_blank'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a874"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'include_blank'</span><span class="src-sym">] </span>: <span class="src-id">false</span><span class="src-sym">,</span></li>
<li><a name="a875"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'discard_type'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a876"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_type'</span><span class="src-sym">] </span>: <span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a877"></a>    <span class="src-sym">}</span></li>
<li><a name="a878"></a>&nbsp;</li>
<li><a name="a879"></a>    <span class="src-doc">/**</span></li>
<li><a name="a880"></a><span class="src-doc">     *  Generate HTML/XML for month selector pull-down menu</span></li>
<li><a name="a881"></a><span class="src-doc">     *</span></li>
<li><a name="a882"></a><span class="src-doc">     *  Returns &lt;samp&gt;&lt;select&gt;...&lt;/select&gt;&lt;/samp&gt; HTML with an option</span></li>
<li><a name="a883"></a><span class="src-doc">     *  for each of the twelve months.  The first argument, if</span></li>
<li><a name="a884"></a><span class="src-doc">     *  present, specifies the initially selected month.  The second</span></li>
<li><a name="a885"></a><span class="src-doc">     *  argument controls the format of the generated HTML.</span></li>
<li><a name="a886"></a><span class="src-doc">     *</span></li>
<li><a name="a887"></a><span class="src-doc">     *</span></li>
<li><a name="a888"></a><span class="src-doc">     *  Examples:</span></li>
<li><a name="a889"></a><span class="src-doc">     *  &lt;ul&gt;</span></li>
<li><a name="a890"></a><span class="src-doc">     *   &lt;li&gt;&lt;samp&gt;select_month();&lt;/samp&gt; Generates menu January,</span></li>
<li><a name="a891"></a><span class="src-doc">     *    February etc.&lt;/li&gt;</span></li>
<li><a name="a892"></a><span class="src-doc">     *   &lt;li&gt;&lt;samp&gt;select_month(null,array('use_month_number' =&gt; true));&lt;/samp&gt;</span></li>
<li><a name="a893"></a><span class="src-doc">     *    Generates menu 1, 2 etc.&lt;/li&gt;</span></li>
<li><a name="a894"></a><span class="src-doc">     *   &lt;li&gt;&lt;samp&gt;select_month(null,array('add_month_number' =&gt; true));&lt;/samp&gt;</span></li>
<li><a name="a895"></a><span class="src-doc">     *    Generates menu 1 - January, 2 - February etc.&lt;/li&gt;</span></li>
<li><a name="a896"></a><span class="src-doc">     *  &lt;/ul&gt;</span></li>
<li><a name="a897"></a><span class="src-doc">     *</span></li>
<li><a name="a898"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc"> Initially selected month as two-digit number.</span></li>
<li><a name="a899"></a><span class="src-doc">     *   If a value for this field is specified in</span></li>
<li><a name="a900"></a><span class="src-doc">     *   </span><span class="src-doc-inlinetag">{@link $request_months}</span><span class="src-doc">[</span><span class="src-doc-inlinetag">{@link $attribute_name}</span><span class="src-doc">], then that month</span></li>
<li><a name="a901"></a><span class="src-doc">     *   is initially selected regardless of the value of this argument.</span></li>
<li><a name="a902"></a><span class="src-doc">     *   Otherwise, if the first argument is present and is a character</span></li>
<li><a name="a903"></a><span class="src-doc">     *   string of two decimal digits with a value in the range</span></li>
<li><a name="a904"></a><span class="src-doc">     *   '01'..'12' then that month is initially selected.  Otherwise,</span></li>
<li><a name="a905"></a><span class="src-doc">     *   if the first argument is a date in some US English date</span></li>
<li><a name="a906"></a><span class="src-doc">     *   format, the month from that date is initially selected. If</span></li>
<li><a name="a907"></a><span class="src-doc">     *   this argument is absent or invalid, the current calendar month</span></li>
<li><a name="a908"></a><span class="src-doc">     *   is initially selected.</span></li>
<li><a name="a909"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed[] </span><span class="src-doc">Output format options:</span></li>
<li><a name="a910"></a><span class="src-doc">     *   &lt;ul&gt;</span></li>
<li><a name="a911"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'include_blank' =&gt; true&lt;/samp&gt; Show a blank</span></li>
<li><a name="a912"></a><span class="src-doc">     *       as the first option.&lt;/li&gt;</span></li>
<li><a name="a913"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'use_month_number' =&gt; true&lt;/samp&gt; Show months in</span></li>
<li><a name="a914"></a><span class="src-doc">     *       the menu by their month number (1, 2 ...).  Default is to</span></li>
<li><a name="a915"></a><span class="src-doc">     *       show English month name (January, February ...).&lt;/li&gt;</span></li>
<li><a name="a916"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'add_month_number' =&gt; true&lt;/samp&gt; Show both month</span></li>
<li><a name="a917"></a><span class="src-doc">     *       number and month name in the menu.&lt;/li&gt;</span></li>
<li><a name="a918"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'field_name' =&gt; '&lt;/samp&gt;&lt;i&gt;somestring&lt;/i&gt;&lt;samp&gt;'&lt;/samp&gt;</span></li>
<li><a name="a919"></a><span class="src-doc">     *       Generate output&lt;br /&gt;</span></li>
<li><a name="a920"></a><span class="src-doc">     *       &lt;samp&gt;&lt;select name=&quot;&lt;/samp&gt;&lt;i&gt;somestring&lt;/i&gt;&lt;samp&gt;&quot;&gt;...&lt;/select&gt;&lt;/samp&gt; .</span></li>
<li><a name="a921"></a><span class="src-doc">     *       &lt;br /&gt;If absent, generate output&lt;br /&gt;</span></li>
<li><a name="a922"></a><span class="src-doc">     *       &lt;samp&gt;&lt;select name=&quot;month&quot;&gt;...&lt;/select&gt;&lt;/samp&gt;.&lt;/li&gt;</span></li>
<li><a name="a923"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'discard_type' =&gt; ???&lt;/samp&gt; FIXME&lt;/li&gt;</span></li>
<li><a name="a924"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'prefix' =&gt; ???&lt;/samp&gt; FIXME&lt;/li&gt;</span></li>
<li><a name="a925"></a><span class="src-doc">     *   &lt;/ul&gt;</span></li>
<li><a name="a926"></a><span class="src-doc">     *   In all cases the value sent to the server is the two digit</span></li>
<li><a name="a927"></a><span class="src-doc">     *   month number in the range '01'..'12'.</span></li>
<li><a name="a928"></a><span class="src-doc">     *</span></li>
<li><a name="a929"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc"> Generated HTML</span></li>
<li><a name="a930"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> attribute_name</span></li>
<li><a name="a931"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> leading_zero_on_single_digits()</span></li>
<li><a name="a932"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> request_months</span></li>
<li><a name="a933"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_html</span></li>
<li><a name="a934"></a><span class="src-doc">     */</span></li>
<li><a name="a935"></a>    <span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methodselect_month">select_month</a><span class="src-sym">(</span><span class="src-var">$date </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$options </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a936"></a>        <span class="src-var">$month_options </span>= <span class="src-str">&quot;&quot;</span><span class="src-sym">;    </span><span class="src-comm">// will accumulate &lt;option&gt;s</span></li>
<li><a name="a937"></a>        </li>
<li><a name="a938"></a>        <span class="src-comm">//  If a value for this attribute was parsed from $_REQUEST,</span></li>
<li><a name="a939"></a>        <span class="src-comm">//  use it as initially selected and ignore first argument</span></li>
<li><a name="a940"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_months">request_months</a><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a941"></a>            <span class="src-var">$date_month </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_months">request_months</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">]</span><span class="src-sym">;    </span></li>
<li><a name="a942"></a>        <span class="src-sym">}</span></li>
<li><a name="a943"></a>&nbsp;</li>
<li><a name="a944"></a>        <span class="src-comm">//  No value in $_REQUEST so look at the first argument.</span></li>
<li><a name="a945"></a>        <span class="src-comm">//  If it is valid use it as initially selected</span></li>
<li><a name="a946"></a>        <span class="src-key">elseif</span><span class="src-sym">(</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$date</span><span class="src-sym">) </span>== <span class="src-num">2 </span>&amp;&amp; <a href="http://www.php.net/is_numeric">is_numeric</a><span class="src-sym">(</span><span class="src-var">$date</span><span class="src-sym">)</span></li>
<li><a name="a947"></a>               &amp;&amp; <span class="src-var">$date </span>&gt;=<span class="src-num">1 </span>&amp;&amp; <span class="src-var">$date </span>&lt;= <span class="src-num">12 </span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a948"></a>            <span class="src-var">$date_month </span>= <span class="src-var">$date</span><span class="src-sym">;</span></li>
<li><a name="a949"></a>        <span class="src-sym">}</span></li>
<li><a name="a950"></a>&nbsp;</li>
<li><a name="a951"></a>        <span class="src-comm">//  Parse initially selected month from US English description</span></li>
<li><a name="a952"></a>        <span class="src-comm">//  in first argument if present, otherwise select current month</span></li>
<li><a name="a953"></a>        <span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a954"></a>            <span class="src-var">$date </span>= <span class="src-var">$date </span>? <span class="src-var">$date </span>: <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;Y-m-d H:i:s&quot;</span><span class="src-sym">)</span><span class="src-sym">; </span></li>
<li><a name="a955"></a>            <span class="src-var">$date_month </span>= <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;m&quot;</span><span class="src-sym">,</span><a href="http://www.php.net/strtotime">strtotime</a><span class="src-sym">(</span><span class="src-var">$date</span><span class="src-sym">))</span><span class="src-sym">;  </span></li>
<li><a name="a956"></a>        <span class="src-sym">}</span></li>
<li><a name="a957"></a>   </li>
<li><a name="a958"></a>        <span class="src-comm">//  Generate &lt;option&gt;...&lt;/option&gt; HTML for each month</span></li>
<li><a name="a959"></a>        <span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$month_number </span>= <span class="src-num">1</span><span class="src-sym">; </span><span class="src-var">$month_number </span>&lt;= <span class="src-num">12</span><span class="src-sym">; </span><span class="src-var">$month_number</span>++<span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a960"></a>            <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'use_month_numbers'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a961"></a>                <span class="src-var">$month_name </span>= <span class="src-var">$month_number</span><span class="src-sym">;</span></li>
<li><a name="a962"></a>            <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'add_month_numbers'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a963"></a>                <span class="src-var">$month_name </span>= <span class="src-var">$month_number</span>. <span class="src-str">' - '</span></li>
<li><a name="a964"></a>                    . <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;F&quot;</span><span class="src-sym">,</span><a href="http://www.php.net/strtotime">strtotime</a><span class="src-sym">(</span><span class="src-str">&quot;2005-&quot; </span>. <span class="src-var">$month_number</span></li>
<li><a name="a965"></a>                                       . <span class="src-str">&quot;-01&quot;</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a966"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a967"></a>                <span class="src-var">$month_name </span>= <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;F&quot;</span><span class="src-sym">,</span><a href="http://www.php.net/strtotime">strtotime</a><span class="src-sym">(</span><span class="src-str">&quot;2005-&quot; </span>. <span class="src-var">$month_number</span></li>
<li><a name="a968"></a>                                                 .<span class="src-str">&quot;-01&quot;</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a969"></a>            <span class="src-sym">}</span></li>
<li><a name="a970"></a>&nbsp;</li>
<li><a name="a971"></a>            <span class="src-var">$month_options </span>.= <span class="src-sym">(</span><span class="src-var">$date_month </span>== <span class="src-var">$month_number </span>?</li>
<li><a name="a972"></a>                               <span class="src-str">&quot;&lt;option value=\&quot;&quot;</span></li>
<li><a name="a973"></a>                          .<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$month_number</span><span class="src-sym">)</span></li>
<li><a name="a974"></a>                       .<span class="src-str">&quot;</span><span class="src-str">\&quot; <span class="src-id">selected</span>=\&quot;<span class="src-id">selected</span>\&quot;&gt;<span class="src-var">$month_name</span>&lt;/<span class="src-id">option</span>&gt;\n</span><span class="src-str">&quot; </span>:</li>
<li><a name="a975"></a>                               <span class="src-str">&quot;&lt;option value=\&quot;&quot;</span></li>
<li><a name="a976"></a>                          .<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodleading_zero_on_single_digits">leading_zero_on_single_digits</a><span class="src-sym">(</span><span class="src-var">$month_number</span><span class="src-sym">)</span></li>
<li><a name="a977"></a>                               .<span class="src-str">&quot;</span><span class="src-str">\&quot;&gt;<span class="src-var">$month_name</span>&lt;/<span class="src-id">option</span>&gt;\n</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a978"></a>        <span class="src-sym">}</span></li>
<li><a name="a979"></a>&nbsp;</li>
<li><a name="a980"></a>        <span class="src-comm">//  Return finished HTML</span></li>
<li><a name="a981"></a>        <span class="src-var">$field_name </span>= <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'field_name'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a982"></a>                       ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_name'</span><span class="src-sym">] </span>: <span class="src-str">'month'</span><span class="src-sym">;</span></li>
<li><a name="a983"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_html">select_html</a><span class="src-sym">(</span><span class="src-var">$field_name</span><span class="src-sym">, </span><span class="src-var">$month_options</span><span class="src-sym">,</span></li>
<li><a name="a984"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'prefix'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a985"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'prefix'</span><span class="src-sym">] </span>: <span class="src-id">null</span><span class="src-sym">,</span></li>
<li><a name="a986"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'include_blank'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a987"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'include_blank'</span><span class="src-sym">] </span>: <span class="src-id">false</span><span class="src-sym">,</span></li>
<li><a name="a988"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'discard_type'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a989"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_type'</span><span class="src-sym">] </span>: <span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a990"></a>    <span class="src-sym">}</span></li>
<li><a name="a991"></a>&nbsp;</li>
<li><a name="a992"></a>    <span class="src-doc">/**</span></li>
<li><a name="a993"></a><span class="src-doc">     *  Generate HTML/XML for year selector pull-down menu</span></li>
<li><a name="a994"></a><span class="src-doc">     *</span></li>
<li><a name="a995"></a><span class="src-doc">     *  Returns &lt;samp&gt;&lt;select&gt;...&lt;/select&gt;&lt;/samp&gt; HTML with options</span></li>
<li><a name="a996"></a><span class="src-doc">     *  for a number of years.  The first argument, if present,</span></li>
<li><a name="a997"></a><span class="src-doc">     *  specifies the initially selected year.  The second</span></li>
<li><a name="a998"></a><span class="src-doc">     *  argument controls the format of the generated HTML.</span></li>
<li><a name="a999"></a><span class="src-doc">     *</span></li>
<li><a name="a1000"></a><span class="src-doc">     *  Examples:</span></li>
<li><a name="a1001"></a><span class="src-doc">     *  &lt;ul&gt;</span></li>
<li><a name="a1002"></a><span class="src-doc">     *   &lt;li&gt;&lt;samp&gt;select_year();&lt;/samp&gt;&lt;br /&gt; Generates a pulldown menu with</span></li>
<li><a name="a1003"></a><span class="src-doc">     *     with a range of +/- five years.  If a year is specified in</span></li>
<li><a name="a1004"></a><span class="src-doc">     *     </span><span class="src-doc-inlinetag">{@link $request_years}</span><span class="src-doc">[</span><span class="src-doc-inlinetag">{@link $attribute_name}</span><span class="src-doc">] then it is</span></li>
<li><a name="a1005"></a><span class="src-doc">     *     selected initially, otherwise the current calendar year is</span></li>
<li><a name="a1006"></a><span class="src-doc">     *     selected.&lt;/li&gt;</span></li>
<li><a name="a1007"></a><span class="src-doc">     *   &lt;li&gt;</span></li>
<li><a name="a1008"></a><span class="src-doc">     *  &lt;samp&gt;select_year(null,array('start_year' =&gt; '1900));&lt;/samp&gt;&lt;br /&gt;</span></li>
<li><a name="a1009"></a><span class="src-doc">     *    Generates year options from 1900 to five years after the</span></li>
<li><a name="a1010"></a><span class="src-doc">     *    initially selected year, which is chosen as in the previous</span></li>
<li><a name="a1011"></a><span class="src-doc">     *    example.&lt;/li&gt;</span></li>
<li><a name="a1012"></a><span class="src-doc">     *   &lt;li&gt;&lt;samp&gt;select_year(null,array('start_year'=&gt;date('Y')+5, 'end_year'=&gt;date('Y')-5);&lt;/samp&gt;&lt;br /&gt;</span></li>
<li><a name="a1013"></a><span class="src-doc">     *    Generates year options starting five years after the current year,</span></li>
<li><a name="a1014"></a><span class="src-doc">     *    ending five years before the current year.</span></li>
<li><a name="a1015"></a><span class="src-doc">     *  &lt;/ul&gt;</span></li>
<li><a name="a1016"></a><span class="src-doc">     *</span></li>
<li><a name="a1017"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc">  Year to display as initially selected if none</span></li>
<li><a name="a1018"></a><span class="src-doc">     *     was found in </span><span class="src-doc-inlinetag">{@link $request_years}</span><span class="src-doc">[</span><span class="src-doc-inlinetag">{@link $attribute_name}</span><span class="src-doc">].</span></li>
<li><a name="a1019"></a><span class="src-doc">     *     Character string is either exactly four decimal</span></li>
<li><a name="a1020"></a><span class="src-doc">     *     digits or some English date representation.  If omitted, the</span></li>
<li><a name="a1021"></a><span class="src-doc">     *     current year is initially selected.</span></li>
<li><a name="a1022"></a><span class="src-doc">     *</span></li>
<li><a name="a1023"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed[] </span><span class="src-doc">Output format options:</span></li>
<li><a name="a1024"></a><span class="src-doc">     *   &lt;ul&gt;</span></li>
<li><a name="a1025"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'start_year'=&gt;'&lt;/samp&gt;&lt;i&gt;startyear&lt;/i&gt;&lt;samp&gt;'&lt;/samp&gt;</span></li>
<li><a name="a1026"></a><span class="src-doc">     *       If specified, &lt;i&gt;startyear&lt;/i&gt; will be the first year in</span></li>
<li><a name="a1027"></a><span class="src-doc">     *       the output menu, otherwise the first year in the menu will</span></li>
<li><a name="a1028"></a><span class="src-doc">     *       be five years before the initially selected year.&lt;/li&gt;</span></li>
<li><a name="a1029"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'end_year'=&gt;'&lt;/samp&gt;&lt;i&gt;endyear&lt;/i&gt;&lt;samp&gt;'&lt;/samp&gt;</span></li>
<li><a name="a1030"></a><span class="src-doc">     *       If specified, &lt;i&gt;endyear&lt;/i&gt; will be the last year in</span></li>
<li><a name="a1031"></a><span class="src-doc">     *       the output menu, otherwise the last year in the menu will</span></li>
<li><a name="a1032"></a><span class="src-doc">     *       be five years after the initially selected year.&lt;/li&gt;</span></li>
<li><a name="a1033"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'field_name' =&gt; '&lt;/samp&gt;&lt;i&gt;somestring&lt;/i&gt;&lt;samp&gt;'&lt;/samp&gt;</span></li>
<li><a name="a1034"></a><span class="src-doc">     *       Generate output&lt;br /&gt;</span></li>
<li><a name="a1035"></a><span class="src-doc">     *       &lt;samp&gt;&lt;select name=&quot;&lt;/samp&gt;&lt;i&gt;somestring&lt;/i&gt;&lt;samp&gt;&quot;&gt;...&lt;/select&gt;&lt;/samp&gt; .</span></li>
<li><a name="a1036"></a><span class="src-doc">     *       &lt;br /&gt;If absent, generate output&lt;br /&gt;</span></li>
<li><a name="a1037"></a><span class="src-doc">     *       &lt;samp&gt;&lt;select name=&quot;year&quot;&gt;...&lt;/select&gt;&lt;/samp&gt;.&lt;/li&gt;</span></li>
<li><a name="a1038"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'discard_type' =&gt; ???&lt;/samp&gt; FIXME&lt;/li&gt;</span></li>
<li><a name="a1039"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'prefix' =&gt; ???&lt;/samp&gt; FIXME&lt;/li&gt;</span></li>
<li><a name="a1040"></a><span class="src-doc">     *   &lt;/ul&gt;</span></li>
<li><a name="a1041"></a><span class="src-doc">     *   To generate a list with most recent year first, define that</span></li>
<li><a name="a1042"></a><span class="src-doc">     *   year as the start year and the oldest year as the end year.</span></li>
<li><a name="a1043"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc"> Generated HTML</span></li>
<li><a name="a1044"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> attribute_name</span></li>
<li><a name="a1045"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> request_years</span></li>
<li><a name="a1046"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_html</span></li>
<li><a name="a1047"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> year_option()</span></li>
<li><a name="a1048"></a><span class="src-doc">     */</span></li>
<li><a name="a1049"></a>    <span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methodselect_year">select_year</a><span class="src-sym">(</span><span class="src-var">$date</span>=<span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$options </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1050"></a>        <span class="src-comm">//error_log(&quot;select_year('&quot; . (is_null($date) ? 'null' : $date)</span></li>
<li><a name="a1051"></a>        <span class="src-comm">//          .&quot;', &quot; . var_export($options,true));</span></li>
<li><a name="a1052"></a>        <span class="src-comm">//error_log('request_years='</span></li>
<li><a name="a1053"></a>        <span class="src-comm">//     .var_export($this-&gt;request_years[$this-&gt;attribute_name],true));</span></li>
<li><a name="a1054"></a>        <span class="src-var">$year_options </span>= <span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1055"></a>&nbsp;</li>
<li><a name="a1056"></a>        <span class="src-comm">//  Find the year to display.</span></li>
<li><a name="a1057"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_years">request_years</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1058"></a>&nbsp;</li>
<li><a name="a1059"></a>            <span class="src-comm">//  There was a value for this attribute in $_REQUEST</span></li>
<li><a name="a1060"></a>            <span class="src-comm">//  so display it as the initial choice</span></li>
<li><a name="a1061"></a>            <span class="src-var">$date_year </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_years">request_years</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">]</span><span class="src-sym">;    </span></li>
<li><a name="a1062"></a>        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$date</span><span class="src-sym">) </span>== <span class="src-num">4 </span>&amp;&amp; <a href="http://www.php.net/is_numeric">is_numeric</a><span class="src-sym">(</span><span class="src-var">$date</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1063"></a>&nbsp;</li>
<li><a name="a1064"></a>            <span class="src-comm">//  The first argument is exactly four decimal digits</span></li>
<li><a name="a1065"></a>            <span class="src-comm">//  so interpret that as a year</span></li>
<li><a name="a1066"></a>            <span class="src-var">$date_year </span>= <span class="src-var">$date</span><span class="src-sym">;     </span></li>
<li><a name="a1067"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1068"></a>&nbsp;</li>
<li><a name="a1069"></a>            <span class="src-comm">//  If a first argument was specified, assume that it is</span></li>
<li><a name="a1070"></a>            <span class="src-comm">//  some English date representation and convert it for</span></li>
<li><a name="a1071"></a>            <span class="src-comm">//  use as the initial value.</span></li>
<li><a name="a1072"></a>            <span class="src-comm">//  If first argument was null, use the current year for</span></li>
<li><a name="a1073"></a>            <span class="src-comm">//  the initial value.</span></li>
<li><a name="a1074"></a>            <span class="src-var">$date_year </span>= <span class="src-var">$date </span>? <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;Y&quot;</span><span class="src-sym">,</span><a href="http://www.php.net/strtotime">strtotime</a><span class="src-sym">(</span><span class="src-var">$date</span><span class="src-sym">)) </span>: <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;Y&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1075"></a>        <span class="src-sym">} </span></li>
<li><a name="a1076"></a>&nbsp;</li>
<li><a name="a1077"></a>        <span class="src-comm">//  Set first year to appear in the option list</span></li>
<li><a name="a1078"></a>        <span class="src-var">$start_year </span>= <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'start_year'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a1079"></a>                       ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'start_year'</span><span class="src-sym">] </span>: <span class="src-var">$date_year </span>- <span class="src-num">5</span><span class="src-sym">;</span></li>
<li><a name="a1080"></a>&nbsp;</li>
<li><a name="a1081"></a>        <span class="src-comm">//  Set last year to appear in the option list</span></li>
<li><a name="a1082"></a>        <span class="src-var">$end_year </span>= <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'end_year'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a1083"></a>                     ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'end_year'</span><span class="src-sym">] </span>: <span class="src-var">$date_year </span>+ <span class="src-num">5</span><span class="src-sym">;</span></li>
<li><a name="a1084"></a>&nbsp;</li>
<li><a name="a1085"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$start_year </span>&lt; <span class="src-var">$end_year</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1086"></a>            <span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$year </span>= <span class="src-var">$start_year</span><span class="src-sym">; </span><span class="src-var">$year </span>&lt;= <span class="src-var">$end_year</span><span class="src-sym">; </span><span class="src-var">$year</span>++<span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1087"></a>                <span class="src-var">$year_options </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodyear_option">year_option</a><span class="src-sym">(</span><span class="src-var">$year</span><span class="src-sym">, </span><span class="src-var">$date_year</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1088"></a>            <span class="src-sym">}</span></li>
<li><a name="a1089"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1090"></a>            <span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$year </span>= <span class="src-var">$start_year</span><span class="src-sym">; </span><span class="src-var">$year </span>&gt;= <span class="src-var">$end_year</span><span class="src-sym">; </span><span class="src-var">$year</span>--<span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1091"></a>                <span class="src-var">$year_options </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodyear_option">year_option</a><span class="src-sym">(</span><span class="src-var">$year</span><span class="src-sym">, </span><span class="src-var">$date_year</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1092"></a>            <span class="src-sym">}</span></li>
<li><a name="a1093"></a>        <span class="src-sym">}</span></li>
<li><a name="a1094"></a>&nbsp;</li>
<li><a name="a1095"></a>        <span class="src-var">$field_name </span>= <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'field_name'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a1096"></a>                      ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_name'</span><span class="src-sym">] </span>: <span class="src-str">'year'</span><span class="src-sym">;</span></li>
<li><a name="a1097"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_html">select_html</a><span class="src-sym">(</span><span class="src-var">$field_name</span><span class="src-sym">, </span><span class="src-var">$year_options</span><span class="src-sym">,</span></li>
<li><a name="a1098"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'prefix'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a1099"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'prefix'</span><span class="src-sym">] </span>: <span class="src-id">null</span><span class="src-sym">,</span></li>
<li><a name="a1100"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'include_blank'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a1101"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'include_blank'</span><span class="src-sym">] </span>: <span class="src-id">false</span><span class="src-sym">,</span></li>
<li><a name="a1102"></a>                                  <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'discard_type'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a1103"></a>                                  ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_type'</span><span class="src-sym">] </span>: <span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1104"></a>&nbsp;</li>
<li><a name="a1105"></a>    <span class="src-sym">}</span></li>
<li><a name="a1106"></a>&nbsp;</li>
<li><a name="a1107"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1108"></a><span class="src-doc">     *  Return one HTML/XML year option, selected if so specified</span></li>
<li><a name="a1109"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">integer </span><span class="src-doc">Year to put in the option</span></li>
<li><a name="a1110"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">integer </span><span class="src-doc">Year that should be selected</span></li>
<li><a name="a1111"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">HTML for one year option</span></li>
<li><a name="a1112"></a><span class="src-doc">     */</span></li>
<li><a name="a1113"></a>    <span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methodyear_option">year_option</a><span class="src-sym">(</span><span class="src-var">$year</span><span class="src-sym">, </span><span class="src-var">$date_year</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1114"></a>        <span class="src-key">return </span><span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-id">option</span> <span class="src-id">value</span>=\&quot;<span class="src-var">$year</span>\&quot;</span><span class="src-str">&quot;</span></li>
<li><a name="a1115"></a>            . <span class="src-sym">((</span><span class="src-var">$date_year </span>== <span class="src-var">$year</span><span class="src-sym">) </span>? <span class="src-str">&quot;  selected=\&quot;selected\&quot;&gt;&quot; </span>: <span class="src-str">&quot;&gt;&quot;</span><span class="src-sym">)</span></li>
<li><a name="a1116"></a>            . <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$year</span>&lt;/<span class="src-id">option</span>&gt;\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1117"></a>    <span class="src-sym">}</span></li>
<li><a name="a1118"></a>&nbsp;</li>
<li><a name="a1119"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1120"></a><span class="src-doc">     *  Generate HTML/XML for day/month/year selector pull-down menus</span></li>
<li><a name="a1121"></a><span class="src-doc">     *</span></li>
<li><a name="a1122"></a><span class="src-doc">     *  When called, </span><span class="src-doc-inlinetag">{@link $object_name}</span><span class="src-doc"> describes the</span></li>
<li><a name="a1123"></a><span class="src-doc">     *  </span><span class="src-doc-inlinetag">{@link ActiveRecord}</span><span class="src-doc"> subclass and </span><span class="src-doc-inlinetag">{@link $attribute_name}</span></li>
<li><a name="a1124"></a><span class="src-doc">     *  describes the attribute whose value will be set by the</span></li>
<li><a name="a1125"></a><span class="src-doc">     *  generated pull-down menus.  The value to be displayed</span></li>
<li><a name="a1126"></a><span class="src-doc">     *  initially in each menu is from $_REQUEST if present, otherwise</span></li>
<li><a name="a1127"></a><span class="src-doc">     *  from the database.</span></li>
<li><a name="a1128"></a><span class="src-doc">     *</span></li>
<li><a name="a1129"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed[] </span><span class="src-doc">Output format options</span></li>
<li><a name="a1130"></a><span class="src-doc">     *   &lt;ul&gt;</span></li>
<li><a name="a1131"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'discard_day' =&gt; true&lt;/samp&gt; Don't show a day of</span></li>
<li><a name="a1132"></a><span class="src-doc">     *       month menu. If absent or false, day menu will be output.&lt;/li&gt;</span></li>
<li><a name="a1133"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'discard_month' =&gt; true&lt;/samp&gt; Don't show a month</span></li>
<li><a name="a1134"></a><span class="src-doc">     *       or day of the month menu.  If absent or false, month menu</span></li>
<li><a name="a1135"></a><span class="src-doc">     *       will be output.&lt;/li&gt;</span></li>
<li><a name="a1136"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'discard_type' =&gt; true&lt;/samp&gt; (true is the</span></li>
<li><a name="a1137"></a><span class="src-doc">     *       default) Don't show name of individual field, for example</span></li>
<li><a name="a1138"></a><span class="src-doc">     *       &lt;samp&gt;[year]&lt;/samp&gt;, as part of the &lt;samp&gt;name&lt;/samp&gt; value</span></li>
<li><a name="a1139"></a><span class="src-doc">     *       of the generated &lt;samp&gt;&lt;select ...&gt;&lt;/samp&gt;.  The</span></li>
<li><a name="a1140"></a><span class="src-doc">     *       information to identify the field is available as a suffix</span></li>
<li><a name="a1141"></a><span class="src-doc">     *       &lt;samp&gt;(&lt;/samp&gt;&lt;i&gt;n&lt;/i&gt;&lt;samp&gt;i)&lt;/samp&gt; of the attribute</span></li>
<li><a name="a1142"></a><span class="src-doc">     *       name.&lt;/li&gt;</span></li>
<li><a name="a1143"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'discard_year' =&gt; true&lt;/samp&gt; Don't show a year</span></li>
<li><a name="a1144"></a><span class="src-doc">     *       menu.  If absent or false, year menu will be output.&lt;/li&gt;</span></li>
<li><a name="a1145"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'field_separator' =&gt; '&lt;/samp&gt;&lt;i&gt;string&lt;/i&gt;&lt;samp&gt;'&lt;/samp&gt;</span></li>
<li><a name="a1146"></a><span class="src-doc">     *       String to insert between the submenus in the output.  If</span></li>
<li><a name="a1147"></a><span class="src-doc">     *       absent, one blank will be inserted.&lt;/li&gt;</span></li>
<li><a name="a1148"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'include_blank' =&gt; true&lt;/samp&gt; Initially show a blank</span></li>
<li><a name="a1149"></a><span class="src-doc">     *       selection in the menu.  If absent or false, the current</span></li>
<li><a name="a1150"></a><span class="src-doc">     *       date will be shown as the initial selection.  If a value</span></li>
<li><a name="a1151"></a><span class="src-doc">     *       was parsed from $_REQUEST, it will be used for the initial</span></li>
<li><a name="a1152"></a><span class="src-doc">     *       selection regardless of this option.&lt;/li&gt;</span></li>
<li><a name="a1153"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'month_before_year' =&gt; true&lt;/samp&gt;  Equivalent to</span></li>
<li><a name="a1154"></a><span class="src-doc">     *       &lt;samp&gt;'order' =&gt; array('month', 'day', 'year')&lt;/samp&gt;&lt;/li&gt;</span></li>
<li><a name="a1155"></a><span class="src-doc">     *     &lt;li&gt;&lt;samp&gt;'order' =&gt; array(&lt;/samp&gt;&lt;i&gt;elements&lt;/i&gt;&lt;samp&gt;)&lt;/samp&gt;</span></li>
<li><a name="a1156"></a><span class="src-doc">     *       A list of the elements &lt;samp&gt;'month', 'day'&lt;/samp&gt; and</span></li>
<li><a name="a1157"></a><span class="src-doc">     *       &lt;samp&gt;'year'&lt;/samp&gt; in the order in which the menus should</span></li>
<li><a name="a1158"></a><span class="src-doc">     *       appear in the output. Default is</span></li>
<li><a name="a1159"></a><span class="src-doc">     *       &lt;samp&gt;'year', 'month', 'day'&lt;/samp&gt;&lt;/li&gt;</span></li>
<li><a name="a1160"></a><span class="src-doc">     *     &lt;li&gt;&lt;b&gt;Also:&lt;/b&gt; options provided by </span><span class="src-doc-inlinetag">{@link select_month()}</span><span class="src-doc">,</span></li>
<li><a name="a1161"></a><span class="src-doc">     *       </span><span class="src-doc-inlinetag">{@link select_day()}</span><span class="src-doc"> and </span><span class="src-doc-inlinetag">{@link select_year()}</span></li>
<li><a name="a1162"></a><span class="src-doc">     *   &lt;/ul&gt;</span></li>
<li><a name="a1163"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">Generated HTML</span></li>
<li><a name="a1164"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_day()</span></li>
<li><a name="a1165"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_month()</span></li>
<li><a name="a1166"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> select_year()</span></li>
<li><a name="a1167"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> value()</span></li>
<li><a name="a1168"></a><span class="src-doc">     */</span></li>
<li><a name="a1169"></a>    <span class="src-key">function </span><a href="../PHPonTrax/DateHelper.html#methodto_date_select_tag">to_date_select_tag</a><span class="src-sym">(</span><span class="src-var">$options </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1170"></a><span class="src-comm">//        error_log(&quot;to_date_select_tag() object='$this-&gt;object_name'&quot;</span></li>
<li><a name="a1171"></a><span class="src-comm">//                  . &quot; attribute='$this-&gt;attribute_name'&quot;);</span></li>
<li><a name="a1172"></a><span class="src-comm">//        error_log(&quot;options=&quot;.var_export($options,true));</span></li>
<li><a name="a1173"></a>&nbsp;</li>
<li><a name="a1174"></a>        <span class="src-comm">//  Handle historically misspelled options</span></li>
<li><a name="a1175"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'field_seperator'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1176"></a>            <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_separator'</span><span class="src-sym">] </span>= <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_seperator'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1177"></a>            unset<span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_seperator'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1178"></a>        <span class="src-sym">}</span></li>
<li><a name="a1179"></a>        <span class="src-var">$defaults </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'discard_type' </span>=&gt; <span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1180"></a>        <span class="src-var">$options  </span>= <a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-var">$defaults</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1181"></a>        <span class="src-var">$options_with_prefix </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1182"></a>&nbsp;</li>
<li><a name="a1183"></a>        <span class="src-comm">//  Set the name of each submenu in the form</span></li>
<li><a name="a1184"></a>        <span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$i</span>=<span class="src-num">1 </span><span class="src-sym">; </span><span class="src-var">$i </span>&lt;= <span class="src-num">3 </span><span class="src-sym">; </span><span class="src-var">$i</span>++<span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1185"></a>            <span class="src-var">$options_with_prefix</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">] </span>= <a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">, </span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'prefix' </span>=&gt;</li>
<li><a name="a1186"></a>                  <span class="src-str">&quot;</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">}</span><span class="src-sym">[</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">}</span>({<span class="src-var">$i</span><span class="src-str"></span><span class="src-sym">}</span><span class="src-id">i</span>)<span class="src-sym">]</span><span class="src-str">"</span><span class="src-sym">))</span><span class="src-sym">;</span></span></li>
<li><a name="a1187"></a></span><span class="src-str">        <span class="src-sym">}</span>        </span></li>
<li><a name="a1188"></a></span><span class="src-str">        </span></li>
<li><a name="a1189"></a></span><span class="src-str">        <span class="src-comm">//  Test for output option 'include_blank' == true</span></span></li>
<li><a name="a1190"></a></span><span class="src-str"><span class="src-comm"></span>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">'include_blank'</span><span class="src-sym">,</span> <span class="src-var">$options</span><span class="src-sym">)</span></span></li>
<li><a name="a1191"></a></span><span class="src-str">           &amp;&amp; <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'include_blank'</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a1192"></a>&nbsp;</li>
<li><a name="a1193"></a></span><span class="src-str">            <span class="src-comm">//  'include_blank' is present so if no value for this</span></span></li>
<li><a name="a1194"></a></span><span class="src-str"><span class="src-comm"></span>            <span class="src-comm">//  attribute was parsed from $_REQUEST, show blank initially</span></span></li>
<li><a name="a1195"></a></span><span class="src-str"><span class="src-comm"></span>            <span class="src-comm">//  FIXME: this doesn't actually work</span></span></li>
<li><a name="a1196"></a></span><span class="src-str"><span class="src-comm"></span>            <span class="src-var">$value</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodvalue">value</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1197"></a>            <span class="src-var">$date </span>= <span class="src-var">$value </span>? <span class="src-var">$value </span>: <span class="src-id">null</span><span class="src-sym">;</span></li>
<li><a name="a1198"></a>        </span><span class="src-str"><span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span></span></li>
<li><a name="a1199"></a>&nbsp;</li>
<li><a name="a1200"></a></span><span class="src-str">            <span class="src-comm">//  'include_blank' is not present so if no value for this</span></span></li>
<li><a name="a1201"></a></span><span class="src-str"><span class="src-comm"></span>            <span class="src-comm">//  attribute was parsed from $_REQUEST, show today's date</span></span></li>
<li><a name="a1202"></a></span><span class="src-str"><span class="src-comm"></span>            <span class="src-comm">//  initially</span></span></li>
<li><a name="a1203"></a></span><span class="src-str"><span class="src-comm"></span>            <span class="src-var">$value</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodvalue">value</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1204"></a>            <span class="src-var">$date </span>= <span class="src-var">$value </span>? <span class="src-var">$value </span>: <span class="src-id">date</span><span class="src-sym">(</span><span class="src-str">&quot;Y-m-d&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1205"></a>        </span><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a1206"></a>&nbsp;</li>
<li><a name="a1207"></a></span><span class="src-str">        <span class="src-comm">//  Test for output option 'month_before_year' == true</span></span></li>
<li><a name="a1208"></a></span><span class="src-str"><span class="src-comm"></span>        <span class="src-var">$date_select</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1209"></a></span><span class="src-str">        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">'month_before_year'</span><span class="src-sym">,</span> <span class="src-var">$options</span><span class="src-sym">)</span></span></li>
<li><a name="a1210"></a></span><span class="src-str">           &amp;&amp; <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'month_before_year'</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a1211"></a>&nbsp;</li>
<li><a name="a1212"></a></span><span class="src-str">            <span class="src-comm">//  'month_before_year' is present so set the default</span></span></li>
<li><a name="a1213"></a></span><span class="src-str"><span class="src-comm"></span>            <span class="src-comm">//  ordering of output menus accordingly</span></span></li>
<li><a name="a1214"></a></span><span class="src-str"><span class="src-comm"></span>            <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'order'</span><span class="src-sym">]</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'month'</span><span class="src-sym">,</span> <span class="src-str">'year'</span><span class="src-sym">,</span> <span class="src-str">'day'</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1215"></a></span><span class="src-str">        <span class="src-sym">}</span> <span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">'order'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></span></li>
<li><a name="a1216"></a></span><span class="src-str">                 ||<span class="src-sym">!</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'order'</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a1217"></a>&nbsp;</li>
<li><a name="a1218"></a></span><span class="src-str">            <span class="src-comm">//  If 'order' option not present set order from default</span></span></li>
<li><a name="a1219"></a></span><span class="src-str"><span class="src-comm"></span>            <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'order'</span><span class="src-sym">]</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'year'</span><span class="src-sym">,</span> <span class="src-str">'month'</span><span class="src-sym">,</span> <span class="src-str">'day'</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1220"></a></span><span class="src-str">        <span class="src-sym">}</span></span></li>
<li><a name="a1221"></a>&nbsp;</li>
<li><a name="a1222"></a></span><span class="src-str">        <span class="src-var">$position</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'year'</span> =&gt; <span class="src-num">1</span><span class="src-sym">,</span> <span class="src-str">'month'</span> =&gt; <span class="src-num">2</span><span class="src-sym">,</span> <span class="src-str">'day'</span> =&gt; <span class="src-num">3</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1223"></a>&nbsp;</li>
<li><a name="a1224"></a></span><span class="src-str">        <span class="src-comm">//  Evaluate 'discard_field' options to see which fields</span></span></li>
<li><a name="a1225"></a></span><span class="src-str"><span class="src-comm"></span>        <span class="src-comm">//  should not be represented by menus in the output</span></span></li>
<li><a name="a1226"></a></span><span class="src-str"><span class="src-comm"></span>        <span class="src-var">$discard</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1227"></a></span><span class="src-str">        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">'discard_year'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></span></li>
<li><a name="a1228"></a></span><span class="src-str">           &amp;&amp; <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_year'</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-var">$discard</span><span class="src-sym">[</span><span class="src-str">'year'</span><span class="src-sym">]</span>  = <span class="src-id">true</span><span class="src-sym">;</span></span></li>
<li><a name="a1229"></a></span><span class="src-str">        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">'discard_month'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></span></li>
<li><a name="a1230"></a></span><span class="src-str">           &amp;&amp; <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_month'</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-var">$discard</span><span class="src-sym">[</span><span class="src-str">'month'</span><span class="src-sym">]</span> = <span class="src-id">true</span><span class="src-sym">;</span></span></li>
<li><a name="a1231"></a></span><span class="src-str">        <span class="src-key">if</span><span class="src-sym">(</span> <span class="src-sym">(</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">'discard_day'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></span></li>
<li><a name="a1232"></a></span><span class="src-str">             &amp;&amp;<span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_day'</span><span class="src-sym">]</span><span class="src-sym">)</span></span></li>
<li><a name="a1233"></a></span><span class="src-str">            || <span class="src-sym">(</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">'discard_month'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></span></li>
<li><a name="a1234"></a></span><span class="src-str">                &amp;&amp; <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_month'</span><span class="src-sym">]</span><span class="src-sym">))</span> <span class="src-var">$discard</span><span class="src-sym">[</span><span class="src-str">'day'</span><span class="src-sym">]</span> = <span class="src-id">true</span><span class="src-sym">;</span></span></li>
<li><a name="a1235"></a>&nbsp;</li>
<li><a name="a1236"></a></span><span class="src-str">        <span class="src-comm">//  Build HTML for menus in the order determined above,</span></span></li>
<li><a name="a1237"></a></span><span class="src-str"><span class="src-comm"></span>        <span class="src-comm">//  except for fields to be discarded.</span></span></li>
<li><a name="a1238"></a></span><span class="src-str"><span class="src-comm"></span>        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'order'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$param</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a1239"></a></span><span class="src-str">            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-var">$param</span><span class="src-sym">,</span><span class="src-var">$discard</span><span class="src-sym">)</span> || <span class="src-sym">!</span><span class="src-var">$discard</span><span class="src-sym">[</span><span class="src-var">$param</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a1240"></a></span><span class="src-str">                <span class="src-var">$date_select</span><span class="src-sym">[</span><span class="src-sym">]</span> = <span class="src-id">call_user_func</span><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">,</span> <span class="src-str">"</span><span class="src-id">select_</span><span class="src-var">$param</span><span class="src-str">"</span><span class="src-sym">)</span><span class="src-sym">,</span></span></li>
<li><a name="a1241"></a></span><span class="src-str">                              <span class="src-var">$date</span><span class="src-sym">,</span> <span class="src-var">$options_with_prefix</span><span class="src-sym">[</span><span class="src-var">$position</span><span class="src-sym">[</span><span class="src-var">$param</span><span class="src-sym">]]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1242"></a></span><span class="src-str">            <span class="src-sym">}</span></span></li>
<li><a name="a1243"></a></span><span class="src-str">        <span class="src-sym">}</span></span></li>
<li><a name="a1244"></a></span><span class="src-str">        </span></li>
<li><a name="a1245"></a></span><span class="src-str">        <span class="src-comm">//  HTML for each menu is in an element of $date_select[].</span></span></li>
<li><a name="a1246"></a></span><span class="src-str"><span class="src-comm"></span>        <span class="src-comm">//  Join the pieces of HTML with an optional field separator</span></span></li>
<li><a name="a1247"></a></span><span class="src-str"><span class="src-comm"></span>        <span class="src-comm">//  (default blank)</span></span></li>
<li><a name="a1248"></a></span><span class="src-str"><span class="src-comm"></span>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">count</span><span class="src-sym">(</span><span class="src-var">$date_select</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a1249"></a></span><span class="src-str">            <span class="src-var">$separator</span> = <span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">'field_separator'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></span></li>
<li><a name="a1250"></a></span><span class="src-str">                ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_separator'</span><span class="src-sym">]</span> : <span class="src-str">&quot; &quot;</span><span class="src-sym">;</span></span></li>
<li><a name="a1251"></a></span><span class="src-str">            <span class="src-var">$date_select</span> = <span class="src-id">implode</span><span class="src-sym">(</span><span class="src-var">$separator</span><span class="src-sym">,</span> <span class="src-var">$date_select</span><span class="src-sym">)</span><span class="src-sym">;</span>            </span></li>
<li><a name="a1252"></a></span><span class="src-str">        <span class="src-sym">}</span></span></li>
<li><a name="a1253"></a>&nbsp;</li>
<li><a name="a1254"></a></span><span class="src-str">        <span class="src-key">return</span> <span class="src-var">$date_select</span><span class="src-sym">;</span></span></li>
<li><a name="a1255"></a></span><span class="src-str">    <span class="src-sym">}</span></span></li>
<li><a name="a1256"></a>&nbsp;</li>
<li><a name="a1257"></a></span><span class="src-str">    /**</span></li>
<li><a name="a1258"></a></span><span class="src-str">     *  Generate HTML/XML for date/time pulldown menus</span></li>
<li><a name="a1259"></a></span><span class="src-str">     *</span></li>
<li><a name="a1260"></a></span><span class="src-str">     *  Returns &lt;samp&gt;&lt;select&gt;...&lt;/select&gt;&lt;/samp&gt; HTML with options</span></li>
<li><a name="a1261"></a></span><span class="src-str">     *  for a number of years, months, days, hours and minutes.  The</span></li>
<li><a name="a1262"></a></span><span class="src-str">     *  first argument, if present, specifies the initially selected</span></li>
<li><a name="a1263"></a></span><span class="src-str">     *  date.  The second argument controls the format of the</span></li>
<li><a name="a1264"></a></span><span class="src-str">     *  generated HTML.</span></li>
<li><a name="a1265"></a></span><span class="src-str">     *</span></li>
<li><a name="a1266"></a></span><span class="src-str">     *  Examples:</span></li>
<li><a name="a1267"></a></span><span class="src-str">     *  &lt;ul&gt;</span></li>
<li><a name="a1268"></a></span><span class="src-str">     *   &lt;li&gt;&lt;samp&gt;to_datetime_select_tag();&lt;/samp&gt;&lt;br /&gt; Generates a</span></li>
<li><a name="a1269"></a></span><span class="src-str">     *     group of five pulldown menus in the order year, month, day,</span></li>
<li><a name="a1270"></a></span><span class="src-str">     *     hour and minute with the current date and time initially</span></li>
<li><a name="a1271"></a></span><span class="src-str">     *     selected.&lt;/li&gt; </span></li>
<li><a name="a1272"></a></span><span class="src-str">     *   &lt;li&gt;</span></li>
<li><a name="a1273"></a></span><span class="src-str">     *   &lt;li&gt;&lt;samp&gt;to_datetime_select_tag(array('discard_second' =&gt; false);&lt;/samp&gt;&lt;br /&gt;</span></li>
<li><a name="a1274"></a></span><span class="src-str">     *     Generates a group of six pulldown menus in the order year,</span></li>
<li><a name="a1275"></a></span><span class="src-str">     *     month, day, hour, minute and second with the current date</span></li>
<li><a name="a1276"></a></span><span class="src-str">     *     and time initially selected.&lt;/li&gt; </span></li>
<li><a name="a1277"></a></span><span class="src-str">     *   &lt;li&gt;</span></li>
<li><a name="a1278"></a></span><span class="src-str">     *  &lt;samp&gt;to_datetime_select_tag('1998-04-08 13:21:17');&lt;/samp&gt;&lt;br /&gt;</span></li>
<li><a name="a1279"></a></span><span class="src-str">     *    Generates a group of five pulldown menus in the order year,</span></li>
<li><a name="a1280"></a></span><span class="src-str">     *    month, day, hour and minute with the date/time</span></li>
<li><a name="a1281"></a></span><span class="src-str">     *    1998 August 4 13:21 initially selected.&lt;/li&gt; </span></li>
<li><a name="a1282"></a></span><span class="src-str">     *  &lt;/ul&gt;</span></li>
<li><a name="a1283"></a></span><span class="src-str">     *</span></li>
<li><a name="a1284"></a></span><span class="src-str">     *  @param string   Date/time to display as initially selected.</span></li>
<li><a name="a1285"></a></span><span class="src-str">     *    Character string is any US English date representation</span></li>
<li><a name="a1286"></a></span><span class="src-str">     *    supported by {@link strtotime()}.  If omitted, the</span></li>
<li><a name="a1287"></a></span><span class="src-str">     *    current date/time is initially selected.</span></li>
<li><a name="a1288"></a></span><span class="src-str">     *</span></li>
<li><a name="a1289"></a></span><span class="src-str">     *  @param mixed[] Output format options:</span></li>
<li><a name="a1290"></a></span><span class="src-str">     *  &lt;ul&gt;</span></li>
<li><a name="a1291"></a></span><span class="src-str">     *    &lt;li&gt;&lt;samp&gt;'discard_month' =&gt; true&lt;/samp&gt;&lt;br /&gt;</span></li>
<li><a name="a1292"></a></span><span class="src-str">     *      Output selector for only the year.&lt;/li&gt;</span></li>
<li><a name="a1293"></a></span><span class="src-str">     *    &lt;li&gt;&lt;samp&gt;'discard_day' =&gt; true&lt;/samp&gt;&lt;br /&gt;</span></li>
<li><a name="a1294"></a></span><span class="src-str">     *      Output selector for only the year and month.&lt;/li&gt;</span></li>
<li><a name="a1295"></a></span><span class="src-str">     *    &lt;li&gt;&lt;samp&gt;'discard_hour' =&gt; true&lt;/samp&gt;&lt;br /&gt;</span></li>
<li><a name="a1296"></a></span><span class="src-str">     *      Output selector for only the year, month and day.&lt;/li&gt;</span></li>
<li><a name="a1297"></a></span><span class="src-str">     *    &lt;li&gt;&lt;samp&gt;'discard_minute' =&gt; true&lt;/samp&gt;&lt;br /&gt;</span></li>
<li><a name="a1298"></a></span><span class="src-str">     *      Output selector for only the year, month, day and</span></li>
<li><a name="a1299"></a></span><span class="src-str">     *      hour.&lt;/li&gt; </span></li>
<li><a name="a1300"></a></span><span class="src-str">     *    &lt;li&gt;&lt;samp&gt;'discard_second' =&gt; false&lt;/samp&gt;&lt;br /&gt;</span></li>
<li><a name="a1301"></a></span><span class="src-str">     *      Output selector for year, month, day, hour, minute and</span></li>
<li><a name="a1302"></a></span><span class="src-str">     *      second.&lt;/li&gt; </span></li>
<li><a name="a1303"></a></span><span class="src-str">     *  &lt;/ul&gt;</span></li>
<li><a name="a1304"></a></span><span class="src-str">     *  @return string Generated HTML</span></li>
<li><a name="a1305"></a></span><span class="src-str">     *  @uses request_days</span></li>
<li><a name="a1306"></a></span><span class="src-str">     *  @uses request_hours</span></li>
<li><a name="a1307"></a></span><span class="src-str">     *  @uses request_minutes</span></li>
<li><a name="a1308"></a></span><span class="src-str">     *  @uses request_months</span></li>
<li><a name="a1309"></a></span><span class="src-str">     *  @uses request_seconds</span></li>
<li><a name="a1310"></a></span><span class="src-str">     *  @uses request_years</span></li>
<li><a name="a1311"></a></span><span class="src-str">     *  @uses select_day()</span></li>
<li><a name="a1312"></a></span><span class="src-str">     *  @uses select_hour()</span></li>
<li><a name="a1313"></a></span><span class="src-str">     *  @uses select_minute()</span></li>
<li><a name="a1314"></a></span><span class="src-str">     *  @uses select_month()</span></li>
<li><a name="a1315"></a></span><span class="src-str">     *  @uses select_second()</span></li>
<li><a name="a1316"></a></span><span class="src-str">     *  @uses select_year()</span></li>
<li><a name="a1317"></a></span><span class="src-str">     *  @uses value()</span></li>
<li><a name="a1318"></a></span><span class="src-str">     */</span></li>
<li><a name="a1319"></a></span><span class="src-str">    <span class="src-key">function</span> <span class="src-id">to_datetime_select_tag</span><span class="src-sym">(</span><span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a1320"></a></span><span class="src-str">        <span class="src-var">$defaults</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'discard_type'</span>   =&gt; <span class="src-id">true</span><span class="src-sym">,</span></span></li>
<li><a name="a1321"></a></span><span class="src-str">                          <span class="src-str">'discard_second'</span> =&gt; <span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1322"></a></span><span class="src-str">        <span class="src-var">$options</span> = <span class="src-id">array_merge</span><span class="src-sym">(</span><span class="src-var">$defaults</span><span class="src-sym">,</span> <span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1323"></a></span><span class="src-str">        <span class="src-var">$options_with_prefix</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1324"></a></span><span class="src-str">        <span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$i</span>=<span class="src-num">1</span> <span class="src-sym">;</span> <span class="src-var">$i</span> &lt;= <span class="src-num">6</span> <span class="src-sym">;</span> <span class="src-var">$i</span>++<span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a1325"></a></span><span class="src-str">            <span class="src-var">$options_with_prefix</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span> =</span></li>
<li><a name="a1326"></a></span><span class="src-str">                <span class="src-id">array_merge</span><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">,</span> <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'prefix'</span> =&gt;</span></li>
<li><a name="a1327"></a></span><span class="src-str">                   <span class="src-str">"</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">}</span><span class="src-sym">[</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">}</span>({<span class="src-var">$i</span><span class="src-str"></span><span class="src-sym">}</span><span class="src-id">i</span>)<span class="src-sym">]</span><span class="src-str">"</span><span class="src-sym">))</span><span class="src-sym">;</span></span></li>
<li><a name="a1328"></a></span><span class="src-str">        <span class="src-sym">}</span></span></li>
<li><a name="a1329"></a>&nbsp;</li>
<li><a name="a1330"></a></span><span class="src-str">        <span class="src-comm">//  FIXME: this doesn't work</span></span></li>
<li><a name="a1331"></a></span><span class="src-str"><span class="src-comm"></span>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">'include_blank'</span><span class="src-sym">,</span> <span class="src-var">$options</span><span class="src-sym">)</span></span></li>
<li><a name="a1332"></a></span><span class="src-str">           &amp;&amp; <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'include_blank'</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a1333"></a></span><span class="src-str">            <span class="src-var">$value</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodvalue">value</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1334"></a>            <span class="src-var">$datetime </span>= <span class="src-var">$value </span>? <span class="src-var">$value </span>: <span class="src-id">null</span><span class="src-sym">;</span></li>
<li><a name="a1335"></a>        </span><span class="src-str"><span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span></span></li>
<li><a name="a1336"></a></span><span class="src-str">            <span class="src-var">$value</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodvalue">value</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1337"></a>            <span class="src-var">$datetime </span>= <span class="src-var">$value </span>? <span class="src-var">$value </span>: <span class="src-id">date</span><span class="src-sym">(</span><span class="src-str">&quot;Y-m-d H:i:s&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1338"></a>        </span><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a1339"></a></span><span class="src-str">    </span></li>
<li><a name="a1340"></a></span><span class="src-str">        <span class="src-comm">//  Generate year pulldown</span></span></li>
<li><a name="a1341"></a></span><span class="src-str"><span class="src-comm"></span>        <span class="src-var">$datetime_select</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_year">select_year</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">,</span></li>
<li><a name="a1342"></a>                                              <span class="src-var">$options_with_prefix</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1343"></a>&nbsp;</li>
<li><a name="a1344"></a>        <span class="src-comm">//  Generate month pulldown if not discarded</span></li>
<li><a name="a1345"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">'discard_month'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a1346"></a>           || <span class="src-sym">!</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_month'</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-str"></span><span class="src-sym">{</span></span></li>
<li><a name="a1347"></a></span><span class="src-str">            <span class="src-var">$datetime_select</span> .= <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_month">select_month</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">,</span></li>
<li><a name="a1348"></a>                                                    <span class="src-var">$options_with_prefix</span><span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1349"></a>&nbsp;</li>
<li><a name="a1350"></a>            <span class="src-comm">//  Generate day pulldown if not discarded</span></li>
<li><a name="a1351"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">'discard_day'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a1352"></a>               || <span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_day'</span><span class="src-sym">] </span>|| <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_month'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-str"></span><span class="src-sym">{</span></span></li>
<li><a name="a1353"></a></span><span class="src-str">                <span class="src-var">$datetime_select</span> .= <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_day">select_day</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">,</span></li>
<li><a name="a1354"></a>                                                      <span class="src-var">$options_with_prefix</span><span class="src-sym">[</span><span class="src-num">3</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1355"></a>&nbsp;</li>
<li><a name="a1356"></a>                <span class="src-comm">//  Generate hour pulldown if not discarded</span></li>
<li><a name="a1357"></a>                <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">'discard_hour'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a1358"></a>                   || <span class="src-sym">!</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_hour'</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-str"></span><span class="src-sym">{</span></span></li>
<li><a name="a1359"></a></span><span class="src-str">                    <span class="src-var">$datetime_select</span> .= <span class="src-str">' &amp;mdash; '</span></span></li>
<li><a name="a1360"></a></span><span class="src-str">                        . <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_hour">select_hour</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">,</span></li>
<li><a name="a1361"></a>                                         <span class="src-var">$options_with_prefix</span><span class="src-sym">[</span><span class="src-num">4</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1362"></a>&nbsp;</li>
<li><a name="a1363"></a>                    <span class="src-comm">//  Generate minute pulldown if not discarded</span></li>
<li><a name="a1364"></a>                    <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">'discard_minute'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a1365"></a>                       || <span class="src-sym">!</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_minute'</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-str"></span><span class="src-sym">{</span></span></li>
<li><a name="a1366"></a></span><span class="src-str">                        <span class="src-var">$datetime_select</span> .= <span class="src-str">' : '</span></span></li>
<li><a name="a1367"></a></span><span class="src-str">                            . <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_minute">select_minute</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">,</span></li>
<li><a name="a1368"></a>                                                   <span class="src-var">$options_with_prefix</span><span class="src-sym">[</span><span class="src-num">5</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1369"></a>&nbsp;</li>
<li><a name="a1370"></a>                        <span class="src-comm">//  Generate second pulldown if not discarded</span></li>
<li><a name="a1371"></a>                        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">'discard_second'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a1372"></a>                           || <span class="src-sym">!</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_second'</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-str"></span><span class="src-sym">{</span></span></li>
<li><a name="a1373"></a></span><span class="src-str">                            <span class="src-var">$datetime_select</span> .= <span class="src-str">' : '</span></span></li>
<li><a name="a1374"></a></span><span class="src-str">                                . <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_second">select_second</a><span class="src-sym">(</span><span class="src-var">$datetime</span><span class="src-sym">,</span></li>
<li><a name="a1375"></a>                                                    <span class="src-var">$options_with_prefix</span><span class="src-sym">[</span><span class="src-num">6</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1376"></a>                        </span><span class="src-str"><span class="src-sym">}</span>  <span class="src-comm">// second</span></span></li>
<li><a name="a1377"></a></span><span class="src-str"><span class="src-comm"></span>                    <span class="src-sym">}</span>      <span class="src-comm">// minute</span></span></li>
<li><a name="a1378"></a></span><span class="src-str"><span class="src-comm"></span>                <span class="src-sym">}</span>          <span class="src-comm">// hour</span></span></li>
<li><a name="a1379"></a></span><span class="src-str"><span class="src-comm"></span>            <span class="src-sym">}</span>              <span class="src-comm">// day</span></span></li>
<li><a name="a1380"></a></span><span class="src-str"><span class="src-comm"></span>        <span class="src-sym">}</span>                  <span class="src-comm">// month</span></span></li>
<li><a name="a1381"></a></span><span class="src-str"><span class="src-comm"></span>        <span class="src-key">return</span> <span class="src-var">$datetime_select</span><span class="src-sym">;</span></span></li>
<li><a name="a1382"></a></span><span class="src-str">    <span class="src-sym">}</span></span></li>
<li><a name="a1383"></a></span><span class="src-str">    </span></li>
<li><a name="a1384"></a></span><span class="src-str">    /**</span></li>
<li><a name="a1385"></a></span><span class="src-str">     *  Generate HTML/XML for expiration month and year pulldown.</span></li>
<li><a name="a1386"></a></span><span class="src-str">     *</span></li>
<li><a name="a1387"></a></span><span class="src-str">     *  Calls {@link to_date_select_tag()} with options for month with</span></li>
<li><a name="a1388"></a></span><span class="src-str">     *  number, followed by year starting this year and going seven</span></li>
<li><a name="a1389"></a></span><span class="src-str">     *  years in the future.</span></li>
<li><a name="a1390"></a></span><span class="src-str">     *  @param mixed[] Output format options</span></li>
<li><a name="a1391"></a></span><span class="src-str">     *  @return string Generated HTML</span></li>
<li><a name="a1392"></a></span><span class="src-str">     *  @uses to_date_select_tag()</span></li>
<li><a name="a1393"></a></span><span class="src-str">     */</span></li>
<li><a name="a1394"></a></span><span class="src-str">    <span class="src-key">function</span> <span class="src-id">to_expiration_date_select_tag</span><span class="src-sym">(</span><span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a1395"></a></span><span class="src-str">        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_day'</span><span class="src-sym">]</span> = <span class="src-id">true</span><span class="src-sym">;</span> </span></li>
<li><a name="a1396"></a></span><span class="src-str">        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'month_before_year'</span><span class="src-sym">]</span> = <span class="src-id">true</span><span class="src-sym">;</span>      </span></li>
<li><a name="a1397"></a></span><span class="src-str">        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'use_month_numbers'</span><span class="src-sym">]</span> = <span class="src-id">true</span><span class="src-sym">;</span>   </span></li>
<li><a name="a1398"></a></span><span class="src-str">        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'start_year'</span><span class="src-sym">]</span> = <span class="src-id">date</span><span class="src-sym">(</span><span class="src-str">&quot;Y&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1399"></a></span><span class="src-str">        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'end_year'</span><span class="src-sym">]</span> = <span class="src-id">date</span><span class="src-sym">(</span><span class="src-str">&quot;Y&quot;</span><span class="src-sym">)</span> + <span class="src-num">7</span><span class="src-sym">;</span></span></li>
<li><a name="a1400"></a></span><span class="src-str">        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'field_separator'</span><span class="src-sym">]</span> = <span class="src-str">&quot; / &quot;</span><span class="src-sym">;</span></span></li>
<li><a name="a1401"></a></span><span class="src-str">        <span class="src-key">return</span> <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodto_date_select_tag">to_date_select_tag</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;               </span></li>
<li><a name="a1402"></a>    </span><span class="src-str"><span class="src-sym">}</span>  </span></li>
<li><a name="a1403"></a>&nbsp;</li>
<li><a name="a1404"></a></span><span class="src-str">    /**</span></li>
<li><a name="a1405"></a></span><span class="src-str">     *  Generate HTML/XML for time pulldown</span></li>
<li><a name="a1406"></a></span><span class="src-str">     *</span></li>
<li><a name="a1407"></a></span><span class="src-str">     *  When called, {@link $object_name} describes the</span></li>
<li><a name="a1408"></a></span><span class="src-str">     *  {@link ActiveRecord} subclass and {@link $attribute_name}</span></li>
<li><a name="a1409"></a></span><span class="src-str">     *  describes the attribute whose value will be set by the</span></li>
<li><a name="a1410"></a></span><span class="src-str">     *  generated pull-down menu.  The value to be displayed initially</span></li>
<li><a name="a1411"></a></span><span class="src-str">     *  is from $_REQUEST if present, otherwise from the database.</span></li>
<li><a name="a1412"></a></span><span class="src-str">     *</span></li>
<li><a name="a1413"></a></span><span class="src-str">     *  @param mixed[] Output format options</span></li>
<li><a name="a1414"></a></span><span class="src-str">     *  @return string Generated HTML</span></li>
<li><a name="a1415"></a></span><span class="src-str">     *  @uses request_hours</span></li>
<li><a name="a1416"></a></span><span class="src-str">     *  @uses request_minutes</span></li>
<li><a name="a1417"></a></span><span class="src-str">     *  @uses request_seconds</span></li>
<li><a name="a1418"></a></span><span class="src-str">     *  @uses select_time()</span></li>
<li><a name="a1419"></a></span><span class="src-str">     *  @uses value()</span></li>
<li><a name="a1420"></a></span><span class="src-str">     */</span></li>
<li><a name="a1421"></a></span><span class="src-str">    <span class="src-key">function</span> <span class="src-id">time_select</span><span class="src-sym">(</span><span class="src-var">$options</span>=<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a1422"></a></span><span class="src-str">        <span class="src-var">$defaults</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'discard_type'</span> =&gt; <span class="src-id">true</span><span class="src-sym">,</span></span></li>
<li><a name="a1423"></a></span><span class="src-str">                          <span class="src-str">'discard_second'</span> =&gt; <span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1424"></a></span><span class="src-str">        <span class="src-var">$options</span> = <span class="src-id">array_merge</span><span class="src-sym">(</span><span class="src-var">$defaults</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1425"></a></span><span class="src-str">        <span class="src-var">$options_with_prefix</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1426"></a></span><span class="src-str">        <span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$i</span>=<span class="src-num">4</span> <span class="src-sym">;</span> <span class="src-var">$i</span> &lt;= <span class="src-num">6</span> <span class="src-sym">;</span> <span class="src-var">$i</span>++<span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a1427"></a></span><span class="src-str">            <span class="src-var">$options_with_prefix</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span> =</span></li>
<li><a name="a1428"></a></span><span class="src-str">                <span class="src-id">array_merge</span><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">,</span> <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'prefix'</span> =&gt;</span></li>
<li><a name="a1429"></a></span><span class="src-str">                 <span class="src-str">"</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">}</span><span class="src-sym">[</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">}</span>({<span class="src-var">$i</span><span class="src-str"></span><span class="src-sym">}</span><span class="src-id">i</span>)<span class="src-sym">]</span><span class="src-str">"</span><span class="src-sym">))</span><span class="src-sym">;</span></span></li>
<li><a name="a1430"></a></span><span class="src-str">        <span class="src-sym">}</span></span></li>
<li><a name="a1431"></a>&nbsp;</li>
<li><a name="a1432"></a></span><span class="src-str">        <span class="src-comm">//  If no value for this attribute found in $_REQUEST</span></span></li>
<li><a name="a1433"></a></span><span class="src-str"><span class="src-comm"></span>        <span class="src-comm">//  or the model, show current time initially </span></span></li>
<li><a name="a1434"></a></span><span class="src-str"><span class="src-comm"></span>        <span class="src-var">$time</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodvalue">value</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1435"></a>        <span class="src-var">$time </span>= <span class="src-var">$time </span>? <span class="src-var">$time </span>: <span class="src-id">date</span><span class="src-sym">(</span><span class="src-str">'H:i:s'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1436"></a>&nbsp;</li>
<li><a name="a1437"></a>        <span class="src-comm">//  Generate HTML for hour</span></li>
<li><a name="a1438"></a>        <span class="src-var">$time_select </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_hour">select_hour</a><span class="src-sym">(</span><span class="src-var">$time</span><span class="src-sym">, </span><span class="src-var">$options_with_prefix</span><span class="src-sym">[</span><span class="src-num">4</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1439"></a>&nbsp;</li>
<li><a name="a1440"></a>        <span class="src-comm">//  Generate HTML for minute if not discarded</span></li>
<li><a name="a1441"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-sym">(</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">'discard_minute'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a1442"></a>              &amp;&amp; <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_minute'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-str"></span><span class="src-sym">{</span></span></li>
<li><a name="a1443"></a></span><span class="src-str">            <span class="src-var">$time_select</span> .= <span class="src-str">' : '</span></span></li>
<li><a name="a1444"></a></span><span class="src-str">                . <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_minute">select_minute</a><span class="src-sym">(</span><span class="src-var">$time</span><span class="src-sym">, </span><span class="src-var">$options_with_prefix</span><span class="src-sym">[</span><span class="src-num">5</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1445"></a>&nbsp;</li>
<li><a name="a1446"></a>            <span class="src-comm">//  Generate HTML for second if not discarded</span></li>
<li><a name="a1447"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-sym">(</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">'discard_second'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a1448"></a>                  &amp;&amp; <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'discard_second'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-str"></span><span class="src-sym">{</span></span></li>
<li><a name="a1449"></a></span><span class="src-str">                <span class="src-var">$time_select</span> .= <span class="src-str">' : '</span></span></li>
<li><a name="a1450"></a></span><span class="src-str">                    . <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_second">select_second</a><span class="src-sym">(</span><span class="src-var">$time</span><span class="src-sym">, </span><span class="src-var">$options_with_prefix</span><span class="src-sym">[</span><span class="src-num">6</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1451"></a>            </span><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a1452"></a></span><span class="src-str">        <span class="src-sym">}</span></span></li>
<li><a name="a1453"></a></span><span class="src-str">        <span class="src-key">return</span> <span class="src-var">$time_select</span><span class="src-sym">;</span></span></li>
<li><a name="a1454"></a></span><span class="src-str">    <span class="src-sym">}</span></span></li>
<li><a name="a1455"></a>&nbsp;</li>
<li><a name="a1456"></a></span><span class="src-str">    /**</span></li>
<li><a name="a1457"></a></span><span class="src-str">     *  Generate HTML/XML for year pulldown</span></li>
<li><a name="a1458"></a></span><span class="src-str">     *</span></li>
<li><a name="a1459"></a></span><span class="src-str">     *  When called, {@link $object_name} describes the</span></li>
<li><a name="a1460"></a></span><span class="src-str">     *  {@link ActiveRecord} subclass and {@link $attribute_name}</span></li>
<li><a name="a1461"></a></span><span class="src-str">     *  describes the attribute whose value will be set by the</span></li>
<li><a name="a1462"></a></span><span class="src-str">     *  generated pull-down menu.  The value to be displayed initially</span></li>
<li><a name="a1463"></a></span><span class="src-str">     *  is from $_REQUEST if present, otherwise from the database.</span></li>
<li><a name="a1464"></a></span><span class="src-str">     *</span></li>
<li><a name="a1465"></a></span><span class="src-str">     *  @param mixed[] Output format options</span></li>
<li><a name="a1466"></a></span><span class="src-str">     *  @return string Generated HTML</span></li>
<li><a name="a1467"></a></span><span class="src-str">     *  @uses select_year()</span></li>
<li><a name="a1468"></a></span><span class="src-str">     *  @uses value()</span></li>
<li><a name="a1469"></a></span><span class="src-str">     */</span></li>
<li><a name="a1470"></a></span><span class="src-str">    <span class="src-key">function</span> <span class="src-id">year_select</span><span class="src-sym">(</span><span class="src-var">$options</span>=<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a1471"></a></span><span class="src-str">        <span class="src-var">$defaults</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'discard_type'</span> =&gt; <span class="src-id">true</span><span class="src-sym">,</span></span></li>
<li><a name="a1472"></a></span><span class="src-str">             <span class="src-str">'prefix'</span> =&gt;</span></li>
<li><a name="a1473"></a></span><span class="src-str">                   <span class="src-str">"</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">}</span><span class="src-sym">[</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">}</span>(1<span class="src-id">i</span>)<span class="src-sym">]</span><span class="src-str"></span><span class="src-str">"</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1474"></a></span><span class="src-str">        <span class="src-var">$options</span> = <span class="src-id">array_merge</span><span class="src-sym">(</span><span class="src-var">$defaults</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1475"></a>&nbsp;</li>
<li><a name="a1476"></a></span><span class="src-str">        <span class="src-comm">//  If no value for this attribute found in $_REQUEST</span></span></li>
<li><a name="a1477"></a></span><span class="src-str"><span class="src-comm"></span>        <span class="src-comm">//  or the model, show today's date initially </span></span></li>
<li><a name="a1478"></a></span><span class="src-str"><span class="src-comm"></span>        <span class="src-var">$year</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodvalue">value</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1479"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$year</span><span class="src-sym">) </span><span class="src-str"></span><span class="src-sym">{</span></span></li>
<li><a name="a1480"></a></span><span class="src-str">            <span class="src-var">$year</span> =</span></li>
<li><a name="a1481"></a></span><span class="src-str">            <span class="src-sym">(</span><span class="src-id">is_array</span><span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_years">request_years</a><span class="src-sym">)</span></li>
<li><a name="a1482"></a>             &amp;&amp; <span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_years">request_years</a><span class="src-sym">))</span></li>
<li><a name="a1483"></a>            ? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#var$request_years">request_years</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">]</span></li>
<li><a name="a1484"></a>            : <span class="src-id">date</span><span class="src-sym">(</span><span class="src-str">&quot;Y&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1485"></a>        </span><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a1486"></a></span><span class="src-str">        <span class="src-key">return</span> <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/DateHelper.html#methodselect_year">select_year</a><span class="src-sym">(</span><span class="src-var">$year</span>.<span class="src-str">'-01-01'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1487"></a>    </span><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a1488"></a></span><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a1489"></a>&nbsp;</li>
<li><a name="a1490"></a></span><span class="src-str">/**</span></li>
<li><a name="a1491"></a></span><span class="src-str"> *  Make a new DateHelper object and call its select_date() method</span></li>
<li><a name="a1492"></a></span><span class="src-str"> *  @uses DateHelper::select_date()</span></li>
<li><a name="a1493"></a></span><span class="src-str">  */</span></li>
<li><a name="a1494"></a></span><span class="src-str"><span class="src-key">function</span> <span class="src-id">select_date</span><span class="src-sym">(</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a1495"></a></span><span class="src-str">    <span class="src-var">$date_helper</span> = <span class="src-key">new</span> <span class="src-id">DateHelper</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1496"></a></span><span class="src-str">    <span class="src-var">$args</span> = <span class="src-id">func_get_args</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1497"></a></span><span class="src-str">    <span class="src-key">return</span> <span class="src-id">call_user_func_array</span><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$date_helper</span><span class="src-sym">,</span> <span class="src-str">'select_date'</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-var">$args</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1498"></a></span><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a1499"></a>&nbsp;</li>
<li><a name="a1500"></a></span><span class="src-str">/**</span></li>
<li><a name="a1501"></a></span><span class="src-str"> *  Make a new DateHelper object and call its select_datetime() method</span></li>
<li><a name="a1502"></a></span><span class="src-str"> *  @uses DateHelper::select_datetime()</span></li>
<li><a name="a1503"></a></span><span class="src-str"> */</span></li>
<li><a name="a1504"></a></span><span class="src-str"><span class="src-key">function</span> <span class="src-id">select_datetime</span><span class="src-sym">(</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a1505"></a></span><span class="src-str">    <span class="src-var">$date_helper</span> = <span class="src-key">new</span> <span class="src-id">DateHelper</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1506"></a></span><span class="src-str">    <span class="src-var">$args</span> = <span class="src-id">func_get_args</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1507"></a></span><span class="src-str">    <span class="src-key">return</span> <span class="src-id">call_user_func_array</span><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$date_helper</span><span class="src-sym">,</span> <span class="src-str">'select_datetime'</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-var">$args</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1508"></a></span><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a1509"></a>&nbsp;</li>
<li><a name="a1510"></a></span><span class="src-str">/**</span></li>
<li><a name="a1511"></a></span><span class="src-str"> *  Make a new DateHelper object and call its select_expiration_date() method</span></li>
<li><a name="a1512"></a></span><span class="src-str"> *  @uses DateHelper::select_expiration_date()</span></li>
<li><a name="a1513"></a></span><span class="src-str"> */</span></li>
<li><a name="a1514"></a></span><span class="src-str"><span class="src-key">function</span> <span class="src-id">select_expiration_date</span><span class="src-sym">(</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a1515"></a></span><span class="src-str">    <span class="src-var">$date_helper</span> = <span class="src-key">new</span> <span class="src-id">DateHelper</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1516"></a></span><span class="src-str">    <span class="src-var">$args</span> = <span class="src-id">func_get_args</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1517"></a></span><span class="src-str">    <span class="src-key">return</span> <span class="src-id">call_user_func_array</span><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$date_helper</span><span class="src-sym">,</span> <span class="src-str">'select_expiration_date'</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-var">$args</span><span class="src-sym">)</span><span class="src-sym">;</span>        </span></li>
<li><a name="a1518"></a></span><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a1519"></a>&nbsp;</li>
<li><a name="a1520"></a></span><span class="src-str">/**</span></li>
<li><a name="a1521"></a></span><span class="src-str"> *  Make a new DateHelper object and call its datetime_select() method</span></li>
<li><a name="a1522"></a></span><span class="src-str"> *  @param string Name of an ActiveRecord subclass</span></li>
<li><a name="a1523"></a></span><span class="src-str"> *  @param string Name of an attribute of $object</span></li>
<li><a name="a1524"></a></span><span class="src-str"> *  @param mixed[] Format options</span></li>
<li><a name="a1525"></a></span><span class="src-str"> *  @uses DateHelper::datetime_select()</span></li>
<li><a name="a1526"></a></span><span class="src-str"> *  @see ActiveRecordHelper::to_scaffold_tag()</span></li>
<li><a name="a1527"></a></span><span class="src-str"> */</span></li>
<li><a name="a1528"></a></span><span class="src-str"><span class="src-key">function</span> <span class="src-id">datetime_select</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$attribute</span><span class="src-sym">,</span> <span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a1529"></a></span><span class="src-str">    <span class="src-var">$date_helper</span> = <span class="src-key">new</span> <span class="src-id">DateHelper</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$attribute</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1530"></a></span><span class="src-str">    <span class="src-key">return</span> <span class="src-var">$date_helper</span></span><span class="src-sym">-&gt;</span><span class="src-id">datetime_select</span><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;    </span></li>
<li><a name="a1531"></a></span><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a1532"></a>&nbsp;</li>
<li><a name="a1533"></a></span><span class="src-str">/**</span></li>
<li><a name="a1534"></a></span><span class="src-str"> *  Make a new DateHelper object and call its date_select() method</span></li>
<li><a name="a1535"></a></span><span class="src-str"> *  @param string Name of an ActiveRecord subclass</span></li>
<li><a name="a1536"></a></span><span class="src-str"> *  @param string Name of an attribute of $object</span></li>
<li><a name="a1537"></a></span><span class="src-str"> *  @param mixed[]  Output format options</span></li>
<li><a name="a1538"></a></span><span class="src-str"> *  @return string Generated HTML</span></li>
<li><a name="a1539"></a></span><span class="src-str"> *  @uses DateHelper::date_select()</span></li>
<li><a name="a1540"></a></span><span class="src-str"> *  @see ActiveRecordHelper::to_scaffold_tag()</span></li>
<li><a name="a1541"></a></span><span class="src-str"> */</span></li>
<li><a name="a1542"></a></span><span class="src-str"><span class="src-key">function</span> <span class="src-id">date_select</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$attribute</span><span class="src-sym">,</span> <span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a1543"></a></span><span class="src-str">    <span class="src-var">$date_helper</span> = <span class="src-key">new</span> <span class="src-id">DateHelper</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$attribute</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1544"></a></span><span class="src-str">    <span class="src-key">return</span> <span class="src-var">$date_helper</span></span><span class="src-sym">-&gt;</span><span class="src-id">date_select</span><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;    </span></li>
<li><a name="a1545"></a></span><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a1546"></a>&nbsp;</li>
<li><a name="a1547"></a></span><span class="src-str">/**</span></li>
<li><a name="a1548"></a></span><span class="src-str"> *  Make a new DateHelper object and call its year_select() method</span></li>
<li><a name="a1549"></a></span><span class="src-str"> *  @param string Name of an ActiveRecord subclass</span></li>
<li><a name="a1550"></a></span><span class="src-str"> *  @param string Name of an attribute of $object</span></li>
<li><a name="a1551"></a></span><span class="src-str"> *  @param mixed[] Format options</span></li>
<li><a name="a1552"></a></span><span class="src-str"> *  @uses DateHelper::year_select()</span></li>
<li><a name="a1553"></a></span><span class="src-str"> *  @see ActiveRecordHelper::to_scaffold_tag()</span></li>
<li><a name="a1554"></a></span><span class="src-str"> */</span></li>
<li><a name="a1555"></a></span><span class="src-str"><span class="src-key">function</span> <span class="src-id">year_select</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$attribute</span><span class="src-sym">,</span> <span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a1556"></a></span><span class="src-str">    <span class="src-var">$date_helper</span> = <span class="src-key">new</span> <span class="src-id">DateHelper</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$attribute</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1557"></a></span><span class="src-str">    <span class="src-key">return</span> <span class="src-var">$date_helper</span></span><span class="src-sym">-&gt;</span><span class="src-id">year_select</span><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;    </span></li>
<li><a name="a1558"></a></span><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a1559"></a>&nbsp;</li>
<li><a name="a1560"></a></span><span class="src-str">/**</span></li>
<li><a name="a1561"></a></span><span class="src-str"> *  Make a new DateHelper object and call its select_time() method</span></li>
<li><a name="a1562"></a></span><span class="src-str"> *  @param string Name of an ActiveRecord subclass</span></li>
<li><a name="a1563"></a></span><span class="src-str"> *  @param string Name of an attribute of $object</span></li>
<li><a name="a1564"></a></span><span class="src-str"> *  @param mixed[] Format options</span></li>
<li><a name="a1565"></a></span><span class="src-str"> *  @uses DateHelper::select_time()</span></li>
<li><a name="a1566"></a></span><span class="src-str"> *  @see ActiveRecordHelper::to_scaffold_tag()</span></li>
<li><a name="a1567"></a></span><span class="src-str"> */</span></li>
<li><a name="a1568"></a></span><span class="src-str"><span class="src-key">function</span> <span class="src-id">time_select</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$attribute</span><span class="src-sym">,</span> <span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a1569"></a></span><span class="src-str">    <span class="src-var">$date_helper</span> = <span class="src-key">new</span> <span class="src-id">DateHelper</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$attribute</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1570"></a></span><span class="src-str">    <span class="src-key">return</span> <span class="src-var">$date_helper</span></span><span class="src-sym">-&gt;</span><span class="src-id">time_select</span><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;    </span></li>
<li><a name="a1571"></a></span><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a1572"></a>&nbsp;</li>
<li><a name="a1573"></a></span><span class="src-str">/**</span></li>
<li><a name="a1574"></a></span><span class="src-str"> *  Make a new DateHelper object and call its expiration_date_select() method</span></li>
<li><a name="a1575"></a></span><span class="src-str"> *  @param string Name of an ActiveRecord subclass</span></li>
<li><a name="a1576"></a></span><span class="src-str"> *  @param string Name of an attribute of $object</span></li>
<li><a name="a1577"></a></span><span class="src-str"> *  @param mixed[] Format options</span></li>
<li><a name="a1578"></a></span><span class="src-str"> *  @uses DateHelper::expiration_date_select()</span></li>
<li><a name="a1579"></a></span><span class="src-str"> */</span></li>
<li><a name="a1580"></a></span><span class="src-str"><span class="src-key">function</span> <span class="src-id">expiration_date_select</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$attribute</span><span class="src-sym">,</span> <span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a1581"></a></span><span class="src-str">    <span class="src-var">$date_helper</span> = <span class="src-key">new</span> <span class="src-id">DateHelper</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$attribute</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1582"></a></span><span class="src-str">    <span class="src-key">return</span> <span class="src-var">$date_helper</span></span><span class="src-sym">-&gt;</span><span class="src-id">expiration_date_select</span><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;        </span></li>
<li><a name="a1583"></a></span><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a1584"></a>&nbsp;</li>
<li><a name="a1585"></a></span><span class="src-str">/**</span></li>
<li><a name="a1586"></a></span><span class="src-str"> *  Make a new DateHelper object and call its select_month() method</span></li>
<li><a name="a1587"></a></span><span class="src-str"> *</span></li>
<li><a name="a1588"></a></span><span class="src-str"> *  Generate HTML/XML for month selector pull-down menu using only</span></li>
<li><a name="a1589"></a></span><span class="src-str"> *  explicit month specification.&lt;br /&gt;</span></li>
<li><a name="a1590"></a></span><span class="src-str"> *  &lt;b&gt;NB:&lt;/b&gt;  An attempt to get value of an attribute will always</span></li>
<li><a name="a1591"></a></span><span class="src-str"> *  fail because there is no way to set</span></li>
<li><a name="a1592"></a></span><span class="src-str"> *  {@link DateHelper::object_name} and</span></li>
<li><a name="a1593"></a></span><span class="src-str"> *  {@link DateHelper::attribute_name}.</span></li>
<li><a name="a1594"></a></span><span class="src-str"> *  @uses DateHelper::select_month()</span></li>
<li><a name="a1595"></a></span><span class="src-str"> */</span></li>
<li><a name="a1596"></a></span><span class="src-str"><span class="src-key">function</span> <span class="src-id">select_month</span><span class="src-sym">(</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a1597"></a></span><span class="src-str">    <span class="src-var">$date_helper</span> = <span class="src-key">new</span> <span class="src-id">DateHelper</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1598"></a></span><span class="src-str">    <span class="src-var">$args</span> = <span class="src-id">func_get_args</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1599"></a></span><span class="src-str">    <span class="src-key">return</span> <span class="src-id">call_user_func_array</span><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$date_helper</span><span class="src-sym">,</span> <span class="src-str">'select_month'</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-var">$args</span><span class="src-sym">)</span><span class="src-sym">;</span>    </span></li>
<li><a name="a1600"></a></span><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a1601"></a>&nbsp;</li>
<li><a name="a1602"></a></span><span class="src-str">/**</span></li>
<li><a name="a1603"></a></span><span class="src-str"> *  Make a new DateHelper object and call its select_day() method</span></li>
<li><a name="a1604"></a></span><span class="src-str"> *  @uses DateHelper::select_day()</span></li>
<li><a name="a1605"></a></span><span class="src-str"> */</span></li>
<li><a name="a1606"></a></span><span class="src-str"><span class="src-key">function</span> <span class="src-id">select_day</span><span class="src-sym">(</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a1607"></a></span><span class="src-str">    <span class="src-var">$date_helper</span> = <span class="src-key">new</span> <span class="src-id">DateHelper</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1608"></a></span><span class="src-str">    <span class="src-var">$args</span> = <span class="src-id">func_get_args</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a1609"></a></span><span class="src-str">    <span class="src-key">return</span> <span class="src-id">call_user_func_array</span><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$date_helper</span><span class="src-sym">,</span> <span class="src-str">'select_day'</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-var">$args</span><span class="src-sym">)</span><span class="src-sym">;</span>    </span></li>
<li><a name="a1610"></a></span><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a1611"></a>&nbsp;</li>
<li><a name="a1612"></a></span><span class="src-str"><span class="src-comm">// -- set Emacs parameters --</span></span></li>
<li><a name="a1613"></a></span><span class="src-str"><span class="src-comm">// Local variables:</span></span></li>
<li><a name="a1614"></a></span><span class="src-str"><span class="src-comm">// tab-width: 4</span></span></li>
<li><a name="a1615"></a></span><span class="src-str"><span class="src-comm">// c-basic-offset: 4</span></span></li>
<li><a name="a1616"></a></span><span class="src-str"><span class="src-comm">// c-hanging-comment-ender-p: nil</span></span></li>
<li><a name="a1617"></a></span><span class="src-str"><span class="src-comm">// indent-tabs-mode: nil</span></span></li>
<li><a name="a1618"></a></span><span class="src-str"><span class="src-comm">// End:</span></span></li>
</ol></pre></div>
</div>
        <div class="credit">
		    <hr />
		    Documentation generated on Thu, 04 May 2006 19:47:26 -0600 by <a href="http://www.phpdoc.org">phpDocumentor 1.3.0RC4</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>
Return current item: PHP on Trax