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


PHP values函数代码示例

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


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

示例1: test

 function test()
 {
     $input = [3 => 1, 1 => 3, 2 => 2];
     $expect = [1, 3, 2];
     $actual = iterator_to_array(values($input), false);
     $this->assertEquals($expect, $actual);
 }
开发者ID:morrisonlevi,项目名称:algorithm,代码行数:7,代码来源:ValuesTest.php

示例2: debugging_values

function debugging_values($query, $db = 1, $enc = 0)
{
    global $debug;
    if ($debug) {
        file_put_contents('softphone_debugging.htm', Date("H:i:s") . ": " . $query . "<br><br>", FILE_APPEND | LOCK_EX);
    }
    return values($query, $db, $enc);
}
开发者ID:kipkaev55,项目名称:asterisk,代码行数:8,代码来源:get_adressbook.php

示例3: update

function update($table = NULL)
{
    if (!$table) {
        $table = $GLOBALS['table'];
    }
    $id = format_int($_REQUEST['id']);
    db_update($table, fields($table), values($table), "where id={$id}");
}
开发者ID:JoshuaGrams,项目名称:wfpl,代码行数:8,代码来源:form.php

示例4: difference

function difference()
{
    $collections = func_get_args();
    $union = union($collections);
    $intersection = intersection($collections);
    $difference = without($union, $intersection);
    $difference = values($difference);
    // Re-indexes array
    return $difference;
}
开发者ID:mpetrovich,项目名称:dash,代码行数:10,代码来源:difference.php

示例5: get_today_stats2

function get_today_stats2($current_queue = '%', $operator_restr = '')
{
    global $conf_cdr_db, $conf_realtime_db;
    if ($operator_restr == '') {
        $agent_need = '%';
    } else {
        $agent_need = mysql_escape_string($operator_restr);
    }
    $calls_c = values("SELECT COUNT(*) AS c, SUM(callduration) AS timesum, AVG(callduration) AS timeavg FROM " . $conf_realtime_db . ".call_status WHERE timestamp BETWEEN '" . Date("Y-m-d") . " 00:00:00' AND '" . Date("Y-m-d") . " 23:59:59' AND queue LIKE '" . $current_queue . "' AND agent LIKE '" . $agent_need . "'");
    $calls_num = $calls_c[0]['c'];
    $input_calls_time = format_time(round($calls_c[0]['timesum']), 1);
    if ($operator_restr != '') {
        $out_calls = values("SELECT COUNT(*) AS c FROM `cdr` WHERE src='" . $agent_need . "' AND calldate BETWEEN '" . Date("Y-m-d") . " 00:00:00' AND '" . Date("Y-m-d") . " 23:59:59'");
    }
    $pick = values("SELECT COUNT(*) AS c FROM " . $conf_realtime_db . ".call_status WHERE timestamp BETWEEN '" . Date("Y-m-d") . " 00:00:00' AND '" . Date("Y-m-d") . " 23:59:59' AND queue LIKE '" . $current_queue . "' AND agent LIKE '" . $agent_need . "' AND (status='COMPLETEAGENT' OR status='COMPLETECALLER' OR status='CONNECT')");
    $taken_calls = $pick[0]['c'];
    if ($calls_num != 0) {
        $taken_calls_perc = round(100 * $taken_calls / $calls_num) . '%';
    } else {
        $taken_calls_perc = '---';
    }
    $avgvoicecalls_c = values("SELECT AVG(callduration) AS timeavg FROM `" . $conf_realtime_db . "`.`call_status` WHERE `queue` LIKE '" . $current_queue . "' AND `callduration`>0 AND `timestamp` BETWEEN '" . Date("Y-m-d") . " 00:00:00' AND '" . Date("Y-m-d") . " 23:59:59' AND agent LIKE '" . $agent_need . "'");
    $avg_call_time = round($avgvoicecalls_c[0]['timeavg']) . ' с';
    if ($avg_call_time == 0) {
        $avg_call_time = '---';
    }
    $scalls20_c = values("SELECT COUNT(*) AS c FROM `" . $conf_realtime_db . "`.`call_status` WHERE `queue` LIKE '" . $current_queue . "' AND holdtime<=20 AND `timestamp` BETWEEN '" . Date("Y-m-d") . " 00:00:00' AND '" . Date("Y-m-d") . " 23:59:59' AND agent LIKE '" . $agent_need . "'");
    if ($calls_c[0]['c'] != 0) {
        $service_level = round($scalls20_c[0]['c'] / $calls_c[0]['c'] * 100) . '%';
    } else {
        $service_level = '---';
    }
    $maxacalls_c = values("SELECT MAX(holdtime) AS maxhold FROM `" . $conf_realtime_db . "`.`call_status` WHERE `queue` LIKE '" . $current_queue . "' AND `timestamp` BETWEEN '" . Date("Y-m-d") . " 00:00:00' AND '" . Date("Y-m-d") . " 23:59:59' AND agent LIKE '" . $agent_need . "' AND status!='TRANSFER'");
    if (count($maxacalls_c) == 0 or $maxacalls_c[0]['maxhold'] == 0) {
        $max_await = '---';
    } else {
        $max_await = $maxacalls_c[0]['maxhold'] . ' с';
    }
    if ($operator_restr == '') {
        return '
	<table border=0>
	<tr><td>' . __('Принято') . ':</td><td>' . $taken_calls . '</td></tr>
	<tr><td>' . __('Обслужено') . ':</td><td>' . $taken_calls_perc . '</td></tr>
	<tr><td>' . __('Время') . ':</td><td>' . $input_calls_time . '</td></tr>
	<tr><td>' . __('Среднее') . ':</td><td>' . $avg_call_time . '</td></tr>
	<tr><td>Service lvl:</td><td>' . $service_level . '</td></tr>
	</table>';
    } else {
        return '<span title="' . __('Количество принятых звонков за сегодня') . '">' . __('Принял') . ':</span> ' . $taken_calls . '<br>
<span title="' . __('Количество сделаных звонков за сегодня') . '">' . __('Исходящих') . ':</span>' . $out_calls[0]['c'] . '<br>
<span title="' . __('Общее время разговоров за сегодня') . '">' . __('Время') . ':</span> ' . $input_calls_time . '<br>
<span title="' . __('Среднее время разговора за сегодня') . '">' . __('Среднее') . ':</span> ' . $avg_call_time;
    }
}
开发者ID:kipkaev55,项目名称:asterisk,代码行数:54,代码来源:operators_status.php

