本文整理匯總了PHP中MathZDC函數的典型用法代碼示例。如果您正苦於以下問題:PHP MathZDC函數的具體用法?PHP MathZDC怎麽用?PHP MathZDC使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了MathZDC函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _QXZ
$ASCII_text .= "| " . _QXZ("Scheduled callbk:", 19) . " {$SC_count} {$SC_percent}% |\n";
$ASCII_text .= "| " . _QXZ("Completed:", 19) . " {$COMP_count} {$COMP_percent}% |\n";
$ASCII_text .= "+--------------------------------------------------------------+\n";
for ($d = 0; $d < count($graph_stats); $d++) {
if ($d == 0) {
$class = " first";
} else {
if ($d + 1 == count($graph_stats)) {
$class = " last";
} else {
$class = "";
}
}
$CALLS_graph .= " <tr><td class='chart_td{$class}'>" . $graph_stats[$d][0] . "</td><td nowrap class='chart_td value{$class}'><img src='images/bar.png' alt='' width='" . round(MathZDC(400 * $graph_stats[$d][1], $max_calls)) . "' height='16' />" . $graph_stats[$d][1] . "</td></tr>";
$DURATION_graph .= " <tr><td class='chart_td{$class}'>" . $graph_stats[$d][0] . "</td><td nowrap class='chart_td value{$class}'><img src='images/bar.png' alt='' width='" . round(MathZDC(400 * $graph_stats[$d][2], $max_duration)) . "' height='16' />" . sec_convert($graph_stats[$d][2], 'H') . "</td></tr>";
$HANDLETIME_graph .= " <tr><td class='chart_td{$class}'>" . $graph_stats[$d][0] . "</td><td nowrap class='chart_td value{$class}'><img src='images/bar.png' alt='' width='" . round(MathZDC(400 * $graph_stats[$d][3], $max_handletime)) . "' height='16' />" . sec_convert($graph_stats[$d][3], 'H') . "</td></tr>";
}
$CALLS_graph .= "<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>" . trim($total_calls) . "</th></tr></table>";
$DURATION_graph .= "<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>" . sec_convert($total_duration, 'H') . "</th></tr></table>";
$HANDLETIME_graph .= "<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>" . sec_convert($total_handle_time, 'H') . "</th></tr></table>";
$JS_onload .= "\tDraw" . $list_id . "Graph('CALLS', '1');\n";
$JS_text .= "function Draw" . $list_id . "Graph(graph, th_id) {\n";
$JS_text .= "\tvar CALLS_graph=\"{$CALLS_graph}\";\n";
$JS_text .= "\tvar DURATION_graph=\"{$DURATION_graph}\";\n";
$JS_text .= "\tvar HANDLETIME_graph=\"{$HANDLETIME_graph}\";\n";
$JS_text .= "\n";
$JS_text .= "\tfor (var i=1; i<=3; i++) {\n";
$JS_text .= "\t\tvar cellID=\"list_" . $list_id . "_graph\"+i;\n";
$JS_text .= "\t\tdocument.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
$JS_text .= "\t}\n";
$JS_text .= "\tvar cellID=\"list_" . $list_id . "_graph\"+th_id;\n";
示例2: MathZDC
$login_sec = $login_start_end_check;
}
if ($ASsessions[$k] < 1) {
$ASsessions[$k] = 1;
}
$avg_session_sec = MathZDC($login_sec, $ASsessions[$k]);
$avg_pause_sec = MathZDC($ASpause_sec[$k], $ASpauses[$k]);
$avg_pause_session = MathZDC($ASpauses[$k], $ASsessions[$k]);
if ($ASpauses[$k] < 1 or $login_sec < 1) {
$pct_pause = 100;
} else {
$pct_pause = MathZDC($ASpause_sec[$k], $login_sec) * 100;
}
$avg_cust_sec = MathZDC($cust_sec, $AScalls[$k]);
$avg_wait_sec = MathZDC($ASwait_sec[$k], $AScalls[$k]);
$pct_of_queue = MathZDC($AScalls[$k], $total_calls) * 100;
if ($AScalls[$k] < 1) {
$cust_sec = 0;
$wait_sec = 0;
} else {
$cust_sec = $AStalk_sec[$k] - $ASdead_sec[$k];
$wait_sec = $ASwait_sec[$k];
}
$avg_session_sec = round($avg_session_sec);
$avg_pause_sec = round($avg_pause_sec);
$avg_pause_session = round($avg_pause_session);
$pct_pause = round($pct_pause, 1);
$avg_cust_sec = round($avg_cust_sec);
$avg_wait_sec = round($avg_wait_sec);
$pct_of_queue = round($pct_of_queue, 1);
$login_sec = sec_convert($login_sec, $time_format);
示例3: round
$m++;
}
##### END loop through each user formatting data for output
for ($i = 0; $i < count($graph_stats); $i++) {
if ($i == 0) {
$class = " first";
} else {
if ($i + 1 == count($graph_stats)) {
$class = " last";
} else {
$class = "";
}
}
$GRAPH .= " <tr>\n";
$GRAPH .= "\t<th class=\"thgraph{$class}\" scope=\"col\">" . $graph_stats[$i][0] . "</th>\n";
$GRAPH .= "\t<th class=\"thgraph value{$class}\" scope=\"col\" nowrap><img src=\"images/bar.png\" alt=\"\" width=\"" . round(MathZDC(200 * $graph_stats[$i][1], $max_time)) . "\" height=\"16\" />" . sec_convert($graph_stats[$i][1], 'H') . $graph_stats[$i][2] . "</th>\n";
$GRAPH .= "\t<th class=\"thgraph{$class}\" scope=\"col\">" . $graph_stats[$i][3] . "</th>\n";
$GRAPH .= " </tr>\n";
}
$TOT_AGENTS = sprintf("%4s", $m);
$k = $m;
if ($DB) {
$ASCII_text .= _QXZ("Done analyzing") . "... {$TOTwait}|{$TOTtalk}|{$TOTdispo}|{$TOTpause}|{$TOTALtime}|{$TOTcalls}|{$uc}|<BR>\n";
}
### BEGIN sort through output to display properly ###
if (preg_match('/NAME|ID|TCLOCK|GROUP/', $stage) and $k > 0) {
if (preg_match('/ID/', $stage)) {
sort($TOPsort, SORT_NUMERIC);
}
if (preg_match('/TCLOCK/', $stage)) {
rsort($TOPsort, SORT_NUMERIC);
示例4: sprintf
$Aavg_hold[$h] = sprintf("%4s", $Aavg_hold[$h]);
while (strlen($Aavg_hold[$h]) > 4) {
$Aavg_hold[$h] = preg_replace('/^./', '', $Aavg_hold[$h]);
}
$MAIN .= "|{$HMdisplay[$h]}| {$qrtCALLS[$h]} | {$Phd__0[$h]} {$Phd_20[$h]} {$Phd_40[$h]} {$Phd_60[$h]} {$Phd_80[$h]} {$Phd100[$h]} {$Phd120[$h]} {$Phd121[$h]} | | {$Aavg_hold[$h]} |{$qrtQUEUEavg_scale[$h]}|\n";
$CSV_text .= "\"{$HMdisplay[$h]}\",\"{$qrtCALLS[$h]}\",\"{$Phd__0[$h]}\",\"{$Phd_20[$h]}\",\"{$Phd_40[$h]}\",\"{$Phd_60[$h]}\",\"{$Phd_80[$h]}\",\"{$Phd100[$h]}\",\"{$Phd120[$h]}\",\"{$Phd121[$h]}\",\"{$Aavg_hold[$h]}\"\n";
$h++;
}
$APhd__0 = round(MathZDC($ALLhd__0, $ALLcalls) * 100);
$APhd_20 = round(MathZDC($ALLhd_20, $ALLcalls) * 100);
$APhd_40 = round(MathZDC($ALLhd_40, $ALLcalls) * 100);
$APhd_60 = round(MathZDC($ALLhd_60, $ALLcalls) * 100);
$APhd_80 = round(MathZDC($ALLhd_80, $ALLcalls) * 100);
$APhd100 = round(MathZDC($ALLhd100, $ALLcalls) * 100);
$APhd120 = round(MathZDC($ALLhd120, $ALLcalls) * 100);
$APhd121 = round(MathZDC($ALLhd121, $ALLcalls) * 100);
$ALLcalls = sprintf("%5s", $ALLcalls);
$APhd__0 = sprintf("%4s", $APhd__0);
$APhd_20 = sprintf("%4s", $APhd_20);
$APhd_40 = sprintf("%4s", $APhd_40);
$APhd_60 = sprintf("%4s", $APhd_60);
$APhd_80 = sprintf("%4s", $APhd_80);
$APhd100 = sprintf("%4s", $APhd100);
$APhd120 = sprintf("%4s", $APhd120);
$APhd121 = sprintf("%4s", $APhd121);
while (strlen($totQUEUEavg) > 4) {
$totQUEUEavg = preg_replace('/.$/', '', $totQUEUEavg);
}
$MAIN .= "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n";
$MAIN .= "| " . _QXZ("TOTAL", 11) . " | {$ALLcalls} | {$APhd__0} {$APhd_20} {$APhd_40} {$APhd_60} {$APhd_80} {$APhd100} {$APhd120} {$APhd121} | | {$totQUEUEavg} |\n";
$MAIN .= "+-------------+-------+-----------------------------------------+ +------+\n";
示例5: round
$class = " last";
} else {
$class = "";
}
}
$CALLS_graph .= " <tr><td class='chart_td{$class}'>" . $graph_stats[$q][0] . "</td><td nowrap class='chart_td value{$class}'><img src='images/bar.png' alt='' width='" . round(MathZDC(400 * $graph_stats[$q][1], $max_calls)) . "' height='16' />" . $graph_stats[$q][1] . "</td></tr>";
$ANSWER_graph .= " <tr><td class='chart_td{$class}'>" . $graph_stats[$q][0] . "</td><td nowrap class='chart_td value{$class}'><img src='images/bar.png' alt='' width='" . round(MathZDC(400 * $graph_stats[$q][2], $max_answer)) . "' height='16' />" . $graph_stats[$q][2] . "</td></tr>";
$TALK_graph .= " <tr><td class='chart_td{$class}'>" . $graph_stats[$q][0] . "</td><td nowrap class='chart_td value{$class}'><img src='images/bar.png' alt='' width='" . round(MathZDC(400 * $graph_stats[$q][3], $max_talk)) . "' height='16' />" . sec_convert($graph_stats[$q][3], 'H') . "</td></tr>";
$AVGTALK_graph .= " <tr><td class='chart_td{$class}'>" . $graph_stats[$q][0] . "</td><td nowrap class='chart_td value{$class}'><img src='images/bar.png' alt='' width='" . round(MathZDC(400 * $graph_stats[$q][4], $max_avgtalk)) . "' height='16' />" . sec_convert($graph_stats[$q][4], 'H') . "</td></tr>";
$QUEUE_graph .= " <tr><td class='chart_td{$class}'>" . $graph_stats[$q][0] . "</td><td nowrap class='chart_td value{$class}'><img src='images/bar.png' alt='' width='" . round(MathZDC(400 * $graph_stats[$q][5], $max_queue)) . "' height='16' />" . sec_convert($graph_stats[$q][5], 'H') . "</td></tr>";
$AVGQUEUE_graph .= " <tr><td class='chart_td{$class}'>" . $graph_stats[$q][0] . "</td><td nowrap class='chart_td value{$class}'><img src='images/bar.png' alt='' width='" . round(MathZDC(400 * $graph_stats[$q][6], $max_avgqueue)) . "' height='16' />" . sec_convert($graph_stats[$q][6], 'H') . "</td></tr>";
$MAXQUEUE_graph .= " <tr><td class='chart_td{$class}'>" . $graph_stats[$q][0] . "</td><td nowrap class='chart_td value{$class}'><img src='images/bar.png' alt='' width='" . round(MathZDC(400 * $graph_stats[$q][7], $max_maxqueue)) . "' height='16' />" . sec_convert($graph_stats[$q][7], 'H') . "</td></tr>";
$TOTALABANDONS_graph .= " <tr><td class='chart_td{$class}'>" . $graph_stats[$q][0] . "</td><td nowrap class='chart_td value{$class}'><img src='images/bar.png' alt='' width='" . round(MathZDC(400 * $graph_stats[$q][8], $max_totalabandons)) . "' height='16' />" . $graph_stats[$q][8] . "</td></tr>";
}
$gTOTtalk_avg = round(MathZDC($gTOTtalk_sec, $gTOTanswer_count));
$gTOTqueue_avg = round(MathZDC($gTOTqueue_seconds, $gTOTcalls_count));
$gTOTtalk_sec = sec_convert($gTOTtalk_sec, 'H');
$gTOTtalk_avg = sec_convert($gTOTtalk_avg, 'H');
$gTOTqueue_seconds = sec_convert($gTOTqueue_seconds, 'H');
$gTOTqueue_avg = sec_convert($gTOTqueue_avg, 'H');
$gTOTmax_queue_seconds = sec_convert($gTOTmax_queue_seconds, 'H');
$CALLS_graph .= "<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>" . trim($gTOTcalls_count) . "</th></tr></table>";
$ANSWER_graph .= "<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>" . trim($gTOTanswer_count) . "</th></tr></table>";
$TALK_graph .= "<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>" . trim($gTOTtalk_sec) . "</th></tr></table>";
$AVGTALK_graph .= "<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>" . trim($gTOTtalk_avg) . "</th></tr></table>";
$QUEUE_graph .= "<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>" . trim($gTOTqueue_seconds) . "</th></tr></table>";
$AVGQUEUE_graph .= "<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>" . trim($gTOTqueue_avg) . "</th></tr></table>";
$MAXQUEUE_graph .= "<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>" . trim($gTOTmax_queue_seconds) . "</th></tr></table>";
$TOTALABANDONS_graph .= "<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>" . trim($gTOTdrop_count) . "</th></tr></table>";
$JS_onload .= "\tDrawGraph('CALLS', '1');\n";
$JS_text .= "function DrawGraph(graph, th_id) {\n";
示例6: mysqli_num_rows
if ($DB) {
echo "{$stmt}\n";
}
$talking_to_print = mysqli_num_rows($rslt);
if ($talking_to_print > 0) {
$i = 0;
while ($i < $talking_to_print) {
$row = mysqli_fetch_row($rslt);
$user = sprintf("%-8s", $row[0]);
$leadid = sprintf("%-10s", $row[1]);
$group = sprintf("%-14s", $row[2]);
$phone = sprintf("%-10s", $row[3]);
$status = sprintf("%-6s", $row[4]);
$start_time = sprintf("%-19s", $row[5]);
$call_time_S = $row[6];
$call_time_M = MathZDC($call_time_S, 60);
$call_time_M = round($call_time_M, 2);
$call_time_M_int = intval("{$call_time_M}");
$call_time_SEC = $call_time_M - $call_time_M_int;
$call_time_SEC = $call_time_SEC * 60;
$call_time_SEC = round($call_time_SEC, 0);
if ($call_time_SEC < 10) {
$call_time_SEC = "0{$call_time_SEC}";
}
$call_time_MS = "{$call_time_M_int}:{$call_time_SEC}";
$call_time_MS = sprintf("%7s", $call_time_MS);
$G = '';
$EG = '';
# if ($call_time_M_int >= 5) {$G='<SPAN class="yellow"><B>'; $EG='</B></SPAN>';}
# if ($call_time_M_int >= 10) {$G='<SPAN class="orange"><B>'; $EG='</B></SPAN>';}
echo "| {$G}{$user}{$EG} | {$G}{$leadid}{$EG} | {$G}{$group}{$EG} | {$G}{$phone}{$EG} | {$G}{$status}{$EG} | {$G}{$start_time}{$EG} | {$G}{$call_time_MS}{$EG} |\n";
示例7: _QXZ
} else {
$query_date_BEGIN = $begin_query_time;
$query_date_END = $end_query_time;
echo _QXZ("Server Performance Report", 53) . " {$NOW_TIME}\n";
echo _QXZ("Time range") . ": {$query_date_BEGIN} " . _QXZ("to") . " {$query_date_END}\n\n";
echo "---------- " . _QXZ("TOTALS, PEAKS and AVERAGES") . "\n";
$stmt = "select AVG(sysload),AVG(channels_total),MAX(sysload),MAX(channels_total),MAX(processes) from server_performance where start_time <= '" . mysqli_real_escape_string($link, $query_date_END) . "' and start_time >= '" . mysqli_real_escape_string($link, $query_date_BEGIN) . "' and server_ip='" . mysqli_real_escape_string($link, $group) . "';";
$rslt = mysql_to_mysqli($stmt, $link);
if ($DB) {
echo "{$stmt}\n";
}
$row = mysqli_fetch_row($rslt);
$AVGload = sprintf("%10s", $row[0]);
$AVGchannels = sprintf("%10s", $row[1]);
$HIGHload = $row[2];
$HIGHmulti = intval(MathZDC($HIGHload, 100));
$HIGHchannels = $row[3];
$HIGHprocesses = $row[4];
if ($row[2] > $row[3]) {
$HIGHlimit = $row[2];
} else {
$HIGHlimit = $row[3];
}
if ($HIGHlimit < $row[4]) {
$HIGHlimit = $row[4];
}
$stmt = "select AVG(cpu_user_percent),AVG(cpu_system_percent),AVG(cpu_idle_percent) from server_performance where start_time <= '" . mysqli_real_escape_string($link, $query_date_END) . "' and start_time >= '" . mysqli_real_escape_string($link, $query_date_BEGIN) . "' and server_ip='" . mysqli_real_escape_string($link, $group) . "';";
$rslt = mysql_to_mysqli($stmt, $link);
if ($DB) {
echo "{$stmt}\n";
}
示例8: while
while (strlen($total_CC_percent) > 6) {
$total_CC_percent = substr("{$total_CC_percent}", 0, -1);
}
$total_NI_percent = sprintf("%6.2f", MathZDC($category_totals["NI"], $totalTOTALleads) * 100);
while (strlen($total_NI_percent) > 6) {
$total_NI_percent = substr("{$total_NI_percent}", 0, -1);
}
$total_UW_percent = sprintf("%6.2f", MathZDC($category_totals["UW"], $totalTOTALleads) * 100);
while (strlen($total_UW_percent) > 6) {
$total_UW_percent = substr("{$total_UW_percent}", 0, -1);
}
$total_SC_percent = sprintf("%6.2f", MathZDC($category_totals["SC"], $totalTOTALleads) * 100);
while (strlen($total_SC_percent) > 6) {
$total_SC_percent = substr("{$total_SC_percent}", 0, -1);
}
$total_COMP_percent = sprintf("%6.2f", MathZDC($category_totals["COMP"], $totalTOTALleads) * 100);
while (strlen($total_COMP_percent) > 6) {
$total_COMP_percent = substr("{$total_COMP_percent}", 0, -1);
}
$total_HA_count = sprintf("%10s", $category_totals["HA"]);
while (strlen($total_HA_count) > 10) {
$total_HA_count = substr("{$total_HA_count}", 0, -1);
}
$total_SALE_count = sprintf("%10s", $category_totals["SALE"]);
while (strlen($total_SALE_count) > 10) {
$total_SALE_count = substr("{$total_SALE_count}", 0, -1);
}
$total_DNC_count = sprintf("%10s", $category_totals["DNC"]);
while (strlen($total_DNC_count) > 10) {
$total_DNC_count = substr("{$total_DNC_count}", 0, -1);
}
示例9: horizontal_bar_chart
function horizontal_bar_chart($campaign_id, $days_graph, $title, $link, $metric, $metric_name, $more_link, $END_DATE, $download_link)
{
$stats_start_time = time();
if ($END_DATE) {
$Bstats_date[0] = $END_DATE;
} else {
$Bstats_date[0] = date("Y-m-d");
}
$Btotal_calls[0] = 0;
$link_text = '';
$max_count = 0;
$i = 0;
$NWB = "{$download_link} <a href=\"javascript:openNewWindow('help.php?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
### get stats for last X days
$stmt = "SELECT stats_date,{$metric} from vicidial_daily_max_stats where campaign_id='{$campaign_id}' and stats_flag='OPEN' and stats_date<='{$Bstats_date['0']}';";
if ($metric == 'total_calls_inbound_all') {
$stmt = "SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_type='INGROUP' and stats_flag='OPEN' and stats_date<='{$Bstats_date['0']}' group by stats_date;";
}
if ($metric == 'total_calls_outbound_all') {
$stmt = "SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_type='CAMPAIGN' and stats_flag='OPEN' and stats_date<='{$Bstats_date['0']}' group by stats_date;";
}
if ($metric == 'ra_total_calls') {
$stmt = "SELECT stats_date,total_calls from vicidial_daily_ra_stats where stats_flag='OPEN' and stats_date<='{$Bstats_date['0']}' and user='{$campaign_id}';";
}
if ($metric == 'ra_concurrent_calls') {
$stmt = "SELECT stats_date,max_calls from vicidial_daily_ra_stats where stats_flag='OPEN' and stats_date<='{$Bstats_date['0']}' and user='{$campaign_id}';";
}
$rslt = mysql_to_mysqli($stmt, $link);
$Xstats_to_print = mysqli_num_rows($rslt);
if ($Xstats_to_print > 0) {
$rowx = mysqli_fetch_row($rslt);
$Bstats_date[0] = $rowx[0];
$Btotal_calls[0] = $rowx[1];
if ($max_count < $Btotal_calls[0]) {
$max_count = $Btotal_calls[0];
}
}
$stats_date_ARRAY = explode("-", $Bstats_date[0]);
$stats_start_time = mktime(10, 10, 10, $stats_date_ARRAY[1], $stats_date_ARRAY[2], $stats_date_ARRAY[0]);
while ($i <= $days_graph) {
$Bstats_date[$i] = date("Y-m-d", $stats_start_time);
$Btotal_calls[$i] = 0;
$stmt = "SELECT stats_date,{$metric} from vicidial_daily_max_stats where campaign_id='{$campaign_id}' and stats_date='{$Bstats_date[$i]}';";
if ($metric == 'total_calls_inbound_all') {
$stmt = "SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_date='{$Bstats_date[$i]}' and stats_type='INGROUP' group by stats_date;";
}
if ($metric == 'total_calls_outbound_all') {
$stmt = "SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_date='{$Bstats_date[$i]}' and stats_type='CAMPAIGN' group by stats_date;";
}
if ($metric == 'ra_total_calls') {
$stmt = "SELECT stats_date,total_calls from vicidial_daily_ra_stats where stats_date='{$Bstats_date[$i]}' and user='{$campaign_id}';";
}
if ($metric == 'ra_concurrent_calls') {
$stmt = "SELECT stats_date,max_calls from vicidial_daily_ra_stats where stats_date='{$Bstats_date[$i]}' and user='{$campaign_id}';";
}
echo "<!-- {$i}) {$stmt} \\-->\n";
$rslt = mysql_to_mysqli($stmt, $link);
$Ystats_to_print = mysqli_num_rows($rslt);
if ($Ystats_to_print > 0) {
$rowx = mysqli_fetch_row($rslt);
$Btotal_calls[$i] = $rowx[1];
if ($max_count < $Btotal_calls[$i]) {
$max_count = $Btotal_calls[$i];
}
}
$i++;
$stats_start_time = $stats_start_time - 86400;
}
if ($max_count < 1) {
echo "<!-- no max stats cache summary information available -->";
} else {
if ($title == 'campaign') {
$out_in_type = ' outbound';
}
if ($title == 'in-group') {
$out_in_type = ' inbound';
}
if ($more_link > 0) {
$link_text = "<a href=\"{$PHP_SELF}?ADD=999993&campaign_id={$campaign_id}&stage={$title}\"><font size=1>more summary stats...</font></a>";
}
echo "<table cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"white\" summary=\"Multiple day {$metric_name}.\" style=\"background-image:url(images/bg_fade.png); background-repeat:repeat-x; background-position:left top; width: 33em;\">\n";
echo "<caption align=\"top\">{$days_graph} Day {$out_in_type} {$metric_name} for this {$title} {$link_text} {$NWB}#max_stats{$NWE}<br /></caption>\n";
echo "<tr>\n";
echo "<th scope=\"col\" style=\"text-align: left; vertical-align:top;\"><span class=\"auraltext\">date</span> </th>\n";
echo "<th scope=\"col\" style=\"text-align: left; vertical-align:top;\"><span class=\"auraltext\">{$metric_name}</span> </th>\n";
echo "</tr>\n";
$max_multi = MathZDC(400, $max_count);
$i = 0;
while ($i < $days_graph) {
$bar_width = intval($max_multi * $Btotal_calls[$i]);
if ($Btotal_calls[$i] < 1) {
$Btotal_calls[$i] = "-none-";
}
echo "<tr>\n";
echo "<td class=\"chart_td\"><font style=\"font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 60%;\">{$Bstats_date[$i]} </font></td>\n";
echo "<td class=\"chart_td\"><img src=\"images/bar.png\" alt=\"\" width=\"{$bar_width}\" height=\"10\" style=\"vertical-align: middle; margin: 2px 2px 2px 0;\"/><font style=\"font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 60%;\"> {$Btotal_calls[$i]}</font></td>\n";
echo "</tr>\n";
$i++;
}
//.........這裏部分代碼省略.........
示例10: round
$JS_text .= "\tdocument.getElementById('call_stats_graph').innerHTML=graph_to_display;\n";
$JS_text .= "}\n";
$GRAPH3 = "<tr><td colspan='84' class='graph_span_cell'><span id='call_stats_graph'><BR> <BR></span></td></tr></table><BR><BR>";
for ($d = 0; $d < count($graph_stats); $d++) {
if ($d == 0) {
$class = " first";
} else {
if ($d + 1 == count($graph_stats)) {
$class = " last";
} else {
$class = "";
}
}
$GRAPH .= " <tr>\n";
$GRAPH .= "\t<td class=\"chart_td{$class}\">" . $graph_stats[$d][1] . "</td>\n";
$GRAPH .= "\t<td nowrap class=\"chart_td value{$class}\"><img src=\"images/bar.png\" alt=\"\" width=\"" . round(MathZDC(400 * $graph_stats[$d][0], $max_calls)) . "\" height=\"16\" />" . $graph_stats[$d][0] . "</td>\n";
$GRAPH .= " </tr>\n";
}
$GRAPH .= " <tr>\n";
$GRAPH .= "\t<th class=\"thgraph\" scope=\"col\">" . _QXZ("TOTAL") . ":</th>\n";
$GRAPH .= "\t<th class=\"thgraph\" scope=\"col\">" . trim($TOTALleads) . "</th>\n";
$GRAPH .= " </tr>\n";
$GRAPH .= "</table><PRE>\n";
$GRAPH .= "<BR><BR><a name='callsgraph'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
if ($report_display_type == "HTML") {
$MAIN .= $GRAPH . $GRAPH2 . $GRAPH3;
} else {
$MAIN .= "{$OUToutput}";
}
$ENDtime = date("U");
$RUNtime = $ENDtime - $STARTtime;
示例11: mysqli_fetch_row
if ($DB) {
echo "{$stmt}\n";
}
$row = mysqli_fetch_row($rslt);
echo _QXZ("FIRST LOGIN:", 21) . " {$row['0']}\n";
$start = $row[1];
$stmt = "select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log_archive where event_time <= '" . mysqli_real_escape_string($link, $query_date_END) . "' and event_time >= '" . mysqli_real_escape_string($link, $query_date_BEGIN) . "' and user='" . mysqli_real_escape_string($link, $agent) . "' order by event_time desc limit 1;";
$rslt = mysql_to_mysqli($stmt, $link);
if ($DB) {
echo "{$stmt}\n";
}
$row = mysqli_fetch_row($rslt);
echo _QXZ("LAST LOG ACTIVITY:", 21) . " {$row['0']}\n";
$end = $row[1];
$login_time = $end - $start;
$LOGIN_TIME_H = MathZDC($login_time, 3600);
$LOGIN_TIME_H = round($LOGIN_TIME_H, 2);
$LOGIN_TIME_H_int = intval("{$LOGIN_TIME_H}");
$LOGIN_TIME_M = $LOGIN_TIME_H - $LOGIN_TIME_H_int;
$LOGIN_TIME_M = $LOGIN_TIME_M * 60;
$LOGIN_TIME_M = round($LOGIN_TIME_M, 2);
$LOGIN_TIME_M_int = intval("{$LOGIN_TIME_M}");
$LOGIN_TIME_S = $LOGIN_TIME_M - $LOGIN_TIME_M_int;
$LOGIN_TIME_S = $LOGIN_TIME_S * 60;
$LOGIN_TIME_S = round($LOGIN_TIME_S, 0);
if ($LOGIN_TIME_S < 10) {
$LOGIN_TIME_S = "0{$LOGIN_TIME_S}";
}
if ($LOGIN_TIME_M_int < 10) {
$LOGIN_TIME_M_int = "0{$LOGIN_TIME_M_int}";
}
示例12: sum
if ($call_minutes_int < 10) {
$call_minutes_int = "0{$call_minutes_int}";
}
echo "<tr {$bgcolor}><td><font size=2>{$row['1']}</td>";
echo "<td align=right><font size=2> {$row['0']}</td>\n";
echo "<td align=right><font size=2> {$call_hours_int}:{$call_minutes_int}</td></tr>\n";
$total_calls = $total_calls + $row[0];
$call_seconds = 0;
$o++;
}
$stmt = "SELECT sum(length_in_sec) from call_log where extension='" . mysqli_real_escape_string($link, $extension) . "' and server_ip='" . mysqli_real_escape_string($link, $server_ip) . "' and start_time >= '" . mysqli_real_escape_string($link, $begin_date) . " 0:00:01' and start_time <= '" . mysqli_real_escape_string($link, $end_date) . " 23:59:59'";
$rslt = mysql_to_mysqli($stmt, $link);
$counts_to_print = mysqli_num_rows($rslt);
$row = mysqli_fetch_row($rslt);
$call_seconds = $row[0];
$call_hours = MathZDC($call_seconds, 3600);
$call_hours = round($call_hours, 2);
$call_hours_int = intval("{$call_hours}");
$call_minutes = $call_hours - $call_hours_int;
$call_minutes = $call_minutes * 60;
$call_minutes_int = round($call_minutes, 0);
if ($call_minutes_int < 10) {
$call_minutes_int = "0{$call_minutes_int}";
}
# echo "|$stmt|\n";
echo "<tr><td><font size=2>" . _QXZ("TOTAL CALLS") . " </td><td align=right><font size=2> {$total_calls}</td><td align=right><font size=2> {$call_hours_int}:{$call_minutes_int}</td></tr>\n";
echo "</TABLE></center>\n";
echo "<br><br>\n";
echo "<center>\n";
echo "<B>" . _QXZ("LAST 1000 CALLS FOR DATE RANGE") . ":</B>\n";
echo "<TABLE width=400 cellspacing=0 cellpadding=1>\n";
示例13: mysql_to_mysqli
$rslt = mysql_to_mysqli($stmt, $link);
$gmt_recs = mysqli_num_rows($rslt);
if ($gmt_recs > 0) {
$row = mysqli_fetch_row($rslt);
$DBSERVER_GMT = "{$row['0']}";
if (strlen($DBSERVER_GMT) > 0) {
$SERVER_GMT = $DBSERVER_GMT;
}
if ($isdst) {
$SERVER_GMT++;
}
} else {
$SERVER_GMT = date("O");
$SERVER_GMT = preg_replace('/\\+/i', '', $SERVER_GMT);
$SERVER_GMT = $SERVER_GMT + 0;
$SERVER_GMT = MathZDC($SERVER_GMT, 100);
}
$LOCAL_GMT_OFF = $SERVER_GMT;
$LOCAL_GMT_OFF_STD = $SERVER_GMT;
$dedupe_status_select = '';
$stmt = "SELECT status, status_name from vicidial_statuses order by status;";
$rslt = mysql_to_mysqli($stmt, $link);
$stat_num_rows = mysqli_num_rows($rslt);
$snr_count = 0;
while ($stat_num_rows > $snr_count) {
$row = mysqli_fetch_row($rslt);
$dedupe_status_select .= "\t\t\t<option value='{$row['0']}'>{$row['0']} - {$row['1']}</option>\n";
$snr_count++;
}
#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";}
header("Content-type: text/html; charset=utf-8");
示例14: sprintf
$HTML_text .= $UnocidPERCENT . " | ";
$HTML_text .= sprintf("%6s", $totaldnc) . " | ";
$HTML_text .= sprintf("%6s", $Utotaldnc) . " |";
$UprdncPERCENT = MathZDC($Utotaldnc, $Utotal) * 100;
$UprdncPERCENT = round($UprdncPERCENT, 2);
$UprdncPERCENT = sprintf("%6s", $UprdncPERCENT);
$HTML_text .= $UprdncPERCENT . " | ";
$HTML_text .= sprintf("%6s", $totalsale) . " | ";
$HTML_text .= sprintf("%6s", $Utotalsale) . " |";
$UpsalePERCENT = MathZDC($Utotalsale, $Utotal) * 100;
$UpsalePERCENT = round($UpsalePERCENT, 2);
$UpsalePERCENT = sprintf("%6s", $UpsalePERCENT);
$HTML_text .= $UpsalePERCENT . " | ";
$HTML_text .= sprintf("%6s", $totalarch) . " | ";
$HTML_text .= sprintf("%6s", $Utotalarch) . " |";
$UarchPERCENT = MathZDC($Utotalarch, $Utotal) * 100;
$UarchPERCENT = round($UarchPERCENT, 2);
$UarchPERCENT = sprintf("%6s", $UarchPERCENT);
$HTML_text .= $UarchPERCENT . " |\n";
$HTML_text .= "+------------------------------+--------+--------+-------+----------------------+----------------------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+\n";
$CSV_text .= "\"" . _QXZ("TOTALS") . "\",\"{$total}\",\"{$Utotal}\",\"n/a\",\"{$queue_str}\",\"{$Uqueue_str}\",\"{$UtotalPERCENT}\",\"{$totalnocid}\",\"{$Utotalnocid}\",\"{$UnocidPERCENT}\",\"{$totaldnc}\",\"{$Utotaldnc}\",\"{$UprdncPERCENT}\",\"{$totalsale}\",\"{$Utotalsale}\",\"{$UpsalePERCENT}\",\"{$totalarch}\",\"{$Utotalarch}\",\"{$UarchPERCENT}\",\n";
$HTML_text .= "** - (x|y) " . _QXZ("values under") . " \"" . _QXZ("SENT TO QUEUE") . "\" - \"x\" " . _QXZ("is number of calls taken into queue") . ", \"y\" " . _QXZ("is number of calls sent to an agent") . "\n";
$CSV_text .= "\n\"** - (x|y) " . _QXZ("values under") . " '" . _QXZ("SENT TO QUEUE") . "'\",\n\" - 'x' " . _QXZ("is number of calls taken into queue") . "\",\n\" - 'y' " . _QXZ("is number of calls sent to an agent") . "\",\n";
$ENDtime = date("U");
$RUNtime = $ENDtime - $STARTtime;
$HTML_text .= "\n" . _QXZ("Run Time") . ": {$RUNtime} " . _QXZ("seconds") . "\n";
$HTML_text .= "</PRE>\n";
$HTML_text .= "</TD></TR></TABLE>\n";
$HTML_text .= "</BODY></HTML>\n";
$HTML_text .= "\n\n<BR>{$db_source}";
$HTML_text .= "</TD></TR></TABLE>";
示例15: sprintf
$TOTALleads = sprintf("%10s", $TOTALleads);
$OUToutput .= " +--------+-----------------------------------+------------+\n";
$OUToutput .= " | " . _QXZ("TOTAL", 41, "r") . ": | {$TOTALleads} |\n";
$OUToutput .= " +--------------------------------------------+------------+\n";
$CSV_text4 .= "\"" . _QXZ("TOTAL") . ":\",\"\",\"{$TOTALleads}\"\n\n\n";
for ($d = 0; $d < count($graph_stats); $d++) {
if ($d == 0) {
$class = " first";
} else {
if ($d + 1 == count($graph_stats)) {
$class = " last";
} else {
$class = "";
}
}
$STATUS_graph .= " <tr><td class='chart_td{$class}'>" . $graph_stats[$d][0] . "</td><td nowrap class='chart_td value{$class}'><img src='images/bar.png' alt='' width='" . round(MathZDC(400 * $graph_stats[$d][1], $max_status)) . "' height='16' />" . $graph_stats[$d][1] . "</td></tr>";
}
$STATUS_graph .= "<tr><th class='thgraph' scope='col'>" . _QXZ("TOTAL") . ":</th><th class='thgraph' scope='col'>" . trim($TOTALleads) . "</th></tr></table>";
$JS_onload .= "\tDraw" . $LISTIDlists[$i] . "Graph('FLAGS', '1');\n";
$JS_text .= "function Draw" . $LISTIDlists[$i] . "Graph(graph, th_id) {\n";
$JS_text .= "\tvar FLAGS_graph=\"{$FLAGS_graph}\";\n";
$JS_text .= "\tvar STATUS_graph=\"{$STATUS_graph}\";\n";
$JS_text .= "\n";
$JS_text .= "\tfor (var i=1; i<=2; i++) {\n";
$JS_text .= "\t\tvar cellID=\"graph" . $LISTIDlists[$i] . "\"+i;\n";
$JS_text .= "\t\tdocument.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
$JS_text .= "\t}\n";
$JS_text .= "\tvar cellID=\"graph" . $LISTIDlists[$i] . "\"+th_id;\n";
$JS_text .= "\tdocument.getElementById(cellID).style.backgroundColor='#999999';\n";
$JS_text .= "\tvar graph_to_display=eval(graph+\"_graph\");\n";
$JS_text .= "\tdocument.getElementById('status_" . $LISTIDlists[$i] . "_graph').innerHTML=graph_to_display;\n";