
<?php  
 //session_start();
require_once("includes/header.php");
require_once("lib/helper.php");

?>
<style>
  .form-anf-modal .close-btn{
        padding: 6px 30px;
   
  }
   .templ
  {
    margin-top:10px;  
  }
</style>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.3/xlsx.full.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" />
<body>
 
<div id="wrapper" class="active">  
      <!-- Sidebar -->
      <?php require_once("includes/sidebar.php"); ?>

      <div id="page-content-wrapper">
        <div class="page-content inset">
          
        <div class="main">
 


 <div class="heading-banner">
  <div class="card-header card-header-warning">
   <div class="row captured-data">
                <input type="hidden" id="company_edit_id" name="company_detail_id" value="<?php if(isset($_GET['company_edit_id'])){ echo $_GET['company_edit_id']; } ?>">
                <?php

                   $id=$_COOKIE["company_detail_id"];
             
               $detail=$obj->select( "*","gbca_company_detail_master as gbca RIGHT JOIN gbca_company_master as mas ON gbca.company_detail_name=mas.company_id RIGHT JOIN gbca_section_master as sec ON gbca.section_id=sec.section_id ","company_detail_id= '$id'");

                  if(isset($_GET['company_edit_id']))

                  {
                    $company_detail_id=$_GET['company_edit_id'];
                          // $resource=$obj->select("*","resource","resource_id='$resource_id'");

                    $company_detail= $obj->select("gcdm.*,gcm.*,gsm.* ,date_format(str_to_date(gcdm.company_detail_cutoff_date, '%Y-%m-%d'),' %d %M %Y') as date ","gbca_company_detail_master as gcdm inner join gbca_company_master as gcm on gcdm.company_detail_name = gcm.company_id inner join gbca_section_master as gsm on gcdm.section_id = gsm.section_id ","company_detail_id =$company_detail_id ");
                   
                   
                    $sub_company_detail= $obj->select("*,CASE
    WHEN sub_company_type_id = 1 THEN 'Holding Companies'
    WHEN sub_company_type_id = 2 THEN 'Subsidiary Companies'
    WHEN sub_company_type_id = 3 THEN 'Wholly Owned Subidiary Companies'
    WHEN sub_company_type_id = 4 THEN 'Managing Director'
    WHEN sub_company_type_id = 5 THEN 'Whole time directors'
    WHEN sub_company_type_id = 6 THEN 'Director of an Company'
    WHEN sub_company_type_id = 7 THEN 'Relative of directors'
    WHEN sub_company_type_id = 8 THEN 'Partner of directors in any firm (incl. LLP)'
     WHEN sub_company_type_id = 9 THEN 'Firm (incl. LLP) in which director is a partner'
    WHEN sub_company_type_id = 10 THEN 'Firm (incl. LLP) in which relative of director is a partner'
    WHEN sub_company_type_id = 11 THEN 'Private Companies in which director is a director'
    WHEN sub_company_type_id = 12 THEN 'Private Companies in which director is a Member'
    WHEN sub_company_type_id = 13 THEN 'Director of holding company'
    WHEN sub_company_type_id = 14 THEN 'Companies / LLPs wherein director either singly or jointly with other directors of lending company has 25%'
    WHEN sub_company_type_id = 15 THEN 'any directors of lending company'
    WHEN sub_company_type_id = 16 THEN 'Given Loan to'
    WHEN sub_company_type_id = 17 THEN 'Loan Represented as Book debt'
    WHEN sub_company_type_id = 18 THEN 'Guarantee Given in respect of Loan taken by'
    ELSE 'Security Provided to'
END as sub_company_name","gbca_sub_company_mapping","company_detail_id = '$company_detail_id'");
                    //print_r($sub_company_detail);
                    ?>
                    <?php
                  }  
                    // print_r($company_detail);
                  ?>
               
               <div class="col-md-12">
                <h1><?php if(isset($_GET['company_edit_id']))
                              {
                               echo  $company_detail[0]['company_name'];  
                              }
                              else
                              {
                              echo $detail[0]['company_name'];
                              }
                               ?></h1>

               </div>
               <div class="col-md-6">
                 <h5><?php if(isset($_GET['company_edit_id']))
                              {
                                 echo "Section: ".$company_detail[0]['section_name'];  
                              }
                              else
                              {
                                
                                echo "Section: ".$detail[0]['section_name'];
                            }
                               ?></h5>
               </div>
               <div class="col-md-6">
                 <h5><?php if(isset($_GET['company_edit_id']))
                              {
                                echo "Date: ".date('d F Y');  
                              }
                              else
                              {
                              
                              echo "Date: ". date('d F Y');
                            }
                               ?></h5>
               </div>
               <div class="col-md-6">
                 <h5><?php if(isset($_GET['company_edit_id']))
                              {
                                echo "Made By: ".$company_detail[0]['company_detail_maker_name'];  
                              }
                              else
                              {
                                echo "Made By: ".$detail[0]['company_detail_maker_name'];
                            }
                               ?></h5>
               </div>
               <div class="col-md-6">
                 <h5><?php if(isset($_GET['company_edit_id']))
                              {
                                echo "Checked By: ".$company_detail[0]['company_detail_checker_name'];  
                              }
                              else
                              { 
                              echo "Checked By: ".$detail[0]['company_detail_checker_name'];
                            }
                               ?></h5>
               </div>

   </div>
 </div>
 </div>
 <!-- End Navbar -->
 

 <div class="content wizard-formdiv">
   <div class="container-fluid2">
 
     <div class="row">
       <div class="col-md-12">
        <div class="card">
         <div class="card-body">
       <div class="alert alert-danger errmsg text-center" style="display: none;"></div>
           <!--<form id="regForm" action=""> -->
       
           <div class="tab">
            <input type="hidden" id="step1" name="step1" value="1">
             <input type="hidden" id="prev" name="prev" value="3">
             <div class="row">
               <div class="col-md-6">
                 <h5 class="form-headings">Basic Details:</h5>
               </div>
             </div>
             <div class="row">
              
               <div class="col-md-6">
                 <label for="company-name">Type of Company <span class="mandatory-star">*</span></label>
                 <select name="company-select" id="company-select" onchange="changeFunc();">                
                   <option></option>
                        <?php
                        if(isset($_GET['company_edit_id']))
                        { 
                   foreach($company_detail as $company_type)
                   {
                    ?> 
                       <option value="Private Company"<?=$company_type['company_type_name'] == 'Private Company' ? ' selected="selected"' : '';?> >Private Company</option>                  
                       <option value="Listed Company"<?=$company_type['company_type_name'] == 'Listed Company' ? ' selected="selected"' : '';?>>Listed Company</option>
                       <option value="Unlisted Public Company"<?=$company_type['company_type_name'] == 'Unlisted Public Company' ? ' selected="selected"' : '';?>>Unlisted Public Company</option>
                       <option value="Government Company"<?=$company_type['company_type_name'] == 'Government Company' ? ' selected="selected"' : '';?>>Government Company</option>
                       <option value="Nidhi Company"<?=$company_type['company_type_name'] == 'Nidhi Company' ? ' selected="selected"' : '';?>>Nidhi Company</option>
                       <option value="Foreign Company(incl. Branches and Liasion Office)"<?=$company_type['company_type_name'] == 'Foreign Company(incl. Branches and Liasion Office)' ? ' selected="selected"' : '';?>>Foreign Company (incl. Branches and Liasion Office)</option>
                       <option value="Non-Banking Finance Company"<?=$company_type['company_type_name'] == 'Non-Banking Finance Company' ? ' selected="selected"' : '';?>>Non-Banking Finance Company</option>
                       <option value="Banking Company"<?=$company_type['company_type_name'] == 'Banking Company' ? ' selected="selected"' : '';?>>Banking Company</option>
                       <option value="Not for Profit Organisation "<?=$company_type['company_type_name'] == 'Not for Profit Organisation' ? ' selected="selected"' : '';?>>Not for Profit Organisation </option>
                       <option value="others">Others</option> 
                       <?php
                       }
                     }
                     else
                     {
                      ?>
                      <option value="Private Company">Private Company</option>                  
                       <option value="Listed Company">Listed Company</option>
                       <option value="Unlisted Public Company">Unlisted Public Company</option>
                       <option value="Government Company">Government Company</option>
                       <option value="Nidhi Company">Nidhi Company</option>
                       <option value="Foreign Company(incl. Branches and Liasion Office)">Foreign Company (incl. Branches and Liasion Office)</option>
                       <option value="Non-Banking Finance Company">Non-Banking Finance Company</option>
                       <option value="Banking Company">Banking Company</option>
                       <option value="Not for Profit Organisation ">Not for Profit Organisation </option>
                       <option value="others">Others</option>
                       <?php
                     }

                       ?>             
                 </select>
               </div>
               <div class="col-md-6" style="display: none" id="hidden-input">
                     <label for="company-name">Other Company Name <span class="mandatory-star">*</span></label>
                     <input type="text" name="other" id="other" >
                   </div>

             <!--</div>-->
             <!--<div class="row">-->
               
             <!--</div>-->
             <!--<div class="row">-->
               <div class="col-md-6">
                 <label for="name">Financial Year <span class="mandatory-star">*</span></label>
                <select name="financ_year" id="financ_year">                
                    <option></option>
                         <?php
                         for ($i = 2016; $i <= 2036; $i++)
                         {
                          $year = ($i - 1) . "-" . $i;
                          if(isset($_GET['company_edit_id']))
                          {
                          foreach($company_detail as $financial_year)
                           {
                            ?>   
                          <option value="<?php echo $year; ?>"<?=$financial_year['company_detail_financial_year'] == $year ? ' selected="selected"' : '';?>><?php echo $year; ?></option>
                          <?php 
                        } 
                      }
                      else
                      {
                      ?>
                      <option value="<?php echo $year; ?>"><?php echo $year; ?></option>
                      <?php
                      }
                     }
                        ?>

                 </select>
               </div>
               <div class="col-md-6 pr7">
                 <label for="company-name">Cut-off Date for Checking the Compliance <span class="mandatory-star">*</span></label>
                 <!-- <input type="date" id="date" name="date"> -->
                 <input type='date' id="cut_off_date_step_1" class="cut_off_date" value="<?php if(isset($_GET['company_edit_id']))
                              {
                               echo $company_detail[0]['company_detail_cutoff_date'];  
                              }
                             
                               ?>"  >
                
               </div>
             <!--</div>-->
             <!--<div class="row">-->
               <div class="col-md-6">
                 <label for="name">Whether the Company undertakes lending operations in its ordinary course of buisness? (Main object Clause of the Company should consist of lending activity)<span class="mandatory-star">*</span>
                 </label>
                <select  name="lending" id="lending" >                
                   <option>Select</option>
                   <?php
                   if(isset($_GET['company_edit_id'])) 
                   {
                   foreach($company_detail as $lending_operation_option)
                   {
                    ?>
                   <option value="Yes"<?=$lending_operation_option['company_detail_lending_operation'] == 'Yes' ? ' selected="selected"' : '';?>>Yes</option>
                   <option value="No" <?=$lending_operation_option['company_detail_lending_operation'] == 'No' ? ' selected="selected"' : '';?>>No</option> 
                   <?php
                   }
                 }
                 else
                 {
                  ?>
                  <option value="Yes">Yes</option>
                   <option value="No">No</option>        
                 <?php
                 }
                 ?>  
                 </select>
               </div>
               <div class="col-md-6" style="display: none" id="hidden-dd">
                 <label for="name">Whether interest is charged at a rate not less than the rate of prevailing yield of one year, three years, five years or ten years Government security closest to the tenor of the loan<span class="mandatory-star">*</span>
                 </label>
                 <select name="prevailing" id="prevailing">                
                     <option>Select</option>
                                        <?php 
                  if(isset($_GET['company_edit_id']))
                  {
                   foreach($company_detail as $interest_charge_option)
                   {
                    ?>
                   <option value="Yes"<?=$interest_charge_option['company_detail_interest_charge'] == 'Yes' ? ' selected="selected"' : '';?>>Yes</option>
                   <option value="No" <?=$interest_charge_option['company_detail_interest_charge'] == 'No' ? ' selected="selected"' : '';?>>No</option> 
                   <?php
                   }
                 }
                    else
                 {
                  ?>
                  <option value="Yes">Yes</option>
                   <option value="No">No</option>        
                 <?php
                 }
                 ?>  
                                 
                   </select>
 
               </div>
             </div>
           </div>



         <div class="tab">
               <!--borrowing details div-->
            
              <div class="row">
             
               <div class="col-md-6">
                <!-- <h1><?=$id; ?></h1> -->
                 <h5 class="form-headings">Borrowing Details:</h5>
               </div>
               <div class="col-md-6">
                 <h5 class="cut-off-date">Cut_off Date: <span id="cut_off_date_step_2"><?php if(isset($_GET['company_edit_id']))
                              {
                               echo $company_detail[0]['date'];  
                              }
                             ?></span></h5>
               </div>
             </div>
             <div class="row">
               <div class="col-md-6">
                 <label for="name">Borrowings from Banks <span class="mandatory-star">*</span></label>
                 <input type="text" pattern="[0-9]+" onkeypress="return isNumberKey(event)" id="banks" name="banks" value="<?php if(isset($_GET['company_edit_id']))
                              {
                               echo $company_detail[0]['company_detail_borrow_from_banks'];  
                              }
                             
                               ?>"  >
               </div>
               <div class="col-md-6">
                 <label for="name">Borrowings from NBFC <span class="mandatory-star">*</span></label>
                 <input type="text" pattern="[0-9]+"  onkeypress="return isNumberKey(event)" id="nbfc" name="nbfc" value="<?php if(isset($_GET['company_edit_id']))
                              {
                               echo $company_detail[0]['company_detail_borrow_from_nbfc'];  
                              }
                             
                               ?>"   >
               </div>
               <div class="col-md-6">
                 <label for="name">Borrowings from any other Financial institution <span class="mandatory-star">*</span></label>
                 <input type="text" pattern="[0-9]+" onkeypress="return isNumberKey(event)" name="financ_inst" id="financ_inst" value="<?php if(isset($_GET['company_edit_id']))
                              {
                               echo $company_detail[0]['company_detail_borrow_from_other_institude'];  
                              }
                             
                               ?>">
               </div>              

               <div class="col-md-6">
                 <label for="name">Borrowings from Indian Company <span class="mandatory-star">*</span></label>
                 <input type="text" pattern="[0-9]+" onkeypress="return isNumberKey(event)"  name="indian_comp" id="indian_comp" value="<?php if(isset($_GET['company_edit_id']))
                              {
                               echo $company_detail[0]['company_detail_borrow_from_indian_company'];  
                              }
                             
                               ?>" >
               </div>
               <div class="col-md-6">
                 <label for="name">Borrowings from LLP<span class="mandatory-star">*</span></label>
                 <input type="text" pattern="[0-9]+" onkeypress="return isNumberKey(event)" name="llp" id="llp" value="<?php if(isset($_GET['company_edit_id']))
                              {
                               echo $company_detail[0]['company_detail_borrow_from_llp'];  
                              }
                             
                               ?>" >
               </div>
               <div class="col-md-6">
                 <label for="name">Borrowings from Foreign company <span class="mandatory-star">*</span></label>
                 <input type="text" pattern="[0-9]+" onkeypress="return isNumberKey(event)" name="foreign" id="foreign" value="<?php if(isset($_GET['company_edit_id']))
                              {
                               echo $company_detail[0]['company_detail_borrow_from_foreign_company'];  
                              }
                             
                               ?>">
               </div>

             </div>

             <div class="tb-div">
                 
                 <input type="hidden" pattern="[0-9]+" onkeypress="return isNumberKey(event)" name="foreign" id="foreign" value="<?php if(isset($_GET['company_edit_id']))
                              {
                                  
                                  
                               echo $company_detail[0]['company_detail_borrow_from_foreign_company'];  
                              }
                             
                               ?>">
               <h5 class="total-value">Total Borrowings: <b><span id="total"><?php if(isset($_GET['company_edit_id']))
                              {
                             
                      echo preg_replace("/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/i", "$1,", $company_detail[0]['company_detail_total_borrowing']);  
                              }
                             
                               ?></span></b></h5>
             </div>
           <!-- <div class="tb-div">
             <h5 class="total-value">Total Borrowings: <span id="final"> </span></h5>
           </div>
         -->
         <!--paid up share capital div-->
         <div class="row">
           <div class="col-md-6">
             <h5 class="form-headings">Paid up Share Capital (as on cut-off date):</h5>
           </div>
         </div>
         <div class="row">
           <div class="col-md-6">
             <label for="name">Equity Share Capital <span class="mandatory-star">*</span></label>
             <input type="text" pattern="[0-9]+" onkeypress="return isNumberKey(event)" name="equity" id="equity" value="<?php if(isset($_GET['company_edit_id']))
                              {
                                  
                                  
                                   echo  $company_detail[0]['company_detail_equity_share_capital'];
                             
                              }
                             
                               ?>">
           </div>
           <div class="col-md-6">
             <label for="name">Preference share capital <span class="mandatory-star">*</span></label>
             <input type="text" pattern="[0-9]+" onkeypress="return isNumberKey(event)"  name="capital" id="capital" value="<?php if(isset($_GET['company_edit_id']))
                              {
                               
                                 echo  $company_detail[0]['company_detail_preference_share_capital'];   
                
                              }
                             
                               ?>">
           </div>

         </div>

         <div class="row">

           <div class="col-md-6">
             <h5 class="total-value-pc">Total Paid Up Share capital: <b><span id="total_cap"><?php if(isset($_GET['company_edit_id']))
                              {
                                 
                                  echo preg_replace("/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/i", "$1,", $company_detail[0]['company_detail_total_paid_up_share']); 
                              
                              }
                             
                               ?></span></b></h5>
           </div>
           <div class="col-md-6">
             <h5 class="total-value-tpc">Twice of Paid up Share Capital: <b><span id="twice_cap"><?php if(isset($_GET['company_edit_id']))
                              {
                                  
                                    echo preg_replace("/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/i", "$1,", $company_detail[0]['company_detail_twice_paid_up_share']); 
                               
                              }
                             
                               ?></b></span></h5>
           </div>
         </div>


         <div class="row">
           <div class="col-md-6">
             <h5 class="form-headings">Shareholding Details (as on Cut-off date):</h5>
           </div>

         </div>

         <div class="row">
           <div class="col-md-6">
             <label for="name">Whether there is any default in repayment of the above borrowings? (as on cut-off date)<span class="mandatory-star">*</span>
             </label>
             <select id="repayment">                
               <option >Select</option>
               <?php 
                  if(isset($_GET['company_edit_id']))
                  {
                   foreach($company_detail as $company_default_borrowing_option)
                   {
                    ?>
                   <option value="Yes"<?=$company_default_borrowing_option['company_detail_default_borrowings'] == 'Yes' ? ' selected="selected"' : '';?>>Yes</option>
                   <option value="No" <?=$company_default_borrowing_option['company_detail_default_borrowings'] == 'No' ? ' selected="selected"' : '';?>>No</option> 
                   <?php
                   }
                 }
                 else
                 {
                  ?>
                  <option value="Yes">Yes</option>
                   <option value="No">No</option>
                   <?php               
                 }
                 ?>
             </select>
           </div>
           <div class="col-md-6">
             <label for="name">Whether the shareholders include any Body Corporate i.e. a Company, Limited Liability Partnership or Foreign Company? <span class="mandatory-star">*</span></label>
             <select class="sh-box" id="share-holding" >                
               <option>Select</option>
                <?php
                if(isset($_GET['company_edit_id'])) 
                {
                   foreach($company_detail as $company_default_shareholder_option)
                   {
                    ?>
                   <option value="Yes"<?=$company_default_shareholder_option['company_detail_shareholder_corporate'] == 'Yes' ? ' selected="selected"' : '';?>>Yes</option>
                   <option value="No" <?=$company_default_shareholder_option['company_detail_shareholder_corporate'] == 'No' ? ' selected="selected"' : '';?>>No</option> 
                   <?php
                   }
                 }
                  else
                 {
                  ?>
                  <option value="Yes">Yes</option>
                   <option value="No">No</option>
                   <?php               
                 }
                 ?>             
             </select>
           </div>
           <div class="col-md-6" style="display: none" id="hidden-shareholding">
            <div class="inner"> 
              <div class="position-relative form-group triple-dot">
                <label for="specify">Specify the names <span class="mandatory-star">*</span></label> 
               <input type="text"  data-role="tagsinput" id="specify" name="specify" class="form-control  tagsinput tagsinput1" value="<?php if(isset($_GET['company_edit_id']))
                              {
                               echo $company_detail[0]['shareholders_include_body_corporate'];  
                              }
                             
                               ?>"  >
               <a href="#" class="dot-btn3" company_type="specify" data-toggle="modal" data-target="#add-more-tags"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></a>
             </div>
           </div>

         </div>
       </div>   
     </div>
     <div class="tab">
       <!--Details of the following div-->
      
       <div class="row">
         <div class="col-md-6">
           <h5 class="form-headings">Details of the following :</h5>
         </div>
         <div class="col-md-4 new-file ">
       <input type="file"  id="excel_file185"  name="filename" value="upload" accept=".xlsx, .xls, .csv">
        <span class="span_err" id="excel_file185_err"></span>
      
        </div> 
        <div class="col-md-2 templ">
           <a href='Template.xlsx' download><button  title="Download template" type="button" class="report-btn pull-right" >Export&nbsp;template</button></a>  
        </div>
       </div>
       <div class="row">

         <div class="col-md-6">
           <div class="inner"> 
            <div class="position-relative form-group triple-dot">
             <label for="hold_comp">Holding Companies<span class="mandatory-star"></span></label>
             <input type="text"  data-role="tagsinput" id="hold_comp" name="hold_comp" class="form-control  tagsinput tagsinput1" value="<?php if((isset($_GET['company_edit_id'])) && (!empty($sub_company_detail)) )
                              {
                               foreach($sub_company_detail as $sub_company)
                               {

                                if($sub_company['sub_company_type_id']  == '1')
                                {
                                  echo $sub_company['sub_company_type_name'].",";

                                }

                               }
                              }
                             
                               ?> ">
           </div>
         </div>
         <a href="#" id="dot-btn1" company_type="holding_company" class="dot-btn tdn-1" data-toggle="modal" data-target="#add-more-tags"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></a>
       </div>

       <div class="col-md-6">
        <div class="inner"> 
          <div class="position-relative form-group triple-dot">
           <label for="name">Subsidiary Companies <span class="mandatory-star"></span></label>
           <input type="text" data-role="tagsinput" name="subs_comp" id="subs_comp" class="form-control tagsinput tagsinput1" value="<?php if((isset($_GET['company_edit_id'])) && (!empty($sub_company_detail)) )
                              {
                               foreach($sub_company_detail as $sub_company)
                               {

                                if($sub_company['sub_company_type_id']  == '2')
                                {
                                  echo $sub_company['sub_company_type_name'].",";

                                }

                               }
                              }
                             
                               ?> ">
         </div>
       </div>
       <a href="#"  id="dot-btn2"  company_type="sub_company" class="dot-btn tdn-2" data-toggle="modal" data-target="#add-more-tags"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></a>
     </div>
   </div>

   <div class="row">
     <div class="col-md-6">
      <div class="inner"> 
        <div class="position-relative form-group triple-dot">
         <label for="name">Wholly Owned Subidiary Companies <span class="mandatory-star"></span></label>
         <input type="text" data-role="tagsinput" id="wholl_own" name="wholl_own" class="form-control tagsinput tagsinput1" value="<?php if((isset($_GET['company_edit_id'])) && (!empty($sub_company_detail)) )
                              {
                               foreach($sub_company_detail as $sub_company)
                               {

                                if($sub_company['sub_company_type_id']  == '3')
                                {
                                  echo $sub_company['sub_company_type_name'].",";

                                }

                               }
                              }
                             
                               ?> ">
       </div>
     </div>
     <a href="#" class="dot-btn tdn-3" company_type="wholly_company" data-toggle="modal" data-target="#add-more-tags"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></a>
   </div>
   <div class="col-md-6">
     <div class="inner"> 
      <div class="position-relative form-group triple-dot">
       <label for="name">Managing Director <span class="mandatory-star"></span><span class="small-text">(as per Form DIR 12)</span></label>
       <input type="text" data-role="tagsinput"name="form_dir" id="form_dir" class="form-control tagsinput tagsinput1" value="<?php if((isset($_GET['company_edit_id'])) && (!empty($sub_company_detail)) )
                              {
                               foreach($sub_company_detail as $sub_company)
                               {

                                if($sub_company['sub_company_type_id']  == '4')
                                {
                                  echo $sub_company['sub_company_type_name'].",";

                                }

                               }
                              }
                             
                               ?> ">
     </div>
   </div>
   <a href="#" class="dot-btn tdn-4"  company_type="form_company" data-toggle="modal" data-target="#add-more-tags"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></a>
 </div>
</div>

<div class="row">
 <div class="col-md-6">
  <div class="inner"> 
    <div class="position-relative form-group triple-dot">
      <label for="name">Whole time directors <span class="mandatory-star"></span><span class="small-text">(as per Form DIR 12)</span></label>
      <input type="text" data-role="tagsinput" name="whole_time" id="whole_time" class="form-control tagsinput tagsinput1" value="<?php if((isset($_GET['company_edit_id'])) && (!empty($sub_company_detail)) )
                              {
                               foreach($sub_company_detail as $sub_company)
                               {

                                if($sub_company['sub_company_type_id']  == '5')
                                {
                                  echo $sub_company['sub_company_type_name'].",";

                                }

                               }
                              }
                             
                               ?> ">
    </div>
  </div>
  <a href="#" class="dot-btn tdn-5" company_type="whole_company" data-toggle="modal" data-target="#add-more-tags"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></a>
</div>
<div class="col-md-6">
 <div class="inner"> 
  <div class="position-relative form-group triple-dot">
   <label for="name">Director of an Company <span class="mandatory-star">*</span><span class="small-text">(other than covered in Point iv. And v. above)</span></label>
   <input type="text" data-role="tagsinput" name="direc_comp" id="direc_comp" class="form-control tagsinput tagsinput1" value="<?php if((isset($_GET['company_edit_id'])) && (!empty($sub_company_detail)) )
                              {
                               foreach($sub_company_detail as $sub_company)
                               {

                                if($sub_company['sub_company_type_id']  == '6')
                                {
                                  echo $sub_company['sub_company_type_name'].",";

                                }

                               }
                              }
                             
                               ?> ">
 </div>
</div>
<a href="#" class="dot-btn tdn-6" company_type="director_company" data-toggle="modal" data-target="#add-more-tags"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></a>
</div>
</div>

<div class="row">
 <div class="col-md-6">
  <div class="inner"> 
    <div class="position-relative form-group triple-dot">
     <label for="name">Relative of directors <span class="mandatory-star">*</span></label>
     <input type="text" data-role="tagsinput" name="relat_direct" id="relat_direct"  class="form-control tagsinput tagsinput1" value="<?php if((isset($_GET['company_edit_id'])) && (!empty($sub_company_detail)) )
                              {
                               foreach($sub_company_detail as $sub_company)
                               {

                                if($sub_company['sub_company_type_id']  == '7')
                                {
                                  echo $sub_company['sub_company_type_name'].",";

                                }

                               }
                              }
                             
                               ?> ">
   </div>
 </div>
 <a href="#" class="dot-btn tdn-7" company_type="relat_company" data-toggle="modal" data-target="#add-more-tags"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></a>
</div>
<div class="col-md-6">
 <div class="inner"> 
  <div class="position-relative form-group triple-dot">
   <label for="name">Partner of directors in any firm  <span class="mandatory-star"></span><span class="small-text">(incl. LLP)</span></label>
   <input type="text" data-role="tagsinput" name="part_dirc" id="part_dirc" class="form-control tagsinput tagsinput1" value="<?php if((isset($_GET['company_edit_id'])) && (!empty($sub_company_detail)) )
                              {
                               foreach($sub_company_detail as $sub_company)
                               {

                                if($sub_company['sub_company_type_id']  == '8')
                                {
                                  echo $sub_company['sub_company_type_name'].",";

                                }

                               }
                              }
                             
                               ?> ">
 </div>
</div>
<a href="#" class="dot-btn tdn-8" company_type="part_company" data-toggle="modal" data-target="#add-more-tags"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></a>
</div>
</div>

<div class="row">       
 <div class="col-md-6">
   <div class="inner"> 
    <div class="position-relative form-group triple-dot">
     <label for="name">Firm in which Director is a Partner <span class="mandatory-star"></span><span class="small-text">(incl. LLP)</span></label>
     <input type="text" data-role="tagsinput" name="dirc_part" id="dirc_part" class="form-control tagsinput tagsinput1" value="<?php if((isset($_GET['company_edit_id'])) && (!empty($sub_company_detail)) )
                              {
                               foreach($sub_company_detail as $sub_company)
                               {

                                if($sub_company['sub_company_type_id']  == '9')
                                {
                                  echo $sub_company['sub_company_type_name'].",";

                                }

                               }
                              }
                             
                               ?> ">
   </div>
 </div>
 <a href="#" class="dot-btn tdn-9" company_type="dirc_company" data-toggle="modal" data-target="#add-more-tags"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></a>
</div>
<div class="col-md-6">
 <div class="inner"> 
  <div class="position-relative form-group triple-dot">
   <label for="name">Firm in which relative of Director is a Partner <span class="mandatory-star"></span><span class="small-text">(incl. LLP)</span></label>
   <input type="text" data-role="tagsinput" name="rel_dirc" id="rel_dirc" class="form-control tagsinput tagsinput1" maxlength="10" value="<?php if((isset($_GET['company_edit_id'])) && (!empty($sub_company_detail)) )
                              {
                               foreach($sub_company_detail as $sub_company)
                               {

                                if($sub_company['sub_company_type_id']  == '10')
                                {
                                  echo $sub_company['sub_company_type_name'].",";

                                }

                               }
                              }
                             
                               ?> ">
 </div>
</div>
<a href="#" class="dot-btn tdn-10"  company_type="rel_company" data-toggle="modal" data-target="#add-more-tags"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></a>
</div>

</div>

<div class="row">
 <div class="col-md-6">
   <div class="inner"> 
    <div class="position-relative form-group triple-dot">
     <label for="name">Private Companies in which Director is a Director <span class="mandatory-star"></span></label>
     <input type="text" data-role="tagsinput" name="priv_comp" id="priv_comp"  class="form-control tagsinput tagsinput1" maxlength="10" value="<?php if((isset($_GET['company_edit_id'])) && (!empty($sub_company_detail)) )
                              {
                               foreach($sub_company_detail as $sub_company)
                               {

                                if($sub_company['sub_company_type_id']  == '11')
                                {
                                  echo $sub_company['sub_company_type_name'].",";

                                }

                               }
                              }
                             
                               ?> ">
   </div>
 </div>
 <a href="#" class="dot-btn tdn-11" company_type="priv_company" data-toggle="modal" data-target="#add-more-tags"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></a>
</div>
<div class="col-md-6">
 <div class="inner"> 
  <div class="position-relative form-group triple-dot">
   <label for="name">Private Companies in which Director is a Member <span class="mandatory-star"></span></label>
   <input type="text" data-role="tagsinput"name="direc_mem" id="direc_mem" class="form-control tagsinput tagsinput1" maxlength="10" value="<?php if((isset($_GET['company_edit_id'])) && (!empty($sub_company_detail)) )
                              {
                               foreach($sub_company_detail as $sub_company)
                               {

                                if($sub_company['sub_company_type_id']  == '12')
                                {
                                  echo $sub_company['sub_company_type_name'].",";

                                }

                               }
                              }
                             
                               ?> ">
 </div>
</div>
<a href="#" class="dot-btn tdn-12"  company_type="mem_company" data-toggle="modal" data-target="#add-more-tags"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></a>
</div>
</div>

<div class="row">
 <div class="col-md-6">
   <div class="inner"> 
    <div class="position-relative form-group triple-dot">
     <label for="name">Director of Holding Company <span class="mandatory-star"></span></label>

     <input type="text" data-role="tagsinput" name="direc_hold_comp" id="direc_hold_comp" class="form-control tagsinput tagsinput1" maxlength="10" value="<?php if((isset($_GET['company_edit_id'])) && (!empty($sub_company_detail)) )
                              {
                               foreach($sub_company_detail as $sub_company)
                               {

                                if($sub_company['sub_company_type_id']  == '13')
                                {
                                  echo $sub_company['sub_company_type_name'].",";

                                }

                               }
                              }
                             
                               ?> ">
   </div>
 </div>
 <a href="#" class="dot-btn tdn-13" company_type="direc_hold_company" data-toggle="modal" data-target="#add-more-tags"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></a>
</div>
</div>

<div class="row">
 <div class="col-md-6">
  <div class="inner"> 
    <div class="position-relative form-group triple-dot">
     <label class="mh">Companies / LLPs wherein director either singly or jointly with other directors of lending company has 25% or more voting power of the borrowing Company/LLP?
      <span class="mandatory-star"></span></label>
      <input type="text" data-role="tagsinput" name="llp_comp"  id= "llp_comp" class="form-control tagsinput tagsinput1" maxlength="10" value="<?php if((isset($_GET['company_edit_id'])) && (!empty($sub_company_detail)) )
                              {
                               foreach($sub_company_detail as $sub_company)
                               {

                                if($sub_company['sub_company_type_id']  == '14')
                                {
                                  echo $sub_company['sub_company_type_name'].",";

                                }

                               }
                              }
                             
                               ?> ">
    </div>
  </div>
  <a href="#" class="dot-btn2 tdn-14" company_type="llp_company" data-toggle="modal" data-target="#add-more-tags"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></a>
</div>
<div class="col-md-6">
  <div class="inner"> 
    <div class="position-relative form-group triple-dot">
     <label for="name">Companies / LLPs wherein any of the board of directors or managing directors or manager or the partners of borrowing company / LLP are working as per the instructions of the board of directors or any directors of lending company.
      <span class="mandatory-star"></span></label>
      <input type="text" data-role="tagsinput" name="llp_comp_lead"  id="llp_comp_lead" class="form-control tagsinput tagsinput1" maxlength="10" value="<?php if((isset($_GET['company_edit_id'])) && (!empty($sub_company_detail)) )
                              {
                               foreach($sub_company_detail as $sub_company)
                               {

                                if($sub_company['sub_company_type_id']  == '15')
                                {
                                  echo $sub_company['sub_company_type_name'].",";

                                }

                               }
                              }
                             
                               ?> ">
    </div>
  </div>
  <a href="#" class="dot-btn2 tdn-15"  company_type="llp_comp_company" data-toggle="modal" data-target="#add-more-tags"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></a>
</div>
</div>


</div>
      <!--party wise details-->
      <div class="tab">
        
       <div class="row">
         <div class="col-md-7">
           <h5 class="form-headings">Party-wise details of transactions enetered as on cut-off date:</h5>
         </div>
          <input type="hidden" id="given_id" name="given_id" value="">
       </div>
 
 
       <div class="row part-wise-accord">
         <div class="col-md-12">
           <div id="accordion" class="panel-group">
             <div class="panel">
               <div class="panel-heading">
                 <h4 class="panel-title">
                   <a href="#panelBodyOne" class="accordion-toggle" data-toggle="collapse" data-parent="#accordion">Given Loan To</a>
                 </h4>
               </div>
               <div id="panelBodyOne" class="panel-collapse collapse show">
                 <div class="panel-body">
                  <div class="row">
                   <div class="col-md-5">
                    <label for="name">User Input <span class="mandatory-star"></span></label>
                    <select name="select" id="sub_company" class="txtTeamAddDelete">
                    <option>Select User Input </option>
                    </select>

                   </div>
                   <div class="col-md-5">
                     <label for="name">Relations </label>
                     <input type="text" id="relation" class="txtCricketerAddDelete" >
                   </div>
                    
                     <input type="hidden" name="sub_id" class="sub_id" value="'+sub_id+'">
                 
                    
                   <!-- <div class="col-md-2">
                   <button class="accord-ambtn btnrowAddDelete">Add More</button>
                  </div> -->
                   <div class="col-md-2">                  
                     <a href="javascript:void(0);" class="accord-ambtn  btnrowAddDelete"> Add </a>                   
                   </div>
                 </div>
 
                 <div class="row">
                   <div class="col-md-12">
                     <div class="float table-responsive dash-table-stats"> 
                      <table id="given_loan" class="table table-bordered table-hover TableAddDelete" >
                       <thead class="thead-dark">
                        <tr>
                         <th scope="col">User Input</th>
                         <th scope="col">Relations</th>
                       </tr>
                       
                        
                     </thead>
                     <tbody>
                      
                   </tbody>
                 </table>
 
               </div>
             </div>
           </div>
 
 
         </div>
       </div>
     </div>
     <div class="panel">
       <div class="panel-heading">
         <h4 class="panel-title">
           <a href="#panelBodyTwo" class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion">Loan Represented as Book debt </a>
         </h4>
       </div>
       <div id="panelBodyTwo" class="panel-collapse collapse">
         <div class="panel-body">
          <div class="row">
           <div class="col-md-5">
              
             <label for="name">User Input <span class="mandatory-star"></span></label>
            <select name="select" id="loan_represent"  class="txtTeamAddDelete1">
                 
                 <option>Select User Input </option>
             
                </select>
           </div>
           <div class="col-md-5">
             <label for="name">Relations </label>
             <input type="text" id="relation1"  class="txtCricketerAddDelete1"  name="">
           </div>
           <div class="col-md-2">                   
             <a href="javascript:void(0);" class="accord-ambtn btnrowAddDelete1">Add </a>                   
           </div>
         </div>
 
         <div class="row">
           <div class="col-md-12">
             <div class="float table-responsive dash-table-stats"> 
              <table id="loan" class="table table-bordered table-hover TableAddDelete1">
               <thead class="thead-dark">
                <tr>
                 <th scope="col">User Input</th>
                 <th scope="col">Relations</th>
               </tr>
                 
             </thead>
             <tbody>
             
           </tbody>
         </table>
 
       </div>
     </div>
   </div>
 
 
 </div>
 </div>
 </div>
 <div class="panel">
   <div class="panel-heading">
     <h4 class="panel-title">
       <a href="#panelBodyThree" class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion">Guarantee Given in respect of Loan taken by </a>
     </h4>
   </div>
   <div id="panelBodyThree" class="panel-collapse collapse">
     <div class="panel-body">
      <div class="row">
       <div class="col-md-5">
         <label for="name">User Input <span class="mandatory-star"></span></label>
          <select name="select" id="guarantee" class="txtTeamAddDelete2">
                 
                 <option>Select User Input </option>
              
                </select>
       </div>
       <div class="col-md-5">
         <label for="name">Relations </label>
         <input type="text" id="relation2" class="txtCricketerAddDelete2" name="">
       </div>
       <div class="col-md-2">                   
         <a  href="javascript:void(0);" class="accord-ambtn btnrowAddDelete2">Add</a>                   
       </div>
     </div>
 
     <div class="row">
       <div class="col-md-12">
         <div class="float table-responsive dash-table-stats"> 
          <table id="guarantee_loan" class="table table-bordered table-hover TableAddDelete2">
           <thead class="thead-dark">
            <tr>
             <th scope="col">User Input</th>
             <th scope="col">Relations</th>
           </tr>
         
         </thead>
         <tbody>
         
       </tbody>
     </table>
 
   </div>
 </div>
 </div>
 
 
 </div>
 </div>
 </div>
 <div class="panel">
   <div class="panel-heading">
     <h4 class="panel-title">
       <a href="#panelBodyFour" class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion">Security Provided to </a>
     </h4>
   </div>
   <div id="panelBodyFour" class="panel-collapse collapse">
     <div class="panel-body">
      <div class="row">
       <div class="col-md-5">
         <label for="name">User Input <span class="mandatory-star"></span></label>
         <select name="select" id="security" class="txtTeamAddDelete3">
               <option>Select User Input </option>
              
                </select>
       </div>
       <div class="col-md-5">
         <label for="name">Relations </label>
         <input type="text" id="relation3"  class="txtCricketerAddDelete3"name="">
       </div>
       <div class="col-md-2">                   
         <a href="javascript:void(0);" class="accord-ambtn btnrowAddDelete3">Add</a>                   
       </div>
     </div>
 
     <div class="row">
       <div class="col-md-12">
         <div class="float table-responsive dash-table-stats"> 
          <table id="security_loan" class="table table-bordered table-hover TableAddDelete3">
           <thead class="thead-dark">
            <tr>
             <th scope="col">User Input</th>
             <th scope="col">Relations</th>
           </tr>
          
         </thead>
         <tbody>
          
       </tbody>
     </table>
 
   </div>
 </div>
 </div>
  
 
 </div>
 </div>
 </div>
 </div>
 </div>
 </div>
 
 </div>
 
 <input type="hidden" id="step" name="step" value="">
 <div class="buttons-section">
 <div class="step-titles pull-left">
             <span class="step"><p>Step 1</p></span>
             <span class="step"><p>Step 2</p></span>
             <span class="step"><p>Step 3</p></span>
             <span class="step"><p>Step 4</p></span>
 </div>
   <div class="pull-right">
     <button type="button"  id="drftBtn" onclick="draft_185(-1)">Save as Draft</button>
     <button type="button" id="prevBtn" onclick="prev_185(-1)">
       Previous
     </button>
     
     <button type="button" id="nextBtn" >Next</button>
     <button type="button" class="submit-one185" href="#" >Submit</button>
   </div>
 </div>
  <!--</form> -->
 </div>
 </div>
 </div>
 
 </div>
 </div>
 </div>

<footer class="footer">
    <div class="container-fluid">
     <p>GBCA & Associates LLP, Chartered Accountants. © 2021 All Rights Reserved. Powered by OneRoof Technologies LLP.</p>
   </div>
   </footer>
   </div>
   

        </div>
      </div>



</div>




 <script type="text/javascript" src="assets/js/section-a.js"></script> 
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>

    <script>
      $("#company-select").select2({
          placeholder: "Select",
          allowClear: true
      });
      $("#financ_year").select2({
          placeholder: "Select",
          allowClear: true
      });
      $("#loan_represent").select2({
          placeholder: "Select",
          allowClear: true
      });
      $("#sub_company").select2({
          placeholder: "Select",
          allowClear: true
      });
      $("#security").select2({
          placeholder: "Select",
          allowClear: true
      });
      $("#guarantee").select2({
          placeholder: "Select",
          allowClear: true
      });
    </script>

<?php require_once("includes/footer.php"); ?>
<script>
 $(function() {
$( "#cut_off_date_step_1" ).datepicker();
});

// var pp= $("a[class*='tdn']").length;

// $("#side").on('click',function(){
//    $(this).val('#side');
//    alert($(this).val('#side'));
//    $(this).attr('category-name');
//    $("#e_product_name").val($(this).attr('product-name'));
//    $("#e_category_name").val($(this).attr('category-name'));
// })
 
function isNumberKey(evt)
{
	var charCode = (evt.which) ? evt.which : event.keyCode
	if (charCode > 31 && (charCode < 48 || charCode > 57))
	return false;

	return true;
}

function convertValueToComma(){
    
}

</script>
<script>
  $("#menu-toggle").click(function(e) {
        e.preventDefault();
        $("#wrapper").toggleClass("active");
});



$('.dot-btn').on("click",function()
{
     var c_type =$(this).attr('company_type');
     var result='';
    
     if(c_type=='specify')
     {
       var result = $('#specify').val();   
     }
     if(c_type=='holding_company')
     {
       var result = $('#hold_comp').val();   
     }
     if(c_type=='sub_company')
     {
       var result = $('#subs_comp').val();   
     }
      if(c_type=='wholly_company')
     {
       var result = $('#wholl_own').val();   
     }
     if(c_type=='form_company')
     {
       var result = $('#form_dir').val();   
     }
      if(c_type=='whole_company')
     {
       var result = $('#whole_time').val();   
     }
      if(c_type=='director_company')
     {
       var result = $('#direc_comp').val();   
     }
      if(c_type=='relat_company')
     {
       var result = $('#relat_direct').val();   
     }
      if(c_type=='part_company')
     {
       var result = $('#part_dirc').val();   
     }
       if(c_type=='dirc_company')
     {
       var result = $('#dirc_part').val();   
     }
       if(c_type=='rel_company')
     {
       var result = $('#rel_dirc').val();   
     }
       if(c_type=='priv_company')
     {
       var result = $('#priv_comp').val();   
     }
       if(c_type=='mem_company')
     {
       var result = $('#direc_mem').val();   
     }
      if(c_type=='direc_hold_company')
     {
       var result = $('#direc_hold_comp').val();   
     }
     
     
    document.getElementById("company_tags").value= result;
  
    
});

$('.dot-btn3').on("click",function()
{
     var c_type =$(this).attr('company_type');
     var result='';
    
     if(c_type=='specify')
     {
       var result = $('#specify').val();   
     }
   
     
    document.getElementById("company_tags").value= result;
  
    
});
$('.dot-btn2').on("click",function()
{
     var c_type =$(this).attr('company_type');
     var result='';
    
      if(c_type=='llp_company')
     {
       var result = $('#llp_comp').val();   
     }
      if(c_type=='llp_comp_company')
     {
       var result = $('#llp_comp_lead').val();   
     }
   
     
    document.getElementById("company_tags").value= result;
  
    
});
// $(".form-group").on("change",function() {
//   // var val = $("#hold_comp").val();
//     var val= $(this).closest("div.form-group").find(".form-control").val();
//     alert(val);
//     // var val=$(this).prev('input').attr('id');
//     // $('.company_tags').tagsInput();
    
//     document.getElementById("company_tags").value= val; 
//     // alert(val);
// });

// $(document).ready(function(){        
//   $('#tags-input').tagsInput();
//   var tagsValue = 'Jakarta,Bogor,Bandung';
//   $('#tags-input').val(tagsValue);
// });

$('#regForm').submit(function (e) {
      e.preventDefault();
  });
</script>

</body>
</html>
