Exemplo n.º 1
0
/**
 * 将字符串进行正则匹配(得到匹配class的名称以及值),并将结果放在一个数组中。
 *
 * @param1 String $pregExp 正则匹配模式
 * @param2 String $formatCss 需要格式化的字符串
 * @return Array 匹配成功后的字符串放在数组中。
 */
function matchCss($pregExp, $formatCss, $posts)
{
    $arr = array();
    $formatCss = formatFiles($formatCss);
    if (preg_match_all($pregExp, $formatCss, $match, PREG_SET_ORDER)) {
        foreach ($match as $value) {
            foreach ($posts as $sp) {
                if ($value[2]) {
                }
                if ($value[8]) {
                }
                if ($value[1] === $sp) {
                    if ($value[2]) {
                        array_push($arr, $value[1] . $value[2] . $value[9]);
                    } else {
                        array_push($arr, $value[1] . $value[9]);
                    }
                }
                if ($value[7] === $sp) {
                    if ($value[8]) {
                        array_push($arr, $value[7] . $value[8] . $value[9]);
                    } else {
                        array_push($arr, $value[7] . $value[9]);
                    }
                }
            }
        }
        return $arr;
    }
}
Exemplo n.º 2
0
                    ?>
				<?php 
                    if (isset($_REQUEST['use_callrates']) && $_REQUEST['use_callrates'] == 'true') {
                        echo '<th class="record_col">CallRate</th><th class="record_col">CallRate Dst</th>';
                        $rate_total = 0;
                    }
                    ?>
				<th class="img_col"><a href="#CDR" title="Go to the top of the CDR table"><img src="/icons/small/back.png" alt="CDR Table" /></a></th>
				<th class="img_col"><a href="#Graph" title="Go to the top of the CDR graph"><img src="/icons/small/image2.png" alt="CDR Graph" /></a></th>
				</tr>
				<?php 
                    $i = 0;
                }
                echo "  <tr class=\"record\">\n";
                formatCallDate($row['calldate'], $row['uniqueid']);
                formatFiles($row);
                formatSrc($row['src'], $row['clid']);
                if (isset($row['did']) and strlen($row['did'])) {
                    formatDst($row['did'], $row['dcontext'] . ' # ' . $row['dst']);
                } else {
                    formatDst($row['dst'], $row['dcontext']);
                }
                if (isset($display_column['extension']) and $display_column['extension'] == 1) {
                    formatDst($row['dst'], $row['dcontext']);
                }
                formatApp($row['lastapp'], $row['lastdata']);
                formatChannel($row['channel']);
                if (isset($display_column['clid']) and $display_column['clid'] == 1) {
                    formatClid($row['clid']);
                }
                formatChannel($row['dstchannel']);