-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
1,979 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
class InformacineSitema | ||
{ | ||
public $kodas; | ||
public $pavadinimas; | ||
|
||
public function __construct($kodas, $pavadinimas){ | ||
$this->kodas = $kodas; | ||
$this->pavadinimas = $pavadinimas; | ||
} | ||
} | ||
|
||
/* | ||
Informaciiniø sistemø parseris | ||
$xlsData Spreadsheet_Excel_Reader klasës objektas | ||
*/ | ||
class ISParseris | ||
{ | ||
static public function rastiIS($xlsData, $sheetNr){ | ||
$res = array(); | ||
|
||
for ($i = 2; $i <= $xlsData->rowcount($sheetNr); $i++){ | ||
$IS = new InformacineSistema($xlsData->val($i, 1, $sheetNr), $xlsData->val($i, 2, $sheetNr)); | ||
$res[] = $IS; | ||
} | ||
|
||
return($res); | ||
} | ||
|
||
/*Bandoma nustatyti ar dokumentas yra tikrai padaliniø sarasas*/ | ||
static function validuotiDokumenta(){ | ||
return(TRUE); | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
require_once("Padalinys.php"); | ||
|
||
class IS_PadaliniaiParseris | ||
{ | ||
static public function rastiIS_Padalinius($xlsData, $sheetNr){ | ||
$res = array(); | ||
|
||
for ($i = 2; $i <= $xlsData->colcount($sheetNr) - 1; $i++){ | ||
$padalinioKodas = $xlsData->val(3, $i, $sheetNr); | ||
$padalinys = new Padalinys($padalinioKodas, ""); | ||
$res[] = $padalinys; | ||
|
||
for ($j = 4; $j <= $xlsData->rowcount($sheetNr) - 1; $j++){ | ||
$isKodas = $xlsData->val($j, 1, $sheetNr); | ||
if ($xlsData->val($j, $i, $sheetNr) == "1"){ | ||
$padalinys->naudojamosIS[] = $isKodas; | ||
} | ||
} | ||
} | ||
|
||
return($res); | ||
} | ||
|
||
/*Bandoma nustatyti ar dokumentas yra tikrai padaliniø sarasas*/ | ||
static public function validuotiDokumenta(){ | ||
return(TRUE); | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
require_once("Padalinys.php"); | ||
|
||
class PadaliniaiParseris | ||
{ | ||
static public function rastiPadalinius($xlsData, $sheetNr){ | ||
$res = array(); | ||
|
||
for ($i = 2; $i <= $xlsData->rowcount($sheetNr); $i++){ | ||
$padalinys = new Padalinys($xlsData->val($i, 1, $sheetNr), $xlsData->val($i, 2, $sheetNr)); | ||
$res[] = $padalinys; | ||
} | ||
|
||
return($res); | ||
} | ||
|
||
/*Bandoma nustatyti ar dokumentas yra tikrai padaliniø sarasas*/ | ||
static public function validuotiDokumenta(){ | ||
return(TRUE); | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
class Padalinys | ||
{ | ||
public $kodas; | ||
public $pavadinimas; | ||
public $naudojamosIS = array(); //informaciniu sistemu kodai | ||
public $paramosPriemones = array(); //ParamosPriemone objektu masyvas | ||
|
||
public function __construct($kodas, $pavadinimas){ | ||
$this->kodas = $kodas; | ||
$this->pavadinimas = $pavadinimas; | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
require_once("ParamosPriemone.php"); | ||
|
||
class ParamosAdministravimasParseris | ||
{ | ||
static public function rastiAdministravimoSanaudas($xlsData, $sheetNr) | ||
{ | ||
$res = array(); | ||
|
||
for ($i = 2; $i <= $xlsData->colcount($sheetNr) - 1; $i++){ | ||
$padalinys = new Padalinys($xlsData->val(3, $i, $sheetNr), ""); | ||
$res[] = $padalinys; | ||
|
||
for ($j = 4; $j <= $xlsData->rowcount($sheetNr) - 1; $j++){ | ||
$paramosPriemonesKodas = $xlsData->val($j, 1, $sheetNr); | ||
$paramosPriemone = new ParamosPriemone($paramosPriemonesKodas, ""); | ||
$paramosPriemone->administravimoSanaudos = (float)$xlsData->val($j, $i, $sheetNr); | ||
$padalinys->paramosPriemones[] = $paramosPriemone; | ||
} | ||
} | ||
|
||
return $res; | ||
} | ||
|
||
/*Bandoma nustatyti ar dokumentas yra tikrai paramos priemoniu sarasas*/ | ||
static public function validuotiDokumenta(){ | ||
return(TRUE); | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
class ParamosKiekiai | ||
{ | ||
public $priemonesKodas; | ||
public $paramosNuo; | ||
public $paramosIki; | ||
public $kiekis; | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
require_once("ParamosKiekiai.php"); | ||
|
||
class ParamosKiekiaiParseris | ||
{ | ||
static public function rastiParamosKiekius($xlsData, $sheetNr) | ||
{ | ||
$res = array(); | ||
|
||
for ($i = 2; $i <= $xlsData->rowcount($sheetNr); $i++){ | ||
$paramosKiekiai = new ParamosKiekiai(); | ||
$paramosKiekiai->priemonesKodas = $xlsData->val($i, 1, $sheetNr); | ||
$paramosKiekiai->paramosNuo = $xlsData->val($i, 2, $sheetNr); | ||
$paramosKiekiai->paramosIki = $xlsData->val($i, 3, $sheetNr); | ||
$paramosKiekiai->kiekis = $xlsData->val($i, 4, $sheetNr); | ||
$res[] = $paramosKiekiai; | ||
} | ||
|
||
return($res); | ||
} | ||
|
||
/*Bandoma nustatyti ar dokumentas yra tikrai paramos priemoniu sarasas*/ | ||
static public function validuotiDokumenta(){ | ||
return(TRUE); | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
class ParamosPriemone | ||
{ | ||
public $kodas; | ||
public $pavadinimas; | ||
public $administravimoSanaudos; | ||
|
||
public function __construct($kodas, $pavadinimas){ | ||
$this->kodas = $kodas; | ||
$this->pavadinimas = $pavadinimas; | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
require_once("ParamosPriemone.php"); | ||
|
||
class ParamosPriemoniuKryptis | ||
{ | ||
public $pavadinimas; | ||
public $paramosPriemones = array(); | ||
} | ||
|
||
class ParamosPriemonesParseris | ||
{ | ||
|
||
/* | ||
Ið "Paramos priemoniø" xls failo iðparsina visas kryptis, paramos priemones ir gràþina jas masyve. | ||
Masyvas yra klasiø ParamosPriemoniuKryptis tipo. | ||
*/ | ||
static public function rastiKryptis($xlsData, $sheetNr){ | ||
$res = array(); | ||
|
||
for ($i = 2; $i <= $xlsData->rowcount($sheetNr); $i++){ | ||
$line = $xlsData->val($i, 2, $sheetNr); | ||
|
||
if (strpos($line, "KRYPTIS") !== FALSE){ | ||
$pavadinimas = explode("KRYPTIS", $line); | ||
$kryptis = new ParamosPriemoniuKryptis(); | ||
$kryptis->pavadinimas = $pavadinimas[1]; | ||
$res[] = $kryptis; | ||
} | ||
else{ | ||
$pavadinimas = explode(".", $line); | ||
$paramosPriemone = new ParamosPriemone($xlsData->val($i, 1, $sheetNr), $pavadinimas[1]); | ||
$res[sizeof($res) - 1]->paramosPriemones[] = $paramosPriemone; | ||
} | ||
} | ||
return($res); | ||
} | ||
|
||
/*Bandoma nustatyti ar dokumentas yra tikrai paramos priemoniu sarasas*/ | ||
static public function validuotiDokumenta(){ | ||
return(TRUE); | ||
} | ||
} | ||
?> |
Oops, something went wrong.