コード例 #1
0
ファイル: get_users.php プロジェクト: komunikator/komunikator
 *  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);
コード例 #2
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 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);
コード例 #3
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);
コード例 #4
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);
コード例 #5
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 ((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);
コード例 #6
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);