⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 call-daily-load.php

📁 最近在做软交换时研究的一个软交换的东东
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?php /* $Id: call-daily-load.php 2413 2006-09-14 03:37:03Z qldrob $ */include_once(dirname(__FILE__) . "/lib/defines.php");include_once(dirname(__FILE__) . "/lib/Class.Table.php");getpost_ifset(array('current_page', 'fromstatsday_sday', 'fromstatsmonth_sday', 'days_compare', 'min_call', 'posted',  'dsttype', 'sourcetype', 'clidtype', 'channel', 'resulttype', 'stitle', 'atmenu', 'current_page', 'order', 'sens', 'dst', 'src', 'clid', 'userfieldtype', 'userfield', 'accountcodetype', 'accountcode'));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=DB_TABLENAME;// THIS VARIABLE DEFINE THE COLOR OF THE HEAD TABLE$FG_TABLE_HEAD_COLOR = "#D1D9E7";$FG_TABLE_EXTERN_COLOR = "#7F99CC"; //#CC0033 (Rouge)$FG_TABLE_INTERN_COLOR = "#EDF3FF"; //#FFEAFF (Rose)// THIS VARIABLE DEFINE THE COLOR OF THE HEAD TABLE$FG_TABLE_ALTERNATE_ROW_COLOR[] = "#FFFFFF";$FG_TABLE_ALTERNATE_ROW_COLOR[] = "#F2F8FF";//$link = DbConnect();$DBHandle  = DbConnect();// 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();/*******Calldate Clid Src Dst Dcontext Channel Dstchannel Lastapp Lastdata Duration Billsec Disposition Amaflags Accountcode Uniqueid Serverid*******/$FG_TABLE_COL[]=array ("Calldate", "calldate", "18%", "center", "SORT", "19");$FG_TABLE_COL[]=array ("Channel", "channel", "13%", "center", "", "30");$FG_TABLE_COL[]=array ("Source", "src", "10%", "center", "", "30");$FG_TABLE_COL[]=array ("Clid", "clid", "12%", "center", "", "30");$FG_TABLE_COL[]=array ("Lastapp", "lastapp", "8%", "center", "", "30");$FG_TABLE_COL[]=array ("Lastdata", "lastdata", "12%", "center", "", "30");$FG_TABLE_COL[]=array ("Dst", "dst", "9%", "center", "SORT", "30");//$FG_TABLE_COL[]=array ("Serverid", "serverid", "10%", "center", "", "30");$FG_TABLE_COL[]=array ("Disposition", "disposition", "9%", "center", "", "30");$FG_TABLE_COL[]=array ("Duration", "duration", "6%", "center", "SORT", "30");$FG_TABLE_DEFAULT_ORDER = "calldate";$FG_TABLE_DEFAULT_SENS = "DESC";// This Variable store the argument for the SQL query$FG_COL_QUERY='calldate, channel, src, clid, lastapp, lastdata, dst, disposition, duration';//$FG_COL_QUERY='calldate, channel, src, clid, lastapp, lastdata, dst, serverid, disposition, duration';$FG_COL_QUERY_GRAPH='calldate, duration';// The variable LIMITE_DISPLAY define the limit of record to display by page$FG_LIMITE_DISPLAY=25;// Number of column in the html table$FG_NB_TABLE_COL=count($FG_TABLE_COL);// The variable $FG_EDITION define if you want process to the edition of the database record$FG_EDITION=true;//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++;//This variable define the Title of the HTML table$FG_HTML_TABLE_TITLE=" - Call Logs - ";//This variable define the width of the HTML table$FG_HTML_TABLE_WIDTH="90%";if ($FG_DEBUG == 3) echo "<br>Table : $FG_TABLE_NAME  	- 	Col_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){	  function do_field($sql,$fld){  		$fldtype = $fld.'type';		global $$fld;		global $$fldtype;        if (isset($$fld) && ($$fld!='')){                if (strpos($sql,'WHERE') > 0){                        $sql = "$sql AND ";                }else{                        $sql = "$sql WHERE ";                }				$sql = "$sql $fld";				if (isset ($$fldtype)){                                        switch ($$fldtype) {							case 1:	$sql = "$sql='".$$fld."'";  break;							case 2: $sql = "$sql LIKE '".$$fld."%'";  break;							case 3: $sql = "$sql LIKE '%".$$fld."%'";  break;							case 4: $sql = "$sql LIKE '%".$$fld."'";						}                }else{ $sql = "$sql LIKE '%".$$fld."%'"; }		}        return $sql;  }    $SQLcmd = '';  if ($_POST['before']) {    if (strpos($SQLcmd, 'WHERE') > 0) { 	$SQLcmd = "$SQLcmd AND ";    }else{     								$SQLcmd = "$SQLcmd WHERE "; }    $SQLcmd = "$SQLcmd calldate<'".mysql_real_escape_string($_POST['before'])."'";  }  if ($_POST['after']) {    if (strpos($SQLcmd, 'WHERE') > 0) {      $SQLcmd = "$SQLcmd AND ";  } else {      $SQLcmd = "$SQLcmd WHERE ";    }    $SQLcmd = "$SQLcmd calldate>'".mysql_real_escape_string($_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($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'";}else{	if (isset($fromstatsday_sday) && isset($fromstatsmonth_sday)) $date_clause.=" AND calldate < ADDDATE('$fromstatsmonth_sday-$fromstatsday_sday',INTERVAL 1 DAY) AND calldate >= '$fromstatsmonth_sday-$fromstatsday_sday'";  }if ($FG_DEBUG == 3) echo "<br>$date_clause<br>";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); }/* --AMP BEGIN-- *///enforce restrictions for this AMP Usersession_start();$AMP_CLAUSE = $HTTP_SESSION_VARS['AMP_SQL'];if (!isset($AMP_CLAUSE)) {        $AMP_CLAUSE = " AND src = 'NeverReturnAnything'";}$FG_TABLE_CLAUSE .= $AMP_CLAUSE;/* --AMP END-- */if ($_POST['posted']==1){	//> function Get_list ($clause=null, $order=null, $sens=null, $field_order_letter=null, $letters = null, $limite=null, $current_record = NULL)	$list = $instance_table -> Get_list ($FG_TABLE_CLAUSE, $order, $sens, null, null, $FG_LIMITE_DISPLAY, $current_page*$FG_LIMITE_DISPLAY);		$list_total = $instance_table_graph -> Get_list ($FG_TABLE_CLAUSE, null, null, null, null, null, null);}if ($FG_DEBUG == 3) echo "<br>Clause : $FG_TABLE_CLAUSE";//$nb_record = $instance_table -> Table_count ($FG_TABLE_CLAUSE);$nb_record = count($list_total);if ($FG_DEBUG >= 1) var_dump ($list);if ($nb_record<=$FG_LIMITE_DISPLAY){ 	$nb_record_max=1;}else{ 	$nb_record_max=(intval($nb_record/$FG_LIMITE_DISPLAY)+1);}if ($FG_DEBUG == 3) echo "<br>Nb_record : $nb_record";if ($FG_DEBUG == 3) echo "<br>Nb_record_max : $nb_record_max";?><script language="JavaScript" type="text/JavaScript"><!--function MM_openBrWindow(theURL,winName,features) { //v2.0  window.open(theURL,winName,features);}//--></script><!-- ** ** ** ** ** Part for the research ** ** ** ** ** -->	<center>	<FORM METHOD=POST ACTION="<?php echo $_SERVER['PHP_SELF']?>?s=<?php echo $s?>&t=<?php echo $t?>&order=<?php echo $order?>&sens=<?php echo $sens?>&current_page=<?php echo $current_page?>">	<INPUT TYPE="hidden" NAME="posted" value=1>		<table class="bar-status" width="75%" border="0" cellspacing="1" cellpadding="2" align="center">			<tbody>						<tr>        		<td align="left" bgcolor="#000033">										<font face="verdana" size="1" color="#ffffff"><b>Select the day</b></font>				</td>      			<td align="left" bgcolor="#acbdee">					<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#acbdee"><tr><td>	  				<b>From : </b><select name="fromstatsday_sday">					<?php  						for ($i=1;$i<=31;$i++){							if ($fromstatsday_sday==sprintf("%02d",$i)){$selected="selected";}else{$selected="";}							echo '<option value="'.sprintf("%02d",$i)."\"$selected>".sprintf("%02d",$i).'</option>';						}					?>										</select>				 	<select name="fromstatsmonth_sday">					<?php 	$year_actual = date("Y");  							for ($i=$year_actual;$i >= $year_actual-1;$i--)						{		   							   $monthname = array( "January", "February","March", "April", "May", "June", "July", "August", "September", "October", "November", "December");							   if ($year_actual==$i){									$monthnumber = date("n")-1; // Month number without lead 0.							   }else{									$monthnumber=11;							   }		   							   for ($j=$monthnumber;$j>=0;$j--){											$month_formated = sprintf("%02d",$j+1);							   			if ($fromstatsmonth_sday=="$i-$month_formated"){$selected="selected";}else{$selected="";}										echo "<OPTION value=\"$i-$month_formated\" $selected> $monthname[$j]-$i </option>";											   }						}													?>															</select>					</td></tr></table>	  			</td>    		</tr>							<tr>				<td class="bar-search" align="left" bgcolor="#555577">								<font face="verdana" size="1" color="#ffffff"><b>&nbsp;&nbsp;DESTINATION</b></font>				</td>								<td class="bar-search" align="left" bgcolor="#cddeff">				<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td>&nbsp;&nbsp;<INPUT TYPE="text" NAME="dst" value="<?php echo $dst?>"></td>				<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="dsttype" value="1" <?php if((!isset($dsttype))||($dsttype==1)){?>checked<?php }?>>Exact</td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -