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


PHP do_field函数代码示例

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


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

示例1: gettext

$FG_EDITION = true;
$FG_TOTAL_TABLE_COL = $FG_NB_TABLE_COL;
if ($FG_DELETION || $FG_EDITION) {
    $FG_TOTAL_TABLE_COL++;
}
$FG_HTML_TABLE_TITLE = " - " . gettext("Call Logs") . " - ";
$FG_HTML_TABLE_WIDTH = "98%";
$instance_table = new Table($FG_TABLE_NAME, $FG_COL_QUERY);
if (is_null($order) || is_null($sens)) {
    $order = $FG_TABLE_DEFAULT_ORDER;
    $sens = $FG_TABLE_DEFAULT_SENS;
}
if ($posted == 1) {
    $SQLcmd = '';
    $SQLcmd = do_field($SQLcmd, 'src', 'source');
    $SQLcmd = do_field($SQLcmd, 'phonenumber', 'calledstation');
}
$date_clause = '';
normalize_day_of_month($fromstatsday_sday, $fromstatsmonth_sday, 1);
normalize_day_of_month($tostatsday_sday, $tostatsmonth_sday, 1);
if ($fromday && isset($fromstatsday_sday) && isset($fromstatsmonth_sday)) {
    $date_clause .= " AND t1.starttime >= ('{$fromstatsmonth_sday}-{$fromstatsday_sday}')";
}
if ($today && isset($tostatsday_sday) && isset($tostatsmonth_sday)) {
    $date_clause .= " AND t1.starttime <= ('{$tostatsmonth_sday}-" . sprintf("%02d", intval($tostatsday_sday)) . " 23:59:59')";
}
if (strpos($SQLcmd, 'WHERE') > 0) {
    $FG_TABLE_CLAUSE = substr($SQLcmd, 6) . $date_clause;
} elseif (strpos($date_clause, 'AND') > 0) {
    $FG_TABLE_CLAUSE = substr($date_clause, 5);
}
开发者ID:hellbound,项目名称:a2billing-mod,代码行数:31,代码来源:call-history.php

