4a74bb7ba4f914e192a32880e32c5573a78013de
[fa-stable.git] / includes / page / header.inc
1 <?php
2
3 function page_header($title, $no_menu=false, $is_index=false, $onload="", $js="")
4 {
5         // titles and screen header
6         global $db_connections, $path_to_root, $def_app;
7         $theme = user_theme();
8         $local_path_to_root = $path_to_root;
9
10         if (!isset($no_menu)) 
11         {
12                 $no_menu = false;
13         }
14         if (!isset($_SESSION["sel_app"]))
15                 session_register("sel_app");    
16         if (isset($_SESSION["App"]) && is_object($_SESSION["App"]) && isset($_SESSION["App"]->selected_application) && 
17                 $_SESSION["App"]->selected_application != "")
18                 $sel_app = $_SESSION["App"]->selected_application;
19         elseif (isset($_SESSION["sel_app"]) && $_SESSION["sel_app"] != "")
20                 $sel_app = $_SESSION["sel_app"];
21         else
22                 $sel_app = $def_app;
23         $_SESSION["sel_app"] = $sel_app;
24
25     echo "<html dir='" . $_SESSION['language']->dir . "' >";
26     echo "<head><title>$title</title>";
27     $encoding = $_SESSION['language']->encoding;
28         echo "<meta http-equiv='Content-type' content='text/html'; charset='$encoding'>";
29         echo "<link href='$local_path_to_root/themes/$theme/default.css' rel='stylesheet' type='text/css' /> \n";
30         echo "<link href='$local_path_to_root/" . $_SESSION['language']->get_stylesheet() . "' rel='stylesheet' type='text/css' /> \n";
31         if ($js != "")
32                 echo $js;
33         echo "</head> \n";
34         if ($onload == "")
35                 echo "<body>";
36         else
37                 echo "<body onload=\"$onload\">";
38     echo "<table class='callout_main' border='0' cellpadding='0' cellspacing='0'>\n";
39         echo "<tr>\n";
40     echo "<td colspan='2' rowspan='2'>\n";
41
42         echo "<table class='main_page' border='0' cellpadding='0' cellspacing='0'>\n";
43         echo "<tr>\n";
44         echo "<td>\n";
45     echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
46         echo "<tr>\n";
47     echo "<td class='quick_menu'>\n";
48         if (!$no_menu) 
49         {
50                 echo "<table cellpadding=0 cellspacing=0 width='100%'><tr><td>";
51                 echo "<div class=tabs>";
52                 echo "<a ".($sel_app == "orders" ? "class='selected' " : "")."href='$local_path_to_root/index.php?application=orders". SID ."'>" . _("Sales") . "</a>";
53                 echo "<a ".($sel_app == "AP" ? "class='selected' " : "")."href='$local_path_to_root/index.php?application=AP". SID ."'>" . _("Purchases") . "</a>";
54                 echo "<a ".($sel_app == "stock" ? "class='selected' " : "")."href='$local_path_to_root/index.php?application=stock". SID ."'>" . _("Items and Inventory") . "</a>";
55                 echo "<a ".($sel_app == "manuf" ? "class='selected' " : "")."href='$local_path_to_root/index.php?application=manuf". SID ."'>" . _("Manufacturing") . "</a>";
56                 echo "<a ".($sel_app == "proj" ? "class='selected' " : "")."href='$local_path_to_root/index.php?application=proj". SID ."'>" . _("Dimensions") . "</a>";
57                 echo "<a ".($sel_app == "GL" ? "class='selected' " : "")."href='$local_path_to_root/index.php?application=GL". SID ."'>" . _("Banking and General Ledger") . "</a>";
58                 echo "<a ".($sel_app == "system" ? "class='selected' " : "")."href='$local_path_to_root/index.php?application=system". SID ."'>" . _("Setup") . "</a>";
59                 echo "</div>";
60
61                 echo "</td></tr></table>";
62
63                 echo "<table class=logoutBar>";
64                 echo "<tr><td class=headingtext3>" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "</td>";
65                 echo "<td class=logoutBarRight><a href='$local_path_to_root/access/logout.php?'>" . _("Logout") . "</a>";
66                 echo "</td></tr></table>";
67         }
68
69         echo "</td></tr></table>";
70
71         if ($title && !$no_menu && !$is_index) 
72         {
73                 echo "<center><table width='100%'><tr><td width='100%' class='titletext'>$title</td></tr></table></center>";
74         }
75
76         if (!$is_index)
77                 echo "<br>";
78 }
79
80 ?>