示例6: testValues

 public function testValues()
 {
     $expectedValuesFirstViewSuccessful = array(1 => 100, 3 => 300);
     $expectedValuesFirstViewAll = array(1 => 100, 2 => 200, 3 => 300);
     $expectedValuesRepeatViewSuccessful = array(2 => 300);
     $expectedValuesRepeatViewAll = array(1 => 200, 2 => 300);
     $this->assertEquals($expectedValuesFirstViewSuccessful, values($this->pageData, 0, 'TTFB', true));
     $this->assertEquals($expectedValuesFirstViewAll, values($this->pageData, 0, 'TTFB', false));
     $this->assertEquals($expectedValuesRepeatViewSuccessful, values($this->pageData, 1, 'TTFB', true));
     $this->assertEquals($expectedValuesRepeatViewAll, values($this->pageData, 1, 'TTFB', false));
 }
开发者ID:lucasRolff,项目名称:webpagetest,代码行数:11,代码来源:pageDataTest.php

示例7: intersection

function intersection($collections)
{
    if (func_num_args() > 1) {
        $collections = func_get_args();
    }
    $intersection = array_shift($collections);
    foreach ($collections as $collection) {
        foreach ($intersection as $key => $value) {
            if (!contains($collection, $value)) {
                // @todo Test whether unset() works with all Traversable
                unset($intersection[$key]);
            }
        }
    }
    $intersection = values($intersection);
    // Re-indexes due to unset() holes
    return $intersection;
}
开发者ID:mpetrovich,项目名称:dash,代码行数:18,代码来源:intersection.php