示例2: do_field

    if (strpos($SQLcmd, 'WHERE') > 0) {
        $SQLcmd = "{$SQLcmd} AND ";
    } else {
        $SQLcmd = "{$SQLcmd} WHERE ";
    }
    $SQLcmd = "{$SQLcmd} starttime <'" . $before . "'";
}
if ($after) {
    if (strpos($SQLcmd, 'WHERE') > 0) {
        $SQLcmd = "{$SQLcmd} AND ";
    } else {
        $SQLcmd = "{$SQLcmd} WHERE ";
    }
    $SQLcmd = "{$SQLcmd} starttime >'" . $after . "'";
}
$SQLcmd = do_field($SQLcmd, 'dst', 'calledstation');
if (isset($customer) && $customer > 0) {
    if (strlen($SQLcmd) > 0) {
        $SQLcmd .= " AND ";
    } else {
        $SQLcmd .= " WHERE ";
    }
    $SQLcmd .= " card_id='{$customer}' ";
} else {
    if (isset($entercustomer) && $entercustomer > 0) {
        if (strlen($SQLcmd) > 0) {
            $SQLcmd .= " AND ";
        } else {
            $SQLcmd .= " WHERE ";
        }
        $SQLcmd .= " card_id='{$entercustomer}' ";
开发者ID:saydulk,项目名称:a2billing,代码行数:31,代码来源:graph_hourdetail.php

示例3: gettext

$FG_TOTAL_TABLE_COL = $FG_NB_TABLE_COL;
if ($FG_DELETION || $FG_EDITION) {
    $FG_TOTAL_TABLE_COL++;
}
$FG_HTML_TABLE_TITLE = gettext(" - Call Logs - ");
$FG_HTML_TABLE_WIDTH = '98%';
$instance_table = new Table($FG_TABLE_NAME, $FG_COL_QUERY);
if (is_null($order) || is_null($sens)) {
    $order = $FG_TABLE_DEFAULT_ORDER;
    $sens = $FG_TABLE_DEFAULT_SENS;
}
if ($posted == 1) {
    $SQLcmd = '';
    $SQLcmd = do_field($SQLcmd, 'src', 'src');
    $SQLcmd = do_field($SQLcmd, 'dst', 'calledstation');
    $SQLcmd = do_field($SQLcmd, 'dnid', 'dnid');
}
$date_clause = '';
if (DB_TYPE == "postgres") {
    $UNIX_TIMESTAMP = "";
} else {
    $UNIX_TIMESTAMP = "UNIX_TIMESTAMP";
}
normalize_day_of_month($fromstatsday_sday, $fromstatsmonth_sday, 1);
normalize_day_of_month($tostatsday_sday, $tostatsmonth_sday, 1);
// Date Clause
if ($fromday && isset($fromstatsday_sday) && isset($fromstatsmonth_sday)) {
    if ($fromtime) {
        $date_clause .= " AND {$UNIX_TIMESTAMP}(t1.starttime) >= {$UNIX_TIMESTAMP}('{$fromstatsmonth_sday}-{$fromstatsday_sday} {$fromstatsday_hour}:{$fromstatsday_min}')";
    } else {
        $date_clause .= " AND {$UNIX_TIMESTAMP}(t1.starttime) >= {$UNIX_TIMESTAMP}('{$fromstatsmonth_sday}-{$fromstatsday_sday}')";
开发者ID:pearlvoip,项目名称:a2billing,代码行数:31,代码来源:call-log-customers.php

示例4: do_field

        $SQLcmd = "{$SQLcmd} calldate<'" . $_POST['before'] . "'";
    }
    if ($_POST['after']) {
        if (strpos($SQLcmd, 'WHERE') > 0) {
            $SQLcmd = "{$SQLcmd} AND ";
        } else {
            $SQLcmd = "{$SQLcmd} WHERE ";
        }
        $SQLcmd = "{$SQLcmd} calldate>'" . $_POST['after'] . "'";
    }
    $SQLcmd = do_field($SQLcmd, 'clid');
    $SQLcmd = do_field($SQLcmd, 'src');
    $SQLcmd = do_field($SQLcmd, 'dst');
    $SQLcmd = do_field($SQLcmd, 'channel');
    $SQLcmd = do_field($SQLcmd, 'userfield');
    $SQLcmd = do_field($SQLcmd, 'accountcode');
}
$date_clause = '';
// Period (Month-Day)
if (!isset($fromstatsday_sday)) {
    $fromstatsday_sday = date("d");
    $fromstatsmonth_sday = date("Y-m");
}
if (!isset($days_compare)) {
    $days_compare = 2;
}
//if (isset($fromstatsday_sday) && isset($fromstatsmonth_sday)) $date_clause.=" AND calldate <= '$fromstatsmonth_sday-$fromstatsday_sday+23' AND calldate >= SUBDATE('$fromstatsmonth_sday-$fromstatsday_sday',INTERVAL $days_compare DAY)";
if (DB_TYPE == "postgres") {
    if (isset($fromstatsday_sday) && isset($fromstatsmonth_sday)) {
        $date_clause .= " AND calldate < date'{$fromstatsmonth_sday}-{$fromstatsday_sday}'+ INTERVAL '1 DAY' AND calldate >= date'{$fromstatsmonth_sday}-{$fromstatsday_sday}' - INTERVAL '{$days_compare} DAY'";
    }
开发者ID:shinichi85,项目名称:voiperopen,代码行数:31,代码来源:call-comp.php

示例5: EmailInvoice

function EmailInvoice($id, $invoice_type = 1)
{
    //getpost_ifset(array('customer', 'posted', 'Period', 'cardid','exporttype','choose_billperiod','id','invoice_type'));
    if ($invoice_type == "") {
        $invoice_type = 1;
    }
    if ($invoice_type == 1) {
        $cardid = $id;
        if ($cardid == "") {
            exit("Invalid ID");
        }
    }
    if ($invoice_type == 2) {
        if ($id == "" || !is_numeric($id)) {
            exit(gettext("Invalid ID"));
        }
    }
    if ($invoice_type == 1) {
        $invoice_heading = gettext("Unbilled Details");
        $invocie_top_heading = gettext("Unbilled Invoice Details for Card Number");
    } else {
        $invoice_heading = gettext("Billed Details");
        $invocie_top_heading = gettext("Billed Invoice Details for Card Number");
    }
    $DBHandle = DbConnect();
    $num = 0;
    if ($invoice_type == 1) {
        $QUERY = "Select username, vat, t1.id from cc_card t1 where t1.id = {$cardid}";
    } else {
        $QUERY = "Select username, vat, t1.id from cc_card t1, cc_invoices t2 where t1.id = t2.cardid and t2.id = {$id}";
    }
    $res_user = $DBHandle->Execute($QUERY);
    if ($res_user) {
        $num = $res_user->RecordCount();
    }
    if ($num > 0) {
        $userRecord = $res_user->fetchRow();
        $customer = $userRecord[0];
        $vat = $userRecord[1];
        $customerID = $userRecord[2];
    } else {
        exit(gettext("No User found"));
    }
    if (!isset($current_page) || $current_page == "") {
        $current_page = 0;
    }
    // this variable specifie the debug type (0 => nothing, 1 => sql result, 2 => boucle checking, 3 other value checking)
    $FG_DEBUG = 0;
    // The variable FG_TABLE_NAME define the table name to use
    $FG_TABLE_NAME = "cc_call t1";
    // The variable Var_col would define the col that we want show in your table
    // First Name of the column in the html page, second name of the field
    $FG_TABLE_COL = array();
    $FG_TABLE_COL[] = array(gettext("Calldate"), "starttime", "18%", "center", "SORT", "19", "", "", "", "", "", "display_dateformat");
    $FG_TABLE_COL[] = array(gettext("Source"), "src", "10%", "center", "SORT", "30");
    $FG_TABLE_COL[] = array(gettext("Callednumber"), "calledstation", "18%", "right", "SORT", "30", "", "", "", "", "", "");
    $FG_TABLE_COL[] = array(gettext("Destination"), "destination", "18%", "center", "SORT", "30", "", "", "", "", "", "remove_prefix");
    $FG_TABLE_COL[] = array(gettext("Duration"), "sessiontime", "8%", "center", "SORT", "30", "", "", "", "", "", "display_minute");
    if (!(isset($customer) && $customer > 0) && !(isset($entercustomer) && $entercustomer > 0)) {
        $FG_TABLE_COL[] = array(gettext("Cardused"), "username", "11%", "center", "SORT", "30");
    }
    $FG_TABLE_COL[] = array(gettext("Cost"), "sessionbill", "9%", "center", "SORT", "30", "", "", "", "", "", "display_2bill");
    $FG_TABLE_DEFAULT_ORDER = "t1.starttime";
    $FG_TABLE_DEFAULT_SENS = "DESC";
    // This Variable store the argument for the SQL query
    $FG_COL_QUERY = 't1.starttime, t1.src, t1.calledstation, t1.destination, t1.sessiontime  ';
    if (!(isset($customer) && $customer > 0) && !(isset($entercustomer) && $entercustomer > 0)) {
        $FG_COL_QUERY .= ', t1.username';
    }
    $FG_COL_QUERY .= ', t1.sessionbill';
    if (LINK_AUDIO_FILE == 'YES') {
        $FG_COL_QUERY .= ', t1.uniqueid';
    }
    $FG_COL_QUERY_GRAPH = 't1.callstart, t1.duration';
    // The variable LIMITE_DISPLAY define the limit of record to display by page
    $FG_LIMITE_DISPLAY = 500;
    // Number of column in the html table
    $FG_NB_TABLE_COL = count($FG_TABLE_COL);
    //This variable will store the total number of column
    $FG_TOTAL_TABLE_COL = $FG_NB_TABLE_COL;
    if ($FG_DELETION || $FG_EDITION) {
        $FG_TOTAL_TABLE_COL++;
    }
    if ($FG_DEBUG == 3) {
        echo "<br>Table : {$FG_TABLE_NAME}  \t- \tCol_query : {$FG_COL_QUERY}";
    }
    $instance_table = new Table($FG_TABLE_NAME, $FG_COL_QUERY);
    $instance_table_graph = new Table($FG_TABLE_NAME, $FG_COL_QUERY_GRAPH);
    if (is_null($order) || is_null($sens)) {
        $order = $FG_TABLE_DEFAULT_ORDER;
        $sens = $FG_TABLE_DEFAULT_SENS;
    }
    if ($posted == 1) {
        $SQLcmd = '';
        $SQLcmd = do_field($SQLcmd, 'src', 'src');
        $SQLcmd = do_field($SQLcmd, 'dst', 'calledstation');
    }
    $date_clause = '';
    // Period (Month-Day)
    if (DB_TYPE == "postgres") {
//.........这里部分代码省略.........
开发者ID:sayemk,项目名称:a2billing,代码行数:101,代码来源:invoice.php

示例6: do_field

            } else {
                $sql = "{$sql} LIKE '%" . ${$fld} . "%'";
            }
        }
        return $sql;
    }
    $SQLcmd = '';
    $SQLcmd = do_field($SQLcmd, 'clid');
    $SQLcmd = do_field($SQLcmd, 'src');
    $SQLcmd = do_field($SQLcmd, 'dst');
    $SQLcmd = do_field($SQLcmd, 'userfield');
    $SQLcmd = do_field($SQLcmd, 'accountcode');
    $SQLcmd = do_field($SQLcmd, 'channel');
    $SQLcmd = do_field_duration($SQLcmd, 'duration1', 'duration');
    $SQLcmd = do_field_duration($SQLcmd, 'duration2', 'duration');
    $SQLcmd = do_field($SQLcmd, 'uuid');
}
$date_clause = '';
// Period (Month-Day)
if (DB_TYPE == "postgres") {
    $UNIX_TIMESTAMP = "";
} else {
    $UNIX_TIMESTAMP = "UNIX_TIMESTAMP";
}
if ($Period == "Month") {
    if ($frommonth && isset($fromstatsmonth)) {
        $date_clause .= " AND {$UNIX_TIMESTAMP}(calldate) >= {$UNIX_TIMESTAMP}('{$fromstatsmonth}-01')";
    }
    if ($tomonth && isset($tostatsmonth)) {
        $date_clause .= " AND {$UNIX_TIMESTAMP}(calldate) <= {$UNIX_TIMESTAMP}('{$tostatsmonth}-31 23:59:59')";
    }
开发者ID:butch,项目名称:asterisk-cdr-plus,代码行数:31,代码来源:call-log.php

示例7: sql_vinculos

function sql_vinculos($src, $dst, $orides, $srctype, $dsttype)
{
    unset($retorno);
    global $valor;
    /* Não tendo vínculo */
    if (trim($_SESSION['vinculos_user']) == "") {
        /* Monta clausula WHERE para campo src (origem) */
        unset($TMP_COND);
        if (count($array_orides = explode(",", trim($src))) > 0) {
            foreach ($array_orides as $valor) {
                $TMP_COND = do_field($TMP_COND, 'valor', 'srctype', 'src', 'OR');
            }
            if (strlen($TMP_COND) > 0) {
                $retorno .= " AND ( " . substr($TMP_COND, 6) . " )";
            }
        }
        /* Monta clausula WHERE para campo dst (destino) */
        unset($TMP_COND);
        if (count($array_orides = explode(",", trim($dst))) > 0) {
            foreach ($array_orides as $valor) {
                $TMP_COND = do_field($TMP_COND, 'valor', 'dsttype', 'dst', 'OR');
            }
            if (strlen($TMP_COND) > 0) {
                $retorno .= " AND ( " . substr($TMP_COND, 6) . " )";
            }
        }
        /* Tendo vínculo - fica limitado à relacao de ramais vinculados */
    } else {
        // Verifica se ramal e vinculo são iguais, sendo assim, restrito aos seus dados.
        if ($_SESSION['vinculos_user'] == $_SESSION['name_user']) {
            return " src='{$_SESSION['name_user']}' || dst='{$_SESSION['name_user']}' ";
            exit;
        }
        unset($vinculo, $TMP_COND);
        //$vinculo = monta_vinculo($_SESSION["vinculos"],'A');   // Monta array dos vinculos
        $vinculo = explode(',', $_SESSION["vinculos_user"]);
        // Cria variavel com valor determinado = 1 para comparacao com valores vinculados
        global $type_in, $valor;
        $type_in = "1";
        // 1 = comparacao direta com sinal de = (igual) no SQL
        /* Se origem ou destino forem especificados verifica se pertencem aos vinculos  */
        if ($src != "" || $dst != "") {
            $array_vin = explode(",", $dst);
            //   entao verifico o que esta em DST x vinculo
            $array_out = explode(",", $src);
            $campo_vin = 'dst';
            $campo_out = 'src';
            foreach ($array_vin as $valor) {
                // Verifica se existe algum VINCULO  para montar o SQL
                if (in_array($valor, $vinculo)) {
                    $TMP_COND = do_field($TMP_COND, 'valor', 'type_in', $campo_vin, 'OR');
                }
            }
            foreach ($array_out as $valor) {
                // Verifica se existe algum VINCULO  para montar o SQL
                if (in_array($valor, $vinculo)) {
                    $TMP_COND = do_field($TMP_COND, 'valor', 'type_in', $campo_vin, 'OR');
                }
            }
            /* Se origem e destino não forem especificados, cria condicoes para os vinculos existentes. */
        } else {
            foreach ($vinculo as $valor) {
                $TMP_COND = do_field($TMP_COND, 'valor', 'type_in', $campo_vin, 'OR');
            }
        }
        // Varre o campo que o usuario NAO escolheu, deve ter somente numeros que
        // estao na relacao dos vinculos para montar o SQL
        if (strlen($TMP_COND) > 0) {
            $retorno .= " AND ( " . substr($TMP_COND, 6) . " )";
        }
        // Varre o campo que o usuario informou livremente
        unset($TMP_COND);
        foreach ($array_out as $valor) {
            if (in_array($valor, $vinculo)) {
                $TMP_COND = do_field($TMP_COND, 'valor', $campo_out . "type", $campo_out, 'OR');
            }
        }
        if (strlen($TMP_COND) > 0) {
            $retorno .= " AND ( " . substr($TMP_COND, 6) . " )";
        }
    }
    /*
         if($orides == '' && $src == '' && $dst == '' && $_SESSION['vinculos_user'] != "") {
             $vinculos = explode(",",monta_vinculo($_SESSION['vinculos_user'],"L"));
             foreach($vinculos as $i => $v) {
                 $retorno .= " AND src='$v' OR dst='$v' ";
            }
         }
     if($src == '' && $dst == '') {
             $vinculos = explode(",",monta_vinculo($_SESSION['vinculos_user'],"L"));
             foreach($vinculos as $i => $v) {
                 $retorno .= " AND src='$v' OR dst='$v' ";
             }
         }
    */
    return $retorno;
}
开发者ID:rootzig,项目名称:SNEP,代码行数:97,代码来源:functions.php

示例8: do_field

                    case 4:
                        $sql = "{$sql} LIKE '%" . ${$fld} . "'";
                }
            } else {
                $sql = "{$sql} LIKE '%" . ${$fld} . "%'";
            }
        }
        return $sql;
    }
    $SQLcmd = '';
    $SQLcmd = do_field($SQLcmd, 'clid');
    $SQLcmd = do_field($SQLcmd, 'src');
    $SQLcmd = do_field($SQLcmd, 'dst');
    $SQLcmd = do_field($SQLcmd, 'userfield');
    $SQLcmd = do_field($SQLcmd, 'accountcode');
    $SQLcmd = do_field($SQLcmd, 'channel');
    $SQLcmd = do_field_duration($SQLcmd, 'duration1', 'billsec');
    $SQLcmd = do_field_duration($SQLcmd, 'duration2', 'billsec');
}
$date_clause = '';
// Period (Month-Day)
if (DB_TYPE == "postgres") {
    $UNIX_TIMESTAMP = "";
} else {
    $UNIX_TIMESTAMP = "UNIX_TIMESTAMP";
}
if ($Period == "Month") {
    if ($frommonth && isset($fromstatsmonth)) {
        $date_clause .= " AND {$UNIX_TIMESTAMP}(calldate) >= {$UNIX_TIMESTAMP}('{$fromstatsmonth}-01')";
    }
    if ($tomonth && isset($tostatsmonth)) {
开发者ID:antirek,项目名称:prestige-pbx,代码行数:31,代码来源:call-log.php

示例9: do_field

        if (strpos($SQLcmd, 'WHERE') > 0) {
            $SQLcmd = "{$SQLcmd} AND ";
        } else {
            $SQLcmd = "{$SQLcmd} WHERE ";
        }
        $SQLcmd = "{$SQLcmd} calldate<'" . $_POST['before'] . "'";
    }
    if ($_POST['after']) {
        if (strpos($SQLcmd, 'WHERE') > 0) {
            $SQLcmd = "{$SQLcmd} AND ";
        } else {
            $SQLcmd = "{$SQLcmd} WHERE ";
        }
        $SQLcmd = "{$SQLcmd} calldate>'" . $_POST['after'] . "'";
    }
    $SQLcmd = do_field($SQLcmd, 'dst');
}
$date_clause = '';
if (!isset($months_compare)) {
    $months_compare = 2;
}
$fromstatsday_sday = 1;
if (DB_TYPE == "postgres") {
    if (isset($fromstatsmonth_sday)) {
        $date_clause .= " AND t1.starttime < date'{$fromstatsmonth_sday}-{$fromstatsday_sday}'+ INTERVAL '{$months_compare} MONTH' AND t1.starttime >= date'{$fromstatsmonth_sday}-{$fromstatsday_sday}' - INTERVAL '{$months_compare} MONTH'";
    }
} else {
    if (isset($fromstatsmonth_sday)) {
        $date_clause .= " AND t1.starttime < ADDDATE('{$fromstatsmonth_sday}-{$fromstatsday_sday}',INTERVAL {$months_compare} MONTH) AND t1.starttime >= SUBDATE('{$fromstatsmonth_sday}-{$fromstatsday_sday}',INTERVAL {$months_compare} MONTH)";
    }
}
开发者ID:sayemk,项目名称:a2billing,代码行数:31,代码来源:call-last-month.php


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