{% include 'header.twig' %}
      
      
      
        
        <!-- Main variables *content* -->
        <!-- 
	Theme: MotherSmm V1
	Theme Author: Maruf Ahmed Raj
	Phone: +8801603746079(whatsapp)
 -->
<style>
  .order-actions{
        display: none;
  }
  .status_capsule.status_Completed.Completed{
    background: #1cb474 !important;
  }
  .status_capsule.status_Completed.Canceled{
        background: #ff0018 !important;
  }
  .status_capsule.status_Completed.In.progress{
        background: #ffc107 !important;
  }
  .status_capsule.status_Completed.Pending{
        background: #8e00b3 !important;
  }
</style>  












<!-- Main variables *content* -->
        <main class="auth">
                    <div class="about_us_effect">
            <img
              src="https://smmxz.sacloud.site/images/about-us-page-left-image.png"
              class="img-fluid about_us_img_left"
              alt=""
            />
            <img
              src="https://smmxz.sacloud.site/images/about-us-page-right-image.png"
              class="img-fluid about_us_img_right"
              alt=""
            />
          </div>

    <!-- Order Search Box -->
    <div class="search__box">
        <div class="container-fluid">
            <div class="row">
                <div class="col-lg-12">
                    <div class="card card_v2 mb-3">
                        <div class="card-body">
                            <form action="/orders" method="get" id="history-search">
                                <div class="search_inputs ">
                                    <div class="search">
                                        <input type="text" class="search_input" placeholder="Search" name="search" data-search-service="#service-table" id="filterServicesInput" value="{{ search }}" />
                                        <button type="submit" class="icon" data-filter-serch-btn="true">
                                            <iconify-icon icon="material-symbols:search"></iconify-icon>
                                        </button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- ### Order Search Box -->

    <!-- Orders Filter Buttons -->
    <div class="orders__filter__btn mb-3">
        <div class="container-fluid">
            <div class="row">
                <div class="col-lg-12 col-12">
                    <div class="order__filters">
                        <a href="/orders" class="btn btn__orders__filter {% if 'all' == status %} active {% endif %}">
                            <div class="icon">
                                <iconify-icon icon="mingcute:settings-6-line"></iconify-icon>
                            </div>
                            <div class="text">All</div>
                        </a>
                        <a href="/orders/pending" class="btn btn__orders__filter {% if 'pending' == status %} active {% endif %}">
                            <div class="icon">
                                <iconify-icon icon="ic:baseline-sync"></iconify-icon>
                            </div>
                            <div class="text">Pending</div>
                        </a>
                        <a href="/orders/inprogress" class="btn btn__orders__filter {% if 'inprogress' == status %} active {% endif %}">
                            <div class="icon">
                                <iconify-icon icon="ph:hourglass-high-duotone"></iconify-icon>
                            </div>
                            <div class="text">In progress</div>
                        </a>
                        <a href="/orders/completed" class="btn btn__orders__filter {% if 'completed' == status %} active {% endif %}">
                            <div class="icon">
                                <iconify-icon icon="solar:check-circle-broken"></iconify-icon>
                            </div>
                            <div class="text">Completed</div>
                        </a>
                        <a href="/orders/partial" class="btn btn__orders__filter {% if 'partial' == status %} active {% endif %}">
                            <div class="icon">
                                <iconify-icon icon="solar:stop-circle-linear"></iconify-icon>
                            </div>
                            <div class="text">Partial</div>
                        </a>
                        <a href="/orders/processing" class="btn btn__orders__filter {% if 'processing' == status %} active {% endif %}">
                            <div class="icon">
                                <iconify-icon icon="ic:baseline-sync-lock"></iconify-icon>
                            </div>
                            <div class="text">Processing</div>
                        </a>
                        <a href="/orders/canceled" class="btn btn__orders__filter {% if 'canceled' == status %} active {% endif %}">
                            <div class="icon">
                                <iconify-icon icon="carbon:close-outline"></iconify-icon>
                            </div>
                            <div class="text">Canceled</div>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- #### Orders Filter Buttons -->


