- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / include / inc_products_search_result_mod.php
blob5fc58732a52af002569d7cdb8e1c9bb7d60d30fb
1 <?php
2 /*------begin------ This protection code was suggested by Luki R. luki@karet.org ---- */
3 if (eregi("inc_products_search_result_mod.php",$PHP_SELF))
4 die('<meta http-equiv="refresh" content="0; url=../">');
5 /*------end------*/
7 # If smarty object is not available create one
8 if(!isset($smarty)){
9 /**
10 * LOAD Smarty
11 * param 2 = FALSE = dont initialize
12 * param 3 = FALSE = show no copyright
13 * param 4 = FALSE = load no javascript code
15 include_once($root_path.'gui/smarty_template/smarty_care.class.php');
16 $smarty = new smarty_care('common',FALSE,FALSE,FALSE);
18 # Set a flag to display this page as standalone
19 $bShowThisForm=TRUE;
22 if($bcat) $LDMSRCindex['']=""; // if parent is order catalog add one empty column at the end
23 if($update||($mode=="search")){
25 switch($cat)
27 case "pharma":
28 $imgpath=$root_path."pharma/img/";
29 break;
30 case "medlager":
31 $imgpath=$root_path."med_depot/img/";
32 break;
36 if($saveok||(!$update)) $statik=true;
38 if($linecount)
40 # Assign form elements
41 $smarty->assign('LDOrderNr',$LDOrderNr);
42 $smarty->assign('LDArticleName',$LDArticleName);
43 $smarty->assign('LDGeneric',$LDGeneric);
44 $smarty->assign('LDDescription',$LDDescription);
45 $smarty->assign('LDPacking',$LDPacking);
46 $smarty->assign('LDCAVE',$LDCAVE);
47 $smarty->assign('LDCategory',$LDCategory);
48 $smarty->assign('LDMinOrder',$LDMinOrder);
49 $smarty->assign('LDMaxOrder',$LDMaxOrder);
50 $smarty->assign('LDPcsProOrder',$LDPcsProOrder);
51 $smarty->assign('LDIndustrialNr',$LDIndustrialNr);
52 $smarty->assign('LDLicenseNr',$LDLicenseNr);
53 $smarty->assign('LDPicFile',$LDPicFile);
55 //echo $linecount;
56 if($linecount==1)
58 $zeile=$ergebnis->FetchRow();
60 # Assign the preview picture
62 if(($statik||$update)&&($zeile['picfile']!="")){
63 $smarty->assign('LDPreview',$LDPreview);
64 $sTemp = '<img src="'.$imgpath.$zeile['picfile'].'" border=0 name="prevpic" ';
65 if(!$update||$statik)
67 if(file_exists($imgpath.$zeile['picfile']))
69 $imgsize=GetImageSize($imgpath.$zeile['picfile']);
70 $sTemp =$sTemp.$imgsize[3];
73 $smarty->assign('sProductImage',$sTemp.'>');
74 }else{
75 $smarty->assign('sProductImage','<img src="../../gui/img/common/default/pixel.gif" border=0 name="prevpic">');
78 # Assign form inputs (or values)
80 if ($statik||$update) $smarty->assign('sOrderNrInput',$zeile['bestellnum'].'</b><input type="hidden" name="bestellnum" value="'.$zeile['bestellnum'].'">');
81 else $smarty->assign('sOrderNrInput','<input type="text" name="bestellnum" value="'.$zeile['bestellnum'].'" size=20 maxlength=20>');
84 if ($statik){
85 $smarty->assign('sArticleNameInput',$zeile['artikelname'].'<input type="hidden" name="artname" value="'.$zeile['artikelname'].'">');
86 $smarty->assign('sGenericInput',$zeile['generic'].'<input type="hidden" name="generic" value="'.$zeile['generic'].'">');
87 $smarty->assign('sDescriptionInput',nl2br($zeile['description']).'<input type="hidden" name="besc" value="'.$zeile['description'].'">');
88 $smarty->assign('sPackingInput',$zeile['packing'].'<input type="hidden" name="pack" value="'.$zeile['packing'].'">');
89 $smarty->assign('sCAVEInput',$zeile['cave'].'<input type="hidden" name="caveflag" value="'.$zeile['cave'].'">');
90 $smarty->assign('sCategoryInput',$zeile['medgroup'].'<input type="hidden" name="medgroup" value="'.$zeile['medgroup'].'">');
91 $smarty->assign('sMinOrderInput',$zeile['minorder'].'<input type="hidden" name="minorder" value="'.$zeile['minorder'].'">');
92 $smarty->assign('sMaxOrderInput',$zeile['maxorder'].'<input type="hidden" name="maxorder" value="'.$zeile['maxorder'].'">');
93 $smarty->assign('sPcsProOrderInput',$zeile['proorder'].'<input type="hidden" name="proorder" value="'.$zeile['proorder'].'">');
94 $smarty->assign('sIndustrialNrInput',$zeile['artikelnum'].'<input type="hidden" name="artnum" value="'.$zeile['artikelnum'].'">');
95 $smarty->assign('sLicenseNrInput',$zeile['industrynum'].'<input type="hidden" name="indusnum" value="'.$zeile['industrynum'].'">');
96 $smarty->assign('sPicFileInput',$zeile['picfile'].'<input type="hidden" name="bild" value="'.$zeile['picfile'].'">');
97 }else{
98 $smarty->assign('sArticleNameInput','<input type="text" name="artname" value="'.$zeile['artikelname'].'" size=40 maxlength=40>');
99 $smarty->assign('sGenericInput','<input type="text" name="generic" value="'.$zeile['generic'].'" size=40 maxlength=60>');
100 $smarty->assign('sDescriptionInput','<textarea name="besc" cols=35 rows=4>'.$zeile['description'].'</textarea>');
101 $smarty->assign('sPackingInput','<input type="text" name="pack" value="'.$zeile['packing'].'" size=40 maxlength=40>');
102 $smarty->assign('sCAVEInput','<input type="text" name="caveflag" value="'.$zeile['cave'].'" size=40 maxlength=80>');
103 $smarty->assign('sCategoryInput','<input type="text" name="medgroup" value="'.$zeile['medgroup'].'" size=20 maxlength=40>');
104 $smarty->assign('sMinOrderInput','<input type="text" name="minorder" value="'.$zeile['minorder'].'" size=20 maxlength=9>');
105 $smarty->assign('sMaxOrderInput','<input type="text" name="maxorder" value="'.$zeile['maxorder'].'" size=20 maxlength=9>');
106 $smarty->assign('sPcsProOrderInput','<input type="text" name="proorder" value="'.$zeile['proorder'].'" size=20 maxlength=40>');
107 $smarty->assign('sIndustrialNrInput','<input type="text" name="artnum" value="'.$zeile['industrynum'].'" size=20 maxlength=20>');
108 $smarty->assign('sLicenseNrInput','<input type="text" name="indusnum" value="'.$zeile['artikelname'].'" size=20 maxlength=20>');
109 $smarty->assign('sPicFileInput','<input type="file" name="bild" onChange="getfilepath(this)">');
112 echo '
113 <table border=0 cellspacing=2 cellpadding=3 >
114 <tr >
115 <td align=right width=140 bgcolor="#ffffdd"><FONT face="Verdana,Helvetica,Arial" size=2 color="#000080">'.$LDOrderNr.'</td>
117 if($statik||$update)
118 echo '
119 <td width=320 bgcolor="#ffffdd"><FONT face="Verdana,Helvetica,Arial" size=3><b>'.$zeile['bestellnum'].'</b><input type="hidden" name="bestellnum" value="'.$zeile['bestellnum'].'">
120 </td>';
121 else echo '
122 <td width=320 bgcolor="#ffffdd"><input type="text" name="bestellnum" value="'.$zeile['bestellnum'].'" size=20 maxlength=20>
123 </td>';
125 echo '
126 <td rowspan=13 valign=top >';
127 if($zeile['picfile']!="")
129 echo'
130 <FONT face="Verdana,Helvetica,Arial" size=2 color="#800000">'.$LDPreview.':<br>
131 <img src="'.$imgpath.$zeile['picfile'].'" border=0 name="prevpic" ';
132 if(!$update||$statik)
134 if(file_exists($imgpath.$zeile['picfile']))
136 $imgsize=GetImageSize($imgpath.$zeile['picfile']);
137 echo $imgsize['3'];
140 echo ' >';
142 else echo '<img src="'.$root_path.'gui/img/common/default/pixel.gif" border=0 name="prevpic" >';
143 echo '</td>';
144 echo '
145 </tr>
146 <tr bgcolor="#ffffdd">
147 <td align=right><FONT face="Verdana,Helvetica,Arial" size=2 color="#000080">'.$LDArticleName.'</td>
149 if($statik)
150 echo '
151 <td><FONT face="Verdana,Helvetica,Arial" size=2 color="#800000"><b>'.$zeile['artikelname'].'</b><input type="hidden" name="artname" value="'.$zeile['artikelname'].'">
152 </td>';
153 else echo '
154 <td width=320 bgcolor="#ffffdd"><input type="text" name="artname" value="'.$zeile['artikelname'].'" size=20 maxlength=40>
155 </td>';
156 echo '
157 </tr>
158 <tr bgcolor="#ffffdd">
159 <td align=right><FONT face="Verdana,Helvetica,Arial" size=2 color="#000080">'.$LDGeneric.'</td>
161 if($statik)
162 echo '
163 <td><FONT face="Verdana,Helvetica,Arial" size=2>'.$zeile['generic'].'<input type="hidden" name="generic" value="'.$zeile['generic'].'">
164 </td>';
165 else echo '
166 <td width=320 bgcolor="#ffffdd"><input type="text" name="generic" value="'.$zeile['generic'].'" size=40 maxlength=60>
167 </td>';
168 echo '
169 </tr>
170 <tr bgcolor="#ffffdd">
171 <td align=right><FONT face="Verdana,Helvetica,Arial" size=2 color="#000080">'.$LDDescription.'</td>
173 if($statik)
174 echo '
175 <td><FONT face="Verdana,Helvetica,Arial" size=2>'.nl2br($zeile['description']).'<input type="hidden" name="besc" value="'.$zeile['desription'].'">
176 </td>
177 </td>';
178 else echo '
179 <td width=320 bgcolor="#ffffdd"><textarea name="besc" cols=35 rows=4>'.$zeile['description'].'</textarea>
180 </td>';
181 echo '
182 </tr>
183 <tr bgcolor="#ffffdd">
184 <td align=right><FONT face="Verdana,Helvetica,Arial" size=2 color="#000080">'.$LDPacking.'</td>
186 if($statik)
187 echo '
188 <td><FONT face="Verdana,Helvetica,Arial" size=2>'.$zeile['packing'].'<input type="hidden" name="pack" value="'.$zeile['packing'].'">
189 </td>';
190 else echo '
191 <td width=320 bgcolor="#ffffdd"><input type="text" name="pack" value="'.$zeile['packing'].'" size=40 maxlength=40>
192 </td>';
193 echo '
194 </tr>
195 <tr bgcolor="#ffffdd">
196 <td align=right><FONT face="Verdana,Helvetica,Arial" size=2 color="#000080">'.$LDCAVE.'</td>
198 if($statik)
199 echo '
200 <td><FONT face="Verdana,Helvetica,Arial" size=2>'.$zeile['cave'].'<input type="hidden" name="caveflag" value="'.$zeile['cave'].'">
201 </td>';
202 else echo '
203 <td width=320 bgcolor="#ffffdd"><input type="text" name="caveflag" value="'.$zeile['cave'].'" size=40 maxlength=80>
204 </td>';
205 echo '
206 </tr>
207 <tr bgcolor="#ffffdd">
208 <td align=right><FONT face="Verdana,Helvetica,Arial" size=2 color="#000080">'.$LDCategory.'</td>
210 if($statik)
211 echo '
212 <td><FONT face="Verdana,Helvetica,Arial" size=2>'.$zeile['medgroup'].'<input type="hidden" name="medgroup" value="'.$zeile['medgroup'].'">
213 </td>';
214 else echo '
215 <td width=320 bgcolor="#ffffdd"><input type="text" name="medgroup" value="'.$zeile['medgroup'].'" size=20 maxlength=40>
216 </td>';
217 echo '
218 </tr>
219 <tr bgcolor="#ffffdd">
220 <td align=right><FONT face="Verdana,Helvetica,Arial" size=2 color="#000080">'.$LDMinOrder.'</td>
222 if($statik)
223 echo '
224 <td><FONT face="Verdana,Helvetica,Arial" size=2>'.$zeile['minorder'].'<input type="hidden" name="minorder" value="'.$zeile['minorder'].'">
225 </td>';
226 else echo '
227 <td width=320 bgcolor="#ffffdd"><input type="text" name="minorder" value="'.$zeile['minorder'].'" size=20 maxlength=9>
228 </td>';
229 echo '
230 </tr>
231 <tr bgcolor="#ffffdd">
232 <td align=right><FONT face="Verdana,Helvetica,Arial" size=2 color="#000080">'.$LDMaxOrder.'</td>
234 if($statik)
235 echo '
236 <td><FONT face="Verdana,Helvetica,Arial" size=2>'.$zeile['maxorder'].'<input type="hidden" name="maxorder" value="'.$zeile['maxorder'].'">
237 </td>';
238 else echo '
239 <td width=320 bgcolor="#ffffdd"><input type="text" name="maxorder" value="'.$zeile['maxorder'].'" size=20 maxlength=9>
240 </td>';
241 echo '
242 </tr>
243 <tr bgcolor="#ffffdd">
244 <td align=right><FONT face="Verdana,Helvetica,Arial" size=2 color="#000080">'.$LDPcsProOrder.'</td>
246 if($statik)
247 echo '
248 <td><FONT face="Verdana,Helvetica,Arial" size=2>'.$zeile['proorder'].'<input type="hidden" name="proorder" value="'.$zeile['proorder'].'"></td>
249 </td>';
250 else echo '
251 <td width=320 bgcolor="#ffffdd"><input type="text" name="proorder" value="'.$zeile['proorder'].'" size=20 maxlength=40>
252 </td>';
253 echo '
254 </tr>
255 <tr bgcolor="#ffffdd">
256 <td align=right><FONT face="Verdana,Helvetica,Arial" size=2 color="#000080">'.$LDIndustrialNr.'</td>
258 if($statik)
259 echo '
260 <td><FONT face="Verdana,Helvetica,Arial" size=2>'.$zeile['artikelnum'].'<input type="hidden" name="artnum" value="'.$zeile['artikelnum'].'">
261 </td>';
262 else echo '
263 <td width=320 bgcolor="#ffffdd"><input type="text" name="artnum" value="'.$zeile['artikelnum'].'" size=20 maxlength=20>
264 </td>';
265 echo '
266 </tr>
267 <tr bgcolor="#ffffdd">
268 <td align=right><FONT face="Verdana,Helvetica,Arial" size=2 color="#000080">'.$LDLicenseNr.'</td>
270 if($statik)
271 echo '
272 <td><FONT face="Verdana,Helvetica,Arial" size=2>'.$zeile['industrynum'].'<input type="hidden" name="indusnum" value="'.$zeile['industrynum'].'">
273 </td>';
274 else echo '
275 <td width=320 bgcolor="#ffffdd"><input type="text" name="indusnum" value="'.$zeile['industrynum'].'" size=20 maxlength=20>
276 </td>';
277 echo '
278 </tr>
280 <tr bgcolor="#ffffdd">
281 <td align=right><FONT face="Verdana,Helvetica,Arial" size=2 color="#000080">'.$LDPicFile.'</td>
283 if($statik)
284 echo '
285 <td><FONT face="Verdana,Helvetica,Arial" size=2>'.$zeile['picfile'].'<input type="hidden" name="bild" value="'.$zeile['picfile'].'"></td>
286 </td>';
287 else echo '
288 <td width=320 bgcolor="#ffffdd"><input type="file" name="bild" onChange="getfilepath(this)">
289 </td>';
290 echo '
291 </tr>
292 </table>
296 # If display is forced
297 if($bShowThisForm) $smarty->display('products/form.tpl');
299 }else{
300 echo "<p>".str_replace("~nr~",$linecount,$LDFoundNrData)."<br>$LDClk2SeeInfo<p>";
302 echo "<table border=0 cellpadding=3 cellspacing=1> ";
304 echo '<tr class="wardlisttitlerow">';
306 for($i=0;$i<sizeof($LDMSRCindex)-1;$i++)
308 echo '<td>'.$LDMSRCindex[$i].'</td>';
310 echo "</tr>";
312 /* Load common icons */
313 $img_info=createComIcon($root_path,'info3.gif','0');
314 $img_arrow=createComIcon($root_path,'dwnarrowgrnlrg.gif','0');
316 while($zeile=$ergebnis->FetchRow())
318 echo "<tr class=";
319 if($toggle) { echo "wardlistrow2>"; $toggle=0;} else {echo "wardlistrow1>"; $toggle=1;};
320 echo '
321 <td valign="top"><a href="'.$thisfile.URL_APPEND.'&dept_nr='.$dept_nr.'&keyword='.$zeile['bestellnum'].'&mode=search&from=multiple&cat='.$cat.'&userck='.$userck.'"><img '.$img_info.' alt="'.$LDOpenInfo.$zeile['artikelname'].'"></a></td>
322 <td valign="top"><font size=1>'.$zeile['bestellnum'].'</td>
323 <td valign="top"><font size=1>'.$zeile['artikelnum'].'</td>
324 <td valign="top"><font size=1>'.$zeile['industrynum'].'</td>
325 <td valign="top"><a href="'.$thisfile.URL_APPEND.'&dept_nr='.$dept_nr.'&keyword='.$zeile['bestellnum'].'&mode=search&from=multiple&cat='.$cat.'&userck='.$userck.'"><font size=2 color="#800000"><b>'.$zeile['artikelname'].'</b></font></a></td>
326 <td valign="top"><font size=1>'.$zeile['generic'].'</td>
327 <td valign="top"><font size=1>'.$zeile['description'].'</td>
329 // if parent is order catalog add this option column at the end
330 if($bcat) echo'
331 <td valign="top"><a href="'.$thisfile.URL_APPEND.'&dept_nr='.$dept_nr.'&mode=save&artikelname='.str_replace("&","%26",strtr($zeile['artikelname']," ","+")).'&bestellnum='.$zeile['bestellnum'].'&proorder='.str_replace(" ","+",$zeile['proorder']).'&hit=0&cat='.$cat.'&userck='.$userck.'"><img '.$img_arrow.' alt="'.$LDPut2Catalog.'"></a></td>';
332 echo '
333 </tr>';
335 echo "</table>";
336 if($linecount>15)
338 echo '
339 <a href="#pagetop">'.$LDPageTop.'</a>';
340 }//end of if $linecount>15
342 }//end of else
343 }else{
344 echo '
345 <p><img '.createMascot($root_path,'mascot1_r.gif','0','middle').'>
346 '.$LDNoDataFound;