This repository was archived by the owner on Apr 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimportcategory.php
More file actions
executable file
·310 lines (308 loc) · 6.07 KB
/
importcategory.php
File metadata and controls
executable file
·310 lines (308 loc) · 6.07 KB
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
<?php
require "config.php";
$content = "-ds:Designers
--Garden Style
---Asian
---Coastal
---Contemporary
---Cottage
---Eclectic
---Formal
---Mediterranean
---Modern
---Rock Gardens
---Traditional
---Tropical
--Location
---Australia
---Europe
----France
----Holland
----Italy
---North America
----Canada
----USA
-----Arizona
-----California
-----Connecticut
-----Delaware
-----Florida
-----Georgia
-----Illinois
-----Maryland
-----Massachusetts
-----Missouri
-----Nevada
-----New Jersey
-----New York
-----Pennsylvania
-----Texas
-----Utah
-----Virginia
-----Washington
--Professionals
---AHBL Landscape Architecture
---Andrew Grossman
---Andrew Renn Design
---Bradanini & Associates
---C.O.S. Design
---Carl Balton & Associates
---Carson Poetzl
---Carter Rohrer Co.
---Chip N Dale's Custom Landscaping
---Debora Carl Landscape Design
---Denise Dering Design
---Designing Eden
---Dig Your Garden
---Elliott Brundage Landscape Design
---Envision Landscape studio
---Fernhill Landscapes
---Gardens by Gabriel
---Genevieve Schmidt Design
---Goodman Landscape Design
---Habitat Design
---Integration Design Studio
---Isler Homes
---Jacqueline van der Kloet
---Jean Marsh Design Inc
---Joel Loblaw
---JSL Exteriors Landscape Design/Build
---Katie Moss Landscape Design
---Lankford Associates Landscape Architects
---Liquidscapes
---Louis Benech
---MB Design & Build
---Pat Brodie Landscape Design
---Paul Moon Design
---Pedersen Associates
---Prideaux Design
---RDM Architecture
---Schmechtig Landscapes
---Shades Of Green Landscape Architecture
---Slater Associates
---Studio H Landscape Architecture
---Suzman Design Associates
---Taylor Lombardo Architects
---The Labyrinth Company
---Thomas Kyle Landscape Design
---Van De Voorde Elemental Design Group
---Verdance Fine Garden Design
---WA Design
---Wendy Resin
---Westover Landscape Design
-gi:Garden Ideas
--Design Ideas
---Accessories
---Arbors, Pergolas, Trellises
---Fire pits
---Front Yards
---Gates
---Pathways
---Patios
---Pools
---Small Gardens
---Stairs
---Walls
--My Garden Style
---Asian Style
---Coastal Style
---Contemporary Style
---Cottage Style
---Eclectic Style
---Formal Style
---Mediterranean Style
---Modern Style
---Rock Garden Style
---Traditional Style
---Tropical Style
--Plantings Ideas
---All Planting Types
----Bed & Border Ideas
----Climbing Garden Ideas
----Ground Cover Ideas
----Hedge Ideas
----Meadow & Lawn Ideas
----Pot & Container Ideas
---Bloom / Season of Interest
----Fall Season
----Spring Season
-----Early Spring Season
-----Late Spring Season
-----Mid Spring Season
----Summer Season
-----Early Summer Season
-----Late Summer Season
-----Mid Summer Season
----Winter Season
---Hardiness
----Zone 1
----Zone 10
----Zone 11
----Zone 12
----Zone 2
----Zone 3
----Zone 4
----Zone 5
----Zone 6
----Zone 7
----Zone 8
----Zone 9
---Light / Sun Requirements
----Full Sun Needs
----Partial Sun Needs
----Shade Needs
---Maintenance / Care
----Average Maintenance / Care
----High Maintenance / Care
----Low Maintenance / Care
---Moisture / Water Needs
----Average Water Needs
----High Water Needs
----Low Water Needs
---Plant Color
----Apricot Color
----Blue Color
----Brown Color
----Cream Color
----Gray Color
----Green Color
----Lavender Color
----Mixed Color
----Orange Color
----Pink Color
----Purple Color
----Red Color
----White Color
----Yellow Color
---Plant Type
----Annual Plant
----Bulb Plant
-----Crocus Plant
-----Daffodil Plant
-----Tulip Plant
----Ground Cover Plant
----Ornamental Grass
----Perennial Plant
----Rose
----Shrub
----Succulent
----Vine
-pl:Plants
--1. Hardiness Zone
---Hardiness Zone 1
---Hardiness Zone 10
---Hardiness Zone 11
---Hardiness Zone 12
---Hardiness Zone 2
---Hardiness Zone 3
---Hardiness Zone 4
---Hardiness Zone 5
---Hardiness Zone 6
---Hardiness Zone 7
---Hardiness Zone 8
---Hardiness Zone 9
--2. Period of Interest
---Fall
---Spring
----Early Spring
----Late Spring
----Mid Spring
---Summer
----Early Summer
----Late Summer
----Mid Summer
---Winter
--3. Sun Needs
---Full Sun
---Partial Sun
---Shade
--4. Usage
---Beds & Borders
---Containers
---Cut Flowers
---Ground Covers
---Hanging Baskets
---Hedges
---Rock Garden
---Wall
--5. Maintenance
---Average Maintenance
---High Maintenance
---Low Maintenance
--6. Watering Needs
---Average Water Need
---High Water Need
---Low Water Need
--7. Plant Type
---Annuals
---Bulbs
----Crocus
----Daffodils
----Dahlias
----Tulips
---Herbs
---Ornamental Grasses
---Perennials
---Roses
---Shrubs
---Trees
--8. Color
---Apricot
---Beige
---Blue
---Brown
---Cream
---Lavender
---Mixed Colors
---Orange
---Pink
---Purple
---Red
---White
---Yellow
-pr:Promenades";
$items = explode("\n",$content);
$parents = array();
$type = "";
foreach ($items as $i)
{
preg_match('/-+/is',$i,$match);
switch($match[0])
{
case "-":
$line = trim(str_replace('-','',$i));
$temp = explode(':',$line);
$type = $temp[0];
continue;
break;
case "--":
$parent_id = 0;
$cname = mysql_real_escape_string(trim(str_replace('-','',$i)));
$last_node = "--";
mysql_query("INSERT INTO product_category SET category_name='$cname', category_type='{$type}', parent_id='{$parent_id}' ") or die (mysql_error());
$parents["--"] = mysql_insert_id();
break;
case "---":
$parent_id = $parents["--"];
$cname = mysql_real_escape_string(trim(str_replace('-','',$i)));
$last_node = "---";
mysql_query("INSERT INTO product_category SET category_name='$cname', category_type='{$type}', parent_id='{$parent_id}' ") or die (mysql_error());
$parents["---"] = mysql_insert_id();
break;
case "----":
$parent_id = $parents["---"];
$cname = mysql_real_escape_string(trim(str_replace('-','',$i)));
$last_node = "----";
mysql_query("INSERT INTO product_category SET category_name='$cname', category_type='{$type}', parent_id='{$parent_id}' ") or die (mysql_error());
$parents["----"] = mysql_insert_id();
break;
case "-----":
$parent_id = $parents["----"];
$cname = mysql_real_escape_string(trim(str_replace('-','',$i)));
$last_node = "-----";
mysql_query("INSERT INTO product_category SET category_name='$cname', category_type='{$type}', parent_id='{$parent_id}' ") or die (mysql_error());
$parents["-----"] = mysql_insert_id();
break;
}
}
?>