-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcsv_import.php
executable file
·112 lines (74 loc) · 2.37 KB
/
csv_import.php
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
<?php
require('class/config.inc.php');
require 'class/class.contacts.php';
$page = new basic_page();
$page->auth->Checklogin();
$notify= new Notification();
$contact=new Company_Global();
$contact->SetGroups($page->auth->Get_group());
$contact->SetUserID($page->auth->Get_user_id());
$contact->SetUserName($page->auth->Get_user_name());
$page -> setPageKeywords('');
$page -> setPageDescription('');
$page -> setPageTitle("CSV IMPORT");
$page -> setActiveButton('2');
//$page -> setInnerNav('');
//$page -> setImportCss1('main_style.css');
//$page -> setImportCss2('form.css');
$page -> SetDynamicCSS_1('main_style.php');
$page -> SetDynamicCSS_2('form.php');
$page -> setImportCss3('');
$page -> setImportCss4('');
$page -> setImportCss5('');
//$page -> setExtJavaScripts($external_js); // might not need
//*********************Page Style *******************************//
// used to set page styles. This should be used sparingly. External css should be used instead.
$page_style = '
';
$page -> setCustomJavaScripts('
function validateExtension(Form_Name,Upload_File) {
var filename = document.forms[Form_Name].elements[Upload_File].value;
if(filename.lastIndexOf(".csv") == "-1"){
alert("Please upload any CSV file.");
return false;
}
else{
return true;
}
}
');
$page -> setPageStyle($page_style);
$page -> displayPageTop();
$notify->Notify();
?>
<div id="content_column_header">
Import Contacts from outlook
</div>
<div >
<?php
if(isset($_POST['submit'])) {
$contact->ImportContacts('server');
}
else {
$contact->ImportContacts('local');
}
if(isset($_POST['s1']))
{
$contact->ImportContacts('csvupld');
}
?>
</div>
<?php
// **********************Closes the Content Column and begins Info Column ****************************//
$page-> printContentColumnEnd();
// **********************Start code for Info Column ****************************//
?>
<div class="form_main">
<div><a href="contact_addperson.php"><img src="images/add_person.jpg" border="0" /></a></div>
<div><a href="contact_addcompany.php"><img src="images/add_company.jpg" /></a></div>
<div><a href="csv_export.php"><img src="images/export_outlook.png" /></a></div>
<div class="form_main"> <?php echo $contact->GetALLTagsAtoZ();?> </div>
</div>
<?php
$page -> displayPageBottom();
?>