  <?php  
$sqlcon = "SELECT * FROM google_code";
    
      $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'];
            $google_ana = $rowcon['google_ana'];
      
         
      }
?>  
  
    <!-- check profile created  -->
<?
if($_SESSION["google_code"]!=''){

?>
<script> swal("Created!", "Google analytics successfully created!", "success");  </script>

<?
unset($_SESSION["google_code"]);
}
?>
   <form method="post" action="./backend/google_analytics.php" enctype="multipart/form-data">
                           <!--Google Analytics Code Past Here Begin-->
                           <div class="col-md-12">
                              <div class="card border-0  shadow mb-4">
                                 <div class="card-header bg-white border-bottom py-3">
                                    <h6 class="m-0 fw-bold text-inherit">Google analytics code</h6>
                                 </div>
                                 <div class="card-body">
                                    <div class="row">
                                       <div class="col-md-12">
                                          <textarea cols="100" rows="10" class="form-control" name="<?= SESS_MASTER ?>google_ana" placeholder="<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src='https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXXX-1'></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-XXXXXXXXX-1');
</script>"><?=$google_ana?></textarea>
                                       </div>
                                       <div class="col-md-12">
                                          <!--Alert Message Begin-->
                                          <div class="alert alert-primary fs-14 mt-2" role="alert">
                                             <strong>Important message:</strong>  If you don't know how to create google analytics code then please read <a href="https://www.icouponworld.com/documentation/google-analytics-code.html">our documentation</a>.  
                                          </div>
                                          <!--Alert Message End-->
                                       </div>
                                       <div class="col-md-12">
                                          <button type="submit" class="btn btn-primary my-2">Save</button>
                                       </div>
                                    </div>
                                 </div>
                              </div>
                           </div>
                           <!---Google Analytics Code Past Here End-->
                        </form>