<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); 
/**
* @version $Id: shop.debug.php,v 1.5 2005/01/27 19:34:03 soeren_nb Exp $
* @package mambo-phpShop
* @subpackage HTML
* Contains code from PHPShop(tm):
* 	@copyright (C) 2000 - 2004 Edikon Corporation (www.edikon.com)
*	Community: www.phpshop.org, forums.phpshop.org
* Conversion to Mambo and the rest:
* 	@copyright (C) 2004-2005 Soeren Eberhardt
*
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* mambo-phpShop is Free Software.
* mambo-phpShop comes with absolute no warranty.
*
* www.mambo-phpshop.net
*/
mm_showMyFileName( __FILE__ );

global $page, $last_page, $error, $database;
$return_to_page = mosGetParam( $_REQUEST, 'return_to_page' );

include_once(ADMINPATH ."/version.php");
?>
      <table width="100%" border="0" cellspacing="0" cellpadding="2" >
        <tr class="sectiontableheader" nowrap> 
          <td colspan="4" align="center">
          <h3>--DEBUG--</h3><br />
          <?php echo "Version: <div align=\"center\">$version</div>"; ?></td>
        </tr>
        <tr nowrap> 
          <td class="sectiontableentry1" nowrap align="right" width="14%"><b>RunTime:</b></td>
          <td align="left" nowrap width="32%"><?php echo $runtime; ?> sec.&nbsp;</td>
          <td class="sectiontableentry1" width="18%" align="right" valign="top"><b>Current Page:</b></td>
          <td width="36%" valign="top"><?php echo $page; ?></td>
        </tr>
        <tr nowrap> 
          <td class="sectiontableentry2" width="14%" align="right" valign="top" nowrap><b>No. of queries executed:</b></td>
          <td width="32%" valign="top" nowrap><?php echo $database->_ticker; ?></td>
          <td class="sectiontableentry2" width="18%" align="right" valign="top"><b>Last Page:</b></td>
          <td width="36%" valign="top"><?php echo $_SESSION['last_page']; ?>&nbsp;</td>
        </tr>
        <tr nowrap> 
          <td class="sectiontableentry1" width="14%" align="right" nowrap valign="top"><b>UID:</b></td>
          <td width="32%" nowrap valign="top"><?php echo $auth["user_id"]; ?>&nbsp;</td>
          <td class="sectiontableentry1" width="18%" align="right" valign="top"><b>Return To Page:</b></td>
          <td width="36%" valign="top"><?php echo $return_to_page; ?>&nbsp;</td>
        </tr>
        <tr nowrap> 
          <td class="sectiontableentry2" width="14%" align="right" valign="top"><b>Username:</b></td>
          <td width="32%" valign="top"><?php echo $auth["username"]; ?>&nbsp;</td>
          <td class="sectiontableentry2" width="18%" align="right" valign="top"><b>Function:</b></td>
          <td width="36%" valign="top"><?php echo $func;?>&nbsp;</b></td>
        </tr>
        <tr nowrap> 
          <td class="sectiontableentry1" width="14%" align="right" valign="top"><b>Perms:</b></td>
          <td width="32%" valign="top"><?php echo $auth["perms"]; ?>&nbsp;</td>
          <td class="sectiontableentry1" width="18%" align="right" valign="top"><b>&nbsp;&nbsp;Command:</b></td>
          <td width="36%" valign="top">
            <?php echo $cmd."<br />Result:"; 
                  if ($ok) 
                     echo "True"; 
                  else  
                     echo "False"; ?>  &nbsp;</td>
        </tr>
        <tr nowrap> 
          <td class="sectiontableentry2" width="14%" align="right" valign="top"><b>$func_perms:</b></td>
          <td width="32%" valign="top"><?php echo $func_list["perms"]; ?>&nbsp;</td>
          <td class="sectiontableentry2" width="18%" align="right" valign="top"><b>$ps_vendor_id:</b></td>
          <td width="36%" valign="top"><?php echo $ps_vendor_id; ?> &nbsp;&nbsp;</td>
        </tr>
        <tr> 
          <td class="sectiontableentry1" width="14%" align="right" valign="top"><b>&nbsp;&nbsp;</b><b>$dir_perms:</b></td>
          <td width="32%" valign="top"><?php echo $dir_list["perms"]; ?>&nbsp;</td>
          <td class="sectiontableentry1" width="18%" align="right" valign="top"><b>$error:</b></td>
          <td width="36%" valign="top"><?php echo $error; ?> &nbsp;&nbsp;</td>
        </tr>
        <tr> 
          <td class="sectiontableentry2" align="right" width="14%"><b>$cart:</b></td>
          <td width="32%"><?php   
          for ($i=0;$i<$cart["idx"];$i++) {
            echo "\$cart[$i]:ID[" . $cart[$i]["product_id"];
            echo "]->Qty:[" . $cart[$i]["quantity"] . "]<br />";
           } 
           ?></td>
          <td width="18%">&nbsp;</td>
          <td width="36%">&nbsp;</td>
        </tr>
        <?php 
        if ($HTTP_POST_VARS) { ?>
        <tr> 
          <td class="sectiontableentry1" width="14%" align="right" valign="top"><b></b>$_POST:</b></td>
          <td colspan="3" width="32%" valign="top"><?php   
            while (list($val,$key) = each($_POST)) {
              echo "$val=>$key<BR>";
            }
            ?>
          </td>
          <?php 
          }
          else { ?>
        <tr> 
          <td class="sectiontableentry1" width="14%" align="right" valign="top"><b>$_GET:</b> </td>
          <td colspan="3" width="32%" valign="top"><?php   
            while (list($val,$key) = each($_GET)) {
              echo "$val=>$key<BR>";
            }
            ?>
          </td>
    <?php } ?>
        </tr>
        <tr>
          <td class="sectiontableentry2" width="18%" align="right" valign="top"><b>$vars:</b></td>
          <td colspan="3" width="36%"><?php   
            while (list($val,$key) = each($vars)) {
              echo "$val=>$key<BR>";
            }
            ?>
          </td>
        </tr>
      </table>


