Location: PHPKode > projects > T-77.com Operational Management System > omis/menu/bla.php
<?php require_once('../Connections/t77_connect.php'); ?>
<?php
mysql_select_db($database_t77_connect, $t77_connect);
$query_bill_types = "SELECT * FROM t77_bill_types ORDER BY t77_bill_types.bill_type";
$bill_types = mysql_query($query_bill_types, $t77_connect) or die(mysql_error());
$row_bill_types = mysql_fetch_assoc($bill_types);
$totalRows_bill_types = mysql_num_rows($bill_types);
?>
<?
mysql_select_db($database_t77_connect, $t77_connect);
$query_companies_contacts = "SELECT * FROM t77_bill_companies";
$companies_contacts = mysql_query($query_companies_contacts, $t77_connect) or die(mysql_error());
$row_companies_contacts = mysql_fetch_assoc($companies_contacts);
$totalRows_companies_contacts = mysql_num_rows($companies_contacts);
?>
<?php
  // Chip's HTML_TreeMenu Information Page
  
  // Revision History
	// 2002-12-02 cchapin  Release XL2.0.2
	// 2002-11-15 cchapin  Fix PHP short tag in document template.
	// 2002-11-14 cchapin  Major update for release 1.1.0/XL2.0
  // 2002-11-02 cchapin  Revised to use HTML_TreeMenuXL class
  // 2002-11-02 cchapin  Initial release (XL1.0)
  // 2002-10-30 cchapin  Initial Creation
  
// +-----------------------------------------------------------------------+
// | Copyright (c) 2002 Chip Chapin <hide@address.com>               |
// |                    http://www.chipchapin.com                          |
// | All rights reserved.                                                  |
// |                                                                       |
// | Redistribution and use in source and binary forms, with or without    |
// | modification, are permitted provided that the following conditions    |
// | are met:                                                              |
// |                                                                       |
// | o Redistributions of source code must retain the above copyright      |
// |   notice, this list of conditions and the following disclaimer.       |
// | o Redistributions in binary form must reproduce the above copyright   |
// |   notice, this list of conditions and the following disclaimer in the |
// |   documentation and/or other materials provided with the distribution.| 
// | o The names of the authors may not be used to endorse or promote      |
// |   products derived from this software without specific prior written  |
// |   permission.                                                         |
// |                                                                       |
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |
// |                                                                       |
// +-----------------------------------------------------------------------+
// | Author: Chip Chapin <hide@address.com>                          |
// +-----------------------------------------------------------------------+

  $pgEmailSubj = 'HTML_TreeMenu_Page';

  // Control dynamic style sheet
  $styleBodyIndent=true;
  $styleBodyBGcolor="#FFDBB7";
  include_once( 'TreeMenuXL.php' );

  $menu01  = new HTML_TreeMenuXL();
  $nodeProperties = array("icon"=>"folder.gif");


// start the dynamic menu

	$i = 0;

// start with the first level based on the doctypes

	do {
	$i++;
	
		$node{$i} = new HTML_TreeNodeXL($row_bill_types['type_description'], "../doc_list.php?typeID=" . $row_bill_types['bill_type'], $nodeProperties);
		
			// construct the company list
			mysql_select_db($database_t77_connect, $t77_connect);
			$query_companies_def = "SELECT * FROM t77_bill_companies ORDER BY t77_bill_companies.company_name";
			$companies_def = mysql_query($query_companies_def, $t77_connect) or die(mysql_error());
			$row_companies_def = mysql_fetch_assoc($companies_def);
			$totalRows_companies_def = mysql_num_rows($companies_def);
		
			do {
			
			$nx = &$node{$i}->
					addItem(new HTML_TreeNodeXL($row_companies_def['company_name'], "../doc_list.php?typeID=" . $row_bill_types['bill_type'], $nodeProperties));
					
					// and finally construct the docs
					
							$colname_docs_def = $row_bill_types['bill_type'];
							if (isset($row_bill_types['bill_type'])) {
							  $colname_docs_def = (get_magic_quotes_gpc()) ? $row_bill_types['bill_type'] : addslashes($row_bill_types['bill_type']);
							}
							$colname2_docs_def = $row_companies_def['company_id'];
							if (isset($row_companies_def['company_id'])) {
							  $colname2_docs_def = (get_magic_quotes_gpc()) ? $row_companies_def['company_id'] : addslashes($row_companies_def['company_id']);
							}
							mysql_select_db($database_t77_connect, $t77_connect);
							$query_docs_def = sprintf("SELECT * FROM t77_bill_bills WHERE t77_bill_bills.bill_type = %s AND t77_bill_bills.bill_contact = %s ORDER BY t77_bill_bills.order_number", $colname_docs_def, $colname2_docs_def);
							$docs_def = mysql_query($query_docs_def, $t77_connect) or die(mysql_error());
							$row_docs_def = mysql_fetch_assoc($docs_def);
							$totalRows_docs_def = mysql_num_rows($docs_def);
					
					if($totalRows_docs_def > 0) {
					
						do {
							
							$nx->
     							addItem(new HTML_TreeNodeXL($row_docs_def['order_number'] . " - " . $row_docs_def['bill_name'], "../items.php?id=".$row_docs_def['bill_id'], $nodeProperties));
					
					
					
						} while ($row_docs_def = mysql_fetch_assoc($docs_def));
						
					}
					
					mysql_free_result($docs_def);
					
			} while ($row_companies_def = mysql_fetch_assoc($companies_def));
			
			mysql_free_result($companies_def);
		
		$menu01->addItem($node{$i});
	} while ($row_bill_types = mysql_fetch_assoc($bill_types));
  
  
  	// add another node for the contacts.
	$i++;
	$node{$i} = new HTML_TreeNodeXL("Contactpersonen", "../contacts.php", $nodeProperties);

	// loop through the comapnies
	do {
	
		$nx = &$node{$i}->
    		addItem(new HTML_TreeNodeXL($row_companies_contacts['company_name'], "../contacts.php?comID=" . $row_companies_contacts['company_id'], $nodeProperties));
		
	} while ($row_companies_contacts = mysql_fetch_assoc($companies_contacts));
	
	$menu01->addItem($node{$i});
				
	// some room to add custom nodes...
	$menu01->addItem(new HTML_TreeNodeXL("Bedrijven",  "../companies.php", $nodeProperties));
	$menu01->addItem(new HTML_TreeNodeXL("Instellingen",  "../settings.php", $nodeProperties));

