{% include 'header.twig' %}
{% if contentText %}
<div class="container">
  <div class="row">
    <div class="col-md-8 col-md-offset-2">
      <div class="well ">
{{ contentText }}
</div>
</div>
</div></div>
{% endif %}
<div class="paddingbody"></div>
<div class="container-fluid container-fluid-spacious">
	<div class="row">
		<div class="col-md-8 col-md-offset-2">

			<style>
				.cards {
					min-height: 20px;
					padding: 10px;
					margin-bottom: 0;
					margin-right: 10;
					margin-left: 10;
					background-color: #178acc;
					background-image: linear-gradient(#54b4eb, #2fa4e7 60%, #1d9ce5);
					;
					color: #fff;
					border: 1px solid rgba(0, 0, 0, .1);
					border-radius: 4px;
					box-shadow: inset 0 1px 1px rgb(0 0 0 / 5%);
					margin-top: 5px;
					margin-bottom: 5px;
				}


				.main_playes #app-cover {
					
					height: 100%;
					margin: 1px auto;
				   }
				   
				   .main_playes  #bg-artwork {
					
				   }
				   
				   .main_playes  #bg-layer {
				
				   }
				   
				   .main_playes   #player {
					position: relative;
					height: 100%;
					z-index: 3;
					display: flex;
					justify-content: center;
					align-items: center;
				   }
				   
				   .main_playes  #player-track {
				   display: none;
				   }
				   
				   .main_playes  #player-track.active {
					top: -92px;
				   }
				   
				   .main_playes   #album-name {
					color: #54576f;
					font-size: 17px;
					font-weight: bold;
				   }
				   
				   .main_playes   #track-name {
					color: #acaebd;
					font-size: 13px;
					margin: 2px 0 13px 0;
				   }
				   
				   .main_playes  #track-time {
					height: 12px;
					margin-bottom: 3px;
					overflow: hidden;
				   }
				   
				   .main_playes   #current-time {
					float: left;
				   }
				   
				   .main_playes  #track-length {
					float: right;
				   }
				   
				   #current-time,
				   #track-length {
					color: transparent;
					font-size: 11px;
					background-color: #ffe8ee;
					border-radius: 10px;
					transition: 0.3s ease all;
				   }
				   
				   #track-time.active #current-time,
				   #track-time.active #track-length {
					color: #f86d92;
					background-color: transparent;
				   }
				   
				   #s-area,
				   #seek-bar {
					position: relative;
					height: 4px;
					border-radius: 4px;
				   }
				   
				   .main_playes   #s-area {
					background-color: #ffe8ee;
					cursor: pointer;
				   }
				   
				   .main_playes   #ins-time {
					position: absolute;
					top: -29px;
					color: #fff;
					font-size: 12px;
					white-space: pre;
					padding: 5px 6px;
					border-radius: 4px;
					display: none;
				   }
				   
				   .main_playes   #s-hover {
					position: absolute;
					top: 0;
					bottom: 0;
					left: 0;
					opacity: 0.2;
					z-index: 2;
				   }
				   
				   .main_playes   #ins-time,
				   .main_playes   #s-hover {
					background-color: #3b3d50;
				   }
				   
				   .main_playes   #seek-bar {
					content: "";
					position: absolute;
					top: 0;
					bottom: 0;
					left: 0;
					width: 0;
					background-color: #fd6d94;
					transition: 0.2s ease width;
					z-index: 1;
				   }
				   
				   .main_playes   #player-content {
					position: relative;
					height: 100%;
					
				
					border-radius: 15px;
					z-index: 2;
					display: flex;
					justify-content: center;
					width: fit-content;
				   }
				   
				   .main_playes   #album-art {
				   display: none;
				   }
				   
				   .main_playes   #album-art.active {
					top: -60px;
					box-shadow: 0 0 0 4px #fff7f7, 0 30px 50px -15px #afb7c1;
				   }
				   
				   .main_playes  #album-art:before {
					content: "";
					position: absolute;
					top: 50%;
					right: 0;
					left: 0;
					width: 20px;
					height: 20px;
					margin: -10px auto 0 auto;
					background-color: #d6dee7;
					border-radius: 50%;
					box-shadow: inset 0 0 0 2px #fff;
					z-index: 2;
				   }
				   
				   .main_playes   #album-art img {
					display: block;
					position: absolute;
					top: 0;
					left: 0;
					width: 100%;
					height: 100%;
					opacity: 0;
					z-index: -1;
				   }
				   
				   .main_playes   #album-art img.active {
					opacity: 1;
					z-index: 1;
				   }
				   
				   .main_playes   #album-art.active img.active {
					z-index: 1;
					animation: rotateAlbumArt 3s linear 0s infinite forwards;
				   }
				   
				   @keyframes rotateAlbumArt {
					0% {
					  transform: rotateZ(0);
					}
					100% {
					  transform: rotateZ(360deg);
					}
				   }
				   
				   .main_playes  #buffer-box {
					position: absolute;
					top: 50%;
					right: 0;
					left: 0;
					height: 13px;
					color: #1f1f1f;
					font-size: 13px;
					font-family: Helvetica;
					text-align: center;
					font-weight: bold;
					line-height: 1;
					padding: 6px;
					margin: -12px auto 0 auto;
					background-color: rgba(255, 255, 255, 0.19);
					opacity: 0;
					z-index: 2;
				   }
				   
				   .main_playes   #album-art img,
				   .main_playes  #buffer-box {
					transition: 0.1s linear all;
				   }
				   
				   .main_playes   #album-art.buffering img {
					opacity: 0.25;
				   }
				   
				   .main_playes  #album-art.buffering img.active {
					opacity: 0.8;
					filter: blur(2px);
					-webkit-filter: blur(2px);
				   }
				   
				   .main_playes  #album-art.buffering #buffer-box {
					opacity: 1;
				   }
				   
				   .main_playes  #player-controls {
				   
					height: 100%;
				   
					float: right;
					overflow: hidden;
					display: flex;
					gap: 15px;
				   }
				   
				   .main_playes .control {
					width: auto;
					float: left;
					padding: 12px 0;
				   }
				   
				   .main_playes  .button {
				

					cursor: pointer;
					display: flex;
					justify-content: center;
					align-items: center;
				   }
				   
				   .main_playes .button i {
					display: block;
					color: #fff;
					font-size: 15px;
					text-align: center;
					line-height: 1;
				   }
				   
				   .main_playes .button,
				   .main_playes  .button i {
					transition: 0.2s ease all;
				   }
				   
				
				
			</style>

			<p></p>
			<div class=" row card-divs">
				<div class="col-md-4">
					<div class="cards">
						<div class="card-body">
							<h3 class="card-title">Total Spent</h3>
							<h3 class="card-text text-right">{{ user["spent"] }}</h3>

						</div>
					</div>
				</div>
				<div class="col-md-4">
					<div class="cards">
						<div class="card-body">
							<h3 class="card-title">Total Orders</h3>
							<h3 class="card-text text-right"> {{totalorders}}</h3>

						</div>
					</div>
				</div>
				<div class="col-md-4">
					<div class="cards">
						<div class="card-body">
							<h3 class="card-title">Total Balance</h3>
							<h3 class="card-text text-right">{{ user["balance"] }}</h3>
						</div>
					</div>
				</div>

				
			</div>
			<p></p>


			
			<div class="well well-float table-responsive">
				<h4 style="font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;"></h4><h4 style="text-align: center; "><font color="#3984c6"><b>Welcome to {{ user["username"]  }}</b></font></h4><h4 style="text-align: center; "></h4><h5 style="text-align: center; "><b style="font-family: inherit; font-size: 12px; color: rgb(57, 132, 198);">Child panel like {{ user["username"]  }} { low cost }</b></h5><h5 style="font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; text-align: center;"><br></h5>
			</div>
  
  
  
  
  
                        



      <div class="row">

				<div class="col-md-12">


					<div id="main-page" class="well well-float table-responsive">
						
						

  


    {% if error %}
      <div class="alert alert-dismissible alert-danger">
        {{ errorText }}
      </div>
    {% endif %}

    {% if data["order"]["success"] == 1 %}
      <div class="alert alert-dismissible alert-success">
          <strong> {{ lang["neworder.success.id"] }}: </strong> {{ data['order']['id'] }} <br>
          <strong> {{ lang["neworder.success.service"] }}: </strong> {{ data['order']['service'] }} <br>
          <strong> {{ lang["neworder.success.link"] }}: </strong> {{ data['order']['link'] }} <br>
          <strong> {{ lang["neworder.success.quantity"] }}: </strong> {{ data['order']['quantity'] }} <br>
          <strong> {{ lang["neworder.success.link"] }}: </strong> {{ data['order']['price'] }} <br>
          <strong> {{ lang["neworder.success.balance"] }}: </strong>{{ data['order']['balance'] }} <br>
      </div>
    {% endif %}
    {% if data["order"]["success"] == 2 %}
      <div class="alert alert-dismissible alert-success">
         <strong> {{ lang["neworder.success.id"] }}: </strong> {{ data['order']['id'] }} <br>
         <strong> {{ lang["neworder.success.service"] }}: </strong> {{ data['order']['service'] }} <br>
         <strong> {{ lang["neworder.success.username"] }}: </strong> {{ data['order']['link'] }} <br>
         <strong> {{ lang["neworder.success.quantity"] }}: </strong> {{ data['order']['min'] }} - {{ data['order']['max'] }} <br>
         <strong> {{ lang["neworder.success.posts"] }}: </strong> {{ data['order']['posts'] }} <br>
         <strong> {{ lang["neworder.success.delay"] }}: </strong>{{ data['order']['delay'] }} <br>
       </div>
    {% endif %}
