Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Read the spreadsheet via a relative path to the document
- $this->php_excel_reader->read($raw_file_path);
- $this->php_excel_reader->setOutputEncoding('CP1251');
- // Get the contents of the second worksheet
- $sheets = $this->php_excel_reader->sheets;
- if (!is_array($sheets))
- {
- log_message('error', 'Rawdata/import: Spreadsheet does not contain two sheet');
- return false;
- }
- $member_data = $sheets[0]['cells']; // this is member data only
- $communication_data = $sheets[1]['cells']; // all the communication data for all the members
- // Get the headings
- $member_data_headings = $member_data[1];
- $communication_data_headings = $communication_data[1];
- // remove headings from the data
- // as we are not looking to insert them
- unset( $member_data[1] );
- unset( $communication_data[1] );
- // make headings lower case
- if (!is_array($member_data_headings) || !is_array($communication_data_headings)) return false;
- array_walk($member_data_headings, create_function('&$item, $key', '$item = strtolower($item); '));
- array_walk($communication_data_headings, create_function('&$item, $key', '$item = strtolower($item); '));
- // Create check array
- $member_check_array = array('REGISTRATION_ID','MEMBER_ID','Contract_Start_Date','Renewal_Date','Title','GIVEN_NAME',
- 'FAMILY_NAME','Birth_Date','email','Address','Members');
- $communication_check_array = array('MEMBER_ID','CELLREF');
Add Comment
Please, Sign In to add comment