function getMailSettings()
{
    // кнопка «Загрузить»
    $sql = "SELECT s.param, s.value FROM ntn_settings s";
    $data = compact_array(query_to_array($sql));
    $ret = array();
    foreach ($data['data'] as $value) {
        $ret[$value[0]] = $value[1];
    }
    // file_put_contents('$test$.txt',print_r($ret,true));
    return $ret;
}
 *    "Komunikator" technical support e-mail: support@komunikator.ru
 *    The project "Komunikator" are used:
 *      the source code of "YATE" project, http://yate.null.ro/pmwiki/
 *      the source code of "FREESENTRAL" project, http://www.freesentral.com/
 *      "Sencha Ext JS" project libraries, http://www.sencha.com/products/extjs
 *    "Komunikator" web application is a free/libre and open-source software. Therefore it grants user rights
 *  for distribution and (or) modification (including other rights) of this programming solution according
 *  to GNU General Public License terms and conditions published by Free Software Foundation in version 3.
 *    In case the file "License" that describes GNU General Public License terms and conditions,
 *  version 3, is missing (initially goes with software source code), you can visit the official site
 *  http://www.gnu.org/licenses/ and find terms specified in appropriate GNU General Public License
 *  version (version 3 as well).
 *  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 */
if (!$_SESSION['user']) {
    echo out(array("success" => false, "message" => "User is undefined"));
    exit;
}
$total = compact_array(query_to_array("SELECT count(*) FROM playlists"));
if (!is_array($total["data"])) {
    echo out(array("success" => false, "message" => $total));
}
$data = compact_array(query_to_array("SELECT playlist_id as id, playlist, in_use FROM playlists " . get_sql_order_limit()));
//file_put_contents("test.txt","SELECT group_id as id, \"group\", description, extension FROM groups ORDER BY ".get_sql_order_limit());
if (!is_array($data["data"])) {
    echo out(array("success" => false, "message" => $data));
}
$obj = array("success" => true);
$obj["total"] = $total['data'][0][0];
$obj["data"] = $data['data'];
echo out($obj);
if (!is_array($total["data"])) {
    echo out(array("success" => false, "message" => $total));
}
$sda_query = <<<EOD
SELECT
    tasc.id as id,
    ta.name as description,
    tas.address as destination,
    tasc.impi as short_name
FROM account_sip_caller tasc
LEFT JOIN account_sip tas
    ON tas.id = tasc.account_sip_id
LEFT JOIN account ta
    ON ta.id = tas.account_id
