Example #1
0
    }
    echo '<center><br><h3>' . __('Добавление/удаление аккаунтов из очереди') . '</h3><br>
<TABLE border=0 cellPadding=3 cellSpacing=0 width="50%">
<TBODY>
<TR bgColor=#F0F0F0>
                  <TD width="50%" align=middle class="tableBody" style="PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px">
                    <center><strong>' . __('SIP-аккаунты') . '</strong></center></TD>
                  <TD width="50%" align=middle class="tableBody" style="PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px">
                    <center><strong>' . __('Члены очереди') . '</strong></center></TD>
                </TR>
';
    $sipusers = values("SELECT * FROM " . $conf_realtime_db . ".sipusers WHERE 1 ORDER BY name");
    $members_accs = '';
    $sip_accs = '';
    $sip_user_names = get_sipuser_names();
    for ($i = 0; $i < count($sipusers); $i++) {
        $members = values("SELECT * FROM " . $conf_realtime_db . ".queue_members WHERE membername='" . $sipusers[$i]["name"] . "' AND queue_name='" . $queue . "'");
        if (count($members) > 0) {
            $members_accs .= '<a href="index.php?remove=' . $sipusers[$i]["name"] . '&queue=' . $queue . '">' . add_sipuser_name($sipusers[$i]["name"], $sip_user_names) . '</a><br>';
        } else {
            $sip_accs .= '<a href="index.php?add=' . $sipusers[$i]["name"] . '&queue=' . $queue . '">' . add_sipuser_name($sipusers[$i]["name"], $sip_user_names) . '</a><br>';
        }
    }
    echo '<TR bgcolor="#F2F8FF">
				<TD vAlign=top align="center" class=tableBody>' . $sip_accs . '</TD>
				<TD vAlign=top align="center" class=tableBody>' . $members_accs . '</TD>
		</TR>';
    echo '</TBODY>
</table>
</center>';
}
Example #2
0
     if ($result_set[$i]['disposition'] == "BUSY" or $result_set[$i]['dstchannel'] == '') {
         $result_set[$i]['disposition'] = __('Нет ответа');
         $status_color = '#FDE2D5';
     }
 }
 if ($result_set[$i]['src'] <= 9999 and $result_set[$i]['dst'] <= 9999) {
     $direct_icon = '<img src="images/inner.png" alt="' . __('Внутренние') . '" title="' . __('Внутренние') . '">';
 }
 $start_src = $result_set[$i]['src'];
 $start_dst = $result_set[$i]['dst'];
 $find_param = array(to_format_number($start_src), to_format_number($start_dst));
 $result_set[$i]['src'] = format_number($result_set[$i]['src']);
 $result_set[$i]['dst'] = format_number($result_set[$i]['dst']);
 $sip_user_names = get_sipuser_names();
 $result_set[$i]['src'] = add_sipuser_name($start_src, $sip_user_names, $result_set[$i]['src']);
 $result_set[$i]['dst'] = add_sipuser_name($start_dst, $sip_user_names, $result_set[$i]['dst']);
 if (strpos(' ' . $result_set[$i]['dstchannel'], 'SIP')) {
     $result_set[$i]['dst'] .= ' (' . substr(str_replace('SIP/', '', $result_set[$i]['dstchannel']), 0, strpos(str_replace('SIP/', '', $result_set[$i]['dstchannel']), '-')) . ')';
 }
 //сюда вписать абонента, если он есть
 $choose_src_abonents = values("SELECT phone_number, abonent FROM " . $conf_statistic_db . ".addressbook WHERE phone_number = \"" . $find_param[0] . "\"");
 $choose_dest_abonents = values("SELECT phone_number, abonent FROM " . $conf_statistic_db . ".addressbook WHERE phone_number = \"" . $find_param[1] . "\"");
 $abonents = [];
 if (count($choose_src_abonents) > 0) {
     $abonents[0] = "" . $choose_src_abonents[0][1] . "<br>";
 } else {
     $abonents[0] = "";
 }
 if (count($choose_dest_abonents) > 0) {
     $abonents[1] = "" . $choose_dest_abonents[0][1] . "<br>";
 } else {
Example #3
0
                $perc = 0;
            } else {
                $perc = round($lost[0]['c'] * 100 / ($incoming[0]['c'] + $lost[0]['c']));
            }
            $active_time = values("SELECT SUM(length) AS dur FROM firestat.operators_events WHERE operator=" . $operators[$i]['Name'] . " AND eventtype=1 AND eventtime BETWEEN '" . $from . "' AND '" . $to . "'");
            $last_active_time = values("SELECT UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(eventtime) AS dur FROM firestat.operators_events WHERE operator=" . $operators[$i]['Name'] . " AND eventtype=1 AND length=0 AND eventtime BETWEEN '" . $from . "' AND '" . $to . "' ORDER BY eventtime DESC LIMIT 1");
            if (count($last_active_time) == 0) {
                $work_time = $active_time[0]['dur'];
            } else {
                $work_time = $active_time[0]['dur'] + $last_active_time[0]['dur'];
            }
            $sip_user_names = get_sipuser_names();
            $out .= '               		 <TR bgcolor="' . $status_color . '"  onMouseOver="bgColor=\'#C4FFD7\'" onMouseOut="bgColor=\'' . $status_color . '\'" onMouseClick="bgColor=\'#C4FFD7\'">
						<TD vAlign=top align="" class=tableBody>&nbsp;</TD>

						                 		 <TD vAlign=top align="right" class=tableBody><a href="index.php?module=' . $sModule . '&operator=' . $operators[$i]['Name'] . '&posted=1">' . add_sipuser_name($operators[$i]['Name'], $sip_user_names) . '</a></TD>

						                 		 <TD vAlign=top align="center" class=tableBody>' . format_time($work_time, 1) . '</TD>

						                 		 <TD vAlign=top align="center" class=tableBody>' . $pauses[0]['c'] . '</TD>

						                 		 <TD vAlign=top align="left" class=tableBody>' . format_time($pauses[0]['dur'], 1) . '</TD>

						                 		 <TD vAlign=top align="center" class=tableBody>graph_plot_' . $operators[$i]["Name"] . '</TD>

						                 		 <TD vAlign=top align="center" class=tableBody>' . $incoming[0]['c'] . '</TD>

						                 		 <TD vAlign=top align="center" class=tableBody>' . $lost[0]['c'] . '</TD>

						                 		 <TD vAlign=top align="center" class=tableBody>' . $perc . '%</TD>