-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconf_cdr.php
More file actions
256 lines (198 loc) · 7.94 KB
/
conf_cdr.php
File metadata and controls
256 lines (198 loc) · 7.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<?php
include ("./lib/defines.php");
include ("./lib/functions.php");
include ("./lib/database.php");
include ("locale.php");
session_start();
getpost_ifset(array('bookId','confno','view','s','t'));
// 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_TABLECDR;
// 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 (_("Caller Name"), "CIDname", "50%", "middle", "", "30");
$FG_TABLE_COL[]=array (_("Telephone"), "CIDnum", "25%", "middle", "", "30");
$FG_TABLE_COL[]=array (_("Duration"), "duration", "25%", "middle", "", "30");
$FG_TABLE_DEFAULT_ORDER = "CIDname";
$FG_TABLE_DEFAULT_SENS = "ASC";
// This Variable store the argument for the SQL query
$FG_COL_QUERY='CIDnum, CIDname, duration';
// The variable LIMITE_DISPLAY define the limit of record to display by page
$FG_LIMITE_DISPLAY=15;
$FG_LIMITE_DISPLAY_BLANK_LINE=5;
// 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;
//This variable define the Title of the HTML table
$FG_HTML_TABLE_TITLE=" - "._("Conference Participants").": $confno";
//This variable define the width of the HTML table
$FG_HTML_TABLE_WIDTH="100%";
if ($FG_DEBUG == 3) echo "<br>Table : $FG_TABLE_NAME - Col_query : $FG_COL_QUERY";
if ( !isset ($order) || !isset ($sens) ){
$order = $FG_TABLE_DEFAULT_ORDER;
$sens = $FG_TABLE_DEFAULT_SENS;
}
$now=getConfDate();
if (isset($bookId)){
$FG_TABLE_CLAUSE = "bookId='$bookId'";
}
$i = 0;
$query = "SELECT $FG_COL_QUERY FROM $FG_TABLE_NAME WHERE $FG_TABLE_CLAUSE";
$result = $db->query($query);
if ($FG_DEBUG == 3)
print_r ($result);
while($row = $result->fetchRow())
$list[$i++] = $row;
$nb_record = $i-1;
if ($i){
for ($x=0; $x < $i; $x++){
$dur = intval($list[$x][2]);
$hr = intval(($dur / 3600));
$min = intval(($dur % 3600) / 60);
$sec = intval(($dur % 60));
$list[$x][2] = $hr.":".$min.":".$sec;
}
}
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";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title><?php print GUI_TITLE; ?> control</title>
<meta http-equiv="Content-Type" content="text/html">
<link rel="stylesheet" type="text/css">
<style type="text/css" media="screen">
@import url("css/content.css");
@import url("css/docbook.css");
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body>
<br><br>
<!-- ** ** ** ** ** Part to display the conference ** ** ** ** ** -->
<center>
<?php if ( (isset($list) && is_array($list)) ){ ?>
<table width="<?php echo $FG_HTML_TABLE_WIDTH; ?>" border="0" align="center" cellpadding="0" cellspacing="0">
<TR bgcolor="#ffffff">
<TD bgColor=#7f99cc height=16 style="PADDING-LEFT: 5px; PADDING-RIGHT: 3px">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD><SPAN style="COLOR: #ffffff; FONT-SIZE: 11px"><B><?php echo $FG_HTML_TABLE_TITLE; ?></B></SPAN></TD>
<TD align=right> <IMG alt="Back to Top" border=0 height=12 src="images/btn_top_12x12.gif" width=12>
</TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<TR>
<TD>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR bgColor=#F0F0F0>
<?php
if (is_array($list) && count($list)>0){
for($i=0;$i<$FG_NB_TABLE_COL;$i++){
?>
<TD width="<?php $FG_TABLE_COL[$i][2]; ?>" align=middle class="tableBody" style="PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px">
<center><strong>
<?php if (strtoupper($FG_TABLE_COL[$i][4])=="SORT"){?>
<a href="<?php echo $_SERVER[PHP_SELF]."?s=$s&t=$t&view=$view¤t_page=$current_page&order=".$FG_TABLE_COL[$i][1]."&sens=";
if ($sens=="ASC"){echo"DESC";}else{echo"ASC";}
echo "";?>">
<span class="liens"><?php } ?>
<?php echo $FG_TABLE_COL[$i][0]; ?>
<?php if (strtoupper($FG_TABLE_COL[$i][4])=="SORT"){?>
</span></a>
<?php } ?>
</strong></center></TD>
<?php } ?>
<?php
$ligne_number=1;
foreach ($list as $recordset){
$ligne_number++;
if ($recordset[0] || $recordset[1]){ ?>
<TR bgcolor="<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR[$ligne_number%2];?>" onMouseOver="bgColor='#C4FFD7'" onMouseOut="bgColor='<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR[$ligne_number%2]; ?>'">
<?php for($i=0;$i<$FG_NB_TABLE_COL;$i++){ ?>
<?php $record_display = $recordset[$i];
?>
<TD width="<?php echo $FG_TABLE_COL[$i][2]; ?>" vAlign=middle align="<?php echo $FG_TABLE_COL[$i][3];?>" class=tableBody>
<?php echo htmlentities( $record_display); ?></TD>
<?php } ?>
<?php } ?>
</TD>
</TR>
<?php
}
}else{
echo _("No data found")."!!!";
}//end_if
?>
<TR>
<TD class=tableDivider colSpan=<?php echo $FG_TOTAL_TABLE_COL+1; ?>><IMG height=1
src="images/clear.gif"
width=1></TD>
</TR>
<TR>
<TD class=tableDivider align=right colSpan=<?php echo $FG_TOTAL_TABLE_COL+1; ?>>
</TD>
</TR>
</TBODY>
</TABLE></td>
</tr>
<TR bgcolor="#ffffff">
<TD bgColor=#ADBEDE height=16 style="PADDING-LEFT: 5px; PADDING-RIGHT: 3px">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD align="right"><SPAN style="COLOR: #ffffff; FONT-SIZE: 11px"><B>
<?php if (isset ($current_page) && $current_page>0){?>
<img src="images/fleche-g.gif" width="5" height="10">
<a href="<?php echo "$_SERVER[PHP_SELF]?order=$order&sens=$sens¤t_page=" . ($current_page-1); echo "&bookId=$bookId&confno=$confno";?>">
Previous </a> -
<?php }?>
<?php if (isset($current_page)) echo ($current_page+1) ." / " . $nb_record_max; ?>
<?php if (isset ($current_page) && $current_page<$nb_record_max-1){?>
- <a href="<?php echo "$_SERVER[PHP_SELF]?order=$order&view=$view&sens=$sens¤t_page=" . ($current_page+1); echo "&bookId=$bookId&confno=$confno";?>">
Next </a> <img src="images/fleche-d.gif" width="5" height="10">
</B></SPAN>
<?php }?>
</TD>
</TBODY>
</TABLE></TD>
</TR>
</table>
<FORM>
<INPUT TYPE="Submit" onClick="window.close()" NAME="Close" VALUE="Close" align="top" border="0"/>
</FORM>
<?php
}
else
{
echo _("No participants found for that conference number");
}
?>
</center>
</td></tr></tbody></table>
</center>
<br></br>
<br></br>
<!-- END -->
</body>
</html>