{% include 'header.twig' %}

   <div class="content">
        <div id="page_info">

        </div>
        
<div class="def_wraper">
  <div class="container-fluid">
      <div class="row">
        <div class="col-md-12">
           <div class="card card_v2 mb-4">
              <div class="card-body">
                 <form action="/tickets" method="get" id="history-search">
                    <div class="input-group">
                       <input type="text" name="search" class="form-control" value="" placeholder="Search">
                       <span class="input-group-btn">
                       <button type="submit" class="btn btn-default"><i class="fa fa-search" aria-hidden="true"></i></button>
                       </span>
                    </div>
                 </form>
              </div>
           </div>
        </div>
     </div>
     <div class="row">
        <div class="col-md-6">
           <div class="card card_v2">
            <div class="card-header v2_header">
              <div class="new_order_tabs">
                 <ul class="nav nav-pills" id="pills-tab" role="tablist">
                    <li class="nav-item" role="presentation">
                       <button class="nav-link active" id="pills-order-tab" data-bs-toggle="pill" data-bs-target="#pills-order" type="button" role="tab" aria-controls="pills-order" aria-selected="true"> 
                          <span class="icon"><i class="fas fa-ticket-alt"></i></span>
                          <span class="text_name">  New Ticket</span>
                       </button>
                    </li>
                 </ul>
                </div>
           </div>
              <div class="card-body">
                 <div class="tab-content tab_wrap" id="pills-tabContent">
                    <div class="tab-pane fade show active" id="pills-order" role="tabpanel" aria-labelledby="pills-order-tab">
                     
                       
                      	<form method="post" action="" id="ticketsend"class="">
                      	        
                          <div class="alert alert-dismissible alert-danger ticket-danger " style="display: none">
                            <button type="button" class="close">×</button>
                            <div></div>
                          </div>
                          
                          	{% if error %}
                                <div class="alert alert-dismissible alert-danger ">
                                  {{ errorText }}
                                </div>
                              {% elseif success %}
                                <div class="alert alert-dismissible alert-success">
                                  {{ successText }}
                                </div>
                              {% endif %}
                              
                          <div class="siginInRow form-group">
                            <label class="control-label">Subject</label>
                          	<select id="subject" name="subject" class="form-control fg-control" data-class="form-control fg-control">
                                                                                 {% for subjects in orders %}
                       <option value"{{ subjects['subject'] }}">{{ subjects['subject'] }}</option>
                      {% endfor %}
                                                                                          </select>
                          </div>
                         
                         
                             <div class="siginInRow form-group ticket-textarea" >
                              <label class="control-label">Message</label>    
                             <textarea class="form-control" rows="4" cols="50" id="message" name="message" style="min-height: 100px; display: block;">{{ data['message'] }}</textarea>
                            </div>    
                            
                         
                         
                         
                             <button type="submit" class="btn btn-primary d-blc w-100" id="sendTicket">Submit ticket</button>
                          </span>
                        </form>



                    </div>
                
                 

                 </div>
              </div>
           </div>
        </div>
      
      
      <div class="col-md-6">
           <div class="card card_v2">
            <div class="card-header v2_header">
              <div class="new_order_tabs">
                 <ul class="nav nav-pills" id="pills-tab" role="tablist">
                    <li class="nav-item" role="presentation">
                        <button class="nav-link active" id="pills-favorite-tab" data-bs-toggle="pill" data-bs-target="#pills-favorite" type="button" role="tab" aria-controls="pills-favorite" aria-selected="false"> 
                          <span class="icon"><i class="fas fa-history"></i></span>
                          <span class="text_name">  Ticket History</span>
                       </button>
                    </li>
                 </ul>
                </div>
           </div>
              <div class="card-body">
                <div class="tab-content tab_wrap" id="pills-tabContent">
                  <div class="tab-pane fade show active" id="pills-favorite" role="tabpanel" aria-labelledby="pills-favorite-tab">
                        
                    <div class="btn-group w-100 gap-2" role="group" id="ticket_filter_wrap">
                      <button type="button" class="btn btn-secondary ticket_btn_active" id="ticket_all" onclick="showAll()">All</button>
                    <!--  <button type="button" class="btn btn-secondary" id="ticket_pending" onclick="showPending()">Pending</button>
                      <button type="button" class="btn btn-secondary" id="ticket_answered" onclick="showAns()">Answered</button> -->
                    </div>
                  
                    
                                         <!-- ticket item Edited -->
                                             {% for ticket in ticketList %}
                                            
                      <a href="tickets/{{ ticket['ticket_id'] }}" class="ticket_link ticket_status_Closed" >
                         <div class="ticket_item ticket_Closed">
                            <div class="item_left text-start">
                                <div class="ticket_icon">
                                    <i class="fas fa-ticket-alt"></i>
                                </div>
                                <div>
                                  <h3>{{ ticket['subject'] }}</h3>
                                  <p>{{ ticket['status'] }}</p>
                                </div>
                            </div>
                            <div class="item_right text-end">
                                <p>#{{ ticket['ticket_id'] }}</p>
                                <p>{{ ticket['lastupdate_time'] }}</p>
                            </div>
                        </div>
                      </a>
                      {% endfor %}
                      <!-- ## ticket item Edited -->
                                                            

                                          

                
                  </div>
                </div>
              </div>
           </div>
        </div>
     </div>
  </div>
</section>



{% include 'footer.twig' %}
