当前位置: 首页>>代码示例>>PHP>>正文


PHP compact_array函数代码示例

本文整理汇总了PHP中compact_array函数的典型用法代码示例。如果您正苦于以下问题:PHP compact_array函数的具体用法?PHP compact_array怎么用?PHP compact_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了compact_array函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getMailSettings

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;
}
开发者ID:komunikator,项目名称:komunikator,代码行数:12,代码来源:mail_settings.php

示例2: out

 *    "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);
开发者ID:komunikator,项目名称:komunikator,代码行数:31,代码来源:get_playlist_extended.php

示例3: out

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
开发者ID:komunikator,项目名称:komunikator,代码行数:31,代码来源:get_call_button.php

示例4: out

 *  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:komunikator,项目名称:komunikator,代码行数:31,代码来源:get_groups_list.php

示例5: array

}
$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 {
开发者ID:komunikator,项目名称:komunikator,代码行数:31,代码来源:update_music_on_hold.php

示例6: count

  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;
    }
}
开发者ID:komunikator,项目名称:komunikator,代码行数:31,代码来源:get_statistic.php

示例7: out

 *    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);
开发者ID:komunikator,项目名称:komunikator,代码行数:31,代码来源:get_groups.php

示例8: array

$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";
开发者ID:komunikator,项目名称:komunikator,代码行数:31,代码来源:create_extensions.php

示例9: out

 *    "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);
开发者ID:komunikator,项目名称:komunikator,代码行数:31,代码来源:get_gateways.php

示例10: date

 $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"));
开发者ID:komunikator,项目名称:komunikator,代码行数:31,代码来源:load_prompt.php

示例11: out

 *    "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);
开发者ID:komunikator,项目名称:komunikator,代码行数:31,代码来源:get_number_extensions.php

示例12: out

 *    "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);
开发者ID:komunikator,项目名称:komunikator,代码行数:31,代码来源:get_prompts.php

示例13: out

*    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';
开发者ID:komunikator,项目名称:komunikator,代码行数:31,代码来源:get_call_back_code.php

示例14: out

 *  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);
开发者ID:komunikator,项目名称:komunikator,代码行数:31,代码来源:get_users.php

示例15: out

 *    "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);
开发者ID:komunikator,项目名称:komunikator,代码行数:31,代码来源:get_time_frames.php


注:本文中的compact_array函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。