Assembla home | Assembla project page
 

Changeset 88

Show
Ignore:
Timestamp:
10/23/06 13:15:18 (2 years ago)
Author:
moensch
Message:

Importing working copy of pre-released 0.1.1RC2

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/com_mls_catering/admin.mls_catering.html.php

    <
    r26 r88  
    1414                        <tr> 
    1515                                <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                                 &copy; 2004 Samuel Suter &lt;<a href="mailto:samuel.suter@gmx.ch">samuel.suter@gmx.ch</a>&gt;<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                                &copy; 2005 - 2006 Samuel Suter &lt;<a href="mailto:samuel.suter@mylansite.org">samuel.suter@mylansite.org</a>&gt;<br> 
    1818                                This is Free Software released under the GNU/GPL License. 
    1919                                </td> 
     
    8484}; 
    8585 
     86 
     87/** Till **/ 
     88class 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">&nbsp;</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 "&nbsp;"; 
     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">&nbsp;</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>&nbsp;</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>&nbsp;</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?>">&nbsp;</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?>">&nbsp;</td> 
     304                                </tr> 
     305                                <tr> 
     306                                        <td colspan="5">&nbsp;</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>&nbsp;</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?>">&nbsp;</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?>">&nbsp;</td> 
     335                                </tr> 
     336                                <tr> 
     337                                        <td colspan="5" style="<?php echo $style; ?>">&nbsp;</td> 
     338                                </tr> 
     339                                <?php 
     340                                mosMLS_catering_money::addZeros($totals["total"]); 
     341                                ?> 
     342                                <tr> 
     343                                        <td style="<?php echo $style?>">&nbsp;</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?>">&nbsp;</td> 
     347                                </tr> 
     348                                </table> 
     349                                </td> 
     350                        </tr> 
     351                        <tr> 
     352                                <td colspan="2">&nbsp;</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>&nbsp;</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 **/ 
    86417class HTML_MLS_catering_categories { 
    87418        function listCategories(&$rows, $pageNav, $option, $act) { 
     
    92423                <table class="adminheading"> 
    93424                <tr> 
    94                         <th>myLANsite Catering: <?=$l->m("catering_categories")?></th> 
     425                        <th>myLANsite Catering: <?php echo $l->m("catering_categories")?></th> 
    95426                </tr> 
    96427                </table> 
     
    99430                        <th width="5">#</td> 
    100431                        <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> 
    105436                        <th width="30%">&nbsp;</th> 
    106437                </tr> 
     
    150481                <table class="adminform"> 
    151482                        <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> 
    153484                                <td width="80%"><input class="text_area" type="text" name="name" size="50" maxlength="255" value="<?php echo $row->name; ?>" /></td> 
    154485                        </tr> 
    155486                        <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> 
    157488                                <td><?php echo $lists["published"]; ?></td> 
    158489                        </tr> 
     
    180511                <table class="adminheading"> 
    181512                <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> 
    184515                        <td> <?php echo $category_select; ?></td> 
    185                         <td><?=$l->m("caterer")?>:</td> 
     516                        <td><?php echo $l->m("caterer")?>:</td> 
    186517                        <td> <?php echo $caterer_select; ?></td> 
    187                         <td><?=$l->m("search","general"); ?>:</td> 
     518                        <td><?php echo $l->m("search","general"); ?>:</td> 
    188519                        <td><input type="text" name="search" value="<?php echo $search;?>" class="text_area" onChange="document.adminForm.submit();" /></td> 
    189520                </tr> 
     
    193524                        <th width="5">#</td> 
    194525                        <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> 
    205536                </tr> 
    206537                <?php 
     
    233564                ?> 
    234565                <tr class="<?php echo "row$k"; ?>"> 
    235                         <td style="<?=$style?>" align="center">&nbsp;</td> 
     566                        <td style="<?php echo $style?>" align="center">&nbsp;</td> 
    236567                        <?php $style = "border-top: 1px solid grey; border-bottom: 1px solid grey; font-weight: bold;"; ?> 
    237                         <td style="<?=$style?>" width="20">&nbsp;</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">&nbsp;</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> 
    240571                        <?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> 
    242573                        <?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> 
    244575                        <?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">&nbsp;</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">&nbsp;</td> 
    248579                </tr> 
    249580                </table> 
     
    258589        } 
    259590         
    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
    262593                $l->setBlock("catering"); 
    263594                ?> 
     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> 
    264622                <form action="index2.php" method="POST" name="adminForm"> 
    265623                <table class="adminheading"> 
     
    270628                <table class="adminform"> 
    271629                        <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> 
    273631                                <td width="80%"><input class="text_area" type="text" name="name" size="50" maxlength="50" value="<?php echo $row->name; ?>" /></td> 
    274632                        </tr> 
    275633                        <tr>  
    276                                 <td valign="top" align="right"><?=$l->m("description") ?>:</td> 
     634                                <td valign="top" align="right"><?php echo $l->m("description") ?>:</td> 
    277635                                <td><textarea class="text_area" name="description" rows="2" cols="50"><?php echo $row->description; ?></textarea></td> 
    278636                        </tr> 
    279637                        <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> 
    281639                                <td><?php echo $lists["categoryid"]; ?></td> 
    282640                        </tr> 
    283641                        <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> 
    285643                                <td><?php echo $lists["catererid"]; ?></td> 
    286644                        </tr> 
    287645                        <tr>  
    288                                 <td valign="top" align="right"><?=$l->m("price") ?>:</td> 
     646                                <td valign="top" align="right"><?php echo $l->m("price") ?>:</td> 
    289647                                <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> 
    290648                        </tr> 
    291649                        <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'];?>&nbsp; 
     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> 
    297660                                <td><?php echo $lists["published"]; ?></td> 
    298661                        </tr> 
     
    303666                <input type="hidden" name="task" value="" /> 
    304667                </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;