[smoothoperator] r4186 committed - Add csv file import possibility

0 views
Skip to first unread message

smootho...@googlecode.com

unread,
Apr 11, 2013, 10:03:52 AM4/11/13
to smootho...@googlegroups.com
Revision: 4186
Author: ma...@venturevoip.com
Date: Thu Apr 11 07:03:35 2013
Log: Add csv file import possibility
http://code.google.com/p/smoothoperator/source/detail?r=4186

Modified:
/SmoothOperatorCRM/receive.php
/SmoothOperatorCRM/view_files.php

=======================================
--- /SmoothOperatorCRM/receive.php Tue Jul 24 16:26:18 2012
+++ /SmoothOperatorCRM/receive.php Thu Apr 11 07:03:35 2013
@@ -29,12 +29,21 @@
$filename = $row['location'];
}
switch ($_GET['format']) {
- case "txt":
+ case "txt":
$start = 0;
if (($handle = fopen($filename, "r")) !== FALSE) {
while (($line = fgetcsv($handle)) !== FALSE) {
$arr[] = $line;
}
+ fclose($handle);
+ }
+ break;
+ case "csv":
+ $start = 0;
+ if (($handle = fopen($filename, "r")) !== FALSE) {
+ while (($line = fgetcsv($handle)) !== FALSE) {
+ $arr[] = $line;
+ }
fclose($handle);
}
break;
@@ -231,6 +240,16 @@
while (($line = fgetcsv($handle)) !== FALSE) {
$arr[] = $line;
}
+ fclose($handle);
+ }
+ break;
+ case "csv":
+ $start = 0;
+ $extra = 1;
+ if (($handle = fopen($filename, "r")) !== FALSE) {
+ while (($line = fgetcsv($handle)) !== FALSE) {
+ $arr[] = $line;
+ }
fclose($handle);
}
break;
=======================================
--- /SmoothOperatorCRM/view_files.php Tue Jul 24 16:21:25 2012
+++ /SmoothOperatorCRM/view_files.php Thu Apr 11 07:03:35 2013
@@ -47,9 +47,14 @@
?>
<a
href="receive.php?import_list=<?=$row['id']?>&type=txt">Import List From
File</a>
<?
+ break;
+ case "csv":
+ ?>
+ <a
href="receive.php?import_list=<?=$row['id']?>&type=csv">Import List From
File</a>
+ <?
break;
default:
- echo "".$extension." (xls or txt required for import)";
+ echo "".$extension." (xls, csv or txt required for
import)";
break;
}
echo ''."</td><td>";
Reply all
Reply to author
Forward
0 new messages