From a3b5c4d369a11d0e44effd9898a97235f6c62fe8 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Tue, 23 Aug 2016 18:08:07 +0400 Subject: [PATCH] =?UTF-8?q?UISidebar=E6=94=B9=E6=88=90=E4=BE=9D=E6=8D=AE?= =?UTF-8?q?=E5=B1=8F=E5=B9=95=E5=AE=BD=E5=BA=A6=E8=87=AA=E9=80=82=E5=BA=94?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phptools.php | 4 ++++ ui_sidebar.php | 43 ++++++++++++++++++++++++------------------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/phptools.php b/phptools.php index 1080121..bd34e64 100644 --- a/phptools.php +++ b/phptools.php @@ -2,6 +2,10 @@ require_once 'tools.php'; + require_once 'tools_session.php'; + require_once 'form/form_editbox.php'; require_once 'form/form_button.php'; require_once 'form/form.php'; + + require_once 'ui_sidebar.php'; diff --git a/ui_sidebar.php b/ui_sidebar.php index 6f24406..e73343b 100644 --- a/ui_sidebar.php +++ b/ui_sidebar.php @@ -5,11 +5,30 @@ class UISideBar { - private $active=""; + private $active; + + private $screen_width; + private $screen_height; + + private $sidebar_width; //bootstarp中屏幕被分为12列宽,我们在PC桌面宽度环境,导航栏宽度设为1。手机/平板纵屏中,导航栏宽度设为2 public function __construct($a) { $this->active=$a; + + init_session(); + + $this->screen_width =$_SESSION["screen_width" ]; + $this->screen_height=$_SESSION["screen_height" ]; + + if($this->screen_width>$this->screen_height) //横向布局 + { + $this->sidebar_width=1; + } + else //纵向布局 + { + $this->sidebar_width=2; + } } private function echo_item($link,$text) @@ -24,30 +43,16 @@ private function echo_header() { - init_session(); + echo_html_header("ChinaMall ERP System"); - echo_html_header("CMI MoneyCabinet"); - - echo_title(); - - echo '

'; - - echo_span_label("primary",$_SESSION['service_hall_fullname']);echo' '; - echo_span_label("Warning",$_SESSION['usercode']);echo' '; - echo_span_label("default",$_SESSION['name']);echo' '; - echo_span_label("danger",$_SESSION['currency']); - - echo '

-
'; - - echo_hr(); + //echo_hr(); } public function start() { $this->echo_header(); - echo '
+ echo '
'; $this->echo_item("main", "现金总览" ); @@ -66,7 +71,7 @@ echo '
-
'; +
'; } public function end()