Browse Source

certs admin finish

huangdong 6 years ago
parent
commit
afc34ce999
2 changed files with 26 additions and 2 deletions
  1. 12 1
      admin/control/index.php
  2. 14 1
      admin/templates/default/layout/index_layout.php

+ 12 - 1
admin/control/index.php

@@ -21,13 +21,24 @@ class indexControl extends SystemControl
 		Tpl::output('admin_info',$this->getAdminInfo());
 		//输出菜单
 		$this->getNav('',$top_nav,$left_nav,$map_nav);
+		$this->init_notice($notice);
 		Tpl::output('top_nav',$top_nav);
 		Tpl::output('left_nav',$left_nav);
 		Tpl::output('map_nav',$map_nav);
-
+		Tpl::output('notice',$notice);
 		Tpl::showpage('index','index_layout');
 	}
 
+	private function init_notice(&$notice)
+    {
+	    $certs = Model('room')->roomCerts(['cstatus'=>0],'cert_id',false);
+	    if(empty($certs)){
+            $notice['certs_num'] = 0;
+        }else{
+            $notice['certs_num'] = count($certs);
+        }
+    }
+
 	/**
 	 * 退出
 	 */

+ 14 - 1
admin/templates/default/layout/index_layout.php

@@ -280,4 +280,17 @@ function addFavorite(url, title) {
   </tbody>
 </table>
 </body>
-</html>
+<script>
+    init_notice();
+
+    function init_notice(){
+        var room_certs = "<?php echo $output['notice']['certs_num']; ?>";
+
+        if(room_certs > 0) {
+            var html = '<span>群聊('+room_certs+')</span>';
+            $("#nav_room").html(html);
+        }
+    }
+
+</script>
+</html>