summaryrefslogtreecommitdiff
path: root/httemplate/misc
diff options
context:
space:
mode:
authorivan <ivan>2006-02-18 11:14:21 +0000
committerivan <ivan>2006-02-18 11:14:21 +0000
commitfadaa67e77ad8d5d966e252aba7f193e9e3840e3 (patch)
tree8f425d82a445dd5ba6ed58f316e4b7a6802ef2dc /httemplate/misc
parent6d27649c93f3f83c14611c790281a7b667062fc0 (diff)
CDR schema and class
Diffstat (limited to 'httemplate/misc')
-rw-r--r--httemplate/misc/cdr-import.html15
-rw-r--r--httemplate/misc/process/cdr-import.html26
2 files changed, 41 insertions, 0 deletions
diff --git a/httemplate/misc/cdr-import.html b/httemplate/misc/cdr-import.html
new file mode 100644
index 000000000..dc1733249
--- /dev/null
+++ b/httemplate/misc/cdr-import.html
@@ -0,0 +1,15 @@
+<%= include("/elements/header.html",'Call Detail Record Import') %>
+<FORM ACTION="process/cdr-import.html" METHOD="POST" ENCTYPE="multipart/form-data">
+Import a CSV file containing Call Detail Records (CDRs).<BR><BR>
+CDR Format: <SELECT NAME="format">
+<!-- <OPTION VALUE="asterisk">Asterisk</OPTION> -->
+<OPTION VALUE="unitel">Unitel/RSLCOM</OPTION>
+</SELECT><BR><BR>
+
+Filename: <INPUT TYPE="file" NAME="csvfile"><BR><BR>
+
+<INPUT TYPE="submit" VALUE="Upload">
+</FORM>
+
+<%= include('/elements/footer.html') %>
+
diff --git a/httemplate/misc/process/cdr-import.html b/httemplate/misc/process/cdr-import.html
new file mode 100644
index 000000000..381b07820
--- /dev/null
+++ b/httemplate/misc/process/cdr-import.html
@@ -0,0 +1,26 @@
+<%
+
+ my $fh = $cgi->upload('csvfile');
+
+ my $error = defined($fh)
+ ? FS::cdr::batch_import( {
+ 'filehandle' => $fh,
+ 'format' => $cgi->param('format'),
+ } )
+ : 'No file';
+
+ if ( $error ) {
+ %>
+ <!-- mason kludge -->
+ <%
+ eidiot($error);
+# $cgi->param('error', $error);
+# print $cgi->redirect( "${p}cust_main-import.cgi
+ } else {
+ %>
+ <!-- mason kludge -->
+ <%= include("/elements/header.html",'Import sucessful') %>
+ <!-- XXX redirect to batch search like the payment entry... -->
+ <%= include("/elements/footer.html",'Import sucessful') %> <%
+ }
+%>