
      <!-- check profile created  -->
<?php
if($_SESSION["created"]!=''){

?>
<script> swal("Successfully!", "Affiliate coupon API has been saved!", "success");  </script>

<?php
unset($_SESSION["created"]);
}
?>

<div class="row">
                           <div class="col-lg-3 col-md-12">
                              <div class="top-coupon-left">
                                 <div class="nav flex-column nav-pills me-3" id="v-pills-tab" role="tablist" aria-orientation="vertical">
                                   
                                    <!--pills-Icubeswire-->
                                    <!-- <div class="nav-link" id="v-pills-Icubeswire-tab" data-bs-toggle="pill" data-bs-target="#v-pills-Icubeswire" role="tab" aria-controls="v-pills-Icubeswire" aria-selected="false">
                                       <div class="coupon-tab-left">
                                          <div class="coupon-svg">
                                             <i class="fas fa-network-wired"></i>
                                          </div>
                                          <div class="coupon-txt ps-3">
                                             <p>Icubeswire</p>
                                          </div>
                                       </div>
                                    </div> -->
                                    <!--pills-Flipkart-->
                                    <!-- <div class="nav-link active" id="v-pills-Flipkart-tab" data-bs-toggle="pill" data-bs-target="#v-pills-Flipkart" role="tab" aria-controls="v-pills-Flipkart" aria-selected="true">
                                       <div class="coupon-tab-left">
                                          <div class="coupon-svg">
                                             <i class="fas fa-gift"></i>
                                          </div>
                                          <div class="coupon-txt ps-3">
                                             <p>Flipkart</p>
                                          </div>
                                       </div>
                                    </div> -->
                                     <!--pills-Vcommission-->
                                     <!-- <div class="nav-link" id="v-pills-Vcommission-tab" data-bs-toggle="pill" data-bs-target="#v-pills-Vcommission" role="tab" aria-controls="v-pills-Vcommission" aria-selected="true">
                                       <div class="coupon-tab-left">
                                          <div class="coupon-svg">
                                             <i class="fas fa-cogs"></i>
                                          </div>
                                          <div class="coupon-txt ps-3">
                                             <p>Vcommission</p>
                                          </div>
                                       </div>
                                    </div> -->
                                     <!--pills-Vcommission-->
                                     <!-- <div class="nav-link" id="v-pills-admitad-tab" data-bs-toggle="pill" data-bs-target="#v-pills-admitad" role="tab" aria-controls="v-pills-admitad" aria-selected="true">
                                       <div class="coupon-tab-left">
                                          <div class="coupon-svg">
                                             <i class="fas fa-cogs"></i>
                                          </div>
                                          <div class="coupon-txt ps-3">
                                             <p>Admitad</p>
                                          </div>
                                       </div>
                                    </div> -->
                                    <!--pills-Omgpm-->
                                    <!-- <div class="nav-link" id="v-pills-Omgpm-tab" data-bs-toggle="pill" data-bs-target="#v-pills-Omgpm" role="tab" aria-controls="v-pills-Omgpm" aria-selected="false">
                                       <div class="coupon-tab-left">
                                          <div class="coupon-svg">
                                             <i class="fas fa-file-alt"></i>
                                          </div>
                                          <div class="coupon-txt ps-3">
                                             <p>Omgpm</p>
                                          </div>
                                       </div>
                                    </div> -->
                                    <!--pills-Cuelinks-->
                                    <!-- <div class="nav-link" id="v-pills-Cuelinks-tab" data-bs-toggle="pill" data-bs-target="#v-pills-Cuelinks" role="tab" aria-controls="v-pills-Cuelinks" aria-selected="false">
                                       <div class="coupon-tab-left">
                                          <div class="coupon-svg">
                                             <i class="fas fa-link"></i>
                                          </div>
                                          <div class="coupon-txt ps-3">
                                             <p>Cuelinks</p>
                                          </div>
                                       </div>
                                    </div> -->
                                    <!--pills-Brandreward-->
                                    <div class="nav-link active" id="v-pills-Brandreward-tab" data-bs-toggle="pill" data-bs-target="#v-pills-Brandreward" role="tab" aria-controls="v-pills-Brandreward" aria-selected="true">
                                       <div class="coupon-tab-left">
                                          <div class="coupon-svg">
                                             <i class="fab fa-bandcamp"></i>
                                          </div>
                                          <div class="coupon-txt ps-3">
                                             <p>Brandreward</p>
                                          </div>
                                       </div>
                                    </div>
                                    <!--pills-Skimlinks-->
                                    <div class="nav-link" id="v-pills-Skimlinks-tab" data-bs-toggle="pill" data-bs-target="#v-pills-Skimlinks" role="tab" aria-controls="v-pills-Skimlinks" aria-selected="false">
                                       <div class="coupon-tab-left">
                                          <div class="coupon-svg">
                                             <i class="fas fa-draw-polygon"></i>
                                          </div>
                                          <div class="coupon-txt ps-3">
                                             <p>Skimlinks</p>
                                          </div>
                                       </div>
                                    </div>
                                    <!--pills-Affiliatefuture-->
                                    <!-- <div class="nav-link" id="v-pills-Affiliatefuture-tab" data-bs-toggle="pill" data-bs-target="#v-pills-Affiliatefuture" role="tab" aria-controls="v-pills-Affiliatefuture" aria-selected="false">
                                       <div class="coupon-tab-left">
                                          <div class="coupon-svg">
                                             <i class="fas fa-globe"></i>
                                          </div>
                                          <div class="coupon-txt ps-3">
                                             <p>Affiliatefuture</p>
                                          </div>
                                       </div>
                                    </div> -->
                                    <!--pills-Tradedoubler-->
                                    <div class="nav-link" id="v-pills-Tradedoubler-tab" data-bs-toggle="pill" data-bs-target="#v-pills-Tradedoubler" role="tab" aria-controls="v-pills-Tradedoubler" aria-selected="false">
                                       <div class="coupon-tab-left">
                                          <div class="coupon-svg">
                                             <i class="fas fa-suitcase"></i>
                                          </div>
                                          <div class="coupon-txt ps-3">
                                             <p>Tradedoubler</p>
                                          </div>
                                       </div>
                                     
                                    </div>
                                   
                                    <!--pills-2performant-->
                                    <!-- <div class="nav-link" id="v-pills-2performant-tab" data-bs-toggle="pill" data-bs-target="#v-pills-2performant" role="tab" aria-controls="v-pills-2performant" aria-selected="false">
                                       <div class="coupon-tab-left">
                                          <div class="coupon-svg">
                                             <i class="fas fa-users-cog"></i>
                                          </div>
                                          <div class="coupon-txt ps-3">
                                             <p>2performant</p>
                                          </div>
                                       </div>
                                    </div> -->
                                 </div>
                              </div>
                             
                             
                              <!-- <form action="" method="POST">
                            
                            <button type="submit"  name="submitbrand" class="btn btn-primary mb-3">Brand Store</button>
                            </form> -->
                           
                              
                             
                           </div>
                          
                           <div class="col-lg-9 col-md-12">
                              <!--pills-tabContent profile-setting-->
                              <div class="tab-content" id="v-pills-tabContent">
                               
                                 <!--pills-tabContent Icubeswire-->
                                 <!-- <div class="tab-pane fade" id="v-pills-Icubeswire" role="tabpanel" aria-labelledby="v-pills-Icubeswire-tab">
                                     <?php // include("./cpages/coupon_api_config/icubeswire.php");  ?>
                                 </div> -->
                                 <!--pills-tabContent Flipkart -->
                                 <!-- <div class="tab-pane fade show active" id="v-pills-Flipkart" role="tabpanel" aria-labelledby="v-pills-Flipkart-tab">
                                     <?//php include("./cpages/coupon_api_config/flipkart.php");  ?>
                                 </div> -->
                                 <!--pills-tabContent product-Omgpm-->
                                 <!-- <div class="tab-pane fade" id="v-pills-Omgpm" role="tabpanel" aria-labelledby="v-pills-Omgpm-tab">
                                    <?//php include("./cpages/coupon_api_config/omgpm.php");  ?>
                                 </div> -->
                                 <!--pills-tabContent product-Cuelinks-->
                                 <!-- <div class="tab-pane fade" id="v-pills-Cuelinks" role="tabpanel" aria-labelledby="v-pills-Cuelinks-tab">
                                     <?//php include("./cpages/coupon_api_config/cuelinks.php");  ?>
                                 </div> -->
                                 <!--pills-tabContent Brandreward-->
                                 <div class="tab-pane fade show active" id="v-pills-Brandreward" role="tabpanel" aria-labelledby="v-pills-Brandreward-tab">
                                    <?php include("./cpages/coupon_api_config/brandreward.php");  ?>
                                 </div>
                                 <!--pills-tabContent Skimlinks-->
                                 <div class="tab-pane fade" id="v-pills-Skimlinks" role="tabpanel" aria-labelledby="v-pills-Skimlinks-tab">
                                   <?php include("./cpages/coupon_api_config/skimlinks.php");  ?>
                                 </div>
                                 <div class="tab-pane fade" id="v-pills-Vcommission" role="tabpanel" aria-labelledby="v-pills-Vcommission-tab">
                                     <?php  include("./cpages/coupon_api_config/vcommission.php");  ?>
                                 </div>    
                                 <div class="tab-pane fade" id="v-pills-admitad" role="tabpanel" aria-labelledby="v-pills-admitad-tab">
                                     <?php  include("./cpages/coupon_api_config/admitad.php");  ?>
                                 </div>  
                                 <!-- <div class="tab-pane fade" id="v-pills-Affiliatefuture" role="tabpanel" aria-labelledby="v-pills-Affiliatefuture-tab">
                                   <?//php include("./cpages/coupon_api_config/affilliatefuture.php");  ?>
                                 </div>   -->
                                 <div class="tab-pane fade" id="v-pills-2performant" role="tabpanel" aria-labelledby="v-pills-2performant-tab">
                                   <?php include("./cpages/coupon_api_config/performant.php");  ?>
                                 </div>  
                                                                
                                
                                 <!--pills-tabContent Affiliatefuture-->
                                 <!-- <div class="tab-pane fade" id="v-pills-Affiliatefuture" role="tabpanel" aria-labelledby="v-pills-Affiliatefuture-tab">
                                    <div class="row">
                                       <div class="col-lg-12 col-md-12">
                                          <div class="merchant-profile-right">
                                             <div class="card">
                                                <div class="card-body">
                                                
                                                   <form class="profile-box">
                                                      <div class="bottom-line">
                                                         <h6 class="h5 mb-5">Affiliatefuture API Key</h6>
                                                      </div>
                                                      <div class="row">
                                                       
                                                         <div class="col-md-12">
                                                            <div class="mb-3">
                                                               <label class="fw-bold form-label">Affiliatefuture API Key:</label>
                                                               <input type="text" value="6CA659B51A" class="form-control">
                                                            </div>
                                                         </div>
                                                        
                                                         <div class="col-md-12">
                                                            <div class="mb-3">
                                                               <label class="fw-bold form-label">Affiliatefuture Passcode:</label>
                                                               <input type="text" value="C4660949F2" class="form-control">
                                                            </div>
                                                         </div>
                                                        
                                                         <div class="col-md-12">
                                                            <button type="button" class="btn btn-primary mb-3">Save</button>
                                                         </div>
                                                      </div>
                                                     
                                                      <div class="alert alert-primary fs-14 mt-2" role="alert">
                                                         <strong>Note:</strong>  API requires user authentication. You will need an API key to pass with your requests to provide authentication.
                                                      </div>
                                                     
                                                    
                                                      <div class="alert alert-primary fs-14 mt-2" role="alert">
                                                         <strong>Message :</strong>    you do not have affiliatefuture API , first go to <a href="https://afuk-affiliate.affiliatefuture.com/login.aspx?ReturnUrl=%2f"> Affiliatefuture.com</a> and register on affiliate link. then you can get coupon API. 
                                                      </div>
                                                    
                                                   </form>
                                                   
                                                </div>
                                             </div>
                                          </div>
                                       </div>
                                    </div>
                                 </div> -->
                                 <!--pills-tabContent tradedoubler -->
                                 <?php  