<form method="post" action="">
							<div class="form-hidden form-group">
<div class="component_button_forms">
            <div class="form-group">
              <label for="orderform-category" class="control-label">{{ lang["neworder.category"] }}</label>
              <select class="form-control" id="neworder_category" name="categories" data-select="true" data-select-search="true" data-select-search-placeholder="Search" data-select-container="#select-category-container" tabindex="-1" aria-hidden="true">
{{ category_html_simplify }}
</select>
</div>

             
            </div>
            <div class="form-group">
              <label for="orderform-service" class="control-label">{{ lang["neworder.service"] }}</label>
              <select class="form-control" id="neworder_services" name="services" data-select="true" data-select-search="true" data-select-search-placeholder="Search" data-select-container="#select-service-container" tabindex="-1" aria-hidden="true"><option value="1">No services found in this category</option>
</select>
            </div>





            <div id="neworder_fields"></div>


<div class="form-group" id="charge_div">
              <label for="charge" class="control-label">{{ lang["neworder.charge"] }}</label>
              <input type="text" class="form-control" id="charge" readonly>
            </div>




          
          <button type="submit" class="btn btn-primary">{{ lang["neworder.button"] }}</button>
</form>
      </div>
    </div>
  </div>
</div>
</div></div>

    
        
<script>
$(document).ready(function(){

  /* Katogeriye ait servisleri Ã§ek */
  category_detail();
  $("#neworder_category").change(function(){
    category_detail();
  });
  /* Katogeriye ait servisleri Ã§ek */
  /* Servise ait verileri Ã§ek */
  $("#neworder_services").change(function(){
    service_detail();
  });
  /* Servise ait verileri Ã§ek */
  /* SipariÅŸ miktarÄ± deÄŸiÅŸince fiyat hesapla */
  $(document).on('keyup', '#order_quantity', function() {
    var service   = $("#neworder_services").val();
    var quantity  = $("#neworder_quantity").val();
    var runs      = $("#dripfeed-runs").val();
      if( $("#dripfeedcheckbox").prop('checked') ){
        var dripfeed  = "var";
      }else{
        var dripfeed  = "bos";
      }
    $.post('ajax_data',{action:'service_price',service:service,quantity:quantity,dripfeed:dripfeed,runs:runs}, function(data){
        $("#charge").val(data.price);
        $("#dripfeed-totalquantity").val(data.totalQuantity);
    }, 'json');
  });
  $(document).on('keyup', '#dripfeed-runs', function() {
    var service   = $("#neworder_services").val();
    var quantity  = $("#neworder_quantity").val();
    var runs      = $("#dripfeed-runs").val();
      if( $("#dripfeedcheckbox").prop('checked') ){
        var dripfeed  = "var";
      }else{
        var dripfeed  = "bos";
      }
    $.post('ajax_data',{action:'service_price',service:service,quantity:quantity,dripfeed:dripfeed,runs:runs}, function(data){
        $("#charge").val(data.price);
        $("#dripfeed-totalquantity").val(data.totalQuantity);
    }, 'json');
  });
  $(document).on('keyup', '#neworder_comment', function() {
    comment_charge();
  });
  /* SipariÅŸ miktarÄ± deÄŸiÅŸince fiyat hesapla */
  /* Dripfeed deÄŸiÅŸtir */
  $(document).on('change', '#dripfeedcheckbox', function() {
    var dripfeed = $(this).prop('checked');
    if( dripfeed ){
      $("#dripfeed-options").removeClass();
      dripfeed_charge();
    }else{
      $("#dripfeed-options").addClass('hidden');
      dripfeed_charge();
    }
  });
  /* Dripfeed deÄŸiÅŸtir */
});

