-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.php
75 lines (61 loc) · 1.99 KB
/
build.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
<?php
/** Error reporting */
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
ini_set("memory_limit","512M");
date_default_timezone_set('America/Montreal');
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
require_once './vendor/PHPExcel/PHPExcel.php';
require_once 'libs/import.php';
$excels = array(
'INVIVA' => array('sheet' => 0,
'max' => 80),
'Coverdale' => array('sheet' => 1,
'max' => 69),
'Elizabeth' => array('sheet' => 2,
'max' => 46),
);
/**
* Import It
*/
$import = new Import();
$import->setExcelName("MasterClinicList.xlsx");
$import->setSheet(0);
$import->setMax(80);
$import->init();
$structure = new stdClass();
$structure->provinces = new stdClass();
$structure->provinces->id = "E";
$structure->provinces->cities = new stdClass();
$structure->provinces->cities->id = "D";
$structure->provinces->cities->label = "D";
$structure->provinces->cities->locations = new stdClass();
$structure->provinces->cities->locations->label = "A";
$structure->provinces->cities->locations->street = "B";
$structure->provinces->cities->locations->app = "C";
$structure->provinces->cities->locations->city = "F";
$import->parseVerticalExcel($structure, 4);
$import->setSheet(1);
$import->setMax(69);
$import->init();
$structure = new stdClass();
$structure->provinces = new stdClass();
$structure->provinces->id = "F";
$structure->provinces->cities = new stdClass();
$structure->provinces->cities->id = "E";
$structure->provinces->cities->label = "E";
$structure->provinces->cities->locations = new stdClass();
$structure->provinces->cities->locations->label = "A";
$structure->provinces->cities->locations->street = "C";
$structure->provinces->cities->locations->app = "D";
$structure->provinces->cities->locations->city = "H";
$import->parseVerticalExcel($structure, 4);
//$import->setSheet(2);
//$import->setMax(14);
//$import->init();
// 16 - 25
// 27 - 36
// 38 - 46
$import->setJsonName("clinic.json");
$import->exportJson();