<?php include 'includes/header.php'; 
 //session_start();

require_once("lib/helper.php");

$sub_id=$_COOKIE["company_detail_id"];

?>
<!DOCTYPE html>

<html lang="en">
<body>


		<div class="page-container hidden-on-narrow">
			<div class="pdf-page size-a4" style="margin: 0 auto;
			color: #333;
			position: relative;
			background:#fff bottom center no-repeat;
			width: 8.3in; height: auto;">
				<div class="pdf-header" style="position: absolute;
				top: .5in;
				height: .6in;
				left: 30px;
				right: .5in;">
					<span class="company-logo">
						<img src="assets/img/logo.png" style="height: 70px;" alt="logo">
					</span>

				</div>

				<div class="for" style="position: absolute;
				top: 0.3in;
				left: 2.3in;
				width: 59%;
				font-size: 18px;
				color: #254796;
				text-decoration: underline;">
					<h3>Report Card for Eligibility Test of Section 2(22)e of the Income Tax Act, 1961
					</h3>
				</div>
      <?php
 
                //$id=$_SESSION['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= $sub_id");
          
           {
           ?>


				<div class="pdf-body" style="position: absolute;
				top: 9%;
				bottom: 1.2in;
				left: 0%;
				right: .5in;">
					<div class="from" style="position: absolute;
					top: 1.5in;
					right: .5in;
					width: 2.5in;">
						<h3>Date:<?= $detail[0]["company_detail_cutoff_date"]; ?></h3>
						<h3>Checker:<?= $detail[0]["company_detail_checker_name"]; ?></h3>
			
					</div>
					<div class="co-name" style="position: absolute;
					top: 1.5in;
					left: .5in;
					width: 100%;">
						<h3><?=$detail[0]["company_name"]; ?></h3>
						<h3>Maker:<?=$detail[0]["company_detail_maker_name"]; ?></h3>
						
<?php
             }
            ?>


                 
						
						<p>A.List of Shareholders to whom the company cannot extend any Loan or Advance </p>

                     <?php
    $company_arr = $obj->select("*,gbca_company_shareholding_name,gbca_company_shareholding_percentage","gbca_company_shareholding_master","gbca_company_shareholding_company_id='$sub_id' AND  gbca_company_shareholding_percentage >=10 AND gbca_company_shareholding_excel_type='1'");
                                // echo "<pre>";print_r($company_arr);echo "</pre>";exit;
                              //print_r($company_arr);
                          $type_of_concern_company_arr = $obj->select("*","gbca_company_shareholding_master","gbca_company_shareholding_company_id='$sub_id' and gbca_company_shareholding_type_of_concern = 'company'");

                          $type_of_concern_other_than_company_arr = $obj->select("*","gbca_company_shareholding_master","gbca_company_shareholding_company_id='$sub_id' and gbca_company_shareholding_type_of_concern != 'company'"); 

                                ?>


						<table cellpadding="0" cellspacing="0" style="width: 100%;
						margin: 0 auto 3em 0;
						border-collapse: collapse;">



							<thead>
								<tr>
									<th scope="col" style="background: rgba(20,133,204,0.2);
									border: 1px solid #CCC;
		padding: 5px;
		width: 5%;
		font-size: 0.9em;
		text-align: left;">Sr. No.</th>
									<th scope="col"style="background: rgba(20,133,204,0.2);
									border: 1px solid #CCC;
		padding: 5px;
		width: 20%;
		font-size: 0.9em;
		text-align: left;">Name of the Shareholder</th>
									<th scope="col"style="background: rgba(20,133,204,0.2);
									border: 1px solid #CCC;
		padding: 5px;
		width: 20%;
		font-size: 0.9em;
		text-align: left;">% Eq. Shareholding </th>
								</tr>
							</thead>
							<tbody>

								<?php

                            if(is_array($company_arr))
                            {
                              $i = 1;
                              foreach($company_arr as $company)
                              {
                                ?>
								<tr>
									<td style="border: 1px solid #CCC;
									padding: 5px;
									width: 5%;
									font-size: 0.9em;
									text-align: left;"><?php echo $i; ?></td>
									<td style="border: 1px solid #CCC;
									padding: 5px;
									width: 20%;
									font-size: 0.9em;
									text-align: left;"><?php echo $company['gbca_company_shareholding_name'];?></td>
									<td style="border: 1px solid #CCC;
									padding: 5px;
									width: 20%;
									font-size: 0.9em;
									text-align: left;"><?php echo $company['gbca_company_shareholding_percentage']; ?></td>
										
								</tr>
									<?php
                                    $i++;

                                  }
                                } ?>
							</tbody>
						</table>
						<p>B. List of Concerns, being companies, to whom you cannot extend any Loan or Advance		</p>
						<table cellpadding="0" cellspacing="0" style="width: 100%;
						margin: 0 auto 3em 0;
						border-collapse: collapse;">
							<thead>

								<tr>
									<th scope="col"style="background: rgba(20,133,204,0.2);
									border: 1px solid #CCC;
		padding: 5px;
		width: 5%;
		font-size: 0.9em;
		text-align: left;">Sr. No.</th>
									<th scope="col"style="background: rgba(20,133,204,0.2);
									border: 1px solid #CCC;
		padding: 5px;
		width: 20%;
		font-size: 0.9em;
		text-align: left;">Name of the Company</th>
									<th scope="col"style="background: rgba(20,133,204,0.2);
									border: 1px solid #CCC;
		padding: 5px;
		width: 20%;
		font-size: 0.9em;
		text-align: left;">Substantial Interest of  </th>
		<th scope="col"style="background: rgba(20,133,204,0.2);
									border: 1px solid #CCC;
		padding: 5px;
		width: 20%;
		font-size: 0.9em;
		text-align: left;">% Shareholding / % Interest  </th>
								</tr>
							</thead>
							<tbody>
								<?php

                            if(is_array($type_of_concern_company_arr))
                            {
                              foreach($type_of_concern_company_arr as $type_of_concern_company)
                              {
                                ?>
								<tr>
									<td style="border: 1px solid #CCC;
									padding: 5px;
									width: 5%;
									font-size: 0.9em;
									text-align: left;"><?php echo $i; ?></td>
									<td style="border: 1px solid #CCC;
									padding: 5px;
									width: 20%;
									font-size: 0.9em;
									text-align: left;"><?php echo $type_of_concern_company['gbca_company_shareholding_type_of_concern'];?></td>
									<td style="border: 1px solid #CCC;
									padding: 5px;
									width: 20%;
									font-size: 0.9em;
									text-align: left;"><?php echo $type_of_concern_company['gbca_company_shareholding_name']; ?></td>
									<td style="border: 1px solid #CCC;
									padding: 5px;
									width: 20%;
									font-size: 0.9em;
									text-align: left;"><?php echo $type_of_concern_company['gbca_company_shareholding_percentage']; ?></td>
								</tr>
									<?php
                                    $i++;

                                  }
                                } ?>
							
							</tbody>
						</table>
						<p>C. List of Parties to whom the company can advance Loan or Provide any Security or Give any guarantee in respect of loan taken by such party without any conditions</p>
						<table cellpadding="0" cellspacing="0" style="width: 100%;
						margin: 0 auto 3em 0;
						border-collapse: collapse;">
							<thead>
								<tr>
									<th scope="col"style="background: rgba(20,133,204,0.2);
									border: 1px solid #CCC;
		padding: 5px;
		width: 5%;
		font-size: 0.9em;
		text-align: left;">Sr. No.</th>
									<th scope="col"style="background: rgba(20,133,204,0.2);
									border: 1px solid #CCC;
		padding: 5px;
		width: 20%;
		font-size: 0.9em;
		text-align: left;">Name of the Company</th>
									<th scope="col"style="background: rgba(20,133,204,0.2);
									border: 1px solid #CCC;
		padding: 5px;
		width: 20%;
		font-size: 0.9em;
		text-align: left;">Substantial Interest of  </th>
									<th scope="col"style="background: rgba(20,133,204,0.2);
									border: 1px solid #CCC;
		padding: 5px;
		width: 20%;
		font-size: 0.9em;
		text-align: left;">% Shareholding / % Interest </th>
								</tr>
							</thead>
							<tbody>

								<?php

                            if(is_array($type_of_concern_other_than_company_arr))
                            {
                              $i = 1;
                              foreach($type_of_concern_other_than_company_arr as $type_of_concern_other_than_company)
                              {
                                ?>
								<tr>
									<td style="border: 1px solid #CCC;
									padding: 5px;
									width: 5%;
									font-size: 0.9em;
									text-align: left;"><?php echo $i; ?></td>
									<td style="border: 1px solid #CCC;
									padding: 5px;
									width: 20%;
									font-size: 0.9em;
									text-align: left;"><?php echo $type_of_concern_other_than_company['gbca_company_shareholding_type_of_concern'];?></td>
									<td style="border: 1px solid #CCC;
									padding: 5px;
									width: 20%;
									font-size: 0.9em;
									text-align: left;"><?php echo $type_of_concern_other_than_company['gbca_company_shareholding_name']; ?></td>
									<td style="border: 1px solid #CCC;
									padding: 5px;
									width: 20%;
									font-size: 0.9em;
									text-align: left;"><?php echo $type_of_concern_other_than_company['gbca_company_shareholding_percentage']; ?></td>
								</tr>
								
								<?php
                                    $i++;

                                  }
                                } ?>
							</tbody>
						</table>


						

						<!-- <h3>Maker: Dummy text</h3>
						<h3>Checker: Dummy text</h3> -->
						<h3 style="text-align:right;font-size: 1.07em;">Date of Export:<?=date('d F Y')?></h3>

						</div>

						<div class="data1">

						</div>

					</div>

				</div>
			</div>
			<div class="responsive-message"></div>
		</div>
	</body>