?>
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script src="TreeMenu.js" language="JavaScript" type="text/javascript"></script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
//-->
</script>
<style type="text/css">
<!--
.tmenu0text {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10pt;
	font-weight: bold;
	vertical-align: text-bottom;
	color: #000033;
}
.tmenu1text {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 9pt;
	vertical-align: text-bottom;
	color: #000033;
}
.tmenu2text {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 7.5pt;
	vertical-align: middle;
	color: #000033;
}
.tmenu3text {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 7.5pt;
  color: #000033;
}
/* Since all menu items are links, the following is equally important 
 * to your menu appearance.  
 * The main thing you may want to change are the A:link and A:visited colors.
 */
*.tmenu0text A:link,*.tmenu1text A:link,*.tmenu2text A:link,*.tmenu3text A:link 
  { text-decoration:underline; color:#003ca5 }
*.tmenu0text A:visited,*.tmenu1text A:visited,*.tmenu2text A:visited,*.tmenu3text A:visited 
  { text-decoration:underline; color:#003ca5 }
*.tmenu0text A:active,*.tmenu1text A:active,*.tmenu2text A:active,*.tmenu3text A:active 
  { text-decoration:none; color:#003ca5 }
*.tmenu0text A:hover,*.tmenu1text A:hover,*.tmenu2text A:hover,*.tmenu3text A:hover 
  { text-decoration:underline; color:#ff0000 }

/* .tmlistbox controls the appearance of Listbox menus */
.tmlistbox {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 11px;  /* match 'smalltext' value */
  font-size-adjust: 0.58; /* Verdana */
  margin-bottom: 0px;
}

/* .tmenuSelected is used with linkSelectKey to highlight selected items */
.tmenuSelected { 
  background-color: yellow;
}
*.tmenuSelected A:link    { text-decoration:none; color:#2020ff }
*.tmenuSelected A:visited { text-decoration:none; color:#2020ff }
*.tmenuSelected A:active  { text-decoration:none; color:#ff2020 }
*.tmenuSelected A:hover   { text-decoration:underline; color:#FF0000 }
-->
</style>
<style type="text/css">
<!--
.tableBack {
	background-image: url(../images/back.gif);
	background-repeat: repeat-y;
	border-right-width: 1px;
	border-right-style: solid;
	border-right-color: #003CA5;
}

-->
</style>
</head>

<body leftmargin="10" topmargin="0" marginwidth="0" marginheight="0">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="left" valign="top">
        <?php 
        // Create the presentation object
        $example010 = &new HTML_TreeMenu_DHTMLXL($menu01, array("images"=>"TMimages", "defaultClass"=>"auto"));
        $example010->printMenu();
      ?>
    </td>
  </tr>
</table>
</body>
</html>
<?php
mysql_free_result($bill_types);

mysql_free_result($facturen);

mysql_free_result($offertes);

mysql_free_result($companies_contacts);
?>
Return current item: T-77.com Operational Management System