$sqlcon = "SELECT * FROM api_coupan  WHERE api_type='tradedoubler'";
    
      $myquerycon=$conn->query($sqlcon);
   $mydaracon= $myquerycon->fetchAll()  ;
   
   $rows_foundcon = $myquerycon->rowCount();
    if($rows_foundcon==0){
        $stat='0';
    }else{
         $stat='1';
    }

      foreach( $mydaracon as $rowcon ) {
            $con_id  = $rowcon['rowId'];
            $token   = $rowcon['access_token'];
          
         
      }
?>  
                                 <div class="tab-pane fade" id="v-pills-Tradedoubler" role="tabpanel" aria-labelledby="v-pills-Tradedoubler-tab">
                                    <div class="row">
                                       <div class="col-lg-12 col-md-12">
                                          <div class="merchant-profile-right">
                                             <div class="card">
                                                <div class="card-body">
                                                   <!--Form Tradedoubler  API Key Begin-->
                                                   <form class="profile-box" action="./backend/tradedoubler.php" method="post" id="tradedoubler-form">
                                                      <div class="bottom-line">
                                                         <h6 class="h5 mb-5">Tradedoubler API Key</h6>
                                                      </div>
                                                      <div class="row">
                                                         <!--Tradedoubler Access token-->
                                                         <div class="col-md-12">
                                                            <div class="mb-3">
                                                               <label class="fw-bold form-label">Tradedoubler Access token<span class="text-danger">*</span>:</label>
                                                               <input type="text" name="<?=SESS_MASTER ?>token" value="<?=$token?>" class="form-control" required>
                                                            </div>
                                                         </div>
                                                         <!--Save-->
                                                         <div class="col-md-12">
                                                         <input type="hidden" class="btn btn-primary btn-lg" name="<?=SESS_MASTER  ?>stat" value="<?=$stat?>">
                 <input type="hidden" class="btn btn-primary btn-lg" name="<?=SESS_MASTER  ?>api_type" value="tradedoubler">
                                                            <button type="submit" class="btn btn-primary mb-3">Save</button>
                                                         </div>
                                                      </div>
                                                      <div id="success4" class="text-primary">

                                                          </div>
                                                      <!--Note Bgin-->
                                                      <div class="alert alert-primary fs-14 mt-2" role="alert">
                                                         <strong>Note:</strong>  API requires user authentication. You will need an API key to pass with your requests to provide authentication.
                                                      </div>
                                                      <!--Note End-->
                                                      <!--MEssage BEgin-->
                                                      <div class="alert alert-primary fs-14 mt-2" role="alert">
                                                         <strong>Message :</strong>     If you do not have tradedoubler api, first go to tradedoubler.com and register there and get api.
                                                      </div>
                                                      <!--MEssage End-->
                                                   </form>
                                                   <!--Form BrandrSkimlinks API Key End-->
                                                </div>
                                             </div>
                                          </div>
                                       </div>
                                    </div>
                                 </div>
                                 <!--pills-tabContent 2performant -->
                                 <!-- <div class="tab-pane fade" id="v-pills-2performant" role="tabpanel" aria-labelledby="v-pills-2performant-tab">
                                    
                                 </div> -->
                              </div>
                             
                           </div>
                           
                        </div>
                        <script src="./cpages/coupon_api_config/js/jquery-3.4.1.min.js"></script>
                               <script>
                        $('#tradedoubler-form').on('submit', function(e) {
	
   e.preventDefault();
  var url = $(this).attr('action');
   var formData = new FormData(this);
//alert(formData)
  $.ajax({
     dataType: 'json',
     type: 'POST',
     url: url,
     data: formData,
     cache:false,
      contentType: false,
      processData: false,
     success: function(resp) {
   if(resp.status)
     {
      swal("Successfully!", "Affiliate coupon API has been saved!", "success");
      
     }
    
   //alert('success');
      //console.log(resp);
     },
     error: function(res) {
        console.log('there was a problem checking the fields');
        
     }
  }); 
});
                              </script>
