Appointment system, checking if person is availaible at particular time
<p>i am working on an appointment system, the problem i am facing is in a function where i want to check if the <em>person</em> with whom <em>someone</em> wants to book an appointment is available at that time or not. </p>

<p>each <em>person</em> has fixed daily time slot for example 02:00:00 to 04:30:00 during which <em>anyone</em> can contact him/her, now when booking appointment, i wanna check if <em>person</em> is available at the time when <em>someone</em> is willing to book an appointment or not.</p>

<p>here is the code:</p>

<pre><code>    $strtTime = $PA[0]['starttime'];   //02:00:00
    $endTime = $PA[0]['endtime'];    //04:30:00        

    $expectedTime = date('g:i:s', strtotime($dteTime));   // $dteTime = 2010-12-31 02:30


    if($strtTime &lt; $expectedTime &amp;&amp; $endTime &gt; $expectedTime) // the second condition is returning false
    {
        echo "PAA is available";
    }
    else
    {
        echo  "PAA is not available at that time slot.";
        exit();           
    }
</code></pre>