<section id="table">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12">
               <div class="card card_v2">
                   <div class="card-body">
                        <div class="responsive-table def_table">
                            <div class="table-responsive">
                                <table class="table order_page" id="service-table">
                                    <thead>
                                        <tr>
                                            <th scope="col">ID</th>
                                            <th scope="col">Date</th>
                                            <th scope="col">Link</th>
                                            <th scope="col">Charge</th>
                                            <th scope="col">Start count</th>
                                            <th scope="col">Quantity</th>
                                            <th scope="col">Service</th>
                                            <th scope="col">Remains</th>
                                            <th scope="col">Status</th>
                                            <th scope="col">Complete details</th>
                                                             <th></th>                        
                                        </tr>
                                    </thead>
                                    <tbody>
                                          
                                           {% for order in orders %}
              <tr>
<td>
<span class="order_id" id="order-{{ order['id'] }}">{{ order['id'] }}</span>
{% if order['order_where'] == "api"  %}<a class="btn btn-actions">Api</a>{% endif %} </td>




                <td>
                <div class="order_date">
                                                {{ order['date'] }}
                                            </div>
                </td>
                
                
                <td>
                <div class="order_link_wrap">
                                                <a href="{{ order['link'] }}" target="_blank" class="order_link">
                                                    <span> <i class="far fa-link"></i> {{ order['link'] }}</span>
                                                </a>
                                            </div></td>
            
            
                 <td>{{order["charge"]}}</td>
                <td class="nowrap">{{ order['start_count'] }}</td>
                <td>{{ order['quantity'] }}</td>
                <td>{{ order['service'] }}</td> 
                <td>{{ order['remains'] }}</td>

           <td>{{ order['remains'] }}</td>
<td>
    {% if order['status'] == lang['orders.status.completed'] %}
        <div class="ordStatus align-items-center" style="background: #28a745; color:#fff; border-radius: 15px; padding: 6px 15px; font-size: 14px; text-align: center;">
            <i class="ri-checkbox-line"></i>
            <span>{{ order['status'] }}</span>
        </div>
      
    {% elseif order['status'] == lang['orders.status.inprogress'] %}
        <div class="ordStatus align-items-center" style="background: #ff870b; color:#fff; border-radius: 15px; padding: 6px 15px; font-size: 14px; text-align: center;">
            <i class="ri-loader-2-line"></i>
            <span>{{ order['status'] }}</span>
        </div>
    {% elseif order['status'] == lang['orders.status.pending'] %}
        <div class="ordStatus align-items-center" style="background: #ffcc29; color:#fff; border-radius: 15px; padding: 6px 15px; font-size: 14px; text-align: center;">
            <i class="ri-file-damage-line"></i>
            <span>{{ order['status'] }}</span>
        </div>
    {% elseif order['status'] == lang['orders.status.partial'] %}
        <div class="ordStatus align-items-center" style="background: #11698e; color:#fff; border-radius: 15px; padding: 6px 15px; font-size: 14px; text-align: center;">
            <i class="ri-star-half-line"></i>
            <span>{{ order['status'] }}</span>
        </div>
    {% elseif order['status'] == lang['orders.status.processing'] %}
        <div class="ordStatus align-items-center" style="background: #61c0bf; color:#fff; border-radius: 15px; padding: 6px 15px; font-size: 14px; text-align: center;">
            <i class="ri-remote-control-line"></i>
            <span>{{ order['status'] }}</span>
        </div>
    {% elseif order['status'] == lang['orders.status.canceled'] %}
        <div class="ordStatus align-items-center" style="background: #ec4646; color:#fff; border-radius: 15px; padding: 6px 15px; font-size: 14px; text-align: center;">
            <i class="ri-qr-scan-line"></i>
            <span>{{ order['status'] }}</span>
        </div>
    {% endif %}
