diff options
| author | lsces <lester@lsces.co.uk> | 2025-08-24 15:35:09 +0100 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2025-08-24 15:35:09 +0100 |
| commit | ce4fa87baac56fe2478cfea56b539cba63887467 (patch) | |
| tree | 6d5f6a74d4d80fcc11b12ce2fa86715e1bff9b88 /load_contacts.php | |
| parent | 69b08377a8a2d3791b21d96720657d93beda2af0 (diff) | |
| download | contact-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-x | load_contacts.php | 39 |
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: ' ) ); |
