colly_wyx
2017-08-11 0b55ac0050b2779383499c122182f82d0ce97f0f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
 
    <link rel="stylesheet" href="/themes/echats/css/echartsHome.css">
    <link rel="stylesheet" href="/themes/AdminLTE/plugins/daterangepicker/daterangepicker.css">
    <script type="text/javascript" src="/themes/AdminLTE/plugins/daterangepicker/moment.min.js"></script>
    <script type="text/javascript" src="/themes/AdminLTE/plugins/daterangepicker/daterangepicker.js"></script>
 
<style>
#time{text-align: center; font-size: 26px; padding: 20px 0;}
</style>
     <!-- Main content -->
    <section class="content">
      <div class="row">
        <div class="col-xs-12">
          <div class="box">
            <div id="time" style="">辐射数据表</div>
            <!-- /.box-header -->
            <div class="box-body">
              <div id="main" class="main"></div>
            </div>
            <!-- /.box-body -->
          </div>
        </div>
      </div>
      <div class="row">
      <div class="col-md-6">
        <div class="box box-primary">
            <div class="box-header with-border">
              <h3 class="box-title">平台通知</h3>
 
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
          <!-- /.box-header -->
          <div class="box-body">
            <ul class="products-list product-list-in-box">
            <?php foreach ($system_news as $key => $system_new):?>
              <li class="item">
                <i class="fa fa-file-text-o">   
                </i>
                <a href="/admin/index/look/id/<?php echo $system_new['_id']?>">
                &nbsp;&nbsp;<?php echo $system_new['name']?>
                 <span class=" pull-right">[<?php echo $system_new['create_time']?>]</span>
                </a>
              </li>
 
            <?php endforeach;?>
              
             
              <!-- /.item -->
            </ul>
          </div>
        </div>
        </div>
        <div class="col-md-6">
          <div class="box box-primary">
              <div class="box-header with-border">
                <h3 class="box-title">行业资讯</h3>
 
                <div class="box-tools pull-right">
                  <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                  </button>
                  <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
                </div>
              </div>
            <!-- /.box-header -->
            <div class="box-body">
              <ul class="products-list product-list-in-box">
              <?php foreach ($industry_news as $key => $industry_new):?>
                <li class="item">
                  <i class="fa fa-file-text-o">   
                  </i>
                  <a href="/admin/index/look/id/<?php echo $system_new['_id']?>">
                  &nbsp;&nbsp;<?php echo $industry_new['name']?>
                   <span class=" pull-right">[<?php echo $industry_new['create_time']?>]</span>
                  </a>
                </li>
 
              <?php endforeach;?>
                
               
                <!-- /.item -->
              </ul>
          </div>
          </div>
        </div>
      </div>
            <div class="row">
      <div class="col-md-6">
        <div class="box box-primary">
            <div class="box-header with-border">
              <h3 class="box-title">防辐射知识</h3>
 
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
          <!-- /.box-header -->
          <div class="box-body">
            <ul class="products-list product-list-in-box">
            <?php foreach ($ffs_news as $key => $ffs_new):?>
              <li class="item">
                <i class="fa fa-file-text-o">   
                </i>
                <a href="/admin/index/look/id/<?php echo $system_new['_id']?>">
                &nbsp;&nbsp;<?php echo $ffs_new['name']?>
                 <span class=" pull-right">[<?php echo $ffs_new['create_time']?>]</span>
                 </a>
              </li>
 
            <?php endforeach;?>
              
             
              <!-- /.item -->
            </ul>
          </div>
        </div>
        </div>
        <div class="col-md-6">
          <div class="box box-primary">
              <div class="box-header with-border">
                <h3 class="box-title">母婴知识</h3>
 
                <div class="box-tools pull-right">
                  <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                  </button>
                  <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
                </div>
              </div>
            <!-- /.box-header -->
            <div class="box-body">
              <ul class="products-list product-list-in-box">
              <?php foreach ($my_news as $key => $my_new):?>
                <li class="item">
                  <i class="fa fa-file-text-o">   
                  </i>
                  <a href="/admin/index/look/id/<?php echo $system_new['_id']?>">
                  &nbsp;&nbsp;<?php echo $my_new['name']?>
                   <span class=" pull-right">[<?php echo $my_new['create_time']?>]</span>
                  </a>
                </li>
 
              <?php endforeach;?>
                
               
                <!-- /.item -->
              </ul>
          </div>
          </div>
        </div>
      </div>
          </div>
          <!-- /.box -->
        </section>
    <script type="text/javascript" src="/themes/echats/js/echarts-all.js"></script>
<script>
    myChart = echarts.init(document.getElementById('main'));
    window.onresize = myChart.resize;
    var option = {
          title : {
              text: '辐射数据监控报表',
             // subtext: ''
          },
          tooltip : {
              trigger: 'axis'
          },
          calculable : true,
          xAxis : [
              {
                  type : 'category',
                  boundaryGap : false,
                  data : [
                  <?php foreach ($days_arr as $day): ?>
                  <?php echo "'".$day."',"?>  
                  <?php endforeach ?>
                  ]
              }
          ],
          yAxis : [
              {
                  type : 'value',
                  axisLabel : {
                      formatter: '{value}'
                  }
              }
          ],
          series : [
              {
                  name:'每日辐射平均值',
                  type:'line',
                  data:[
                    <?php $day_daily_arr[] =array();?>
                    <?php foreach ($user_dailys as $user_daily):?>
                    <?php $day_daily_arr[$user_daily['date']] = $user_daily['day_avg'];?>
                    <?php endforeach;?>
                    <?php foreach ($days_arr as $day): ?>
                    <?php if(isset($day_daily_arr[$day])):?>
                    <?php echo $day_daily_arr[$day].',';?>
                    <?php else:?>
                    0,
                    <?php endif;?>
                    <?php endforeach;?>
                  ],
                  markPoint : {
                      data : [
                          {type : 'max', name: '最大值'},
                          {type : 'min', name: '最小值'}
                      ]
                  },
              },
          ]
        };
      myChart.setOption(option);
 
      $(function(){    
       
 
        function getDay(add_days){
          var date = new Date();
          date.setDate(date.getDate()+add_days);
          var year = date.getFullYear();
          var month = date.getMonth()+1;
          var day = date.getDate();
          return year+"-0"+month+"-0"+day;
        }
 
        var start_time = getDay(-7);
        var end_time = getDay(-1);
        var max_time = getDay(-1);
        $('#time').text('辐射数据表['+start_time+" 至 "+ end_time + ']');
 
      });
</script>