{% include 'header.twig' %}
<div id="content-wrap">
        <div class="section">
          <div class="container collapse-view ">
            <div class="text-content">
              <div class="row">
                <div class="col-6 mb-2">You are currently on:   <strong>Child Panels</strong></div>
                <div class="col-6 mb-2">Welcome,   <strong>{{ user['username'] }}</strong>! Your balance is <strong>{% if settings['site_currency'] == "TRY" %}{{ "&#8378;" }}
                {% elseif settings['site_currency'] == "USD" %}{{ "&#36;" }}
                {% else %}{{ "₹" }}
                {% endif %}{{ user['balance'] }}</strong></div>
              </div>
            </div>

            
    {% if error %}
      <div class="alert alert-dismissible alert-danger">
          <button type="button" class="close" data-dismiss="alert">&times;</button>
        {{ errorText }}
      </div>
    {% endif %}  

    {% if data["childpanel"]["success"] == 1 %}
      <div class="alert alert-dismissible alert-success">
          <strong> Order Id: </strong> {{ data['childpanel']['id'] }} <br>
          <strong> Service: </strong> {{ data['childpanel']['service'] }} <br>
          <strong> Domain: </strong> {{ data['childpanel']['link'] }} <br>
          <strong> Quantity: </strong> {{ data['childpanel']['quantity'] }} <br>
          <strong> Charge: </strong> {{ data['childpanel']['price'] }} <br>
      </div>
    {% endif %}
    
    {% if data["childpanel"]["success"] == 2 %}
      <div class="alert alert-dismissible alert-success">
          <strong> Order Id: </strong> {{ data['childpanel']['id'] }} <br>
          <strong> Child Panel Renewed Successfully</strong>
      </div>
    {% endif %}
  
