Add php files
This commit is contained in:
40
modules/EcmCharts/chartHelper.php
Executable file
40
modules/EcmCharts/chartHelper.php
Executable file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
function repl($t){
|
||||
$a1=array("ą","ś","ę","ż","ź","ć","ń","ó","ł","Ą","Ś","Ę","Ż","Ź","Ć","Ń","Ó","Ł");
|
||||
$a2=array("a","s","e","z","z","c","n","o","l","A","S","E","Z","Z","C","N","O","L");
|
||||
return str_replace($a1,$a2,$t);
|
||||
}
|
||||
function multisort($data,$keys){
|
||||
if(count($data)>0){
|
||||
foreach($data as $key => $row)
|
||||
{
|
||||
foreach($keys as $k)
|
||||
{
|
||||
$cols[$k['key']][$key] = $row[$k['key']];
|
||||
}
|
||||
}
|
||||
|
||||
$idkeys=@array_keys($data);
|
||||
$i=0;
|
||||
foreach($keys as $k)
|
||||
{
|
||||
if($i>0)$sort.=',';
|
||||
$sort.='$cols['.$k['key'].']';
|
||||
if($k['sort'])$sort.=',SORT_'.strtoupper($k['sort']);
|
||||
if($k['type'])$sort.=',SORT_'.strtoupper($k['type']);
|
||||
$i++;
|
||||
}
|
||||
$sort.=',$idkeys';
|
||||
$sort='@array_multisort('.$sort.');';
|
||||
eval($sort);
|
||||
foreach($idkeys as $idkey)
|
||||
{
|
||||
$result[$idkey]=$data[$idkey];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
function sum($year){
|
||||
return unserialize(base64_decode(file_get_contents("/var/www/html/e5crm/modules/EcmReports/cache".$year.".dat")));
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user