<?php
include("loginkey.php");//引入公共变量文件
include("include/config.php");//引入公共变量文件
include("include/common.php");//引入公共函数文件
?>
<!DOCTYPE html>
<html>
<head>
	<title><?=rinput(websitename)?>-后台管理系统</title>
<meta name="Keywords" content="<?=rinput(websitekey)?>" />
<meta name="Description" content="<?=rinput(websitedes)?>" />  
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	
    <!-- bootstrap -->
    <link href="css/bootstrap/bootstrap.css" rel="stylesheet" />
    <link href="css/bootstrap/bootstrap-responsive.css" rel="stylesheet" />
    <link href="css/bootstrap/bootstrap-overrides.css" type="text/css" rel="stylesheet" />

    <!-- libraries -->
    <link href="css/lib/jquery-ui-1.10.2.custom.css" rel="stylesheet" type="text/css" />
    <link href="css/lib/font-awesome.css" type="text/css" rel="stylesheet" />

    <!-- global styles -->
    <link rel="stylesheet" type="text/css" href="css/layout.css" />
    <link rel="stylesheet" type="text/css" href="css/elements.css" />
    <link rel="stylesheet" type="text/css" href="css/icons.css" />

    <!-- this page specific styles -->
    <link rel="stylesheet" href="css/compiled/index.css" type="text/css" media="screen" />    

 
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body>

    <!-- navbar头部导航 -->
<?php
 include("header.php");
 ?>
    <!-- end navbar头部导航 -->

    <!-- sidebar左侧导航开始 -->
 
<?php
 include("leftmenu.php");
 ?> 
    <!-- end sidebar左侧导航结果 -->


	<!-- main container -->
    <div class="content">
　　　　　
        <div id="pad-wrapper">
      　　　　   
            <div class="row-fluid">
                     <div style="margin:10px auto;font-size:18px;">栏目列表&nbsp;
                     <span style="font-size:14px;color:red;">Art代表文章模型，Shop代表商品模型。目录名代表生成html文件的目录名</span></div>
                    
                                      

                    <div class="row-fluid">
                        <table class="table table-hover">
                            <thead>
                                <tr>
                                    <th class="span3">
                                        
                                        栏目名称
                                    </th>
                                    <th class="span1">
                                        <span class="line"></span>目录名
                                    </th>
                                    <th class="span3">
                                        <span class="line"></span>SEO标题
                                    </th>
                                    <th class="span3">
                                        <span class="line"></span>状态
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <!-- 一级栏目 -->
                                 <?php
                                       $nmsql="select * from limao_nm where lm_nmid=0";
                                       $rs = limaors($nmsql);
                                       $row = array();
                                       while($row=mysql_fetch_object($rs)){
                                       ?>
                                       <form action="modif_namo_ok.php" method="post">
                                <tr class="first">
                                    <td>
                                                                       
                                          <img src="img/table-img.png" />
                                          <input type="hidden" value='<?=rinput($row->lm_id);?>' name="lm_id" />
                                          <input type="hidden" value='<?=rinput($row->lm_nmid);?>' name="lm_nmid" />
                                       　<?=rinput($row->lm_id);?> <input type="text" style="width:50%;" value='<?=rinput($row->lm_nmname);?>' name="lm_nmname" />
                                         <?php
                                         switch(rinput($row->lm_error)){
                                         	case "1":
                                         	echo "&nbsp;Art";
                                       	 break;
                                          case "2":
                                          echo "&nbsp;Shop";
                                          break;
                                          default:
                                          	
                                         	}
                                         ?>
                                    </td>
                                     <td class="description">
                                        <input type="text" style="width:70%;"  value='<?=rinput($row->lm_setname);?>' name="lm_setname" />
                                    </td>
                                    <td class="description">
                                        <input type="text" style="width:80%;" value='<?=rinput($row->lm_nmseo);?>' name="lm_nmseo" />
                                    </td>
                                    <td>
                                       
                                         <select name="lm_action" style="width:100px;height:30px;">
                                         <?php
                                         if($row->lm_action=="0"){
                                         echo "<option selected='' value='0' />前台隐藏";
                                         echo "<option value='1' />前台显示";
                                       }else{
                                       	  echo "<option value='0' />前台隐藏";
                                         echo "<option selected='' value='1' />前台显示";
                                         	}
                                         
                                         ?>
                                       
                                        </select>
                                       
                                      &nbsp; <input type="submit" class="btn-flat primary" value="修改" /> &nbsp;  
                                    
                                      <a href="del_namo_ok.php?lm_id=<?=rinput($row->lm_id);?>&lm_error=<?=rinput($row->lm_error);?>" class="btn-flat danger">删除</a>
                                      
                                    </td>
                                </tr></form>
                                 <?php
                                       $rjnmsql="select * from limao_nm where lm_nmid=". intval($row->lm_id);
                                       $rjrs = limaors($rjnmsql);
                                       $rjrow = array();
                                       while($rjrow=mysql_fetch_object($rjrs)){
                                       ?>
                                 <!--二级栏目-->
                                   <form action="modif_namo_ok.php" method="post">
                               <tr class="first">
                                    <td> 
                                       <div style="padding-left:15px;width:100%;">　
                                          <input type="hidden" value='<?=rinput($rjrow->lm_id);?>' name="lm_id" />
                                          <input type="hidden" value='<?=rinput($rjrow->lm_nmid);?>' name="lm_nmid" />
                                       　 <?=rinput($rjrow->lm_id);?> <input type="text" style="width:50%;" type="text" value='<?=rinput($rjrow->lm_nmname);?>' name="lm_nmname" />
                                        <?php
                                         switch(rinput($rjrow->lm_error)){
                                         	case "1":
                                         	echo "&nbsp;Art";
                                       	 break;
                                          case "2":
                                          echo "&nbsp;Shop";
                                          break;
                                          default:
                                          	
                                         	}
                                         ?>
                                       </div>
                                    </td>
                                      <td class="description">
                                      <input type="text" style="width:70%;" value='<?=rinput($rjrow->lm_setname);?>' name="lm_setname" />
                                    </td>
                                    <td class="description">
                                      <input type="text" style="width:80%;" value='<?=rinput($rjrow->lm_nmseo);?>' name="lm_nmseo" />
                                    </td>
                                    <td>
                                        <select name="lm_action" style="width:100px;height:30px;">
                                         <?php
                                         if($rjrow->lm_action=="0"){
                                         echo "<option selected='' value='0' />前台隐藏";
                                         echo "<option value='1' />前台显示";
                                       }else{
                                       	  echo "<option value='0' />前台隐藏";
                                         echo "<option selected='' value='1' />前台显示";
                                         	}
                                         
                                         ?>
                                       
                                        </select>
                                       
                                      &nbsp; <input type="submit" class="btn-flat primary" value="修改" /> &nbsp;  
                                    
                                      <a href="del_namo_ok.php?lm_id=<?=rinput($rjrow->lm_id);?>&lm_error=<?=rinput($rjrow->lm_error);?>" class="btn-flat danger">删除</a>
                                      
                                      
                                    </td>
                                </tr>
                                  </form>
                                <?
                              }
                            }
                                ?>
                                
                             
                                                              
                               
                               
                            </tbody>
                        </table>
                    </div>
               
                <!-- end products table -->
                     
                       
                    </div>
           
                <!-- end table sample -->
           
          </div>
      
    </div>