</td>
								
								
								
								
						
     
             <td>
{% if order["refillButton"] == "2" %}
{% if order['status'] == "Completed"  %}
{% if order['show_refill'] == "true"  %}
<a class="btn btn-actions order_id" href="orders/refill/{{order['id']}}" class="btn btn-sm refill-button order_id">Refill</a>
<br><br>
{% endif %}
{% endif %}
{% endif %}
{% if order["refillButton"] == "3" %}
{% if order['status'] == "Completed"  %}
{% if order['show_refill'] == "true"  %}
  <button class="btn btn-actions order_id" data-tippy-content="Refill will be available in {{order['refillTimeLeft']}}" class="btn btn-sm refill-button order_id">Refill</button>
{% endif %}
{% endif %}
{% endif %}
{% if order["refillButton"] == "4" %}
{% if order['status'] == "Completed"  %}
{% if order['show_refill'] == "true"  %}
<button class="btn btn-actions order_id badges_inprogress" type="button" class="btn btn-sm refill-button order_id badges_inprogress" disabled="true">{{"Refilling"}}</button>
{% endif %}
{% endif %}
{% endif %}
{% if order['cancelButton']   == true %}
                   <a  class="btn btn-actions order_id order_status_badges badges_canceled" href="orders/cancel/{{order['id']}}" class="btn btn-actions order_id order_status_badges badges_canceled">cancel</a>
               {% endif %}

                 </td>    
                 
               
      {% if order.duration %}
            <td style="margin-top: 5px; font-size: 12px;">
                {{ order.duration }}
            </td>
        {% endif %}
                 
              </tr>
            {% endfor %}

          </tbody>
        </table>
      </div>

      {% if pagination["count"] > 1 %}
        <ul class="pagination">

          {% if pagination["current"] != 1 %}
            <li>
              <a class="btn btn-actions" href="orders/{{ status }}/{{ pagination["previous"] }}{% if search %}?search={{ search }}{% endif %}" aria-label="Previous">
                <span aria-hidden="true">«</span>
              </a>
            </li>
          {% endif %}

          {% set r, l = 3, 3 %}

          {% if pagination['current'] == 1 %}
            {% set r = 7 %}
          {% endif %}

          {% if pagination['current'] == 2 %}
            {% set r = 5 %}
          {% endif %}

          {% if pagination['current'] >= pagination['count'] %}
            {% set l = 5 %}
          {% endif %}

          {% for page in 1..pagination["count"] %}
            {% if page >= (pagination['current']-l) and page <= (pagination['current']+r) %}
              <li{% if page == pagination['current'] %} class="active" {%endif%}><a class="btn btn-actions" 
 href="orders/{{ status }}/{{ page }}{% if search %}?search={{ search }}{% endif %}">{{ page }}</a></li>
            {%endif%}
          {% endfor %}

          {% if pagination['current'] < pagination['count'] %}
            <li>
              <a class="btn btn-actions" href="orders/{{ status }}/{{ pagination['next'] }}{% if search %}?search={{ search }}{% endif %}" aria-label="Next">
                <span aria-hidden="true">»</span>
              </a>
            </li>
          {% endif %}

        </ul>
      {% endif %}
      
      </tbody>
                                </table>
                                                            </div>
                    </div>
                   </div>
               </div>
            </div>
        </div>
    </div>
</section>

                </div>
            </div>
        </main>


                    <script type="text/javascript"  src="https://storage.perfectcdn.com/libs/jquery/1.12.4/jquery.min.js" >
                            </script>
                    <script type="text/javascript"  src="https://storage.perfectcdn.com/global/6lea6p5h1se0ydlc.js" >
                            </script>
                    <script type="text/javascript"  src="https://storage.perfectcdn.com/global/lpckws4jmmcjpzoh.js" >
                            </script>
                    <script type="text/javascript"  src="https://storage.perfectcdn.com/global/41oyxac8gg4eoke6.js" >
                            </script>
                    <script type="text/javascript"  src="https://storage.perfectcdn.com/global/dmabhtcke4de93dz.js" >
                            </script>
                    <script type="text/javascript"  src="https://storage.perfectcdn.com/global/7hl6zfgduel1sfu0.js" >
                            </script>
                    <script type="text/javascript"  src="https://storage.perfectcdn.com/o9v0gb/umnk9pmrxf8674fk.js" >
                            </script>
                    <script type="text/javascript" >
                window.modules.layouts = {"theme_id":1,"auth":1,"live":true,"csrftoken":"0OyIpy6hNZjqZ7_asDa6ZXBD4U-skyQGv8uBhEBPawKIusr-WpRv7IZR3puCcfsDKhuifcLQUVf1_Mv-JgRZaw=="};
            </script>
                    <script type="text/javascript" >
                window.modules.siteOrdersList = {"pageUrl":"\/orders"};
            </script>
                    <script type="text/javascript" >
                window.modules.alerts = {"alerts":[]};
            </script>
                    <script type="text/javascript" >
                            </script>

  <script type="text/javascript" >
     window.modules.layouts = {"auth":0};   </script>
  <script type="text/javascript" >
     window.modules.signin = [];   </script>
  <script type="text/javascript" >
      </script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.27.6/js/jquery.tablesorter.js"></script>
<script type="text/javascript" >
window.modules.siteOrder = {""}; </script>
<script type="text/javascript" >
window.modules.select = [];   </script>
<script src="public/script.js"></script>
