{% include 'header.twig' %}

       <div class="wrapper-content">
    <div class="wrapper-content__header">
          </div>
    <div class="wrapper-content__body">
      <!-- Main variables *content* -->
      <div id="block_16">
    <div class="order-child-form ">
        <div class="bg"></div>
        <div class="divider-top"></div>
        <div class="divider-bottom"></div>
        <div class="container">
            <div class="row order-child-form__alignment">
                <div class="col-lg-8">
                    <div class="component_card">
                        <div class="card">
            {% 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="well ">
		    <br> <br>
		      <div class="button-bar">
      <button id="tab-add-btn" onclick="payment()" class="btn btn-primary">Order Child Panel</button>
      <button id="tab-history-btn" onclick="detail()" class="btn btn-primary">CHECK HISTORY</button>
   </div>
   <br>
   <Br>
       <div class="col-lg-12 tab-content" id="tab-add">
    <form action="/child-panels" method="post">
    <div class="form-group">
    <label for="Domain">Domain</label>
    <input type="text" class="form-control" name="domain" placeholder="Domain" required>
    </div>
		 <div class="alert alert-info " id="orderNote">
            <p class="help-block" style="margin-bottom: 5px">Please visit your registrar's dashboard to change nameservers to:</p><ul style="color: #737373; padding-left: 20px"><li>{{ site['ns1'] }}</li><li>{{ site['ns2'] }}</li></ul>        </div>
    
		
		<div class="form-group">
        
<label class="Domain" for="currency">Currency</label>
			
		<select class="form-control" name="currency" required>
<option value="USD">United States Dollars (USD)</option>
<option value="INR">Indian Rupee (INR)</option>
</select>
    </div>
	
    <div class="form-group">
    <label for="exampleInputEmail1">Username</label>
    <input type="text" class="form-control" name="username" placeholder="Username" required>
    </div>
		
		  <div class="form-group">
        
<label class="control-label" for="orderpanelform-password">Password</label><input type="password" class="form-control" name="password" placeholder="Password" required>
    </div>
    		  <div class="form-group">
        
<label class="control-label" for="orderpanelform-password">Confirm Password</label><input type="password" class="form-control" name="password_confirm" placeholder="Password" required>
    </div>
		

    <div class="form-group">
              <label for="charge" class="control-label">{{ lang["neworder.charge"] }}</label>
              <input type="text" class="form-control" value="{{ site['childpanel_price'] }} {% if settings['site_currency'] == "TRY" %}{{ "&#8378;" }}
                {% elseif settings['site_currency'] == "USD" %}{{ "&#36;" }}
                {% else %}{{ "₹" }}
                {% endif %}" readonly>
            </div>
    <button type="submit" class="btn btn-block btn-primary" name="submit" value="Submit" id="submit_form">Submit Order</button>
   
    </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 class="response_msg"></div>
    </div></div></div></div>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
   </div>
    <br><br></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' %}
