output awaiting user response ticket number !

Discussion in 'Templates customization' started by joshans, Nov 15, 2015.

  1. joshans

    joshans New Member

    Joined:
    Nov 15, 2015
    Messages:
    2
    hi i want ask that

    how output awaiting user response ticket number ! in any part of my theme ?
    i want show this message
    You have %s%d ticket(s)%s that require your attention

    but numbers only in another part theme
    any code like
    <?php echo " %s%d" ;?>
    but not work
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    There is not special variable for it but you can retrieve it from database. Here is example:
    PHP:
    <?php
    $cnt 
    $di->db->selectCell("SELECT COUNT(ticket_id)
        FROM ?_helpdesk_ticket
        WHERE status IN (?a)
            AND user_id=?"
    ,
        array(
    HelpdeskTicket::STATUS_AWAITING_USER_RESPONSE),
       
    $di->user->pk());
    echo 
    $cnt;
    ?>
    Here is useful link with guide how to execute queries in database
    http://www.amember.com/docs/API/Db
  3. joshans

    joshans New Member

    Joined:
    Nov 15, 2015
    Messages:
    2
    thank you very much , you make my day

Share This Page