Release 1.16. Look in CHANGELOG.txt for changes.
[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     $local_stylesheet = $_SESSION['language']->get_stylesheet();
29         echo "<meta http-equiv='Content-type' content='text/html'; charset='$encoding'>";
30         echo "<link href='$local_path_to_root/themes/$theme/default.css' rel='stylesheet' type='text/css' /> \n";
31         if (file_exists($local_path_to_root. "/".$local_stylesheet))
32                 echo "<link href='$local_path_to_root/$local_stylesheet' rel='stylesheet' type='text/css' /> \n";
33         if ($js != "")
34                 echo $js;
35         echo "</head> \n";
36         if ($onload == "")
37                 echo "<body>";
38         else
39                 echo "<body onload=\"$onload\">";
40     echo "<table class='callout_main' border='0' cellpadding='0' cellspacing='0'>\n";
41         echo "<tr>\n";
42     echo "<td colspan='2' rowspan='2'>\n";
43
44         echo "<table class='main_page' border='0' cellpadding='0' cellspacing='0'>\n";
45         echo "<tr>\n";
46         echo "<td>\n";
47     echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
48         echo "<tr>\n";
49     echo "<td class='quick_menu'>\n";
50         if (!$no_menu)
51         {
52                 echo "<table cellpadding=0 cellspacing=0 width='100%'><tr><td>";
53                 echo "<div class=tabs>";
54                 echo "<a ".($sel_app == "orders" ? "class='selected' " : "")."href='$local_path_to_root/index.php?application=orders". SID ."'>" . _("Sales") . "</a>";
55                 echo "<a ".($sel_app == "AP" ? "class='selected' " : "")."href='$local_path_to_root/index.php?application=AP". SID ."'>" . _("Purchases") . "</a>";
56                 echo "<a ".($sel_app == "stock" ? "class='selected' " : "")."href='$local_path_to_root/index.php?application=stock". SID ."'>" . _("Items and Inventory") . "</a>";
57                 echo "<a ".($sel_app == "manuf" ? "class='selected' " : "")."href='$local_path_to_root/index.php?application=manuf". SID ."'>" . _("Manufacturing") . "</a>";
58                 echo "<a ".($sel_app == "proj" ? "class='selected' " : "")."href='$local_path_to_root/index.php?application=proj". SID ."'>" . _("Dimensions") . "</a>";
59                 echo "<a ".($sel_app == "GL" ? "class='selected' " : "")."href='$local_path_to_root/index.php?application=GL". SID ."'>" . _("Banking and General Ledger") . "</a>";
60                 echo "<a ".($sel_app == "system" ? "class='selected' " : "")."href='$local_path_to_root/index.php?application=system". SID ."'>" . _("Setup") . "</a>";
61                 echo "</div>";
62
63                 echo "</td></tr></table>";
64
65                 echo "<table class=logoutBar>";
66                 echo "<tr><td class=headingtext3>" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "</td>";
67                 echo "<td class=logoutBarRight><a href='$local_path_to_root/access/logout.php?'>" . _("Logout") . "</a>";
68                 echo "</td></tr></table>";
69         }
70
71         echo "</td></tr></table>";
72
73         if ($title && !$no_menu && !$is_index)
74         {
75                 echo "<center><table width='100%'><tr><td width='100%' class='titletext'>$title</td></tr></table></center>";
76         }
77
78         if (!$is_index)
79                 echo "<br>";
80 }
81
82 ?>