SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to create office Time script.

    I am developing Help Desk application but I want to set office hours in it.
    If user drop the call at 5.25Pm and call resloution time will be 2hrs then due time show the next day (if not holiday) 10.20AM .

    Kindly please help me for the script.

    Regards
    Girish

  2. #2
    SitePoint Addict kduv's Avatar
    Join Date
    May 2012
    Location
    Atlanta, GA
    Posts
    244
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Here's a rough example of how you "could" do it. It doesn't take into account the day of the week (weekends, etc) or holidays, but it should get you on the right track to making your own custom function. The date/time functions in PHP give you everything you need. If you want to hire someone to code it for you, that's a different story.
    PHP Code:
    <?php
        
        
        
    function setDueTime()
        {
            
    $open '0800'// 8:00am
            
    $close '1700'// 5:00pm
            
    $responseTime '0200'// 2 Hours
            
    $now date('Hi');
            
            if ((
    $now $responseTime) > $close)
            {
                
    // If the due time is aftern business close, add the remaining due time to the opening of next day
                
    return (($now $responseTime) - $close) + $open;
            } else {
                
    // There's enough time to complete before close of business
                
    return $now $responseTime;
            }
            
        }
    ?>
    Last edited by kduv; May 28, 2012 at 18:21. Reason: Oops, syntax error


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •