{% include 'header.twig' %}
    <div id="page-wrapper">
      <div class="inner-page-wrapper"><script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js">
      </script> 
 <script>
  	function copyToClipboard(element) {
      var $temp = $("<input>");
      $("body").append($temp);
      $temp.val($(element).text()).select();
      document.execCommand("copy");
      $temp.remove();
     }
</script>
<style>
  .width-service-name {
    min-width: 329px;
    width: 329px !important;
  } 
</style>

<div class="container-fluid service-page order-page">
  <div class="row">
    <div class="col-lg-12">
      <div class="well">
    <form action="" method="get" id="history-search">
        <div class="input-group">
        <input type="text" name="search" class="form-control" value="{{ search }}" placeholder="Search refill by order id">
          <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 class="table-responsive">
          <table class="table ">
            <thead>
              <tr>
             <th>Order ID</th>
              
              <th>Date</th>
              <th>Link</th>
              <th>Status</th>        </tr>
            </thead>
            <tbody>
            
            {#reject - #702283#}
{#completed-0e7f00#}
{#inprogress-0721ed#}
{#pending-42b7af#}
{#error-f71111#}

            {% for order in orders %}
              <tr>
                <td><a href="orders/?search={{order['id']}}">{{ order['id'] }}</a></td>
               
                <td>{{ order['date'] }}</td>
                 <td><a   target="_blank" href="{{ order['link'] }}">{{ order['link'] }}</a></td>   
                <td><div style=" line-height:{% if order['status'] == "In progress" %}1 {% endif %}; cursor:pointer; padding:3px 5px;  text-align:center; border-radius:20px; color:white; background:#{% if order['status'] == "Completed"  %}0e7f00 {% elseif order['status'] == "In progress" %}260bc1  {% elseif order['status'] == "Pending" %}42b7af {% elseif order['status'] == "Processing" %}42b7af {% elseif order['status'] == "Rejected" %}702283 {% else %}f25800 {% endif %} ;" >{{ order['status'] }}</div></td>
               
              </tr>
            {% endfor %}

          </tbody>
        </table>
      </div>
    <br>
{% if pagination["count"] > 1 %}
        <ul class="pagination">

          {% if pagination["current"] == 1 %}
            <li>
              <a href="refill/{{ 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) %}
              <div style="border:1px solid rgb(128,128,128); padding:4px; margin-left:8px; min-width:21px; text-align:center;"><li{% if page == pagination['current'] %} class="active" {%endif%}><a href="refill/{{ status }}/{{ page }}{% if search %}?search={{ search }}{% endif %}">{{ page }}</a></li></div>
            {%endif%}
          {% endfor %}

          {% if pagination['current'] < pagination['count'] %}
            <li>
              <a style="margin-left:8px;" href="refill/{{ status }}/{{ pagination['next'] }}{% if search %}?search={{ search }}{% endif %}" aria-label="Next">
                <span aria-hidden="true">»</span>
              </a>
            </li>
          {% endif %}

        </ul>
      {% endif %}

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




<br><br><br><br><br>
{% include 'footer.twig' %}