MOON
Server: Apache
System: Linux e2e-78-16.ssdcloudindia.net 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
User: imensosw (1005)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/imensosw/www/imenso.co/matrix/admin/show_doc.php
<?php include 'admin_header.php';?>
<?php
error_reporting(0);
// assuming file.zip is in the same directory as the executing script.
// include('../PHPExcel/Classes/PHPExcel/IOFactory.php');
  
require '../vendor/autoload.php';

use PhpOffice\PhpSpreadsheet\Spreadsheet;

// $inputFileName = "../docs/".$_GET['assignment_no']."/".$_GET['assignment_no'].".xls";
$FileName = "../docs/".$_GET['assignment_no']."/".$_GET['assignment_no'].".xls" ;
// echo $FileName;
// die();
if(file_exists($FileName))
{
    $fileType = "Xls";
    $inputFileName = $FileName; 
}
else{
    $fileType = "Xlsx";
    $inputFileName = "../docs/".$_GET['assignment_no']."/".$_GET['assignment_no'].".xlsx";
}

/*$inputFileType = PHPExcel_IOFactory::identify($inputFileName);
$excel2 = PHPExcel_IOFactory::createReader($inputFileType);
$excel2 = $objPHPExcel = $excel2->load($inputFileName);
// Empty Sheet
$sheet = $objPHPExcel->getSheet(0);
$highestRow = $sheet->getHighestRow();
$highestColumn = $sheet->getHighestColumn();*/

 // $reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
    // $spreadsheet = $reader->load($inputFileName);

$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($inputFileName);

    $d=$spreadsheet->getSheet(0)->toArray();
    $sheet = $spreadsheet->getActiveSheet();
    // Get the highest row and column numbers referenced in the worksheet
    $highestRow = $sheet->getHighestRow(); // e.g. 10
    $highestColumn = $sheet->getHighestColumn(); // e.g 'F'
$rowData="";
?>
<div class="container-area">

  <div class="container-fluid h-100">

    <div class="row">

      <div class="left-side border-right">

          <ul class="list-group list-group-flush" >

            <?php 
              for ($row = 1; $row <= $highestRow; $row++) {

               //  Read a row of data into an array

                 $rowData = $sheet->rangeToArray('A' . $row . ':' . $highestColumn . $row, NULL, TRUE, FALSE);

                $check_data="";
                /*print_r($rowData);*/

                if($rowData[0][0]!="Document ID"){
                  if($rowData[0][3]!=""){
                    $check_data = "done doubt";
                  }
                  else if($rowData[0][2]!="" || $rowData[0][1]!="")
                  {
                    $check_data = "done";
                  }
                  else{
                    $check_data = "default";
                  }


                  /*if($rowData[0][2]!="" || $rowData[0][3]!=""){

                    if($rowData[0][3]==""){

                      $check_data = "done";

                    }

                    else{

                      $check_data = "done doubt";

                    }

                  }

                  else{

                    $check_data = "default";

                  }*/

             ?>

            <li class="list-group-item p-0 <?php echo $check_data; ?>" >

              <a href="javascript:;" id="row_link" data-row_id="<?php echo $row; ?>" data-doc_id="<?php echo $rowData[0][0]; ?>"><?php echo $rowData[0][0]; ?></a>

            </li>

          <?php } } ?>

          

          </ul>

      </div>

      <div class="right-side">

        <div class="row h-100">

          <div class="col-md-12 h-100">

            <!-- <h2 class="m-0">View PDF</h2>

            <hr /> -->
            
            <iframe id="row_iframe" src="" width="100%" class="h-100"></iframe>

          </div>

        </div>

        <!-- <div class="footer-right border-top">

          

        </div> -->

      </div>

    </div>

  </div>

</div>

<?php //include 'footer_data.php'; ?>