<?php
/*=======================================================================
 *
 * invoice.php
 *
 * Autor: Carsten Annacker
 *
 =======================================================================*/

include_once("../include/global.inc.php");
include_once("../include/caglobal.inc.php");
include_once("../include/auth.inc.php");

list ($csc_id, $currentNavigationItem, $customerId, $cscIdRoot, $cscIdActual) = getHttpVars(array("csc_id", "currentNavigationItem", "customerId", "cscIdRoot", "cscIdActual"));
// Get the rights of the employee logged in and check the accessibility
if (!authCheckEmployeeRights($emp_id, "5")) : reportDie ("$PHP_SELF: Access denied!", false); endif;

list ($csc_id) = getHttpVars(array("csc_id"));
$usr_id = $HTTP_SESSION_VARS['usr_id'];
$usr_type = getFieldValueFromId("user", "usr_id", "$usr_id", "usr_type");
if ($usr_type == 2):
  // customer (employee)
  if ($csc_id == ""):
    $csc_id = getFieldValueFromId("employee", "usr_id", $usr_id, "csc_id");
  endif;
elseif ($usr_type == 1 || $usr_type == 0):
  // headquarter or sysadmin
  $csc_id = "";
else:
  reportDie ("$PHP_SELF: Ungültiger 'usr_type': '$usr_type'", false);
endif;

?>

<html>
<head>
<title>RECHNUNGS&Uuml;BERSICHT</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="Rechnungsdaten">
<script type="text/javascript">
function checkWidth (curWidth) {
  if (document.body.clientWidth < 1400) {
    document.getElementById("winInvoice").rows = "150,*";
  }
}
</script>
</head>

<frameset id="winInvoice" rows="125,*" border=0 onLoad="checkWidth()">
<!-- BEGIN csc_id_ -->
  <frame src="inv_header.php?csc_id=<?php echo $csc_id;?>&currentNavigationItem=<?php echo $currentNavigationItem;?>&customerId=<?php echo $customerId;?>&cscIdRoot=<?php echo $cscIdRoot;?>&cscIdActual=<?php echo $cscIdActual;?>" name="inv_header" scrolling="no" marginwidth=0 marginheight=0>
  <frameset cols="25%,75%" border=0>
    <frame src="inv_list.php?csc_id=<?php echo $csc_id;?>&csc_id_list=" name="inv_list" scrolling="yes" marginwidth=0 marginheight=0>
    <frame src="inv_details.php?csc_id=<?php echo $csc_id;?>" name="inv_details" scrolling="yes" marginwidth=0 marginheight=0>
  </frameset>
<!-- END csc_id_ -->
  <noframes>
    <p>Diese Seite benutzt Frames. Bitte benutzen Sie einen Browser, der Frames darstellen kann
    (z.B. Internet Explorer ab Version 3.0 oder Netscape ab Version 2.0).</p>
  </noframes>
</frameset>
</html>