示例8: autoload

 /**
  * 自动加载
  * @param ClassName 类名
  * @author Colin <15070091894@163.com>
  */
 public static function autoload($ClassName)
 {
     $getModule = values('get', Config('DEFAULT_MODULE_VAR'));
     $getModule = $getModule ? $getModule : Config('DEFAULT_MODULE');
     //处理模块文件载入
     $module = defined('MODULE_NAME') ? MODULE_NAME : $getModule;
     //处理多模块文件载入问题
     $extra_module = Config('EXTRA_MODULE');
     array_push($extra_module, $module);
     $extra_module = array_unique($extra_module);
     foreach ($extra_module as $key => $value) {
         if (preg_match("/{$value}/", $ClassName)) {
             $ClassName = preg_replace("/{$value}/", ltrim(APP_NAME, './') . '\\' . $value, $ClassName);
         }
     }
     if (preg_match("/\\\\/", $ClassName)) {
         //是否为命名空间加载
         $ClassName = preg_replace("/\\\\/", "/", $ClassName);
         require_file(ROOT_PATH . $ClassName . '.class.php');
     }
 }
开发者ID:a1586256143,项目名称:MyClassPHP,代码行数:26,代码来源:MyClass.php

示例9: median

function median($collection)
{
    $size = size($collection);
    if ($size === 0) {
        $median = null;
    } else {
        $sorted = values(sort($collection));
        if ($size % 2 === 0) {
            // For an even number of values,
            // the median is the average of the middle two values
            $start = $size / 2 - 1;
            $end = $start + 1;
            $median = average(array(at($sorted, $start), at($sorted, $end)));
        } else {
            // For an odd number of values,
            // the median is the middle value
            $index = floor($size / 2);
            $median = at($sorted, $index);
        }
    }
    return $median;
}
开发者ID:mpetrovich,项目名称:dash,代码行数:22,代码来源:median.php

