<?php


function ORDERER($ARG1,$ARG1_VAL) {
	global $thiss,$result;
if ($_SESSION['DEBUG']) print_r($thiss);
//		 CREATE_MENUFUNC_NOTD_INIT($_SESSION[LAST_MENU],'POWROT<img src=icon/back.gif border=0 alt=POWROT>');

  $WHILECNT = "0";
  $A_DB_TELBOX_TRACE_PATH_GO = "GO";
  $A_DB_TELBOX_TRACE_PATH_CUST = "";
  $A_DB_TELBOX_TRACE_PATH = "";
  $UNTIL1 = $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_TELBOX_ADDRESS'];

	while (($A_DB_TELBOX_TRACE_PATH_GO == 'GO') && ($WHILECNT < 50)) {
		//TODO 2007-04-28 sprawdzic funkcjonalnosc ADM_COMPANY czy nie wyklucza jakiejs opcji programu		$UNTIL1_SQL="select T_TELBOX_NEIGHBOUR_IN from TELBOXES where T_TELBOX_NAME='$UNTIL1'  and A_ADM_COMPANY like '" .$_SESSION[ADM_COMPANY]. "' ORDER BY ID limit 0,1 ";
		$UNTIL1_SQL = "select T_TELBOX_NEIGHBOUR_IN from TELBOXES where T_TELBOX_NAME='$UNTIL1'   ORDER BY ID limit 0,1 ";
		ZAP_SQL($UNTIL1_SQL);
		while ($h = mysql_fetch_row($result)) {
			$WHILECNT++;
			$UNTIL1 = $h[0];
		}
		if (mysql_numrows($result) == 0) {
			$A_DB_TELBOX_TRACE_PATH_GO = "STOP";
		} else {
			$A_DB_TELBOX_TRACE_PATH = $A_DB_TELBOX_TRACE_PATH . " " . $UNTIL1;
		}
	}

	if (($_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_TELBOX_ADDRESS']) && (!($_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_TELBOX_ADDRESS'] == "N/S;"))) {
		if ($thiss->DETECT_TABLE_NAME == "USERS2") {
			$ZAP_SQL = "select '<b>',S_ADDRESS_STREET,'</b> ',A_STATUS,' ',S_IP,'<b> ',A_PROBLEM,'</b> ',A_PROBLEM_DESC,'<br> ' from $thiss->DETECT_TABLE_NAME where T_TELBOX_ADDRESS='" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_TELBOX_ADDRESS'] . "' and A_ADM_COMPANY like '" . $_SESSION['ADM_COMPANY'] . "' ORDER BY A_STATUS,(substring_index(S_ADDRESS_STREET,'/',-1)+0),ID ;";
		} else {
			$ZAP_SQL = "select '<b>',S_ADDRESS_STREET,'</b> ',A_STATUS,' <b> ',A_PROBLEM,'</b> ',A_PROBLEM_DESC,'<br> ' from $thiss->DETECT_TABLE_NAME where T_TELBOX_ADDRESS='" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_TELBOX_ADDRESS'] . "' and A_ADM_COMPANY like '" . $_SESSION['ADM_COMPANY'] . "' ORDER BY ID ;";
		}

		ZAP_SQL($ZAP_SQL);
		while ($h = mysql_fetch_row($result)) {
			foreach ($h as $value) {
				$MAKE_ORDERER_TELBOX_USERS_LIST = $MAKE_ORDERER_TELBOX_USERS_LIST . " $value";
			}
		}

		$ZAP_SQL = "select ID from $thiss->DETECT_TABLE_NAME where T_TELBOX_ADDRESS='".$_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_TELBOX_ADDRESS']."' and ( A_STATUS='NORMAL' or A_STATUS='WARNING' or  A_STATUS='OFF_SOFT' or A_STATUS='MONITOR' ) and A_ADM_COMPANY like '".$_SESSION['ADM_COMPANY']."' ORDER BY ID ;";
		ZAP_SQL($ZAP_SQL);

		$MAKE_ORDERER_TELBOX_USERS = mysql_numrows($result);
		$MAKE_ORDERER_TELBOX_USERS="( <b>$MAKE_ORDERER_TELBOX_USERS</b> aktywnych )";

		$ZAP_SQL = "select T_TELBOX_NAME,' | ' from TELBOXES where T_TELBOX_NEIGHBOUR_IN='".$_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_TELBOX_ADDRESS']."' and A_ADM_COMPANY like '".$_SESSION['ADM_COMPANY']."' ORDER BY T_TELBOX_NAME ";
		ZAP_SQL($ZAP_SQL);
		while ($h = mysql_fetch_row($result)) {
			foreach ($h as $value) {
				$MAKE_ORDERER_TELBOX_MAGISTRAL = $MAKE_ORDERER_TELBOX_MAGISTRAL . " $value";
			}
		}
		$MAKE_ORDERER_TELBOX_MAGISTRAL_OUT_COUNT = mysql_numrows($result);

		//PATCH 2003-09-30 for BUILDINGS
		$ZAP_SQL = "select '<b>',t1.S_ADDRESS_STREET,'</b> | ',t1.A_STATUS,t1.S_ADMIN_NAME,t1.P_ADMIN_NAME from BUILDINGS as t1, TELBOXES as t2 where t2.T_TELBOX_NAME='".$_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_TELBOX_ADDRESS']."' and t1.S_ADDRESS_STREET = t2.T_TELBOX_BUILDING_IN and t1.A_ADM_COMPANY like '".$_SESSION['ADM_COMPANY']."' ORDER BY t1.S_ADDRESS_STREET ";
		ZAP_SQL($ZAP_SQL);
		while ($h = mysql_fetch_row($result)) {
			foreach ($h as $value) {
				$MAKE_ORDERER_BUILDING_INFO = $MAKE_ORDERER_BUILDING_INFO . " $value";
			}
		}
		$MAKE_ORDERER_BUILDING_INFO_COUNT = mysql_numrows($result);

		$ZAP_SQL = "select t1.B_INVENTORY_DATE from BUILDINGS as t1, TELBOXES as t2 where t2.T_TELBOX_NAME='".$_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_TELBOX_ADDRESS']."' and t1.S_ADDRESS_STREET = t2.T_TELBOX_BUILDING_IN and t1.A_ADM_COMPANY like '".$_SESSION['ADM_COMPANY']."' ORDER BY t1.S_ADDRESS_STREET ";
		ZAP_SQL($ZAP_SQL);
		while ($h = mysql_fetch_row($result)) {
			$MAKE_ORDERER_BUILDING_INVENTORY_DATE = $h[0];
		}
		//EOF BUILDING PATCH

		$ZAP_SQL = "select T_TELBOX_NEIGHBOUR_IN,' | ' from TELBOXES where T_TELBOX_NAME='".$_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_TELBOX_ADDRESS']."' and A_ADM_COMPANY like '".$_SESSION['ADM_COMPANY']."'  ORDER BY T_TELBOX_NAME ";
		ZAP_SQL($ZAP_SQL);
		while ($h = mysql_fetch_row($result)) {
			foreach ($h as $value) {
				$MAKE_ORDERER_TELBOX_MAGISTRAL_IN  = $MAKE_ORDERER_TELBOX_MAGISTRAL_IN . " $value";
			}
		}

		$ZAP_SQL = "select ID from $thiss->DETECT_TABLE_NAME where T_TELBOX_ADDRESS='".$_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_TELBOX_ADDRESS']."' and ( A_STATUS='NORMAL' or A_STATUS='WARNING' or A_STATUS='OFF_SOFT' or A_STATUS='MONITOR' )  and A_ADM_COMPANY like '".$_SESSION['ADM_COMPANY']."'  ORDER BY ID ;";
		ZAP_SQL($ZAP_SQL);
		$MAKE_ORDERER_TELBOX_USERS_COUNT = mysql_numrows($result);

//		$ZAP_SQL="select ID from DEVICES where T_TELBOX_NEIGHBOUR_IN='".$_SESSION[$thiss->DETECT_TABLE_COLUMN][EDITRECORD][T_TELBOX_ADDRESS]."'  and A_ADM_COMPANY like '".$_SESSION[ADM_COMPANY]."'  ORDER BY ID ;";
//		 ZAP_SQL($ZAP_SQL);

		$ZAP_SQL="select '<b>',T_DEVICE_TYPE,T_PRODUCER,'</b>(',T_DEVICE_PORTS_OK,')<b>',A_STATUS,A_STATUS_INFO,A_PROBLEM,'</b><font size=-2>',A_PROBLEM_DESC,S_ADDRESS_STREET,T_DEVICE_POWER,T_DEVICE_INFO,'Awar:',T_WORKPOINTS,'gwar.',T_GUARRANTY_EXPIRE,'</font><br>' from DEVICES where T_TELBOX_NEIGHBOUR_IN='".$_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_TELBOX_ADDRESS']."'  and A_ADM_COMPANY like '".$_SESSION['ADM_COMPANY']."'  ORDER BY ID ;";
		ZAP_SQL($ZAP_SQL);
		while ($h = mysql_fetch_row($result)) {
			foreach ($h as $value) {
				$MAKE_ORDERER_DEVICES_LIST  = $MAKE_ORDERER_DEVICES_LIST . " $value";
			}
		}
		$MAKE_ORDERER_DEVICES_COUNT = mysql_numrows($result);

		$ZAP_SQL = "select sum(T_DEVICE_PORTS_OK) from DEVICES where T_TELBOX_NEIGHBOUR_IN='".$_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_TELBOX_ADDRESS']."'  and A_ADM_COMPANY like '".$_SESSION['ADM_COMPANY']."' ORDER BY ID ;";
		ZAP_SQL($ZAP_SQL);
		while ($h = mysql_fetch_row($result)) {
			$MAKE_ORDERER_DEVICES_PORTS = $h[0];
		}

		$ZAP_SQL = "select '&nbsp; <b>',T_TELBOX_NAME,'</b> &nbsp;&nbsp;','STATUS:<b>', A_STATUS,'</b>(', A_STATUS_INFO, ') <br>Problemy:<b>', A_PROBLEM,'</b>(',A_PROBLEM_DESC,A_PROBLEM_DATE,')Termin_usuniecia:',S_OTHER_INFO, '<BR>Adresy:<b>',S_ADDRESS_CITY,S_ADDRESS_POST_CODE,S_ADDRESS_POST_OFFICE,S_ADDRESS_STREET,S_ADDRESS_HOUSE,'</b><br> Typ:<b>',T_TELBOX_TYPE,'</b><br>Zamkniecie:<b>',T_TELBOX_SAVE,'</b><br>Zasilanie:<b>',T_TELBOX_POWER,'</b><br>Inne inf: ',T_NETWORK_SERVER,'Instalowal:',T_WHO_CONNECTED,T_WHEN_CONNECTED from TELBOXES where T_TELBOX_NAME='".$_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_TELBOX_ADDRESS']."' and A_ADM_COMPANY like '".$_SESSION['ADM_COMPANY']."' ORDER BY ID limit 0,1 ;";
		ZAP_SQL($ZAP_SQL);
		while ($h = mysql_fetch_row($result)) {
			foreach ($h as $value) {
				$MAKE_ORDERER_DEVICE_TELBOX_INFO = $MAKE_ORDERER_DEVICE_TELBOX_INFO . " $value";
			}
		}

		if ($MAKE_ORDERER_DEVICES_COUNT == 0) {
			$MAKE_ORDERER_DEVICES_PORTS_FREE = "<table border=1><tr><td colspan=2 align=center><font size=-1 face=arial><b>Nieznana/niewykryta ilosc wolnych portow - ZINWENTARYZOWAC URZADZENIA W SZAFCE !!!!!!!</td></tr>
			<tr><td width=30%> NrSeryjny:</td><td>&nbsp; </td></tr><tr><td>Typ (np.SW8):</td><td>&nbsp;</td></tr><tr><td>Producent:</td><td>&nbsp;</td></tr><tr><td>Termin_gwarancji:</td><td align=center> - </td></tr><tr><td>Dostawca:</td><td>&nbsp;</td></tr><tr><td>Il.Sprawnych Portow:</td><td>&nbsp;</td></tr></table></font>";
		} else {
			if (!($MAKE_ORDERER_DEVICES_COUNT == 1)) {
				$MAKE_ORDERER_DEVICES_PORTS_FREE = $MAKE_ORDERER_DEVICES_PORTS - ($MAKE_ORDERER_DEVICES_COUNT * 2 ) + 1 - $MAKE_ORDERER_TELBOX_USERS_COUNT - $MAKE_ORDERER_TELBOX_MAGISTRAL_OUT_COUNT;
			} else {
				$MAKE_ORDERER_DEVICES_PORTS_FREE = $MAKE_ORDERER_DEVICES_PORTS - 1 - $MAKE_ORDERER_TELBOX_USERS_COUNT - $MAKE_ORDERER_TELBOX_MAGISTRAL_OUT_COUNT ;
			}
			$MAKE_ORDERER_DEVICES_PORTS_FREE = "Ilosc wolnych portow: <b>$MAKE_ORDERER_DEVICES_PORTS_FREE </b>";
		}
	}

	if (!($MAKE_ORDERER_DEVICE_TELBOX_INFO)) {
		$MAKE_ORDERER_DEVICE_TELBOX_INFO = "<table border=1><tr><td colspan=2 align=center><font size=-1 face=arial><b>ZINWENTARYZOWAC SZAFKE !!!!!!!</td></tr><tr><td width=30%> SZAFKA:</td><td>Ul.:_________ Nr:_____ Kl.:_____ Pietro:_____ </td></tr><tr><td>Typ :</td><td>&nbsp;</td></tr><tr><td>Zamkniecie:</td><td>&nbsp;</td></tr><tr><td>Zasilanie:</td><td align=center> &nbsp; </td></tr><tr><td>Magistrale IN/OUT:</td><td align=left>IN: &nbsp;</td></tr><tr><td>Abonenci:</td><td>&nbsp;</td></tr>
		<tr><td colspan=2 align=center><font size=-1 face=arial><b>ZINWENTARYZOWAC URZADZENIA W SZAFCE !!!!!!!</td></tr>
		<tr><td width=30%> NrSeryjny:</td><td>&nbsp; </td></tr><tr><td>Typ (np.SW8):</td><td>&nbsp;</td></tr><tr><td>Producent:</td><td>&nbsp;</td></tr><tr><td>Termin_gwarancji:</td><td align=center> - </td></tr><tr><td>Dostawca:</td><td>&nbsp;</td></tr><tr><td>Il.Sprawnych Portow:</td><td>&nbsp;</td></tr></table></font>
		";

	} else if (($MAKE_ORDERER_BUILDING_INFO_COUNT == 1) && (strlen($MAKE_ORDERER_BUILDING_INVENTORY_DATE) < 3)) {
		$MAKE_ORDERER_BUILDING_INFO = "<table border=1><tr><td colspan=2 align=center><font size=-1 face=arial><b>ZINWENTARYZOWAC BUDYNEK (ost. akt. $MAKE_ORDERER_BUILDING_INVENTORY_DATE) !!!!!!!</td></tr><tr><td colspan=2><font size=-1>$MAKE_ORDERER_BUILDING_INFO</font></td></tr></table></font>";
	} else if (($MAKE_ORDERER_BUILDING_INFO_COUNT == 1) && (strlen($MAKE_ORDERER_BUILDING_INVENTORY_DATE) > 3)) {
		$MAKE_ORDERER_BUILDING_INFO="<br>Inf.Budynkowa: $MAKE_ORDERER_BUILDING_INFO , data akt.: $MAKE_ORDERER_BUILDING_INVENTORY_DATE";
	}
	echo "
		  <HTML><BODY onload=\"javascript:printit();\">
		  <SCRIPT Language=\"Javascript\">
		 function printit(){
		  if (window.print) {
		   window.print() ;
	 	  } else {
		   var WebBrowser = '<OBJECT ID=\"WebBrowser1\" WIDTH=0 HEIGHT=0 CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>';M
		   document.body.insertAdjacentHTML('beforeEnd', WebBrowser);M
	           WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = \"\";  M
		  }
		 }
		 </script>";

	// 2012-10-03
	// TODO: empty $MAKE_ORDERER_BUILDING_INFO
	// TODO: pole P_SERVICE: $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['P_SERVICE']
	// TODO: brak pola P_SERVICE_CLASS: $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['P_SERVICE_CLASS']
	// TODO: brak pola P_DEVICE: $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['P_DEVICE']

	// fetch user data from `BILLING_USERS_ADD`
	$out_P_NAME = $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['P_NAME'];
	$out_P_PHONE = $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['P_PHONE'];
	$out_P_FAX = $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['P_FAX'];
	$sql = "select
			P_NAME
			, P_NAME_SECOND
			, P_ADDRESS_STREET
			, P_ADDRESS_HOME
			, P_ADDRESS_HOUSE
			, id_users
			, P_PHONE
			, P_FAX
			, P_CONTACT_PERSON
		from `BILLING_USERS_ADD`
		where `id_users`='" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['ID_BILLING_USERS'] . "'
	";
	ZAP_SQL($sql);
	if ($h = mysql_fetch_assoc($result)) {
		$out_P_NAME = $h['P_NAME'] . ' ' . $h['P_NAME_SECOND'];
		$out_P_PHONE = $h['P_PHONE'];
		$out_P_FAX = $h['P_FAX'];
	}

	// fetch user deal data from `DEALS_TABLE`
	$out_P_DEALNUMBER = $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['P_DEALNUMBER'];
	$out_P_DEAL_DATE = $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['P_DEAL_DATE'];