<div>LIMAOCMS　Copyright @ 2016. All rights reserved.</div>
	<!-- scripts -->
    <script src="js/jquery-latest.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/jquery-ui-1.10.2.custom.min.js"></script>
    <!-- knob -->
    <script src="js/jquery.knob.js"></script>
    <!-- flot charts -->
    <script src="js/jquery.flot.js"></script>
    <script src="js/jquery.flot.stack.js"></script>
    <script src="js/jquery.flot.resize.js"></script>
    <script src="js/theme.js"></script>

    <script type="text/javascript">
        $(function () {

            // jQuery Knobs
            $(".knob").knob();



            // jQuery UI Sliders
            $(".slider-sample1").slider({
                value: 100,
                min: 1,
                max: 500
            });
            $(".slider-sample2").slider({
                range: "min",
                value: 130,
                min: 1,
                max: 500
            });
            $(".slider-sample3").slider({
                range: true,
                min: 0,
                max: 500,
                values: [ 40, 170 ],
            });

            

            // jQuery Flot Chart
            var visits = [[1, 50], [2, 40], [3, 45], [4, 23],[5, 55],[6, 65],[7, 61],[8, 70],[9, 65],[10, 75],[11, 57],[12, 59]];
            var visitors = [[1, 25], [2, 50], [3, 23], [4, 48],[5, 38],[6, 40],[7, 47],[8, 55],[9, 43],[10,50],[11,47],[12, 39]];

            var plot = $.plot($("#statsChart"),
                [ { data: visits, label: "Signups"},
                 { data: visitors, label: "Visits" }], {
                    series: {
                        lines: { show: true,
                                lineWidth: 1,
                                fill: true, 
                                fillColor: { colors: [ { opacity: 0.1 }, { opacity: 0.13 } ] }
                             },
                        points: { show: true, 
                                 lineWidth: 2,
                                 radius: 3
                             },
                        shadowSize: 0,
                        stack: true
                    },
                    grid: { hoverable: true, 
                           clickable: true, 
                           tickColor: "#f9f9f9",
                           borderWidth: 0
                        },
                    legend: {
                            // show: false
                            labelBoxBorderColor: "#fff"
                        },  
                    colors: ["#a7b5c5", "#30a0eb"],
                    xaxis: {
                        ticks: [[1, "JAN"], [2, "FEB"], [3, "MAR"], [4,"APR"], [5,"MAY"], [6,"JUN"], 
                               [7,"JUL"], [8,"AUG"], [9,"SEP"], [10,"OCT"], [11,"NOV"], [12,"DEC"]],
                        font: {
                            size: 12,
                            family: "Open Sans, Arial",
                            variant: "small-caps",
                            color: "#697695"
                        }
                    },
                    yaxis: {
                        ticks:3, 
                        tickDecimals: 0,
                        font: {size:12, color: "#9da3a9"}
                    }
                 });

            function showTooltip(x, y, contents) {
                $('<div id="tooltip">' + contents + '</div>').css( {
                    position: 'absolute',
                    display: 'none',
                    top: y - 30,
                    left: x - 50,
                    color: "#fff",
                    padding: '2px 5px',
                    'border-radius': '6px',
                    'background-color': '#000',
                    opacity: 0.80
                }).appendTo("body").fadeIn(200);
            }

            var previousPoint = null;
            $("#statsChart").bind("plothover", function (event, pos, item) {
                if (item) {
                    if (previousPoint != item.dataIndex) {
                        previousPoint = item.dataIndex;

                        $("#tooltip").remove();
                        var x = item.datapoint[0].toFixed(0),
                            y = item.datapoint[1].toFixed(0);

                        var month = item.series.xaxis.ticks[item.dataIndex].label;

                        showTooltip(item.pageX, item.pageY,
                                    item.series.label + " of " + month + ": " + y);
                    }
                }
                else {
                    $("#tooltip").remove();
                    previousPoint = null;
                }
            });
        });
    </script>

</body>
</html>