<div class="account-info wrapper-box">
  <div class="button-bar">
      <a id="tab-add-btn" onclick="payment()" class="btn btn-primary tab-head">Order Child Panel</a>
      <a id="tab-history-btn" onclick="detail()" class="btn btn-secondary tab-head ml-2">CHECK HISTORY</a>
   </div>
  
  <div class="row">
        <div class="col-lg-12 tab-content" id="tab-add">
            
            <div class="alert alert-info">
    <p style="margin-bottom: 5px">Please visit your registrar's dashboard to change nameservers to:</p>
                              <ul style="padding-left: 20px">
                                  <li>{{ site['ns1'] }}</li>
                                  <li>{{ site['ns2'] }}</li>
                              </ul>
  </div>

  <form action="/child-panels" method="post">

    <div class="row">
      <div class="col-sm-6"><input type="link" class="form-control" id="domain" name="domain" value="" placeholder="DOMAIN"></div>
      <div class="col-sm-6">
        <select class="form-control" id="createorderform-currency" name="currency">
                      <option value="USD" >
              United States Dollars (USD)
            </option>
                      <option value="RUB" >
              Russian Rubles (RUB)
            </option>
                      <option value="THB" >
              Thai Baht (THB)
            </option>
                      <option value="TRY" >
              Turkish Lira (TRY)
            </option>
                      <option value="EUR" >
              Euro (EUR)
            </option>
                      <option value="IDR" >
              Indonesian Rupiah (IDR)
            </option>
                      <option value="BRL" >
              Brazilian Real (BRL)
            </option>
                      <option value="CNY" >
              Chinese Yuan (CNY)
            </option>
                      <option value="KRW" >
              South Korean Won (KRW)
            </option>
                      <option value="INR" >
              Indian Rupee (INR)
            </option>
                      <option value="IRR" >
              Iranian Rial (IRR)
            </option>
                      <option value="SAR" >
              Saudi Arabia Riyal (SAR)
            </option>
                      <option value="PLN" >
              Polish złoty (PLN)
            </option>
                      <option value="MYR" >
              Malaysian Ringgit (MYR)
            </option>
                      <option value="GBP" >
              Pound sterling (GBP)
            </option>
                      <option value="KWD" >
              Kuwaiti dinar (KWD)
            </option>
                      <option value="SEK" >
              Swedish krona (SEK)
            </option>
                      <option value="ILS" >
              Israeli shekel (ILS)
            </option>
                      <option value="HKD" >
              Hong Kong dollar (HKD)
            </option>
                      <option value="NGN" >
              Nigerian naira (NGN)
            </option>
                      <option value="KES" >
              Kenyan shilling (KES)
            </option>
                      <option value="JPY" >
              Japanese Yen (JPY)
            </option>
                      <option value="ARS" >
              Argentine peso (ARS)
            </option>
                      <option value="VND" >
              Vietnamese đồng (VND)
            </option>
                      <option value="CAD" >
              Canadian dollar (CAD)
            </option>
                      <option value="IQD" >
              Iraqi dinar (IQD)
            </option>
                      <option value="TWD" >
              New Taiwan Dollars (TWD)
            </option>
                      <option value="AZN" >
              Azerbaijani manat (AZN)
            </option>
                      <option value="BYN" >
              Belarusian ruble (BYN)
            </option>
                      <option value="KZT" >
              Kazakhstani tenge (KZT)
            </option>
                      <option value="UAH" >
              Ukrainian hryvnia (UAH)
            </option>
                      <option value="RON" >
              Romanian leu (RON)
            </option>
                      <option value="AED" >
              United Arab Emirates dirham (AED)
            </option>
                      <option value="COP" >
              Colombian peso (COP)
            </option>
                      <option value="PKR" >
              Pakistan Rupee (PKR)
            </option>
                      <option value="EGP" >
              Egyptian Pound (EGP)
            </option>
                  </select>
      </div>
      <div class="col-sm-6"><input type="text" class="form-control" id="createorderform-username" name="username" value="" placeholder="ADMIN USERNAME"></div>
      <div class="col-sm-6"><input type="password" class="form-control" id="createorderform-password" name="password" placeholder="ADMIN PASSWORD"></div>
      <div class="col-sm-12">
        <div class="label-text"><input type="password" class="form-control" id="createorderform-password_confirm" name="password_confirm" placeholder="CONFIRM PASSWORD"><span id="price">CHARGE {% if settings['site_currency'] == "TRY" %}{{ "&#8378;" }}
                {% elseif settings['site_currency'] == "USD" %}{{ "&#36;" }}
                {% else %}{{ "₹" }}
                {% endif %}{{ site['childpanel_price'] }}</span></div>
      </div>
      <div class="col-md-12"><button type="submit" class="btn btn-primary btn-block btn-shadow"><strong>SUBMIT</strong> NOW</button></div>
  </div>
  </form>
  </div>
  
     <div class="col-lg-12 tab-content" id="tab-history" style="display: none;">
      <div class="">
        <div class="">
          
          <div class="">
              <div class="table-responsive custom-table">
            <table class="table ">
              <thead>
            <tr>
              <th>#</th>
              <th>Domain</th>
              <th>Currency</th>
              <th class="width-40">Username</th>
              <th>Password</th>
              <th class="nowrap">Date</th>
              <th class="nowrap">Status</th>
            </tr>
          </thead>
          <tbody>

            {% for logs in chilpanel_logs %}
              <tr>
                <td>{{ logs['id'] }}</td>
                <td>{{ logs['domain'] }}</td>
                <td>{{ logs['currency'] }}</td>
                <td class="width-40">{{ logs['child_username'] }}</td>
                <td>{{ logs['child_password'] }}</td>
                <td class="nowrap">{{ logs['date_created'] }}</td>
                <td class="nowrap">
                {% if logs['status'] == "terminated" %}<form action="/child-panels" method="post"><input name="renew_id" type="hidden" value="{{ logs['id'] }}"/><input type="submit" name="renew" class="btn btn-primary" value="Renew"></form>
                {% elseif logs['status'] == "active" %}<button class="btn btn-primary">Active</button>
                {% else %}<button class="btn btn-secondary">Disabled</button>
                {% endif %}
                </td>
              </tr>
            {% endfor %}

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

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


  
          </div>
        </div>
      </div>
                </div>
        </div>
      </div>
      
<script>
    function detail(){
        document.getElementById('tab-add').style.display = 'none';
        document.getElementById('tab-add-btn').className = 'btn btn-secondary tab-head';
        document.getElementById('tab-history').style.display = 'block';
        document.getElementById('tab-history-btn').className = 'btn btn-primary tab-head ml-2';
    }
    
    function payment(){
        document.getElementById('tab-history').style.display = 'none';
        document.getElementById('tab-history-btn').className = 'btn btn-secondary tab-head ml-2';
        document.getElementById('tab-add').style.display = 'block';
        document.getElementById('tab-add-btn').className = 'btn btn-primary tab-head';
    }
</script>
{% include 'footer.twig' %}