Files
crm.twinpol.com/modules/EcmCharts/chartHelper.php
2025-05-12 15:44:39 +00:00

40 lines
1.0 KiB
PHP
Executable File

<?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")));
}
?>