EOD;
$data = compact_array(query_to_array($sda_query));
if (!is_array($data["data"])) {
    echo out(array("success" => false, "message" => $data));
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*
сопоставление номеров групп их символьным обозначениям
скрытие несуществующих номеров
*/
$sda_get_groups = $_SESSION["get_groups"];
// 1 - group, 3 - extension
$sda_get_extensions = $_SESSION["get_extensions"];
// 2 - extension
foreach ($data["data"] as &$row_x) {
    $row_x[2] = extension_number_from_SIP_addresses(base64_decode($row_x[2]));
    // 2 - destination
 *  to GNU General Public License terms and conditions published by Free Software Foundation in version 3.
 *    In case the file "License" that describes GNU General Public License terms and conditions,
 *  version 3, is missing (initially goes with software source code), you can visit the official site
 *  http://www.gnu.org/licenses/ and find terms specified in appropriate GNU General Public License
 *  version (version 3 as well).
 *  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 */
/* получить список групп - модуль "Запись разговора" */
if (!$_SESSION['user']) {
    echo out(array("success" => false, "message" => "User is undefined"));
    exit;
}
$total = compact_array(query_to_array("SELECT ( (SELECT count(*)-1 FROM groups) + (SELECT count(*) FROM extensions) ) count"));
if (!is_array($total["data"])) {
    echo out(array("success" => false, "message" => $total));
}
$sql = <<<EOD
SELECT
    groups.group_id as id,
    groups.group as name
FROM groups
WHERE group_id != 1
EOD;
$data = compact_array(query_to_array($sql));
if (!is_array($data["data"])) {
    echo out(array("success" => false, "message" => $data));
}
$obj = array("success" => true);
$obj["total"] = $total['data'][0][0];
$obj["data"] = $data['data'];
echo out($obj);
}
$id_name = 'music_on_hold_id';
if ($playlist) {
    $need_out = false;
}
include "update.php";
if (!$playlist) {
    return;
}
$sql = <<<EOD
\tSELECT playlist_item_id,g.playlist_id FROM playlist_items gm 
\tleft join playlists g on g.playlist = '{$playlist}'  
\twhere gm.music_on_hold_id = '{$music_on_hold_id}'\t\t\t
EOD;
$rows = array();
$result = compact_array(query_to_array($sql));
if (!is_array($result['data'])) {
    echo out(array('success' => false, 'message' => $result));
}
$row = $result['data'][0];
if ($row) {
    $id_name = 'playlist_item_id';
    $rows[] = array('id' => $row[0], 'playlist_id' => $row[1]);
    if ($playlist != 'null') {
        $action = 'update_playlist_items';
        include "update.php";
    } else {
        $action = 'destroy_playlist_items';
        include "destroy.php";
    }
} else {
  and a.time between  {$cur_date['start']}  and {$cur_date['end']} ;
  EOD; */
$sql = <<<EOD
select count(*)
  from call_history 
  where time between  {$cur_date['start']}  and {$cur_date['end']} ;
EOD;
$data = compact_array(query_to_array($sql));
$f_data[] = array('day_total_calls', $data["data"][0][0]);
$sql = <<<EOD
     select count(*) from extensions 
\t where coalesce(inuse_count,0)!=0;
EOD;
$data = compact_array(query_to_array($sql));
$f_data[] = array('active_calls', $data["data"][0][0]);
$data = compact_array(query_to_array("SELECT count(*) FROM gateways  where status = 'online'"));
$f_data[] = array('active_gateways', $data["data"][0][0]);
function get_userdata($name)
{
    return $_SESSION['userdata'][$name];
}
function set_userdata($ar)
{
    session_start();
    if (!$_SESSION['userdata']) {
        $_SESSION['userdata'] = array();
    }
    foreach ($ar as $key => $value) {
        $_SESSION['userdata'][$key] = $value;
    }
}
Example #7
0
 *    The project "Komunikator" are used:
 *      the source code of "YATE" project, http://yate.null.ro/pmwiki/
 *      the source code of "FREESENTRAL" project, http://www.freesentral.com/
 *      "Sencha Ext JS" project libraries, http://www.sencha.com/products/extjs
 *    "Komunikator" web application is a free/libre and open-source software. Therefore it grants user rights
 *  for distribution and (or) modification (including other rights) of this programming solution according
 *  to GNU General Public License terms and conditions published by Free Software Foundation in version 3.
 *    In case the file "License" that describes GNU General Public License terms and conditions,
 *  version 3, is missing (initially goes with software source code), you can visit the official site
 *  http://www.gnu.org/licenses/ and find terms specified in appropriate GNU General Public License
 *  version (version 3 as well).
 *  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 */
if (!$_SESSION['user']) {
    echo out(array("success" => false, "message" => "User is undefined"));
    exit;
}
$total = compact_array(query_to_array("SELECT count(*)-1 FROM groups"));
if (!is_array($total["data"])) {
    echo out(array("success" => false, "message" => $total));
}
$data = compact_array(query_to_array("SELECT group_id as id, groups.group, description, extension FROM groups WHERE group_id!=1 " . get_sql_order_limit()));
//file_put_contents("test.txt","SELECT group_id as id, \"group\", description, extension FROM groups ORDER BY ".get_sql_order_limit());
if (!is_array($data["data"])) {
    echo out(array("success" => false, "message" => $data));
}
$obj = array("success" => true);
$obj["total"] = $total['data'][0][0];
$obj["data"] = $data['data'];
$_SESSION["get_groups"] = $data['data'];
echo out($obj);
$rows = array();
$groups = array();
$result = compact_array(query_to_array('SELECT extension,extension_id FROM extensions'));
if (!is_array($result["data"])) {
    echo out(array("success" => false, "message" => $result));
}
if ($result['data'] && $extensions) {
    foreach ($result['data'] as $row) {
        foreach ($extensions as $key => $value) {
            if ($row[0] == $key) {
                $groups[$row[1]] = $value;
            }
        }
    }
}
$result = compact_array(query_to_array('SELECT groups.group,group_id FROM groups'));
if (!is_array($result['data'])) {
    echo out(array('success' => false, 'message' => $result));
}
if ($result['data'] && $groups) {
    foreach ($result['data'] as $row) {
        foreach ($groups as $key => $value) {
            if ($value == $row[0]) {
                $rows[] = array('extension_id' => $key, 'group_id' => $row[1]);
            }
        }
    }
}
// file_put_contents('b',print_r($rows,true));
$action = 'create_group_members';
include "create.php";
Example #9
0
 *    "Komunikator" technical support e-mail: support@komunikator.ru
 *    The project "Komunikator" are used:
 *      the source code of "YATE" project, http://yate.null.ro/pmwiki/
 *      the source code of "FREESENTRAL" project, http://www.freesentral.com/
 *      "Sencha Ext JS" project libraries, http://www.sencha.com/products/extjs
 *    "Komunikator" web application is a free/libre and open-source software. Therefore it grants user rights
 *  for distribution and (or) modification (including other rights) of this programming solution according
 *  to GNU General Public License terms and conditions published by Free Software Foundation in version 3.
 *    In case the file "License" that describes GNU General Public License terms and conditions,
 *  version 3, is missing (initially goes with software source code), you can visit the official site
 *  http://www.gnu.org/licenses/ and find terms specified in appropriate GNU General Public License
 *  version (version 3 as well).
 *  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 */
if (!$_SESSION['user']) {
    echo out(array("success" => false, "message" => "User is undefined"));
    exit;
}
$total = compact_array(query_to_array("SELECT count(*) FROM gateways"));
if (!is_array($total["data"])) {
    echo out(array("success" => false, "message" => $total));
}
$data = compact_array(query_to_array("SELECT gateway_id as id, status,/* case when enabled = 1 then true when enabled = 0 then false end as */ enabled, gateway, server, username, password, description, protocol, ip_transport,authname, domain, callerid FROM gateways WHERE gateway_id !=1" . get_sql_order_limit()));
if (!is_array($data["data"])) {
    echo out(array("success" => false, "message" => $data));
}
$obj = array("success" => true);
$obj["total"] = $total['data'][0][0];
$obj["visible_total"] = $total['data'][0][0] - 1;
$obj["data"] = $data['data'];
echo out($obj);
 *    "Komunikator" technical support e-mail: support@komunikator.ru
 *    The project "Komunikator" are used:
 *      the source code of "YATE" project, http://yate.null.ro/pmwiki/
 *      the source code of "FREESENTRAL" project, http://www.freesentral.com/
 *      "Sencha Ext JS" project libraries, http://www.sencha.com/products/extjs
 *    "Komunikator" web application is a free/libre and open-source software. Therefore it grants user rights
 *  for distribution and (or) modification (including other rights) of this programming solution according
 *  to GNU General Public License terms and conditions published by Free Software Foundation in version 3.
 *    In case the file "License" that describes GNU General Public License terms and conditions,
 *  version 3, is missing (initially goes with software source code), you can visit the official site
 *  http://www.gnu.org/licenses/ and find terms specified in appropriate GNU General Public License
 *  version (version 3 as well).
 *  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 */
if (!$_SESSION['user']) {
    echo out(array("success" => false, "message" => "User is undefined"));
    exit;
}
$total = compact_array(query_to_array("select ((SELECT count(*) FROM groups) + (SELECT count(*) FROM extensions)) count"));
if (!is_array($total["data"])) {
    echo out(array("success" => false, "message" => $total));
}
$data = compact_array(query_to_array("SELECT group_id as id, groups.group as name FROM groups union SELECT extension_id as id, extension as name from extensions " . get_sql_order_limit()));
//file_put_contents("test.txt","SELECT group_id as id, \"group\", description, extension FROM groups ORDER BY ".get_sql_order_limit());
if (!is_array($data["data"])) {
    echo out(array("success" => false, "message" => $data));
}
$obj = array("success" => true);
$obj["total"] = $total['data'][0][0];
$obj["data"] = $data['data'];
echo out($obj);
Example #11
0
 $time = date("Y-m-d_H:i:s");
 //global $vm_base;
 //    $file_name    = "$vm_base/auto_attendant/$status"."_".$time.".tmp";
 $file_name = "{$vm_base}/auto_attendant/{$status}.mp3";
 if (file_exists($file_name)) {
     unlink($file_name);
 }
 $cn_file_name = "{$vm_base}/auto_attendant/{$status}.wav";
 if (is_uploaded_file($file_tmp)) {
     if (move_uploaded_file($file_tmp, $file_name)) {
         passthru("madplay -q --no-tty-control -m -R 8000 -o wave:\"{$cn_file_name}\" \"{$file_name}\"");
         if (!is_file($cn_file_name)) {
             echo out(array('success' => false, 'message' => "Could not convert files in mp3 format."));
             return;
         }
         $total = compact_array(query_to_array("SELECT prompt_id FROM prompts where status = '{$status}'"));
         $rows = array();
         $rows[] = array('prompt' => "'{$status}'", 'status' => "'{$status}'", 'file' => "'{$status}" . ".wav'");
         //print_r($total["data"]);
         if (!$total["data"][0][0]) {
             $action = 'create_prompts';
             require_once "create.php";
         } else {
             $rows[0]['id'] = $total["data"][0][0];
             $id_name = 'prompt_id';
             $action = 'update_prompts';
             require_once "update.php";
         }
         //echo (out(array('success'=>true)));
     } else {
         echo out(array('success' => false, 'message' => "Could not upload file"));
 *    "Komunikator" project site: http://komunikator.ru/
 *    "Komunikator" technical support e-mail: support@komunikator.ru
 *    The project "Komunikator" are used:
 *      the source code of "YATE" project, http://yate.null.ro/pmwiki/
 *      the source code of "FREESENTRAL" project, http://www.freesentral.com/
 *      "Sencha Ext JS" project libraries, http://www.sencha.com/products/extjs
 *    "Komunikator" web application is a free/libre and open-source software. Therefore it grants user rights
 *  for distribution and (or) modification (including other rights) of this programming solution according
 *  to GNU General Public License terms and conditions published by Free Software Foundation in version 3.
 *    In case the file "License" that describes GNU General Public License terms and conditions,
 *  version 3, is missing (initially goes with software source code), you can visit the official site
 *  http://www.gnu.org/licenses/ and find terms specified in appropriate GNU General Public License
 *  version (version 3 as well).
 *  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 */
if (!$_SESSION['user']) {
    echo out(array("success" => false, "message" => "User is undefined"));
    exit;
}
$total = compact_array(query_to_array("SELECT count(*) FROM extensions"));
if (!is_array($total["data"])) {
    echo out(array("success" => false, "message" => $total));
}
$data = compact_array(query_to_array("SELECT extension as id, extension as name FROM extensions"));
if (!is_array($data["data"])) {
    echo out(array("success" => false, "message" => $data));
}
$obj = array("success" => true);
$obj["total"] = $total['data'][0][0];
$obj["data"] = $data['data'];
echo out($obj);
Example #13
0
 *    "Komunikator" technical support e-mail: support@komunikator.ru
 *    The project "Komunikator" are used:
 *      the source code of "YATE" project, http://yate.null.ro/pmwiki/
 *      the source code of "FREESENTRAL" project, http://www.freesentral.com/
 *      "Sencha Ext JS" project libraries, http://www.sencha.com/products/extjs
 *    "Komunikator" web application is a free/libre and open-source software. Therefore it grants user rights
 *  for distribution and (or) modification (including other rights) of this programming solution according
 *  to GNU General Public License terms and conditions published by Free Software Foundation in version 3.
 *    In case the file "License" that describes GNU General Public License terms and conditions,
 *  version 3, is missing (initially goes with software source code), you can visit the official site
 *  http://www.gnu.org/licenses/ and find terms specified in appropriate GNU General Public License
 *  version (version 3 as well).
 *  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 */
if (!$_SESSION['user']) {
    echo out(array("success" => false, "message" => "User is undefined"));
    exit;
}
$total = compact_array(query_to_array("SELECT count(*) FROM prompts"));
if (!is_array($total["data"])) {
    echo out(array("success" => false, "message" => $total));
}
$prompt_path = "auto_attendant/";
$data = compact_array(query_to_array("SELECT prompt_id as id, status, prompt, description, " . get_SQL_concat(array("'{$prompt_path}'", 'file')) . " FROM prompts " . get_sql_order_limit()));
if (!is_array($data["data"])) {
    echo out(array("success" => false, "message" => $data));
}
$obj = array("success" => true);
$obj["total"] = $total['data'][0][0];
$obj["data"] = $data['data'];
echo out($obj);
*    In case the file "License" that describes GNU General Public License terms and conditions,
*  version 3, is missing (initially goes with software source code), you can visit the official site
*  http://www.gnu.org/licenses/ and find terms specified in appropriate GNU General Public License
*  version (version 3 as well).

*  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
*/
if (!$_SESSION['user']) {
    echo out(array("success" => false, "message" => "User is undefined"));
    exit;
}
$id_call_back = getparam('id');
$callthrough_time = getparam('callthrough_time');
$host = $_SERVER['SERVER_ADDR'];
$host = "http://" . $host;
$data = compact_array(query_to_array("SELECT settings FROM call_back WHERE call_back_id = {$id_call_back}"));
if (!is_array($data["data"])) {
    echo out(array("success" => false, "message" => $data));
}
$data = json_decode($data['data'][0][0]);
$color_before = $data[6]->{'7'}->{'field4'};
$color_after = $data[7]->{'8'}->{'field4'};
$main_time = $callthrough_time + 5;
$sec_time = $callthrough_time;
$nPage = $data[2]->{'3'}->{'field4'};
$ua = $data[3]->{'4'}->{'field4'};
$url = $data[5]->{'6'}->{'field4'};
$onUserVisit_check = $data[0]->{'1'}->{'field2'} == '1' ? 'true' : 'false';
$onUserExit_check = $data[1]->{'2'}->{'field2'} == '1' ? 'true' : 'false';
$onCheckURLHistory_check = $data[5]->{'6'}->{'field2'} == '1' ? 'true' : 'false';
$onUserActivity2_check = $data[3]->{'4'}->{'field2'} == '1' ? 'true' : 'false';
Example #15
0
 *  for distribution and (or) modification (including other rights) of this programming solution according
 *  to GNU General Public License terms and conditions published by Free Software Foundation in version 3.
 *    In case the file "License" that describes GNU General Public License terms and conditions,
 *  version 3, is missing (initially goes with software source code), you can visit the official site
 *  http://www.gnu.org/licenses/ and find terms specified in appropriate GNU General Public License
 *  version (version 3 as well).
 *  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 */
if (!$_SESSION['user']) {
    echo out(array("success" => false, "message" => "User is undefined"));
    exit;
}
$total = compact_array(query_to_array("SELECT count(*) FROM users"));
if (!is_array($total["data"])) {
    echo out(array("success" => false, "message" => $total));
}
$sql = <<<EOD
\tSELECT 
\tu.user_id as id,
        u.username,
\tu.password
\tFROM users u 
EOD;
$data = compact_array(query_to_array($sql . get_sql_order_limit()));
if (!is_array($data["data"])) {
    echo out(array("success" => false, "message" => $data));
}
$obj = array("success" => true);
$obj["total"] = $total['data'][0][0];
$obj["data"] = $data['data'];
echo out($obj);
 *    "Komunikator" project site: http://komunikator.ru/
 *    "Komunikator" technical support e-mail: support@komunikator.ru
 *    The project "Komunikator" are used:
 *      the source code of "YATE" project, http://yate.null.ro/pmwiki/
 *      the source code of "FREESENTRAL" project, http://www.freesentral.com/
 *      "Sencha Ext JS" project libraries, http://www.sencha.com/products/extjs
 *    "Komunikator" web application is a free/libre and open-source software. Therefore it grants user rights
 *  for distribution and (or) modification (including other rights) of this programming solution according
 *  to GNU General Public License terms and conditions published by Free Software Foundation in version 3.
 *    In case the file "License" that describes GNU General Public License terms and conditions,
 *  version 3, is missing (initially goes with software source code), you can visit the official site
 *  http://www.gnu.org/licenses/ and find terms specified in appropriate GNU General Public License
 *  version (version 3 as well).
 *  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 */
if (!$_SESSION['user']) {
    echo out(array("success" => false, "message" => "User is undefined"));
    exit;
}
$total = compact_array(query_to_array("SELECT count(*) FROM time_frames"));
if (!is_array($total["data"])) {
    echo out(array("success" => false, "message" => $total));
}
$data = compact_array(query_to_array("select time_frame_id as id, day, start_hour, end_hour from (SELECT time_frame_id, day, start_hour-{$_SESSION['time_offset']}/60 as start_hour, end_hour-{$_SESSION['time_offset']}/60 as end_hour, case when numeric_day = 0 then 7 else numeric_day end as numeric_day FROM time_frames) a order by numeric_day "));
if (!is_array($data["data"])) {
    echo out(array("success" => false, "message" => $data));
}
$obj = array("success" => true);
$obj["total"] = $total['data'][0][0];
$obj["data"] = $data['data'];
echo out($obj);
        
            fwd.value as forward,
            fwd_busy.value as forward_busy,
\t    fwd_no_answ.value as forward_noanswer,
\t    no_answ_to.value as noanswer_timeout  
FROM 
   extensions ex 
    left join pbx_settings fwd 
    on fwd.extension_id = ex.extension_id and fwd.param = "forward"
        left join pbx_settings fwd_busy \t\t\t\t\t
            on fwd_busy.extension_id = ex.extension_id and fwd_busy.param = "forward_busy"
                left join pbx_settings fwd_no_answ 
                    on fwd_no_answ.extension_id = ex.extension_id and fwd_no_answ.param = "forward_noanswer"
                        left join pbx_settings no_answ_to 
                            on no_answ_to.extension_id = ex.extension_id and no_answ_to.param = "noanswer_timeout"

WHERE extension = {$number}
\t) a  
EOD;
$data = compact_array(query_to_array($sql . get_filter()));
if (!is_array($data["data"])) {
    echo out(array("success" => false, "message" => $data));
}
$ras = $data['data'][0];
$rak = $data['header'];
$new_array = array();
foreach ($rak as $key => $value) {
    $new_array[$value] = $ras[$key];
}
echo out(array("success" => true, "data" => $new_array));
exit;
Example #18
0
                echo $callback . '({"success":"false"})';
            }
            $last_priority = !$res1[0]["priority"] ? NULL : "WHERE coalesce(gp.priority, 0) < " . $res1[0]["priority"];
            sleep(2);
        }
    } else {
        echo $callback . '({"warning":"Caller group undefined"})';
        exit;
    }
} else {
    $sql_busyness = "SELECT inuse_count FROM extensions WHERE extension = {$caller}";
    $res_busyness = query_to_array($sql_busyness);
    if ($res_busyness[0]['inuse_count'] == 0) {
        click_to_call($caller, $called, $site, $callthrough_time);
        $count = round($callthrough_time / 4, 0, PHP_ROUND_HALF_DOWN);
        for ($i = 0; $i < $count; $i++) {
            sleep(4);
            $data = compact_array(query_to_array($sql_action_call));
            $total = count($data["data"]);
            if ($total > 0) {
                echo $callback . '({"success":"true"})';
                break;
            }
            if ($i == $count - 1 && $total == 0) {
                echo $callback . '({"success":"false"})';
            }
        }
    } else {
        echo $callback . '({"success":"false"})';
    }
}