//	DEALS_TABLE.P_DEALPREFIX as DEALS_TABLE_P_DEALPREFIX , DEALS_TABLE.P_DEALNUMBER as DEALS_TABLE_P_DEALNUMBER , DEALS_TABLE.P_DEALNUMBER_OLD as DEALS_TABLE_P_DEALNUMBER_OLD ,
//	DEALS_TABLE.P_DEALDATE as DEALS_TABLE_P_DEALDATE,  DEALS_TABLE.P_DEALDATE_TERM  as DEALS_TABLE_P_DEALDATE_TERM 
//echo "P_DEAL_DATE".$TAB2."'$h->DEALS_TABLE_P_DEALDATE'".$TAB ;
//echo "P_DEALNUMBER".$TAB2."'".strstr($h->t6_BILLING_OWNER_EMAIL,'@')."/$h->DEALS_TABLE_P_DEALPREFIX/$h->DEALS_TABLE_P_DEALNUMBER $h->DEALS_TABLE_P_DEALNUMBER_OLD'".$TAB ;
//echo "P_DEALEXPIRE".$TAB2."'$h->DEALS_TABLE_P_DEALDATE_TERM'".$TAB ;
//echo "P_BILLING_NO".$TAB2."'$h->ID_SERVICES'".$TAB ;
	$sql = "select
			t2.A_STATUS as A_STATUS
			, t2.HANGUP_FROM
			, t2.HANGUP_TILL
			, t2.HANGUP_STATUS
			, t2.ABONAMENT_VALUE
			, d.P_DEALNUMBER
			, d.P_DEALDATE
		from `SERVICES` as t2
			left join `DEALS_TABLE` as d on (d.`ID`=t2.`ID_DEALS_TABLE`)
		where t2.`ID`='" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['ID_SERVICES'] . "'
	";
	ZAP_SQL($sql);
	if ($h = mysql_fetch_assoc($result)) {
		$out_P_DEALNUMBER = $h['P_DEALNUMBER'];
		$out_P_DEAL_DATE = $h['P_DEALDATE'];
	}

	// fetch user billing owner data from `BILLING_OWNER`
	$sql = "select
			BO.name1 as OPERATOR
		from BILLING_USERS BU
			join BILLING_OWNER BO on BU.BILLING_OWNER=BO.ID
		where BU.`ID`='" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['ID_BILLING_USERS'] . "'
	";
	ZAP_SQL($sql);
	if ($h = mysql_fetch_assoc($result)) {
		$out_OPERATOR = $h['OPERATOR'];
	}


	echo "<TABLE border=2 cellspacing=0 cellpadding=0 width=100%>
 		<TR><TD COLSPAN=2><font size=+1>

		<b>$ARG1_VAL</b></font> status: <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['A_STATUS'] . "</b> Nr <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['ID'] . "</b>  z dnia <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['A_PROBLEM_DATE'] . "</b><br>
		<font size=-1>Dodatk. Info. <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['A_STATUS_INFO'] . "</b> ---- Other Info:<b> " . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['S_OTHER_INFO'] . " </b>  Wystawil: <b>
		" . $_SESSION['ADM_NAME'] . "  <i>(" . $_SESSION['ADM_ACCOUNT'] . ")</i></b> Poziom:<b>" . $_SESSION['ADM_ADMIN_LEVEL'] . "</b> Zasieg: <b>" . $_SESSION['ADM_AREA'] . "(" . $_SESSION['ADM_COMPANY'] . ") </b>
		</TD></TR>
		<TR><TD COLSPAN=2>
		<b>Poziom problemu:</b><b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['A_PROBLEM'] . "</font> </b><br>
		Opis Problemu:<b> " . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['A_PROBLEM_DESC'] . " </b>
		</TD></TR>
		<TR>
		<TD><b><i>Dane Klienta</b></i></TD>
		<TD><b><i>Dane Uslugi</b></i></TD>
		</TR>
		
		<TR>
		<TD>
		Operator: <b>" .$out_OPERATOR . "</b><br>
		Umowa: <b>" . $out_P_DEALNUMBER . "</b> z dnia: <b>" . $out_P_DEAL_DATE . "</b><br>
		Abonent: <b>" . $out_P_NAME . "</b><br>
		Kontakty: <b>" . $out_P_PHONE . "</b> Fax:<b>" . $out_P_FAX . " </b><br>
		Adres: <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['S_ADDRESS_STREET'] . "</b> 
		<font size='-2'>
		Budynek: $MAKE_ORDERER_BUILDING_INFO 
		<hr>
		Telbox_info:$MAKE_ORDERER_DEVICE_TELBOX_INFO<hr>
		Dev: $MAKE_ORDERER_DEVICES_LIST<br>
		Port: $MAKE_ORDERER_DEVICES_PORTS_FREE<hr>
		Magist: $MAKE_ORDERER_TELBOX_MAGISTRAL IN: $MAKE_ORDERER_TELBOX_MAGISTRAL_IN<br>
		Sciezka: $A_DB_TELBOX_TRACE_PATH
		</font>
		</TD>
		<TD>
		<font size='-1'>
		Usluga <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['P_SERVICE'] . "</b><br>
		Klasa uslugi: <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['P_SERVICE_CLASS'] . "</b><br>
		Dodatkowe urzadzenie: <b>".  $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['P_DEVICE'] . "</b><br>
		Hostname: <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['S_HOST'] . "</b>  Domena: <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['S_DOMAIN'] . "</b><br>
		Username: <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['S_ACCOUNT'] . "</b> (" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['S_ALIAS'] . ")<br>
		Password: <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['S_PASSWD'] . "</b><br>
		IP: <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['S_IP'] . "</b><br>
		MAC: <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['S_HW'] . "</b>  MAC_STATUS: <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['S_HWSTAT'] . "</b><br>
		Telbox: <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_TELBOX_ADDRESS'] . "</b> / <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_TELBOX_PORT'] . "</b><br>
		Serwer Sieciowy : <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_NETWORK_SERVER'] . "</b> / <b>" . $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['T_TOPOLOGY_PLACE'] . "</b><br>
		Spotkania : Data <b> ".$_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['L_APPOITMENT_DATE']."</b> Pracownik:<b> ".$_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['L_APPOITMENT_USER']."</b> 
  		<br>Dlugosc spotkania: <b>".$_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['L_APPOITMENT_PERIOD']."min </b> Informacje dodatkowe:".$_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['L_APPOITMENT_INFO']." </b> 
		<br>Typ spotkania:<b>".$_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['L_APPOITMENT_TYPE']." </b>  <font size=-1>(ARRANGED=umowione)</font>
		<hr>
		</font>
		<font size='-2'>
		$MAKE_ORDERER_TELBOX_USERS_LIST $MAKE_ORDERER_TELBOX_USERS</font>
		</TD>
		</TR>
		<tr height=2></tr>
		<tr><td><font size=+1><b>Potwierdzenie Wykonania</b></font></td><td><font size=+1><b>$ARG1_VAL Wykonal</b></font></td></tr>
		<tr>
		<td>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		Rozpoczete platne godziny [....] x 30PLN<br>
		Dnia ........................ <br>
		<br>
		Podpis Abonenta .........................</td>
		<td><br>Dnia ........................<br>
		<br>
		Podpis Pracownika .........................</td>
		</tr>
		</table>
		<font size=-1>Program obslugi abonenta &copy;A.Binder 2001-2002</font>";
		echo "</table>";

	$_REQUEST['MENU_INIT'] = "DOL";
}
