<?php  
$sqlcon = "SELECT * FROM api_coupan  WHERE api_type='flipkart'";
    
      $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['api_key'];
            $tracking_id   = $rowcon['affiliate_id'];
            $access_token = $rowcon['access_token'];
         
      }
?>  
<div class="row">
                                       <div class="col-lg-12 col-md-12">
                                          <div class="merchant-profile-right">
                                             <div class="card">
                                                <div class="card-body">
                                                   <!--Form Flipkart   API Key Begin-->
                                                   <form class="profile-box" action="./backend/flipkart.php" method="post">
                                                      <div class="bottom-line">
                                                         <h6 class="h5 mb-5">Flipkart   API Key</h6>
                                                      </div>
                                                      <div class="row">
                                                         <!--Flipkart   API Key-->
                                                         <div class="col-md-12">
                                                            <div class="mb-3">
                                                               <label class="fw-bold form-label">Flipkart API Key<span class="text-danger">*</span>:</label>
                                                               <input type="text" name="<?=SESS_MASTER ?>api_key" value="<?=$token?>" class="form-control  validate[required,maxSize[100]] text-input" required>
                                                            </div>
                                                         </div>
                                                         <!-- Affiliate Tracking ID Id-->
                                                         <div class="col-md-12">
                                                            <div class="mb-3">
                                                               <label for="Icubeswire" class="fw-bold form-label">
                                                               Affiliate Tracking ID<span class="text-danger">*</span>:
                                                               </label>
                                                               <input type="text" name="<?=SESS_MASTER ?>tracking_id" value="<?=$tracking_id?>" class="form-control validate[required,maxSize[100]] text-input" required>
                                                            </div>
                                                         </div>
                                                         <!-- Token-->
                                                         <div class="col-md-12">
                                                            <div class="mb-3">
                                                               <label for="networkid" class="fw-bold form-label">Token<span class="text-danger">*</span>:</label>
                                                               <input type="text"  name="<?=SESS_MASTER ?>token" value="<?=$access_token?>" class="form-control  validate[required,maxSize[100]] text-input" 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="flipkart">
                                                            <button type="submit" class="btn btn-primary mb-3">Save</button>
                                                         </div>
                                                      </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>    you do not have Flipkart api, first go to <a href="https://affiliate.flipkart.com/">  Flipkart.com</a> and register on affiliate link. then you can get coupon API. 
                                                      </div>
                                                      <!--MEssage End-->
                                                   </form>
                                                   <!--Form Flipkart   API Key End-->
                                                </div>
                                             </div>
                                          </div>
                                       </div>
                                    </div>