\n";
$detailRowFront = array();
$detailRowNumber = array();
$detailRowEnd = array();
$detailRowMax = 0;
$activeMonthValue = 0;
$activeDays = 0;
echo "\t\n";
echo "\t\t";
echo substr($activeFile, 0, 7);
echo " | \n\t\t";
//content array of active file aka DAYS
foreach ($csvContent as $activeLine) {
$activeCell = explode ('|' , $activeLine );
if ($tarifgruppe == "datenvolumen" && stripos($activeCell[8], "internet") !== false){
//datenvolumen was selected and this is a matching csv line
//Cell22 has the traffic in kb
$activeMonthValue += rtrim($activeCell[22], " KB")/1000;
//save month details for later
$detailRowFront[$activeDays] = "\t\t\t\t |
".
//empty cell on front
" | ".
//date of detail
"".$activeCell[13]." | ".
//text description of detail
"".$activeCell[21]." | ".
//Trafficdetail with graph
"".$activeCell[22]." | ".
"
\n";
$activeDays++;
}else if ($tarifgruppe == "sms" && stripos($activeCell[8], "sms") !== false ){
//sms was selected and this is a matching csv line
if ("" == $activeCell[24]){
//all SMS are in detail available
$activeMonthValue += 1;
$detailRowFront[$activeDays] = "\t\t\t\t".
//empty cell on front
" | ".
//date of detail
"".$activeCell[13]." | ".
//text description of detail
"".$activeCell[21]." | ".
//receipient of SMS
"".$activeCell[15]." | ".
//SMS-detail with graph
"1 SMS | ".
"
\n";
}else{
//all SMS are summed up
$activeMonthValue += $activeCell[24];
$detailRowFront[$activeDays] = "\t\t\t\t".
//empty cell on front
" | ".
//date of detail
"".$activeCell[13]." | ".
//text description of detail
"".$activeCell[21]." | ".
//SMS-detail with graph
"".$activeCell[24]." | ".
"
\n";
}
$activeDays++;
}else if ($tarifgruppe == "telefoniekosten" && (stripos($activeCell[8], "verbindungen") !== false || (stripos($activeCell[8], "anrufe") !== false ))){
//euro was selected and this is a matching csv line
if (0 == str_replace(",",".",$activeCell[17])){
//charges were included in a voucher, so no charge had to be paid
//calculate the saved charge
$activeMonthValue += str_replace(",",".",trim($activeCell[9], "()G"));
$detailRowFront[$activeDays] = "\t\t\t\t".
//empty cell on front
" | ".
//date and time of detail
"".$activeCell[13]." ".$activeCell[14]." | ".
//duration of call
"Dauer: ".$activeCell[16]." | ".
//Type of Call (H=Homezone)
"".$activeCell[25]." | ".
//destination of call
"".$activeCell[8]."; Teilnehmer: ".$activeCell[15]." | ".
//charge of call, could be empty if flatrate
"".($activeCell[9]===""?0:$activeCell[9]).$valuesuffix." | ".
"
\n";
}else{
//normal billing of call
$activeMonthValue += str_replace(",",".",$activeCell[17]);
$detailRowFront[$activeDays] = "\t\t\t\t".
//empty cell on front
" | ".
//date and time of detail
"".$activeCell[13]." ".$activeCell[14]." | ".
//duration of call
"Dauer: ".$activeCell[16]." | ".
//Type of Call (H=Homezone)
"".$activeCell[25]." | ".
//destination of call
"".$activeCell[8]."; Teilnehmer: ".$activeCell[15]." | ".
//charge of call
"".$activeCell[17].$valuesuffix." | ".
"
\n";
}
$activeDays++;
}else if ($tarifgruppe == "telefonieminuten" && (stripos($activeCell[8], "verbindungen") !== false || (stripos($activeCell[8], "anrufe") !== false ))){
//minute calculation was selected and this is a matching csv line
$activeMonthValue += strtotime("Jan 1 1970 ".$activeCell[16]." UTC")/60;
$detailRowFront[$activeDays] = "\t\t\t\t".
//empty cell on front
" | ".
//date and time of detail
"".$activeCell[13]." ".$activeCell[14]." | ".
//Type of Call (H=Homezone)
"".$activeCell[25]." | ".
//destination of call
"".$activeCell[8]."; Teilnehmer: ".$activeCell[15]." | ".
//duration of call
"".number_format(strtotime("Jan 1 1970 ".$activeCell[16]." UTC")/60, 2, ',', '.').$valuesuffix." | ".
"
\n";
$activeDays++;
}
}
$detailRowFoot = "\t\t\t
\n";
echo $activeDays;
echo "\n";
if ($Limit < $activeMonthValue){
echo "\t\t".'