$procentEcm = 0; if ($totalECM > 0) { $procentEcm = (int) ($ecmhit_ECMOK / $totalECM * 100); } $procentEcmAfisat = procentColor($procentEcm); if ($totalECM == 0) { $totalECM = "<FONT COLOR=red>-</FONT>"; $procentEcmAfisat = "-"; } echo "<td class=\"tabel_ecm\">" . $totalECM . "</td>"; echo "<td class=\"tabel_ecm\">" . $procentEcmAfisat . "</td>"; echo "<td class=\"Node_Provider\" NOWRAP>" . providerID($caid, $p, true) . "</td>"; unset($clienti_sortat); if (isset($identsClients[$identECM]["Clients"])) { foreach ($identsClients[$identECM]["Clients"] as $clientProvider) { $key = adaug0($identsClientsUsage[$clientProvider][$identECM]["ecm"], 15) . $clientProvider; $clienti_sortat[$key]["clientProvider"] = $clientProvider; } krsort($clienti_sortat); $j = 0; echo "<td class=\"Node_clienti\">"; foreach ($clienti_sortat as $key => $valoare) { $clientProvider = $clienti_sortat[$key]["clientProvider"]; if ($j > 0) { echo " , "; } echo "<A HREF=" . $pagina . "?username={$clientProvider}>" . $clientProvider . "</A>"; $valecmok = $identsClientsUsage[$clientProvider][$identECM]["ecmok"]; $valecm = $identsClientsUsage[$clientProvider][$identECM]["ecm"]; if ($valecmok > 0) { echo "<FONT color=green> " . $valecmok . "</FONT>";
*/ //format1("Unique",$info_total_unic,$info_total); //format1("Reshare",$info_total_reshare,$info_total_unic); $ecm_total = 0; $ecmOK_total = 0; foreach ($servers[$sh_host]["Info"]["Idents"] as $hit_data) { $hit_array = explode(" ", $hit_data); if ($hit_array[0] != "") { $hit_provider = explode(":", $hit_array[1]); $hit_exact = explode("(", $hit_array[2]); $hit_exact2 = explode(")", $hit_exact[1]); $hit_ecm = $hit_exact[0]; $hit_ecmOK = $hit_exact2[0]; $ecm_total = $ecm_total + $hit_ecm; $ecmOK_total = $ecmOK_total + $hit_ecmOK; $key = adaug0($hit_ecmOK, 20) . adaug0($hit_ecm, 20) . $hit_array[1]; $ecmok_sortat[$key] = $hit_data; } } loadECMServers(true); echo "<BR>"; $record_ECM = $ECMservers[$sh_host]["Info"]["ECM_SAVED"]["ECM"]; $record_ECMOK = $ECMservers[$sh_host]["Info"]["ECM_SAVED"]["ECMOK"]; if ($ecm_total == $record_ECM && $ecmOK_total == $record_ECMOK) { format1("Handled ECM", $record_ECMOK, $record_ECM); } else { if ($record_ECM != "") { format1("Handled ECM ( saved )", $record_ECMOK, $record_ECM); } format1("Handled ECM ( now )", $ecmOK_total, $ecm_total); }
} else { $key = adaug0($totalECM, 20) . adaug0($procentEcm, 3) . $sh_host; } } else { $key = "-" . adaug0($procentEcm, 3) . $sh_host; } } if ($sort == "ecmokpercent") { if ($totalECM > 0) { if ($totalECMOK > 0) { $key = adaug0($procentEcm, 3) . adaug0($totalECMOK, 10) . $sh_host; } else { $key = adaug0($procentEcm, 3) . adaug0($totalECM, 10) . $sh_host; } } else { $key = "-" . adaug0($totalECMOK, 5) . $sh_host; } } //echo $sh_host."<BR>"; //================================ $servers_sortat[$key] = $sh_host; $servers_sortat_value[$key]["client_host"] = $client_host; $servers_sortat_value[$key]["total_nodes"] = $total_nodes; $servers_sortat_value[$key]["totalECM"] = $totalECM; $servers_sortat_value[$key]["totalECMOK"] = $totalECMOK; $servers_sortat_value[$key]["procentEcm"] = $procentEcm; } if ($sort != "") { if ($ordine == 1) { krsort($servers_sortat); } else {
if ($servercount != "total") { if ($provider_ecmhitcount == $provider_ecmhit) { $nrprovider++; } } } } } if (!isset($provider_cautat[1])) { list($hitt_caid, $hitt_providers) = explode(":", $provider_ecmhit); echo "<td class=\"Node_clienti\" rowspan=\"{$nrprovider}\" NOWRAP>" . providerID($hitt_caid, $hitt_providers) . "</td>"; } unset($clienti_sortat); if (isset($identsClients[$provider_ecmhit]["Clients"])) { foreach ($identsClients[$provider_ecmhit]["Clients"] as $clientProvider) { $key = adaug0($identsClientsUsage[$clientProvider][$provider_ecmhit]["ecm"], 15) . $clientProvider; $clienti_sortat[$key]["clientProvider"] = $clientProvider; } } if (isset($clienti_sortat)) { krsort($clienti_sortat); } $i = 0; echo "<td class=\"Node_clienti\" rowspan=\"{$nrprovider}\">"; if (isset($clienti_sortat)) { foreach ($clienti_sortat as $key => $valoare) { $clientProvider = $clienti_sortat[$key]["clientProvider"]; if ($i > 0) { echo " , "; } echo "<A HREF=" . $pagina . "?username={$clientProvider}>" . $clientProvider . "</A>";
function UpdateHitProviders() { global $usedProviders; global $usedProvidersFile; LoadUsedProviders(); global $servers_file; $servers_data = file($servers_file); foreach ($servers_data as $currentline) { $inceput1 = substr($currentline, 0, 1); $inceput2 = substr($currentline, 1, 2); if ($inceput1 == "|" && $inceput2 != " H") { $server = explode("|", $currentline); $server_Idents = trim($server[7]); $hit_array = explode(" ", $server_Idents); if ($hit_array[0] != "") { $hit_caid = $hit_array[1]; $hit_provider = explode(":", $hit_caid); $hit_exact = explode("(", $hit_array[2]); $hit_exact2 = explode(")", $hit_exact[1]); $hit_ecm = $hit_exact[0]; $hit_ecmOK = $hit_exact2[0]; if (!isset($ecm_hit[$hit_caid])) { $ecm_hit[$hit_caid] = 0; } $ecm_hit[$hit_caid] += $hit_ecmOK; } } } foreach ($ecm_hit as $hit_caid => $hit_info) { if ($hit_info > 1) { $hit_provider = explode(":", $hit_caid); $hit_caid = adaug0($hit_provider[0], 4) . ":" . adaug0($hit_provider[1], 6); $usedProviders[$hit_caid] = $hit_info; } } ksort($usedProviders); $fp = @fopen($usedProvidersFile, "w"); global $CCcam_providers; foreach ($usedProviders as $S_CAID => $data) { if (!IsFakeProvider($S_CAID)) { if (isset($CCcam_providers[$S_CAID])) { fwrite($fp, $S_CAID . " " . $CCcam_providers[$S_CAID] . "\n"); } else { fwrite($fp, $S_CAID . " Unknown Provider\n"); } } } fclose($fp); }
$share_Type = trim($share[2]); $share_Caid = trim($share[3]); $share_System = trim($share[4]); $share_ProvidersList = trim($share[5]); if ($share_ProvidersList == "0,1,2,3,0") { $share_ProvidersList = "0,1,2,3"; } // pt premiere if ($share_ProvidersList == "") { $share_ProvidersList = $str_empty; } $share_Providers = explode(",", $share_ProvidersList); list($share_Hop, $share_Reshare) = explode(" ", trim($share[6])); $share_Nodes = explode(",", trim($share[7])); $share_Node = $share_Nodes[count($share_Nodes) - 1]; $share_Caid = adaug0($share_Caid, 4); $share_Node = sterg0($share_Node); if ($share_Node == "") { $share_NodeUnic = $share_Caid . "|" . $share_System . "|" . $share_ProvidersList . "|" . $share_Host; } else { $share_NodeUnic = $share_Caid . "|" . $share_System . "|" . $share_ProvidersList . "|" . $share_Node; } $route = 0; if (isset($nodes) && isset($nodes[$share_NodeUnic])) { $route = count($nodes[$share_NodeUnic]); } $nodes[$share_NodeUnic]["total"] = $route; if ($route == 0) { $nodes[$share_NodeUnic]["total"] = 1; } $nodes[$share_NodeUnic][$route] = array($share_Host, $share_Type, $share_Caid, $share_System, $share_ProvidersList, $share_Providers, $share_Hop, $share_Reshare, $share_Nodes, $share_Node);
if ($client["Info"][10] != -1) { $key = "-0" . $key; } $ordine = 1; } else { if ($sort == "lastshare") { $key = adaug0($client["Info"][8], 10) . $username; if ($client["Info"][10] != -1) { $key = "-" . $key; } else { $key = "+" . $key; } $ordine = 2; } else { if ($sort == "ecmtime") { $key = adaug0($client["Info"][9], 10) . $username; if ($client["Info"][10] != -1) { $key = "-" . $key; } else { $key = "+" . $key; } $ordine = 2; } } } } } } } } }
echo "<th class=\"tabel_headerc\">#</th>"; echo "<th class=\"tabel_headerc\">Ecm</th>"; echo "<th class=\"tabel_headerc\">Handled</th>"; echo "<th class=\"tabel_headerc\">%</th>"; echo "<td class=\"tabel_header\">Provider Name</th>"; echo "</tr>"; $i = 1; if (count($ecmhit) > 0) { //ksort($ecmhit); foreach ($ecmhit as $caid => $info) { if ($caid != "total") { $ecmhit_ECMOK = 0; if (isset($ecmhit[$caid]["Info"]["ECMOK"])) { $ecmhit_ECMOK = $ecmhit[$caid]["Info"]["ECMOK"]; } $key = adaug0($ecmhit_ECMOK, 20) . "_" . $caid; $servers_sortat[$tip_ecmhit][$key] = $caid; //echo $key."<BR>"; } } krsort($servers_sortat[$tip_ecmhit]); foreach ($servers_sortat[$tip_ecmhit] as $key => $caid) { $info = $ecmhit[$caid]; echo "<tr>"; $hit_provider = explode(":", $caid); $caidECM = $hit_provider[0]; $pECM = $hit_provider[1]; echo "<td class=\"Node_count\">" . $i . "</td>"; //------------- ECM $totalECM = 0; $ecmhit_ECMOK = 0;