{% include 'header.twig' %}
      <div class="content">
        <!-- page and other top info -->
        <div id="page_info">

        </div>
        <!-- // page and other top info -->
        <section id="tickets_page">
  <div class="container-fluid">
     <div class="row">
        <div class="col-md-8">
           <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-8">
           <div class="card card_v2">
              <div class="card-body">
                 <div  id="newOrderTabsWrap">
                    <ul class="nav nav-pills tab_btn_wrap mb-3" 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"> <i class="fas fa-ticket-alt"></i> New Ticket</button>
                       </li>

                    </ul>
                 </div>
							        {% if error %}
        <div class="alert alert-dismissible alert-danger {% if site['rtl'] %} rtl-alert {% endif %}">
          <button type="button" class="close" data-dismiss="alert">×</button>
          {{ errorText }}
        </div>
      {% elseif success %}
        <div class="alert alert-dismissible alert-success {% if site['rtl'] %} rtl-alert {% endif %}">
          <button type="button" class="close" data-dismiss="alert">×</button>
          {{ successText }}
        </div>
      {% endif %}
      
      
                      	<form method="post" action="" id="ticketsend"class="">
                      	        
                          <div class="alert alert-dismissible alert-danger ticket-danger " style="display: none">
                            <button type="button" class="close">&times;</button>
                            <div></div>
                          </div>
								       
									<div class="form-group subject-panel">
									  <label for="select_subject" class="form-label">Subject</label>
<select  type="text" class="form-control" id="subject" name="subject">
                                  {% 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-lg-8">
           <div class="card card_v2">
            <div class="card-header v2_header">
              

              <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="tickets-list__margin-table">
                                <div class="table-bg component_table ">
                                    <div class="table-wr table-responsive">
                                        <table class="table">
                                            <thead>
                                            <tr>
                                                <th><span class="">ID</th>
                                                <th><span class="">Subject</th>
                                                <th><span class="">Status</th>
                                                <th class="nowrap"><span class="">Last update</th>
                                            </tr>
                                            </thead>
                                            <tbody>
              {% for ticket in ticketList %}
                <tr>
                  <td>{{ ticket['ticket_id'] }}</td>
                  {% if ticket["support_new"] == 2 %}
                    <td><a href="tickets/{{ ticket['ticket_id'] }}"><strong>{{ ticket['subject'] }}</strong></a></td>
                  {% else %}
                    <td><a href="tickets/{{ ticket['ticket_id'] }}">{{ ticket['subject'] }}</a></td>
                  {% endif %}
                  <td>                    
                      
                      
                      {% if ticket['status'] == lang['tickets.status.answered'] %}
								<div class="ordStatus align-items-center" style="background: #28a745; color:#000; border-radius: 15px; padding: 5px 15px; font-size: 12px; text-align: center;">
								   <i class="ri-checkbox-line"></i>
								   <span style="color:#ffffff">{{ticket['status']}}</span>
								</div>
								{% endif %}
								
              {% if ticket['status'] == lang['tickets.status.all'] %}
								<div class="ordStatus align-items-center" style="background: #ff870b; color:#000; border-radius: 15px; padding: 5px 15px; font-size: 12px; text-align: center;">
								   <i class="ri-loader-2-line"></i>
								   <span style="color:#ffffff">{{ticket['status']}}</span>
								</div>
								{% endif %}
                
                {% if ticket['status'] == lang['tickets.status.pending'] %}
								<div class="ordStatus align-items-center" style="background: #0000ff; color:#000; border-radius: 15px; padding: 5px 15px; font-size: 12px; text-align: center;">
								   <i class="ri-file-damage-line"></i>
								   <span style="color:#ffffff">{{ticket['status']}}</span>
								</div>
								{% endif %}
								
								{% if ticket['status'] == lang['tickets.status.expired'] %}
								<div class="ordStatus align-items-center" style="background: #11698e; color:#000; border-radius: 15px; padding: 5px 15px; font-size: 12px; text-align: center;">
								   <i class="ri-star-half-line"></i>
								   <span style="color:#ffffff">{{ticket['status']}}</span>
								</div>
								{% endif %}
								
									{% if ticket['status'] == lang['tickets.status.paused'] %}
								<div class="ordStatus align-items-center" style="background: #61c0bf; color:#000; border-radius: 15px; padding: 5px 15px; font-size: 12px; text-align: center;">
								   <i class="ri-remote-control-line"></i>
								   <span style="color:#000">{{ticket['status']}}</span>
								</div>
								{% endif %}
								
								
									{% if ticket['status'] == lang['tickets.status.closed'] %}
								<div class="ordStatus align-items-center" style="background: #ec4646; color:#000; border-radius: 15px; padding: 5px 15px; font-size: 12px; text-align: center;">
								   <i class="ri-qr-scan-line"></i>
								   <span style="color:#ffffff">{{ticket['status']}}</span>
								</div>
								{% endif %}
                      
                      </td>
                  <td><span class="nowrap">{{ ticket['lastupdate_time'] }}</span></td>
                </tr>
              {% endfor %}
                              </div>  
							
							
							
							
							
							
							
						  							  </div>
						   </div>
						</div>
					 </div>
				</div>
			 </div>
         </div>
      </main>              
                                               
                                               
                                               
                                               
                                               
                                               
                                               
                                               
                                               
                                               
                                               
                                               
              
{% include 'footer.twig' %}