Changeset 88
- Timestamp:
- 10/23/06 13:15:18 (2 years ago)
- Files:
-
- trunk/com_mls_catering/admin.mls_catering.html.php (modified) (36 diffs)
- trunk/com_mls_catering/admin.mls_catering.php (modified) (28 diffs)
- trunk/com_mls_catering/images (deleted)
- trunk/com_mls_catering/install.mls_catering.php (modified) (1 diff)
- trunk/com_mls_catering/install/comupgrade.xml (modified) (4 diffs)
- trunk/com_mls_catering/lang/dutch.php (deleted)
- trunk/com_mls_catering/lang/english.php (modified) (5 diffs)
- trunk/com_mls_catering/lang/german.php (modified) (4 diffs)
- trunk/com_mls_catering/lang/portuguese.php (deleted)
- trunk/com_mls_catering/mls_catering.class.php (modified) (7 diffs)
- trunk/com_mls_catering/mls_catering.config.php (modified) (1 diff)
- trunk/com_mls_catering/mls_catering.html.php (modified) (8 diffs)
- trunk/com_mls_catering/mls_catering.js (added)
- trunk/com_mls_catering/mls_catering.php (modified) (5 diffs)
- trunk/com_mls_catering/mls_catering.xml (modified) (3 diffs)
- trunk/com_mls_catering/toolbar.mls_catering.html.php (modified) (2 diffs)
- trunk/com_mls_catering/toolbar.mls_catering.php (modified) (1 diff)
- trunk/com_mls_catering/version (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/com_mls_catering/admin.mls_catering.html.php
r26 r88 14 14 <tr> 15 15 <td align="center" style="background-color: #F5F5F5; border: 1px solid #D5D5D5"> 16 <a href="http://www.mylansite.org/" target="_top">myLANsite Catering Component for Mambo <?=$currentVersion->version;?></a> (com_mls_catering)<br>17 © 200 4 Samuel Suter <<a href="mailto:samuel.suter@gmx.ch">samuel.suter@gmx.ch</a>><br>16 <a href="http://www.mylansite.org/" target="_top">myLANsite Catering Component for Joomla <?php echo $currentVersion->version;?></a> (com_mls_catering)<br> 17 © 2005 - 2006 Samuel Suter <<a href="mailto:samuel.suter@mylansite.org">samuel.suter@mylansite.org</a>><br> 18 18 This is Free Software released under the GNU/GPL License. 19 19 </td> … … 84 84 }; 85 85 86 87 /** Till **/ 88 class HTML_MLS_catering_till { 89 function showTillUser( $lists, $option, $act ) { 90 global $l, $cnf_mls_catering; 91 $l->setBlock("till"); 92 ?> 93 <form action="index2.php" method="post" name="adminForm" onSubmit="javascript:document.adminForm.task.value='till';"> 94 <table class="adminheading"> 95 <tr> 96 <th>myLANsite Catering: <?php echo $l->m("till"); ?> :: <?php echo $l->m("select_user"); ?></th> 97 </tr> 98 </table> 99 <table class="adminform"> 100 <tr> 101 <td width="20%" valign="top" align="right"><?php echo $l->m("userid") ?>:</td> 102 <td width="80%"><input class="text_area" id="userid" type="text" name="userid" size="10" maxlength="10" value="" /></td> 103 </tr> 104 <tr> 105 <td align="right" valign="top"><?php echo $l->m("search_user") ?>:</td> 106 <td><input class="text_area" id="search_user" type="text" name="search_user" size="30" maxlength="255" value="" /></td> 107 </tr> 108 <tr> 109 <td align="right" valign="top"><?php echo $l->m("select_user") ?>:</td> 110 <td><?php echo $lists["users"]; ?></td> 111 </tr> 112 <tr> 113 <td align="right" valign="top"> </td> 114 <td><input type="submit" class="button" name="submit" value="<?php echo $l->m("search");?>" /></td> 115 </tr> 116 </table> 117 <input type="hidden" name="option" value="<?php echo $option; ?>" /> 118 <input type="hidden" name="act" value="<?php echo $act; ?>" /> 119 <input type="hidden" name="task" value="" /> 120 </form> 121 <script language="JavaScript"> 122 document.getElementById('userid').focus(); 123 </script> 124 <?php 125 HTML_MLS_catering::printFooter($option); 126 } 127 128 function showTill( &$user, &$categories, $items, $option, $act ) { 129 global $l, $cnf_mls_catering; 130 $l->setBlock("till"); 131 ?> 132 <script language="JavaScript"> 133 var strCurrency = '<?php echo $cnf_mls_catering["currency"]; ?>'; 134 </script> 135 <script language="JavaScript" src="components/com_mls_catering/mls_catering.js"></script> 136 <form action="index2.php" method="post" name="adminForm"> 137 <table class="adminheading"> 138 <tr> 139 <th width="50%">myLANsite Catering: <?php echo $l->m("till")?></th> 140 <td style="width: 300px; font-weight: normal;" align="left"> 141 <span style="white-space: nowrap;"><b><?php echo $l->m("user"); ?>:</b> <?php echo $user->name;?> (<?php echo $user->username; ?>)</span><br /> 142 <span style="white-space: nowrap;"><b><?php echo $l->m("balance"); ?>:</b> <?php echo $user->_balance; ?></span> 143 </td> 144 </tr> 145 </table> 146 <table class="adminform"> 147 <tr> 148 <td width="60%" valign="top" align="left"> 149 <?php 150 $tabCat = new mosTabs( 0 ); 151 $tabCat->startPane( "tabs-till-categories" ); 152 for($i = 0; $i < count($categories); $i++) { 153 $cat =& $categories[$i]; 154 $tabCat->startTab($cat->name,"category_".$cat->id); 155 156 $numItems = count($cat->_items); 157 $cols = 4; 158 $rows = ceil($numItems / $cols); 159 ?> 160 <table border="0" width="100%" cellpadding="0" cellspacing="2"> 161 <?php 162 for($iRow = 0; $iRow < $rows; $iRow++) { 163 echo "<tr>\n"; 164 for($iCol = 0; $iCol < $cols; $iCol++) { 165 $width = floor(100 / $cols); 166 echo "<td width=\"".$width."%\" style=\"text-align: center; vertical-align: middle;\">\n"; 167 $index = ($iRow * $cols) + $iCol; 168 if(@$cat->_items[$index]) { 169 $item =& $cat->_items[$index]; 170 ?> 171 <div valign="middle" id="item_<?php echo $item->id;?>" onClick="javascript:clickItemBut(<?php echo $item->id; ?>,'<?php echo $item->name;?>','<?php echo $item->price; ?>')" style="width: 100%; height: 45px; text-align: center; vertical-align: middle; background-color: #CCCCCC; border: 1px solid #000000;"> 172 <b><?php echo $item->name; ?></b> 173 <br /> 174 <?php echo $item->price; ?> <?php echo $cnf_mls_catering["currency"]; ?> 175 </div> 176 <?php 177 } else { 178 echo " "; 179 } 180 echo "</td>\n"; 181 } 182 echo "</tr>\n"; 183 } 184 ?> 185 </table> 186 <?php 187 $tabCat->endTab(); 188 } 189 $tabCat->endPane(); 190 ?> 191 </td> 192 <td width="40%" valign="top" align="left"> 193 <table class="adminlist" width="100%" id="currentOrderTable"> 194 <tr> 195 <th><?php echo $l->m("item"); ?>:</th> 196 <th width="100"><?php echo $l->m("price"); ?>:</th> 197 <th width="20"> </th> 198 </tr> 199 </table> 200 </td> 201 </tr> 202 </table> 203 <input type="hidden" name="option" value="<?php echo $option; ?>" /> 204 <input type="hidden" name="act" value="<?php echo $act; ?>" /> 205 <input type="hidden" name="task" value="" /> 206 <input type="hidden" name="userid" value="<?php echo $user->id; ?>" /> 207 </form> 208 <script> 209 <?php 210 foreach($items as $item) { 211 ?> 212 clickItemBut(<?php echo $item->id; ?>,'<?php echo $item->name;?>','<?php echo $item->price; ?>'); 213 <?php 214 } 215 ?> 216 </script> 217 <?php 218 HTML_MLS_catering::printFooter($option); 219 } 220 221 function checkout( &$user, &$items, &$unpaidOrders, $totals, $lists, $option, $act ) { 222 global $l, $cnf_mls_catering; 223 $l->setBlock("till"); 224 mosMLS_catering_money::addZeros($user->_balance, TRUE, TRUE, TRUE); 225 mosMLS_catering_money::addZeros($user->_fromAccountBoth, TRUE, FALSE, TRUE); 226 mosMLS_catering_money::addZeros($user->_fromAccountItems, TRUE, FALSE, TRUE); 227 //Do not add currency for the "outstanding money" values 228 mosMLS_catering_money::addZeros($user->_outstandingMoneyBoth, FALSE, FALSE, TRUE); 229 mosMLS_catering_money::addZeros($user->_outstandingMoneyItems, FALSE, FALSE, TRUE); 230 mosMLS_catering_money::addZeros($user->_balanceAfterItems, TRUE, FALSE, TRUE); 231 mosMLS_catering_money::addZeros($user->_balanceAfterBoth, TRUE, FALSE, TRUE); 232 ?> 233 <script> 234 var strPaymentSourceBoth = '<?php echo $user->_fromAccountBoth . " " . $l->m("paid_from_account"); ?>'; 235 var strPaymentSourceItems = '<?php echo $user->_fromAccountItems . " " . $l->m("paid_from_account"); ?>'; 236 var strOutstandingBoth = '<?php echo $user->_outstandingMoneyBoth; ?>'; 237 var strOutstandingItems = '<?php echo $user->_outstandingMoneyItems; ?>'; 238 var strBalanceAfterBoth = '<?php echo $user->_balanceAfterBoth; ?>'; 239 var strBalanceAfterItems = '<?php echo $user->_balanceAfterItems; ?>'; 240 function clickPayOrders() { 241 objCheckbox = document.getElementById('payOrders'); 242 if (objCheckbox.checked) { 243 document.getElementById('cashamount').value = strOutstandingBoth; 244 var newTextSrc = document.createTextNode(strPaymentSourceBoth); 245 var newTextBal = document.createTextNode(strBalanceAfterBoth); 246 } else { 247 document.getElementById('cashamount').value = strOutstandingItems; 248 var newTextSrc = document.createTextNode(strPaymentSourceItems); 249 var newTextBal = document.createTextNode(strBalanceAfterItems); 250 } 251 varDivSrc = document.getElementById('divPaymentSource'); 252 varDivSrc.replaceChild(newTextSrc,varDivSrc.childNodes[0]); 253 254 varDivBal = document.getElementById('divBalanceAfter'); 255 varDivBal.replaceChild(newTextBal,varDivBal.childNodes[0]); 256 257 } 258 </script> 259 <form action="index2.php" method="post" name="adminForm"> 260 <table class="adminheading"> 261 <tr> 262 <th width="50%">myLANsite Catering: <?php echo $l->m("checkout")?></th> 263 <td style="width: 300px; font-weight: normal;" align="left"> 264 <span style="white-space: nowrap;"><b><?php echo $l->m("user"); ?>:</b> <?php echo $user->name;?> (<?php echo $user->username; ?>)</span><br /> 265 <span style="white-space: nowrap;"><b><?php echo $l->m("balance"); ?>:</b> <?php echo $user->_balance; ?></span> 266 </td> 267 </tr> 268 </table> 269 <table class="adminform"> 270 <tr> 271 <td width="100%" valign="top" colspan="2"> 272 <table class="adminlist" style="width:60%;"> 273 <tr> 274 <th width="20">#</th> 275 <th><?php echo $l->m("category") ?></th> 276 <th><?php echo $l->m("item") ?></th> 277 <th><?php echo $l->m("price") ?></th> 278 <th> </th> 279 </tr> 280 <?php 281 $k = 0; 282 for($i = 0; $i < count($items); $i++) { 283 $row = $items[$i]; 284 mosMLS_catering_money::addZeros($row->price, TRUE, FALSE, FALSE); 285 ?> 286 <tr class="<?php echo "row$k"; ?>"> 287 <td><?php echo $i + 1; ?><input type="hidden" name="cid[]" size="1" value="<?php echo $row->id; ?>"></td> 288 <td><?php echo $row->categoryname; ?></td> 289 <td><?php echo $row->itemname; ?></td> 290 <td><?php echo $row->price; ?></td> 291 <td> </td> 292 </tr> 293 <?php 294 $k = 1 - $k; 295 } 296 mosMLS_catering_money::addZeros($totals["items"]); 297 $style = "border-top: 1px solid grey; border-bottom: 1px solid grey; font-weight: bold;"; 298 ?> 299 <tr> 300 <td style="<?php echo $style?>"> </td> 301 <td style="<?php echo $style?>" colspan="2"><?php echo $l->m("subtotal"); ?></td> 302 <td style="<?php echo $style?>"><?php echo $totals["items"]; ?></td> 303 <td style="<?php echo $style?>"> </td> 304 </tr> 305 <tr> 306 <td colspan="5"> </td> 307 </tr> 308 <tr> 309 <th colspan="5"><?php echo $l->m("unpaid_orders"); ?> <input type="checkbox" value="1" name="payOrders" id="payOrders" onclick="javascript:clickPayOrders()" checked></th> 310 </tr> 311 <?php 312 $k = 0; 313 for($i = 0; $i < count($unpaidOrders); $i++) { 314 $row = $unpaidOrders[$i]; 315 mosMLS_catering_money::addZeros($row->price, TRUE, FALSE, FALSE); 316 ?> 317 <tr class="<?php echo "row$k"; ?>"> 318 <td><?php echo $i + 1; ?><input type="hidden" name="cidord[]" size="1" value="<?php echo $row->orderid; ?>"></td> 319 <td><?php echo $row->categoryname; ?></td> 320 <td><?php echo $row->itemname; ?></td> 321 <td><?php echo $row->price; ?></td> 322 <td> </td> 323 </tr> 324 <?php 325 $k = 1 - $k; 326 } 327 mosMLS_catering_money::addZeros($totals["orders"]); 328 $style = "border-top: 1px solid grey; border-bottom: 1px solid grey; font-weight: bold;"; 329 ?> 330 <tr> 331 <td style="<?php echo $style?>"> </td> 332 <td style="<?php echo $style?>" colspan="2"><?php echo $l->m("subtotal"); ?></td> 333 <td style="<?php echo $style?>"><?php echo $totals["orders"]; ?></td> 334 <td style="<?php echo $style?>"> </td> 335 </tr> 336 <tr> 337 <td colspan="5" style="<?php echo $style; ?>"> </td> 338 </tr> 339 <?php 340 mosMLS_catering_money::addZeros($totals["total"]); 341 ?> 342 <tr> 343 <td style="<?php echo $style?>"> </td> 344 <td style="<?php echo $style?>" colspan="2"><?php echo $l->m("total"); ?></td> 345 <td style="<?php echo $style?>"><?php echo $totals["total"]; ?></td> 346 <td style="<?php echo $style?>"> </td> 347 </tr> 348 </table> 349 </td> 350 </tr> 351 <tr> 352 <td colspan="2"> </td> 353 </tr> 354 <tr> 355 <td width="20%" valign="top"><?php echo $l->m("balance_before") ?>:</td> 356 <td width="80%"><?php echo $user->_balance;?></td> 357 </tr> 358 <tr> 359 <td valign="top"><?php echo $l->m("balance_after") ?>:</td> 360 <td><div id="divBalanceAfter"><?php echo $user->_balanceAfterBoth;?></div></td> 361 </tr> 362 <tr> 363 <td> </td> 364 </tr> 365 <tr> 366 <td valign="top"><?php echo $l->m("payment_source") ?>:</td> 367 <td style="font-weight: bold;"> 368 <div id="divPaymentSource"> 369 <?php echo $strPaymentSourceBoth; ?> 370 </div> 371 </tr> 372 <tr> 373 <td valign="top"><?php echo $l->m("deposit_cash"); ?>:</td> 374 <td><input type="text" name="cashamount" value="<?php echo $user->_outstandingMoneyBoth; ?>" id="cashamount" size="6" onFocus="this.value = ''" /> <?php echo $cnf_mls_catering["currency"]; ?></td> 375 </tr> 376 <tr> 377 <td valign="top"><?php echo $l->m("money_back_from_cash_action") ?>:</td> 378 <td><?php echo $lists["cash_action"];?></td> 379 </tr> 380 </table> 381 <input type="hidden" name="option" value="<?php echo $option; ?>" /> 382 <input type="hidden" name="act" value="<?php echo $act; ?>" /> 383 <input type="hidden" name="task" value="" /> 384 <input type="hidden" name="userid" value="<?php echo $user->id; ?>" /> 385 <input type="hidden" name="orderid" value="<?php echo $orderid; ?>" /> 386 <input type="hidden" name="boxchecked" value="0" /> 387 </form> 388 <?php 389 HTML_MLS_catering::printFooter($option); 390 } 391 392 function checkoutError( $error, $option, $act ) { 393 global $l, $cnf_mls_catering; 394 $l->setBlock("till"); 395 ?> 396 <form action="index2.php" method="post" name="adminForm"> 397 <table class="adminheading"> 398 <tr> 399 <th>myLANsite Catering: <?php echo $l->m("checkout_overview")?></th> 400 </tr> 401 </table> 402 <table class="adminform"> 403 <tr> 404 <td valign="top" colspan="2" style="font-weight: bold; color: #FF0000;"><?php echo $error ?></td> 405 </tr> 406 <tr> 407 <td valign="top" colspan="2" align="center"><a href="javascript:history.back(1)"><?php echo $l->m("back"); ?></td> 408 </tr> 409 </table> 410 <?php 411 HTML_MLS_catering::printFooter($option); 412 } 413 414 }; 415 416 /** Categories **/ 86 417 class HTML_MLS_catering_categories { 87 418 function listCategories(&$rows, $pageNav, $option, $act) { … … 92 423 <table class="adminheading"> 93 424 <tr> 94 <th>myLANsite Catering: <? =$l->m("catering_categories")?></th>425 <th>myLANsite Catering: <?php echo $l->m("catering_categories")?></th> 95 426 </tr> 96 427 </table> … … 99 430 <th width="5">#</td> 100 431 <th width="20"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?>);" /></th> 101 <th width="20"><? =$l->m("id")?></th>102 <th class="title"><? =$l->m("name")?></th>103 <th width="15%"><? =$l->m("num_records")?></th>104 <th width="10%"><? =$l->m("published","general")?></th>432 <th width="20"><?php echo $l->m("id")?></th> 433 <th class="title"><?php echo $l->m("name")?></th> 434 <th width="15%"><?php echo $l->m("num_records")?></th> 435 <th width="10%"><?php echo $l->m("published","general")?></th> 105 436 <th width="30%"> </th> 106 437 </tr> … … 150 481 <table class="adminform"> 151 482 <tr> 152 <td width="20%" valign="top" align="right"><? =$l->m("name") ?>:</td>483 <td width="20%" valign="top" align="right"><?php echo $l->m("name") ?>:</td> 153 484 <td width="80%"><input class="text_area" type="text" name="name" size="50" maxlength="255" value="<?php echo $row->name; ?>" /></td> 154 485 </tr> 155 486 <tr> 156 <td align="right" valign="top"><? =$l->m("published","general") ?>:</td>487 <td align="right" valign="top"><?php echo $l->m("published","general") ?>:</td> 157 488 <td><?php echo $lists["published"]; ?></td> 158 489 </tr> … … 180 511 <table class="adminheading"> 181 512 <tr> 182 <th>myLANsite Catering: <? =$l->m("catering_items"); ?></th>183 <td><? =$l->m("category")?>:</td>513 <th>myLANsite Catering: <?php echo $l->m("catering_items"); ?></th> 514 <td><?php echo $l->m("category")?>:</td> 184 515 <td> <?php echo $category_select; ?></td> 185 <td><? =$l->m("caterer")?>:</td>516 <td><?php echo $l->m("caterer")?>:</td> 186 517 <td> <?php echo $caterer_select; ?></td> 187 <td><? =$l->m("search","general"); ?>:</td>518 <td><?php echo $l->m("search","general"); ?>:</td> 188 519 <td><input type="text" name="search" value="<?php echo $search;?>" class="text_area" onChange="document.adminForm.submit();" /></td> 189 520 </tr> … … 193 524 <th width="5">#</td> 194 525 <th width="20"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?>);" /></th> 195 <th class="title"><? =$l->m("name");?></th>196 <th class="title"><? =$l->m("category");?></th>197 <th class="title"><? =$l->m("caterer");?></th>198 <th align="right" width="50"><? =$l->m("price");?></th>199 <th width="80"><nobr><? =$l->m("num_userorders");?></nobr></th>200 <th width="80"><nobr><? =$l->m("num_ordered");?></nobr></th>201 <th width="80"><nobr><? =$l->m("num_delivered");?></nobr></th>202 <th width="80"><nobr><? =$l->m("num_paid");?></nobr></th>203 <th align="right" width="50"><? =$l->m("turnover");?></th>204 <th width="10%"><? =$l->m("published","general");?></th>526 <th class="title"><?php echo $l->m("name");?></th> 527 <th class="title"><?php echo $l->m("category");?></th> 528 <th class="title"><?php echo $l->m("caterer");?></th> 529 <th align="right" width="50"><?php echo $l->m("price");?></th> 530 <th width="80"><nobr><?php echo $l->m("num_userorders");?></nobr></th> 531 <th width="80"><nobr><?php echo $l->m("num_ordered");?></nobr></th> 532 <th width="80"><nobr><?php echo $l->m("num_delivered");?></nobr></th> 533 <th width="80"><nobr><?php echo $l->m("num_paid");?></nobr></th> 534 <th align="right" width="50"><?php echo $l->m("turnover");?></th> 535 <th width="10%"><?php echo $l->m("published","general");?></th> 205 536 </tr> 206 537 <?php … … 233 564 ?> 234 565 <tr class="<?php echo "row$k"; ?>"> 235 <td style="<? =$style?>" align="center"> </td>566 <td style="<?php echo $style?>" align="center"> </td> 236 567 <?php $style = "border-top: 1px solid grey; border-bottom: 1px solid grey; font-weight: bold;"; ?> 237 <td style="<? =$style?>" width="20"> </td>238 <td style="<? =$style?>" colspan="4"><?=$l->m("total"); ?></td>239 <td style="<? =$style?>" align="center"><?php echo $tot->userordercount; ?></td>568 <td style="<?php echo $style?>" width="20"> </td> 569 <td style="<?php echo $style?>" colspan="4"><?php echo $l->m("total"); ?></td> 570 <td style="<?php echo $style?>" align="center"><?php echo $tot->userordercount; ?></td> 240 571 <?php $tooltip = sprintf($l->m("show_userorders_to_order"),$l->m("total")); ?> 241 <td style="<? =$style?>" align="center"><?php echo $tot->ordercount; ?> / <a href="javascript: void(0);" onClick="return listItemTask('cb0','totunordered')" onMouseOver="return overlib('<?=$tooltip;?>', BELOW, RIGHT)" onmouseout="return nd()"><?php echo $tot->unordered; ?></a></td>572 <td style="<?php echo $style?>" align="center"><?php echo $tot->ordercount; ?> / <a href="javascript: void(0);" onClick="return listItemTask('cb0','totunordered')" onMouseOver="return overlib('<?php echo $tooltip;?>', BELOW, RIGHT)" onmouseout="return nd()"><?php echo $tot->unordered; ?></a></td> 242 573 <?php $tooltip = sprintf($l->m("show_userorders_undelivered"),$l->m("total")); ?> 243 <td style="<? =$style?>" align="center"><?php echo $tot->delivercount; ?> / <a href="javascript: void(0);" onClick="return listItemTask('cb0','totundelivered')" onMouseOver="return overlib('<?=$tooltip;?>', BELOW, RIGHT)" onmouseout="return nd()"><?php echo $tot->undelivered; ?></a></td>574 <td style="<?php echo $style?>" align="center"><?php echo $tot->delivercount; ?> / <a href="javascript: void(0);" onClick="return listItemTask('cb0','totundelivered')" onMouseOver="return overlib('<?php echo $tooltip;?>', BELOW, RIGHT)" onmouseout="return nd()"><?php echo $tot->undelivered; ?></a></td> 244 575 <?php $tooltip = sprintf($l->m("show_userorders_unpaid"),$l->m("total")); ?> 245 <td style="<? =$style?>" align="center"><?php echo $tot->paidcount; ?> / <a href="javascript: void(0);" onClick="return listItemTask('cb0','totunpaid')" onMouseOver="return overlib('<?=$tooltip;?>', BELOW, RIGHT)" onmouseout="return nd()"><?php echo $tot->unpaidcount; ?></a></td>246 <td style="<? =$style?>" align="right"><nobr><?php echo $tot->turnover; ?> <?php echo $cnf_mls_catering["currency"]; ?></nobr></td>247 <td style="<? =$style?>" align="center"> </td>576 <td style="<?php echo $style?>" align="center"><?php echo $tot->paidcount; ?> / <a href="javascript: void(0);" onClick="return listItemTask('cb0','totunpaid')" onMouseOver="return overlib('<?php echo $tooltip;?>', BELOW, RIGHT)" onmouseout="return nd()"><?php echo $tot->unpaidcount; ?></a></td> 577 <td style="<?php echo $style?>" align="right"><nobr><?php echo $tot->turnover; ?> <?php echo $cnf_mls_catering["currency"]; ?></nobr></td> 578 <td style="<?php echo $style?>" align="center"> </td> 248 579 </tr> 249 580 </table> … … 258 589 } 259 590 260 function editItem(&$row, $lists, $option, $act) {261 global $l, $cnf_mls_catering ;591 function editItem(&$row, $lists, &$images, $currImage, $currFolder, $currIndex, $option, $act) { 592 global $l, $cnf_mls_catering, $mosConfig_live_site; 262 593 $l->setBlock("catering"); 263 594 ?> 595 <script language="javascript" type="text/javascript"> 596 var folderimages = new Array; 597 <?php 598 $i = 0; 599 foreach ($images as $k=>$items) { 600 foreach ($items as $v) { 601 echo "folderimages[".$i++."] = new Array( '$k','".addslashes( ampReplace( $v->value ) )."','".addslashes( ampReplace( $v->text ) )."' );\t"; 602 } 603 } 604 ?> 605 606 function submitbutton(pressbutton) { 607 if(pressbutton == 'save') { 608 if (document.adminForm.name.value == '') { 609 alert('<?php echo $l->m("err_please_enter_name","general"); ?>'); 610 } else if (document.adminForm.categoryid.value == 0) { 611 alert('<?php echo $l->m("err_please_select_category","general"); ?>'); 612 } else if (document.adminForm.catererid.value == 0) { 613 alert('<?php echo $l->m("err_please_select_caterer","general"); ?>'); 614 } else { 615 submitform(pressbutton); 616 } 617 } else { 618 submitform(pressbutton); 619 } 620 } 621 </script> 264 622 <form action="index2.php" method="POST" name="adminForm"> 265 623 <table class="adminheading"> … … 270 628 <table class="adminform"> 271 629 <tr> 272 <td width="20%" valign="top" align="right"><? =$l->m("name") ?>:</td>630 <td width="20%" valign="top" align="right"><?php echo $l->m("name") ?>:</td> 273 631 <td width="80%"><input class="text_area" type="text" name="name" size="50" maxlength="50" value="<?php echo $row->name; ?>" /></td> 274 632 </tr> 275 633 <tr> 276 <td valign="top" align="right"><? =$l->m("description") ?>:</td>634 <td valign="top" align="right"><?php echo $l->m("description") ?>:</td> 277 635 <td><textarea class="text_area" name="description" rows="2" cols="50"><?php echo $row->description; ?></textarea></td> 278 636 </tr> 279 637 <tr> 280 <td width="20%" align="right" valign="top"><? =$l->m("category") ?>:</td>638 <td width="20%" align="right" valign="top"><?php echo $l->m("category") ?>:</td> 281 639 <td><?php echo $lists["categoryid"]; ?></td> 282 640 </tr> 283 641 <tr> 284 <td width="20%" align="right" valign="top"><? =$l->m("caterer") ?>:</td>642 <td width="20%" align="right" valign="top"><?php echo $l->m("caterer") ?>:</td> 285 643 <td><?php echo $lists["catererid"]; ?></td> 286 644 </tr> 287 645 <tr> 288 <td valign="top" align="right"><? =$l->m("price") ?>:</td>646 <td valign="top" align="right"><?php echo $l->m("price") ?>:</td> 289 647 <td><input class="text_area" type="text" name="price" size="10" maxlength="10" value="<?php echo $row->price; ?>" /> <?php echo $cnf_mls_catering["currency"]; ?></td> 290 648 </tr> 291 649 <tr> 292 <td valign="top" align="right"><?=$l->m("image") ?>:</td> 293 <td><input class="text_area" type="text" name="image" size="50" maxlength="255" value="<?php echo $row->image; ?>" /></td> 294 </tr> 295 <tr> 296 <td width="20%" align="right" valign="top"><?=$l->m("published","general") ?>:</td> 650 <td valign="top" align="right"><?php echo $l->m("image") ?>:</td> 651 <td> 652 <?php echo $lists['imagefiles'];?> 653 <img name="view_imagefiles" src="../images/M_images/blank.png" alt="Sample Image" width="100" /> 654 <br /> 655 <?php echo $lists['folders'];?> 656 </td> 657 </tr> 658 <tr> 659 <td width="20%" align="right" valign="top"><?php echo $l->m("published","general") ?>:</td> 297 660 <td><?php echo $lists["published"]; ?></td> 298 661 </tr> … … 303 666 <input type="hidden" name="task" value="" /> 304 667 </form> 668 <script language="javascript"> 669 670 document.adminForm.folders.options[<?php echo $currIndex; ?>].selected = true; 671 672 changeDynaList( 'imagefiles', folderimages, '<?php echo $currFolder; ?>', 0, 0); 673 674 listLen = document.adminForm.imagefiles.length; 675 var strTmp; 676 for(iCount = 0; iCount < listLen; iCount++) { 677 strTmp = document.adminForm.imagefiles.options[iCount].text; 678 if(strTmp == '<?php echo $currImage; ?>') { <679 document.adminForm.imagefiles.options[iCount].selected = true;