add contraint , that everybody expect admin is limited to 3 days, Add card package

This commit is contained in:
2016-02-13 17:23:43 +01:00
parent 556bdc3066
commit 70f43468af
37 changed files with 1418 additions and 19 deletions

View File

@@ -0,0 +1,44 @@
<?php
namespace common\components;
class XLSUtil {
public $objPHPExcel;
public function loadFromFileName($inputFileName) {
// Read your Excel workbook
try {
$inputFileType = \PHPExcel_IOFactory::identify ( $inputFileName );
$objReader = \PHPExcel_IOFactory::createReader ( $inputFileType );
$this->objPHPExcel = $objReader->load ( $inputFileName );
echo "type is: " . $inputFileType;
} catch ( Exception $e ) {
\Yii::error ( "failed to read xls" );
throw $e;
}
}
/**
* first sheet to array
*/
public function toArray( ) {
$objPHPExcel = $this->objPHPExcel;
$array = [ ];
// Get worksheet dimensions
$sheet = $objPHPExcel->getActiveSheet();
//$highestColumn = $sheet->getHighestColumn();
$hr = $sheet->getHighestRow();
foreach ( $sheet->getRowIterator () as $row ) {
$arrayRow = [];
$cellIterator = $row->getCellIterator ();
$cellIterator->setIterateOnlyExistingCells ( false ); // Loop all cells, even if it is not set
foreach ( $cellIterator as $cell ) {
$arrayRow [] = $cell->getCalculatedValue();
}
$array[] = $arrayRow;
}
return $array;
}
}