Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezcontact/user/datasupplier.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: datasupplier.php 7816 2001-10-12 12:27:35Z jhe $
5 //
6 // Created on: <23-Oct-2000 17:53:46 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "classes/ezuritool.php" );
28
29 $ini =& eZINI::instance( 'site.ini' );
30 $GlobalSectionID = $ini->variable( "eZContactMain", "DefaultSection" );
31
32 $url_array = eZURITool::split($_SERVER["REQUEST_URI"] );
33 $url_array_count = count( $url_array );
34
35 for( $i = $url_array_count; $i <= 25; $i++ )
36 {
37 $url_array[$i] = false;
38 }
39
40 if ( is_object( $user ) )
41 {
42 $UserID = $user->id();
43 }
44
45 if ( isset( $UserID ) && $UserID > 0 )
46 {
47 $Add_User = false;
48 }
49 else
50 {
51 $Add_User = true;
52 }
53
54 switch ( $url_array[2] )
55 {
56 case "nopermission":
57 {
58 $Type = $url_array[3];
59 switch ( $Type )
60 {
61 case "company":
62 {
63 $Action = $url_array[4];
64 include( "kernel/ezcontact/admin/nopermission.php" );
65 break;
66 }
67 case "category":
68 {
69 $Action = $url_array[4];
70 include( "kernel/ezcontact/admin/nopermission.php" );
71 break;
72 }
73 case "person":
74 {
75 $Action = $url_array[4];
76 include( "kernel/ezcontact/admin/nopermission.php" );
77 break;
78 }
79 case "login":
80 case "consultation":
81 {
82 include( "kernel/ezcontact/admin/nopermission.php" );
83 break;
84 }
85 case "type":
86 {
87 $Action = $url_array[4];
88 include( "kernel/ezcontact/admin/nopermission.php" );
89 break;
90 }
91 default:
92 {
93 // include_once( "classes/ezhttptool.php" );
94 eZHTTPTool::header( "Location: /contact/error?Type=404&Uri=$REQUEST_URI&Query=$QUERY_STRING&BackUrl=$HTTP_REFERER" );
95 break;
96 }
97 }
98 break;
99 }
100
101 case "search":
102 {
103 $SearchType = $url_array[3];
104 switch ( $SearchType )
105 {
106 case "company":
107 {
108 include( "kernel/ezcontact/user/companysearch.php" );
109 break;
110 }
111 case "person":
112 {
113 include( "kernel/ezcontact/user/personsearch.php" );
114 break;
115 }
116 }
117 break;
118 }
119
120 case "person":
121 {
122 $Action = $url_array[3];
123 $PersonID = $url_array[4];
124 switch ( $Action )
125 {
126 // intentional fall through
127 case "new":
128 case "edit":
129 case "update":
130 case "delete":
131 case "insert":
132 {
133 $CompanyEdit = false;
134 if ( isset( $SendMail ) )
135 {
136 include( "kernel/ezcontact/admin/sendmail.php" );
137 }
138 else if ( isset( $MailButton ) )
139 {
140 $ContactArrayID = array( $PersonID );
141 include( "kernel/ezcontact/admin/sendmail.php" );
142 }
143 else
144 {
145 if ( isset( $NewPerson ) )
146 $Action = "new";
147 include( "kernel/ezcontact/admin/personedit.php" );
148 }
149 break;
150 }
151 case "list":
152 {
153 if ( is_numeric( $url_array[4] ) )
154 $Offset = $url_array[4];
155 include( "kernel/ezcontact/admin/personlist.php" );
156 break;
157 }
158 case "search":
159 {
160 if ( is_numeric( $url_array[4] ) )
161 $Offset = $url_array[4];
162 if ( count( $url_array ) >= 5 && !isset( $SearchText ) )
163 {
164 $SearchText = eZURITool::decode( $url_array[5] );
165 }
166 include( "kernel/ezcontact/admin/personlist.php" );
167 break;
168 }
169 case "view":
170 {
171 include( "kernel/ezcontact/admin/personview.php" );
172 break;
173 }
174 case "folder":
175 {
176 $item_id = $url_array[4];
177 include( "kernel/ezcontact/admin/folder.php" );
178 break;
179 }
180 case "buy":
181 {
182 include( "kernel/ezcontact/admin/buy.php" );
183 break;
184 }
185 default:
186 {
187 // include_once( "classes/ezhttptool.php" );
188 eZHTTPTool::header( "Location: /contact/error?Type=404&Uri=$REQUEST_URI&Query=$QUERY_STRING&BackUrl=$HTTP_REFERER" );
189 break;
190 }
191 }
192 break;
193 }
194
195 case "company":
196 {
197 $Action = $url_array[3];
198 $CompanyID = $url_array[4];
199 switch ( $Action )
200 {
201 case "new":
202 case "edit":
203 case "update":
204 case "delete":
205 case "insert":
206 {
207 $CompanyEdit = true;
208 if ( isset( $SendMail ) )
209 {
210 include( "kernel/ezcontact/admin/sendmail.php" );
211 }
212 else if ( isset( $MailButton ) )
213 {
214 $ContactArrayID = array( $CompanyID );
215 include( "kernel/ezcontact/admin/sendmail.php" );
216 }
217 else
218 {
219 if ( isset( $NewCompany ) )
220 {
221 // include_once( "classes/ezhttptool.php" );
222 eZHTTPTool::header( "Location: /contact/company/new/$CompanyID" );
223 exit;
224 }
225 if ( $Action == "new" )
226 if ( isset( $url_array[4] ) and is_numeric( $url_array[4] ) )
227 $NewCompanyCategory = $url_array[4];
228 // else if ( !isset( $CompanyID ) and isset( $url_array[4] ) and is_numeric( $url_array[4] ) )
229 // $CompanyID = $url_array[4];
230 include( "kernel/ezcontact/admin/companyedit.php" );
231 }
232 break;
233 }
234 case "view":
235 {
236 if ( !isset( $CompanyID ) and isset( $url_array[4] ) and is_numeric( $url_array[4] ) )
237 $CompanyID = $url_array[4];
238 $PersonOffset = $url_array[5];
239 // include_once( "ezcontact/classes/ezcompany.php" );
240 eZCompany::addViewHit( $CompanyID );
241 include( "kernel/ezcontact/admin/companyview.php" );
242 break;
243 }
244 case "list":
245 {
246 $TypeID = $url_array[4];
247 $Offset = $url_array[5];
248 $ShowStats = false;
249 include( "kernel/ezcontact/admin/companytypelist.php" );
250 break;
251 }
252 case "folder":
253 {
254 $item_id = $url_array[4];
255 $CompanyEdit = true;
256 include( "kernel/ezcontact/admin/folder.php" );
257 break;
258 }
259 case "buy":
260 {
261 include( "kernel/ezcontact/admin/buy.php" );
262 break;
263 }
264 default:
265 {
266 // include_once( "classes/ezhttptool.php" );
267 eZHTTPTool::header( "Location: /contact/error?Type=404&Uri=$REQUEST_URI&Query=$QUERY_STRING&BackUrl=$HTTP_REFERER" );
268 break;
269 }
270 }
271 break;
272 }
273
274 case "companycategory" :
275 {
276 $TypeID = $url_array[4];
277 $Action = $url_array[3];
278 switch ( $Action )
279 {
280 // intentional fall through
281 case "new":
282 {
283 $NewParentID = $url_array[4];
284 unset( $TypeID );
285 include( "kernel/ezcontact/admin/companytypeedit.php" );
286 break;
287 }
288 case "edit":
289 case "update":
290 case "delete":
291 case "insert":
292 {
293 include( "kernel/ezcontact/admin/companytypeedit.php" );
294 break;
295 }
296 default:
297 {
298 // include_once( "classes/ezhttptool.php" );
299 eZHTTPTool::header( "Location: /contact/error?Type=404&Uri=$REQUEST_URI&Query=$QUERY_STRING&BackUrl=$HTTP_REFERER" );
300 break;
301 }
302 }
303 break;
304 }
305
306 case "consultation":
307 {
308 if ( isset( $url_array[4] ) && ( !isset( $ConsultationID ) or !is_numeric( $ConsultationID ) ) )
309 $ConsultationID = $url_array[4];
310 if ( isset( $new_consultation ) )
311 {
312 // include_once( "classes/ezhttptool.php" );
313 eZHTTPTool::header( "Location: /contact/consultation/new" );
314 exit();
315 }
316 $Action = $url_array[3];
317 switch ( $Action )
318 {
319 // intentional fall through
320 case "new":
321 case "edit":
322 case "update":
323 case "delete":
324 case "insert":
325 {
326 include( "kernel/ezcontact/admin/consultationedit.php" );
327 break;
328 }
329 case "view":
330 {
331 include( "kernel/ezcontact/admin/consultationview.php" );
332 break;
333 }
334 case "list":
335 {
336 include( "kernel/ezcontact/admin/consultationlist.php" );
337 break;
338 }
339 case "company":
340 {
341 $SubAction = $url_array[3];
342 $Action = $url_array[4];
343 if ( !isset( $CompanyID ) or !is_numeric( $CompanyID ) )
344 $CompanyID = $url_array[5];
345 switch ( $Action )
346 {
347 // intentional fall through
348 case "delete":
349 {
350 $ConsultationID = $url_array[5];
351 }
352 case "new":
353 case "edit":
354 case "update":
355 case "insert":
356 {
357 include( "kernel/ezcontact/admin/consultationedit.php" );
358 break;
359 }
360 case "list":
361 {
362 $ConsultationList = true;
363 include( "kernel/ezcontact/admin/consultationlist.php" );
364 break;
365 }
366 case "view":
367 {
368 include( "kernel/ezcontact/admin/consultationview.php" );
369 break;
370 }
371 }
372 break;
373 }
374 case "person":
375 {
376 $SubAction = $url_array[3];
377 $Action = $url_array[4];
378 if ( !isset( $PersonID ) or !is_numeric( $PersonID ) )
379 $PersonID = $url_array[5];
380 switch ( $Action )
381 {
382 // intentional fall through
383 case "delete":
384 {
385 $ConsultationID = $url_array[5];
386 }
387 case "new":
388 case "edit":
389 case "update":
390 case "insert":
391 {
392 include( "kernel/ezcontact/admin/consultationedit.php" );
393 break;
394 }
395 case "list":
396 {
397 $ConsultationList = true;
398 include( "kernel/ezcontact/admin/consultationlist.php" );
399 break;
400 }
401 case "view":
402 {
403 include( "kernel/ezcontact/admin/consultationview.php" );
404 break;
405 }
406 }
407 break;
408 }
409
410 default:
411 {
412 // include_once( "classes/ezhttptool.php" );
413 eZHTTPTool::header( "Location: /contact/error?Type=404&Uri=$REQUEST_URI&Query=$QUERY_STRING&BackUrl=$HTTP_REFERER" );
414 break;
415 }
416 }
417 break;
418 }
419
420 default :
421 print( "<h1>Contact</h1><h2>Thank you for your interest.</h2><p>Sorry, This page isn't for you. Please go back and make another selection. <a href='' onclick='history.back()'>Go back</a></p>" );
422 break;
423 }
424
425 ?>
$i
$i
Definition: admin/adlist.php:91
eZCompany\addViewHit
addViewHit( $company_id=false)
Definition: ezcompany.php:1148
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZURITool\decode
static & decode(&$text)
Definition: ezuritool.php:81
eZURITool\split
static & split(&$uri)
Definition: ezuritool.php:58
$CompanyEdit
$CompanyEdit
Definition: companyedit.php:32
$Action
$Action
Definition: companysearch.php:80
$SearchText
$SearchText
Definition: ezaddress/admin/typelist.php:143
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$url_array
$url_array
Definition: ezcontact/user/datasupplier.php:32
$GlobalSectionID
$GlobalSectionID
Definition: ezcontact/user/datasupplier.php:30
$ini
$ini
Definition: ezcontact/user/datasupplier.php:29
$url_array_count
$url_array_count
Definition: ezcontact/user/datasupplier.php:33
exit
exit
Definition: folder.php:81
$item_id
$item_id
Definition: personedit.php:76
$UserID
$UserID
Definition: todoedit.php:122
$user
$user
Definition: user/adlist.php:39
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.