function category_detail(){
  var category_now = $("#neworder_category").val();
  $.post('ajax_data',{action:'services_list',category:category_now}, function(data){
      $("#neworder_services").html(data.services);
      service_detail();
  }, 'json');
}

function service_detail(){
  var service_now = $("#neworder_services").val();
  $.post('ajax_data',{action:'service_detail',service:service_now}, function(data){
      if( data.empty == 1 ){
        $("#charge_div").hide();
      }else{
        $("#charge_div").show();
        $("#neworder_fields").html(data.details);
        $("#charge").val(data.price);
      }
      $(".datetime").datepicker({
         format: "dd/mm/yyyy",
         language: "tr",
         startDate: new Date(),
       }).on('change', function(ev){
         $(".datetime").datepicker('hide');
       });
      $("#clearExpiry").click(function(){
           $("#expiryDate").val('');
       });
       var dripfeed = $("#dripfeedcheckbox").prop('checked');
       if( dripfeed ){
         $("#dripfeed-options").removeClass();
       }
       comment_charge();
        if( $("#dripfeedcheckbox").prop('checked') ){
          dripfeed_charge();
        }
          if( data.sub ){
            $("#charge_div").hide();
          }else{
            $("#charge_div").show();
          }
  }, 'json');
}

function comment_charge(){
  var service   = $("#neworder_services").val();
  var comments  = $("#neworder_comment").val();
    if( comments ){
      $.post('ajax_data',{action:'service_price',service:service,comments:comments}, function(data){
          $("#neworder_quantity").val(data.commentsCount);
          $("#charge").val(data.price);
      }, 'json');
    }
}

function dripfeed_charge(){
  var service     = $("#neworder_services").val();
  var quantity    = $("#neworder_quantity").val();
  var runs        = $("#dripfeed-runs").val();
    if( $("#dripfeedcheckbox").prop('checked') ){
      var dripfeed  = "var";
    }else{
      var dripfeed  = "bos";
    }
  $.post('ajax_data',{action:'service_detail',service:service,quantity:quantity,dripfeed:dripfeed,runs:runs}, function(data){
      $("#charge").val(data.price);
  }, 'json');
}

</script>
{% include 'footer.twig' %}