示例10: AND

         $client_select .= " OR cdr.src LIKE '" . $add_perc . $aClient[0][$aColumns[$i]] . "' OR cdr.dst LIKE '" . $add_perc . $aClient[0][$aColumns[$i]] . "'";
     }
 }
 if ($client_select != '') {
     $client_select = ' AND (' . substr($client_select, 4) . ')';
 }
 if ($client_select == '') {
     $client_select = " AND cdr.src LIKE 'no'";
 }
 $where_query = "WHERE 1" . $client_select;
 //echo "SELECT calldate, userfield, src, dst AS dest, duration, uniqueid, randdata, disposition, comment, operator FROM `asteriskcdrdb`.`cdr` cdr LEFT JOIN `hilti`.`calls_ver3` calls ON cdr.uniqueid=calls.unique_id
 //WHERE 1".$client_select." ORDER BY calldate DESC LIMIT ".($page2-1)*$perpage2.", ".$perpage2."<br>";
 //exit;
 values("SET SQL_BIG_SELECTS=1");
 $result_set = values("SELECT calldate, userfield, src, dst AS dest, duration, uniqueid, randdata, disposition, comment, operator FROM `asteriskcdrdb`.`cdr` cdr\nWHERE 1" . $client_select . " ORDER BY calldate DESC LIMIT " . ($page2 - 1) * $perpage2 . ", " . $perpage2);
 $duration_select = values("SELECT COUNT(*) AS c, SUM(duration) AS dur FROM `asteriskcdrdb`.`cdr` cdr WHERE 1" . $client_select);
 $dur_sec = $duration_select[0]['dur'];
 $cal_num = $duration_select[0]['c'];
 $dur_h = floor($dur_sec / 3600);
 $dur_m = floor(($dur_sec - $dur_h * 3600) / 60);
 $dur_s = $dur_sec - $dur_m * 60 - $dur_h * 3600;
 if ($dur_s < 10) {
     $dur_s = '0' . $dur_s;
 }
 if ($dur_m < 10) {
     $dur_m = '0' . $dur_m;
 }
 $rusult_num = count($result_set);
 if ($rusult_num > 0) {
     $pstring2 = '';
     $pages2 = ceil($cal_num / $perpage2);
开发者ID:kipkaev55,项目名称:asterisk,代码行数:31,代码来源:adressbook.php

示例11: LENGTH

    if ($fromstatsmonth < 10) {
        $fromstatsmonth = '0' . $fromstatsmonth;
    }
    if ($tostatsday < 10) {
        $tostatsday = '0' . $tostatsday;
    }
    if ($tostatsmonth < 10) {
        $tostatsmonth = '0' . $tostatsmonth;
    }
    $from = $fromstatsyear . '-' . $fromstatsmonth . '-' . $fromstatsday . ' 00:00:01';
    $to = $tostatsyear . '-' . $tostatsmonth . '-' . $tostatsday . ' 23:59:59';
    $direction_restr = " AND dcontext LIKE '%_out'";
    $status_restr = " AND disposition = 'ANSWERED' AND dcontext NOT LIKE '%noans%' AND dstchannel!=''";
    $where_query = "WHERE calldate BETWEEN '" . $from . "' AND '" . $to . "' AND LENGTH(dst)>7" . $direction_restr . $status_restr;
    $cdr_query = "SELECT SUBSTRING(dst FROM -9 FOR 2) AS dt, COUNT(*) AS c, SUM(billsec) AS bs FROM asteriskcdrdb.cdr\n\t" . $where_query . " GROUP BY dt ORDER BY dt";
    $result_set = values($cdr_query);
    echo '<!-- Тестирование системы: ' . $cdr_query . ' -->';
    if (count($result_set) > 0) {
        ?>
	<center>
	<h3>Исходящие вызовы:</h3>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="60%">
<TBODY>
                <TR bgColor=#F0F0F0>
                  <TD width="7%" align=middle class="tableBody" style="PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px">
                    <center><strong><font color="Black">Код</font></strong></center></TD>
                  <TD width="12%" align=middle class="tableBody" style="PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px">
                    <center><strong><font color="Black">Оператор</font></strong></center></TD>
                  <TD width="10%" align=middle class="tableBody" style="PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px">
                    <center><strong><font color="Black">Звонков</font></strong></center></TD>
                  <TD width="10%" align=middle class="tableBody" style="PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px">
开发者ID:kipkaev55,项目名称:asterisk,代码行数:31,代码来源:gsm_billing.php

示例12: value

function value($name)
{
    $values = values();
    return isset($values[$name]) ? $values[$name] : null;
}
开发者ID:mrjovanovic,项目名称:miniflux,代码行数:5,代码来源:Request.php

示例13: values

            //сюда вписать абонента, если он есть
            $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 {
                $abonents[1] = "";
            }
            $sqlStatus = "SELECT id, status FROM " . $conf_cdr_db . ".catalog_status WHERE id = " . $result_set[$i]['status'] . "";
            $choose_status = values($sqlStatus);
            if (count($choose_status) == 0) {
                $result_set[$i]['status'] = 0;
            }
            echo '               		 <TR bgcolor="' . $status_color . '"  onMouseOver="bgColor=\'#C4FFD7\'" onMouseOut="bgColor=\'' . $status_color . '\'" onMouseClick="bgColor=\'#C4FFD7\'">
						<TD vAlign=top align="" class=tableBody>' . (($page - 1) * $perpage + $i + 1) . '.&nbsp;</TD>
						<TD vAlign=top align="" class=tableBody>' . $direct_icon . '</TD>

						                 		 <TD vAlign=top align="center" class=tableBody>' . $result_set[$i]['calldate'] . '</TD>
						                 		 <TD vAlign=top align="right" class=tableBody>' . $abonents[0] . " " . $result_set[$i]['src'] . '</TD>
						                 		 <TD vAlign=top align="right" class=tableBody>' . $abonents[1] . " " . $result_set[$i]['dst'] . '</TD>';
            if ($show_name) {
                echo '    		                 		 <TD vAlign=top align="center" class=tableBody>' . $out_name . '</TD>
        <TD vAlign=top align="center" class=tableBody>' . $out_name2 . '</TD>';
            }
            echo '    		                 		 <TD vAlign=top align="center" class=tableBody>' . $result_set[$i]['disposition'] . '</TD>
开发者ID:kipkaev55,项目名称:asterisk,代码行数:31,代码来源:statistic.php

示例14: substr

     $short_src = substr($result_set[$i]['src'], 1);
 } else {
     $short_src = $result_set[$i]['src'];
 }
 $sel_name = values("SELECT name, contact FROM hilti.clients_ver1 WHERE phone1='" . $short_src . "' OR phone2='" . $short_src . "' OR phone3='" . $short_src . "' OR fax='" . $short_src . "' OR main_number='" . $short_src . "'");
 if (count($sel_name) > 0) {
     $out_name = $sel_name[0]["name"] . " " . $sel_name[0]["contact"];
 } else {
     $out_name = '';
 }
 if (strpos(' ' . $result_set[$i]['dst'], '0') == 1) {
     $short_dst = substr($result_set[$i]['dst'], 1);
 } else {
     $short_dst = $result_set[$i]['dst'];
 }
 $sel_name2 = values("SELECT name, contact FROM hilti.clients_ver1 WHERE phone1='" . $short_dst . "' OR phone2='" . $short_dst . "' OR phone3='" . $short_dst . "' OR fax='" . $short_dst . "' OR main_number='" . $short_dst . "'");
 if (count($sel_name2) > 0) {
     $out_name2 = $sel_name2[0]["name"] . " " . $sel_name2[0]["contact"];
 } else {
     $out_name2 = '';
 }
 $status_color = '#F2F8FF';
 if ($result_set[$i]['disposition'] == "NO ANSWER") {
     $result_set[$i]['disposition'] = "Нет ответа";
 } elseif ($result_set[$i]['disposition'] == "ANSWERED") {
     $result_set[$i]['disposition'] = "Принят";
 } elseif ($result_set[$i]['disposition'] == "BUSY") {
     $result_set[$i]['disposition'] = "Занято";
 } elseif ($result_set[$i]['disposition'] == "FAILED") {
     $result_set[$i]['disposition'] = "Ошибка";
 }
开发者ID:kipkaev55,项目名称:asterisk,代码行数:31,代码来源:export_csv_old.php

示例15: list

// GET FILTERS AND THEM RESULT
list($from, $to) = prepare_dates($fromstatsday, $fromstatsmonth, $fromstatsyear, $tostatsday, $tostatsmonth, $tostatsyear);
if (isset($posted)) {
    if (isset($callerid)) {
        $query_clid = " AND cdr.src LIKE '%" . $callerid . "%'";
    } else {
        $query_clid = "";
    }
    if (isset($clientname)) {
        $query_clname = " AND (cl.name LIKE '%" . $clientname . "%' OR cl.contact LIKE '%" . $clientname . "%' OR cl.client_code LIKE '%" . $clientname . "%')";
    } else {
        $query_clname = "";
    }
    $where_query = "WHERE calls.call_date BETWEEN '" . $from . "' AND '" . $to . "'" . $add_sipusr . $query_clid . $query_clname . " AND lastapp != 'Transferred Call' ORDER BY calls.call_date DESC";
    $result_set = values("SELECT cl.id AS clid, cl.name AS clname, cl.contact AS clcontact, cl.ttk AS ttk, calls.call_date, calldate, userfield, src, dst AS dest, duration, uniqueid, randdata, disposition, comment, operator FROM " . $conf_statistic_db . ".`calls_ver3` calls LEFT JOIN " . $conf_cdr_db . ".`cdr` cdr ON cdr.uniqueid=calls.unique_id LEFT JOIN " . $conf_statistic_db . ".`clients_ver3` cl  ON cl.id=calls.client_id " . $where_query . " LIMIT " . ($page - 1) * $perpage . ", " . $perpage);
    $duration_select = values("SELECT COUNT(*) AS c, SUM(duration) AS dur FROM " . $conf_statistic_db . ".calls_ver3 calls LEFT JOIN " . $conf_cdr_db . ".`cdr` cdr ON cdr.uniqueid=calls.unique_id LEFT JOIN " . $conf_statistic_db . ".`clients_ver3` cl  ON cl.id=calls.client_id " . $where_query);
    $dur_sec = @$duration_select[0]['dur'];
    $cal_num = @$duration_select[0]['c'];
    $rusult_num = count($result_set);
    if ($rusult_num > 0) {
        $pstring = '';
        $pages = ceil($cal_num / $perpage);
        for ($i = 0; $i < $pages; $i++) {
            if ($i + 1 == $page) {
                $pstring .= '<b>[' . ($i + 1) . ']</b> ';
            } else {
                $pstring .= '<a href="index.php?page=' . ($i + 1) . '">' . ($i + 1) . '</a> ';
            }
        }
        ?>
	<center>
开发者ID:kipkaev55,项目名称:asterisk,代码行数:31,代码来源:clients_calls.php


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