summaryrefslogtreecommitdiff
path: root/load_contacts.php
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2025-08-24 15:35:09 +0100
committerlsces <lester@lsces.co.uk>2025-08-24 15:35:09 +0100
commitce4fa87baac56fe2478cfea56b539cba63887467 (patch)
tree6d5f6a74d4d80fcc11b12ce2fa86715e1bff9b88 /load_contacts.php
parent69b08377a8a2d3791b21d96720657d93beda2af0 (diff)
downloadcontact-ce4fa87baac56fe2478cfea56b539cba63887467.tar.gz
contact-ce4fa87baac56fe2478cfea56b539cba63887467.tar.bz2
contact-ce4fa87baac56fe2478cfea56b539cba63887467.zip
Just a crude merging of the PHP7 code base with the PHP8.4 version
Diffstat (limited to 'load_contacts.php')
-rwxr-xr-xload_contacts.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/load_contacts.php b/load_contacts.php
new file mode 100755
index 0000000..610ace5
--- /dev/null
+++ b/load_contacts.php
@@ -0,0 +1,39 @@
+<?php
+/*
+ * Created on 5 Jan 2008
+ *
+ * To change the template for this generated file go to
+ * Window - Preferences - PHPeclipse - PHP - Code Templates
+ */
+
+// Initialization
+require_once '../kernel/includes/setup_inc.php';
+use Bitweaver\Contact\Contact;
+use Bitweaver\KernelTools;
+
+// Is package installed and enabled
+$gBitSystem->verifyPackage( 'contact' );
+
+// Now check permissions to access this page
+$gBitSystem->verifyPermission('p_contact_admin' );
+
+$contact = new Contact();
+
+// $contact->DataExpunge();
+
+$row = 0;
+
+$handle = fopen("data/cotswold_guard_cust.csv", "r");
+if ( $handle == FALSE) {
+ $row = -999;
+} else {
+ while (($data = fgetcsv($handle, 800, ",")) !== FALSE) {
+ if ( $data ) { $contact->ContactRecordLoad( $data );
+ $row++; }
+ }
+ fclose($handle);
+}
+
+$gBitSmarty->assign( 'count', $row );
+
+$gBitSystem->display( 'bitpackage:contact/load_contacts.tpl', KernelTools::tra( 'Load results: ' ) );