<?php include("parent/callMe.php"); ?>
<?php  include("sessioncheck.php"); 

?>


<!DOCTYPE html>
<html lang="en">
  <head>
    
    <title>Whatsapp Setting | EduPortal</title>
    <?php include('RootMe/css_links.php');?>
  
<script type="text/javascript">

function getSubCat(id){
  //alert(id);

    if (window.XMLHttpRequest) {
      // code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
    } else { // code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function() {
      if (xmlhttp.readyState==4 && xmlhttp.status==200) {

        document.getElementById("subcatgory").innerHTML=xmlhttp.responseText;
       //alert(xmlhttp.responseText);

      }

    }
    xmlhttp.open("GET","get_exp_subcategory.php?id="+id,true);
    xmlhttp.send();
  }


    function getWarningMsg(){
    
     document.getElementById("msg").style.display="block";   
  }

</script> 
  </head>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

  <style>
#snackbar {
  visibility: hidden;
  min-width: 250px;
  margin-left: -125px;
  background-color: #1E90FF;
  color: #fff;
  text-align: right;
  border-radius: 2px;
  padding: 16px;
  position: fixed;
  z-index: 1;
  left: 80%;
  bottom: 30px;
  font-size: 17px;
}

#snackbar.show {
  visibility: visible;
  -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
  animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@-webkit-keyframes fadein {
  from {bottom: 0; opacity: 0;} 
  to {bottom: 30px; opacity: 1;}
}

@keyframes fadein {
  from {bottom: 0; opacity: 0;}
  to {bottom: 30px; opacity: 1;}
}

@-webkit-keyframes fadeout {
  from {bottom: 30px; opacity: 1;} 
  to {bottom: 0; opacity: 0;}
}

@keyframes fadeout {
  from {bottom: 30px; opacity: 1;}
  to {bottom: 0; opacity: 0;}
}
</style>
  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
        <div class="col-md-3 left_col">
     
            <?php include('RootMe/sidebar.php');?>

              <?php include('RootMe/header.php');?>
     
        <!-- page content -->
          <div class="right_col" role="main">

            <a href="<?php echo $_SESSION['dashboard'];?>">Dashboard </a> &nbsp; <i style="" class="fa fa-angle-double-right"></i>  &nbsp; 
            whatsApp Setting
          <br><br>

          <div class="row" style="background-color: white;">
           
  <section class="add_sub_agent" id="table_sub_agent">
  <div class="container">

 <div class="" style="margin-top:10px;">
   
      

                                    <!-- page content -->
        
    <div class="">
    
      <h3 style="margin-left: 15px;">Create Instance ID</h3>
            <div class="row">
          
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
            
                  <div class="x_content">
          
     
                    <form action="<?php echo DOMAIN.AgentDirectory;?>parent/InsertMe.php" method="post" enctype="multipart/form-data" class="form-horizontal form-label-left" >
                      <input type="hidden" name="action" value="add_instanse_id" />
  <?php
  

          $query="select * from eduportal_branch_configration where branch_id =".$_SESSION['branch'];
          $instanceID = $m->query($query);
?>      
          
<p>
<div class="alert alert-danger" id="msg" style="display:none;">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Attention !!!</strong> Please use the same WhatsApp number that you want to use for whatsApp SMS sending. Different numbers will cause the SMS delivery issues.
</div>
</p>
          <div class="item form-group">
                        
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">From Number <span class="required"></span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                         
                           <input class="form-control col-md-7 col-xs-12" required onClick="getWarningMsg()"  name="from_number" placeholder="03*********" value="<?php echo $instanceID[0]['from_number']; ?>">
                        </div>
            </div>
          

            <div class="item form-group">
                        
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Access Token <span class="required"></span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                         
                           <input class="form-control col-md-7 col-xs-12" required  name="access_token" placeholder="" value="<?php echo $instanceID[0]['access_token']; ?>">
                        </div>
            </div>

                   
             <div class="item form-group">
                        
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Instance ID <span class="required"></span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                         
                           <input class="form-control col-md-7 col-xs-12" required  name="instance_id" placeholder="" value="<?php echo $instanceID[0]['instance_id']; ?>">
                        </div>
            </div>
                  


                      <div class="ln_solid" style="border-top:none;"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-md-offset-3">
                          
                          <button id="send" type="submit" class="btn btn-primary" >Submit</button>
                          <button type="submit" class="btn btn-primary" >Cancel</button>

                        </div>
                      </div>

                    </form>
              
          </div>
                </div>
              </div>
            </div>
          </div>
       
        

        <!-- /page content -->



  </div>
  <div class="clearfix"></div>
</section>           

           
          </div>
        </div>

            </div>
          </div>
        </div>
        <!-- /page content -->
  

    
  <?php include('RootMe/js_linksscript.php');?>
  </body>
</html>
<script>
function toastFunction() {
  var x = document.getElementById("snackbar");
  x.className = "show";
  setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
}
</script>