big_design1.js
19.2 KB
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
//计划完成表的当前所选
var indexnum = 0;
var color=['#F35331','#2499F8','#3DF098','#33B734'];
var fontColor='#FFF';
//定义进度条组件和属性
var y_gauge1 =null;
var y_gauge2 =null;
var y_gauge3 =null;
var y_gauge4 =null;
var m_gauge1 =null;
var m_gauge2 =null;
var m_gauge3 =null;
var m_gauge4 =null;
var d_gauge1 =null;
var d_gauge2 =null;
var d_gauge3 =null;
var d_gauge4 =null;
var option_Progress =null;
//定义仪表盘组件和属性
var gauge1 =null;
var gauge2 =null;
var gauge3 =null;
var gauge4 =null;
var gauge5 =null;
var option_gauge =null;
//生产质量堆积图组件和属性
var quality_chart = null;
var quality_option=null;
//生产计划折线图组件和属性
var plan_chart = null;
var plan_option=null;
//环形图的风格定义
var dataStyle = {
normal: {
label: {show:false},
labelLine: {show:false}
}
};
var placeHolderStyle = {
normal : {
color: 'rgba(0,0,0,0.1)',
label: {show:false},
labelLine: {show:false}
},
emphasis : {
color: 'rgba(0,0,0,0)'
}
};
//最大订单号
var lastOrderNumber=1;
$(document).ready(function ()
{
//环形进度条设置对象
option_Progress={
title : {
text: '目前进度',
subtext: '50%',
x: 'center',
y: 90,
itemGap: 10,
textStyle : {
color : '#B7E1FF',
fontWeight: 'normal',
fontFamily : '微软雅黑',
fontSize : 24
},
subtextStyle:{
color: '#B7E1FF',
fontWeight: 'bolder',
fontSize:24,
fontFamily : '微软雅黑'
}
},
series : [{
type : 'pie',
center : ['50%', '50%'],
radius : [75,90],
x: '0%',
tooltip:{show:false},
data : [{
name:'达成率',
value:79,
itemStyle:{color :'rgba(0,153,255,0.8)'},
hoverAnimation: false,
label : {
show : false,
position : 'center',
textStyle: {
fontFamily:'微软雅黑',
fontWeight: 'bolder',
color:'#B7E1FF',
fontSize:24
}
},
labelLine : {
show : false
}
},
{
name:'79%',
value:21,
itemStyle:{color: 'rgba(0,153,255,0.1)'},
hoverAnimation: false,
label : {
show : false,
position : 'center',
padding:20,
textStyle: {
fontFamily:'微软雅黑',
fontSize: 24,
color:'#B7E1FF'
}
},
labelLine : {
show : false
}
}]
},
{
type : 'pie',
center : ['50%', '50%'],
radius : [95,100],
x: '0%',
hoverAnimation: false,
data : [{
value:100,
itemStyle:{color :'rgba(0,153,255,0.3)'},
label : {show : false},
labelLine : {show : false}
}]
},
{
type : 'pie',
center : ['50%', '50%'],
radius : [69,70],
x: '0%',
hoverAnimation: false,
data : [{
value:100,
itemStyle:{color :'rgba(0,153,255,0.3)'},
label : {show : false},
labelLine : {show : false}
}]
}]
};
//年仪表盘
y_gauge1 = echarts.init(document.getElementById('y_gauge1'));
y_gauge2 = echarts.init(document.getElementById('y_gauge2'));
y_gauge3 = echarts.init(document.getElementById('y_gauge3'));
y_gauge4 = echarts.init(document.getElementById('y_gauge4'));
//月仪表盘
m_gauge1 = echarts.init(document.getElementById('m_gauge1'));
m_gauge2 = echarts.init(document.getElementById('m_gauge2'));
m_gauge3 = echarts.init(document.getElementById('m_gauge3'));
m_gauge4 = echarts.init(document.getElementById('m_gauge4'));
//日仪表盘
d_gauge1 = echarts.init(document.getElementById('d_gauge1'));
d_gauge2 = echarts.init(document.getElementById('d_gauge2'));
d_gauge3 = echarts.init(document.getElementById('d_gauge3'));
d_gauge4 = echarts.init(document.getElementById('d_gauge4'));
//监控仪表盘
option_gauge = {
title: {
text: '', //标题文本内容
},
toolbox: { //可视化的工具箱
show: false,
},
tooltip: { //弹窗组件
formatter: "{a} <br/>{b} : {c}%"
},
series: [{
type: 'gauge',
axisLine: {// 坐标轴线
lineStyle: { // 属性lineStyle控制线条样式
color: [
[0.2, color[0]],
[0.8, color[1]],
[1, color[2]]
],
width: 18
}
},
splitLine: { // 分隔线
show:true,
length: 18,
lineStyle: {
color: '#28292D',
width: 1
}
},
axisTick : { //刻度线样式(及短线样式)
show:false,
lineStyle: {
color: 'auto',
width: 1
},
length : 20
},
axisLabel : {
color:'#FFF',
fontSize:14,
fontFamily:'Verdana, Geneva, sans-serif'
},
title: {
textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
fontWeight: 'bolder',
fontSize: 20,
color: '#FFF'
},
offsetCenter: [0, '30%']
},
pointer: {
width: 5,
color: '#F00',
shadowColor: '#FF0',
shadowBlur: 10
},
detail: {
show:false,
formatter:'{value}%',
textStyle:
{
fontFamily:'Arial',
color: '#000',
fontSize:'32px'
},
offsetCenter: [0, '90%']
},
data: [{value: 45, name: '水'}]
}]
};
gauge1 = echarts.init(document.getElementById('gauge1'));
gauge2 = echarts.init(document.getElementById('gauge2'));
gauge3 = echarts.init(document.getElementById('gauge3'));
gauge4 = echarts.init(document.getElementById('gauge4'));
gauge5 = echarts.init(document.getElementById('gauge5'));
option_gauge.series[0].axisLine.lineStyle.color=[[0.2, color[0]],[0.8, color[1]],[1, color[2]]];
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
option_gauge.series[0].data[0].name ="水";
$('#vg1').html(option_gauge.series[0].data[0].value);
gauge1.setOption(option_gauge);
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
option_gauge.series[0].data[0].name ="电";
$('#vg2').html(option_gauge.series[0].data[0].value);
gauge2.setOption(option_gauge);
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
option_gauge.series[0].data[0].name ="天然气";
$('#vg3').html(option_gauge.series[0].data[0].value);
gauge3.setOption(option_gauge);
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
option_gauge.series[0].data[0].name ="压缩空气";
$('#vg4').html(option_gauge.series[0].data[0].value);
gauge4.setOption(option_gauge);
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
option_gauge.series[0].data[0].name ="蒸汽";
$('#vg5').html(option_gauge.series[0].data[0].value);
gauge5.setOption(option_gauge);
//生产质量堆积图
quality_chart = echarts.init(document.getElementById('quality'));
quality_option={
title: {
show:false,
text: 'AUDIT',
left: 'center',
textStyle: {
color: '#F00',
fontSize:32
}
},
xAxis: {
data: ['1月10日','2月10日','3月10日','4月10日','5月10日','6月10日'],
axisLabel: {
textStyle: {
color: '#B7E1FF',
fontSize:24
}
},
axisLine:{
lineStyle:{
color:'#09F'
}
},
axisTick:{
lineStyle:{
color:'#09F'
}
}
},
yAxis: {
inverse: false,
splitArea: {show: false},
axisLine: {show: false},
axisTick: {show: false},
axisLabel: {
textStyle: {
color: '#B7E1FF',
fontSize:24,
fontFamily:'Arial',
}
},
splitLine :{
lineStyle:{
color:'#09F'
}
}
},
grid: {
left: 100
},
tooltip: {
trigger: 'item',
textStyle: {
color: '#B7E1FF',
fontSize:24
}
},
legend:{
show:false,
top: 'bottom',
textStyle: {
color: '#F00',
fontSize:24,
fontFamily:'微软雅黑'
},
data:['AUDIT分数1','AUDIT分数']
},
series: [
{
name: 'AUDIT分数1',
type: 'bar',
stack: 'one',
itemStyle:
{
normal: {color: color[1]}
},
barWidth : 60,
data:[2200,2900,3680,2200,2900,3680]
},
{
name: 'AUDIT分数',
type: 'bar',
stack: 'one',
itemStyle: {
normal: {
color: '#F90',
label: {
show: true,
position: 'insideTop',
textStyle: {
color: '#000',
fontSize:24
}
}
}
},
barWidth : 50,
data: [1800,1100,320,1800,1100,320]
}
]
};
quality_chart.setOption(quality_option);
//生产计划折线图
var plan_data1=[];
var plan_data2=[];
var plan_xAxis=[];
for (var i = 1; i <= 7; i++) {
plan_xAxis.push("3月"+i+"日");
plan_data1.push(Math.round(Math.random() * 100));
plan_data2.push(Math.round(Math.random() * 100));
}
plan_chart = echarts.init(document.getElementById('plan'));
plan_option={
xAxis: {
data:plan_xAxis,
axisLabel: {
textStyle: {
color: '#B7E1FF',
fontSize:24
}
},
axisLine:{
lineStyle:{
color:'#09F'
}
},
axisTick:{
lineStyle:{
color:'#09F'
}
}
},
yAxis: {
inverse: false,
splitArea: {show: false},
axisLine: {show: false},
axisTick: {show: false},
axisLabel: {
textStyle: {
color: '#B7E1FF',
fontSize:24,
fontFamily:'Arial',
}
},
splitLine :{
lineStyle:{
color:'#09F'
}
}
},
tooltip: {
trigger: 'axis',
textStyle: {
color: '#FFF',
fontSize:24
}
},
grid: {
left: 100
},
legend:{
show:false,
top: 'bottom',
textStyle: {
color: '#F00',
fontSize:24
},
data:['计划完成数','实际完成数']
},
series: [
{
name: '计划完成数',
type: 'bar',
itemStyle:
{
normal: {color: color[1]},
emphasis: {color: color[2]}
},
barWidth : 40,
data:plan_data1
},
{
name: '实际完成数',
type: 'line',
itemStyle: {
normal: {
color: '#F90',
label: {
show: true,
position: 'top',
textStyle: {
color: '#CCC',
fontSize:24
}
},
lineStyle:{
color:'#F90',
width:4
}
},
emphasis: {
color: '#FF0'
}
},
symbolSize: 24,
data: plan_data2
}
]
};
plan_chart.setOption(plan_option);
//轮番显示tips
function clock(){
showToolTip_highlight(plan_chart);
}
setInterval(clock, 5000);
//地图开始
var map_chart = echarts.init(document.getElementById('map'));
var CCData = [
[{name:'长春'}, {name:'上海',value:95}],
[{name:'长春'}, {name:'广州',value:90}],
[{name:'长春'}, {name:'大连',value:80}],
[{name:'长春'}, {name:'南宁',value:70}],
[{name:'长春'}, {name:'南昌',value:60}],
[{name:'长春'}, {name:'拉萨',value:50}],
[{name:'长春'}, {name:'长春',value:40}],
[{name:'长春'}, {name:'包头',value:30}],
[{name:'长春'}, {name:'重庆',value:20}],
[{name:'长春'}, {name:'北京',value:10}]
];
var series = [];
[['长春', CCData]].forEach(function (item, i) {
series.push({
name: '一汽汽车销售',
type: 'lines',
zlevel: 1,
effect: {
show: true,
period: 6,
trailLength: 0.7,
color: '#FF0',
symbolSize: 3
},
lineStyle: {
normal: {
color: '#000',
width: 0,
curveness: 0.2
}
},
data: convertData(item[1])
},
{
name: '一汽汽车销售',
type: 'lines',
zlevel: 2,
symbol: ['none', 'arrow'],
symbolSize: 10,
lineStyle: {
normal: {
color: '#FF0',
width: 1,
opacity: 0.6,
curveness: 0.2
}
},
data: convertData(item[1])
},
{
name: '一汽汽车销售',
type: 'effectScatter',
coordinateSystem: 'geo',
zlevel: 2,
rippleEffect: {
brushType: 'stroke'
},
label: {
normal: {
show: true,
position: 'right',
formatter: '{b}'
}
},
symbolSize: function (val) {
return 15;
},
itemStyle: {
normal: {
color: '#FFF',
label: {
show: true,
position: 'top',
textStyle: {
color: '#FFF',
fontSize:24
}
}
}
},
data: item[1].map(function (dataItem) {
return {
name: dataItem[1].name,
value: geoCoordMap[dataItem[1].name].concat([dataItem[1].value])
};
})
});
});
map_option = {
backgroundColor: '',
title : {
show:false,
text: '一汽汽车销售地域分布示意图',
subtext: '截至2018年05月04日',
left: 'center',
top:10,
textStyle : {
color: '#09F',
fontSize:32
},
subtextStyle:{
color: '#09F',
fontSize:24
}
},
tooltip : {
trigger: 'item'
},
legend: {
show:false,
orient: 'vertical',
top: 'bottom',
left: 'right',
data:['一汽汽车销售'],
textStyle: {
color: '#000'
},
selectedMode: 'single'
},
geo: {
map: 'china',
label: {
emphasis: {
show: false
}
},
roam: true,
itemStyle: {
normal: {
areaColor: '#09F',
borderColor: '#09F',
opacity:0.5
},
emphasis: {
areaColor: '#09F',
borderColor: '#09F',
opacity:0.8
}
}
},
series: series
};
map_chart.setOption(map_option, true);
resresh();
//开始定时刷新
setInterval(resresh, 5*1000);
});
var convertData = function (data) {
var res = [];
for (var i = 0; i < data.length; i++) {
var dataItem = data[i];
var fromCoord = geoCoordMap[dataItem[0].name];
var toCoord = geoCoordMap[dataItem[1].name];
if (fromCoord && toCoord) {
res.push({
fromName: dataItem[0].name,
toName: dataItem[1].name,
coords: [fromCoord, toCoord]
});
}
}
return res;
};
function showToolTip_highlight(mychart)
{
var echartObj = mychart;
// 高亮当前图形
var highlight =setInterval(function()
{
echartObj.dispatchAction({
type: 'highlight',
seriesIndex: 0,
dataIndex: indexnum
});
echartObj.dispatchAction({
type: 'showTip',
seriesIndex: 0,
dataIndex: indexnum
});
clearInterval(highlight);
indexnum = indexnum + 1;
if(indexnum>=7) indexnum=0;
},1000);
}
//定时刷新数据
function resresh()
{
var myDate = new Date();
// $('#refresh').html("<img src=\"images/wait.gif\" align=\"absmiddle\"><span>数据刷新中...</span>");
//年月日刷新
$('#currentYear').html(myDate.getFullYear()+"年");
$('#currentMonth').html(insertZero(myDate.getMonth()+1)+"月");
$('#currentDay').html(insertZero(myDate.getDate())+"日");
$('#currentDate').html(myDate.getFullYear()+"/"+insertZero(myDate.getMonth()+1)+"/"+insertZero(myDate.getDate()));
option_gauge.series[0].axisLabel.show=true;
option_gauge.series[0].axisLine.lineStyle.color=[[0.2, color[0]],[0.8, color[1]],[1, color[2]]]
var maxg=Math.round(Math.random()*500)+400;
var n1=Math.round(Math.random()*(maxg-100))+100;
var n2=Math.round(Math.random()*(n1-50))+50;
var n3=(n2/maxg*100).toFixed(2);
//年进度条
option_Progress.title.text ="计划生产";
option_Progress.series[0].data[0].value = maxg;
option_Progress.title.subtext =maxg+"台";
option_Progress.series[0].data[1].value =0;
y_gauge1.setOption(option_Progress);
option_Progress.title.text ="已接订单";
option_Progress.series[0].data[0].value = n1;
option_Progress.title.subtext =n1+"台";
option_Progress.series[0].data[1].value =(maxg-n1);
y_gauge2.setOption(option_Progress);
option_Progress.title.text ="已经完成";
option_Progress.series[0].data[0].value = n2;
option_Progress.title.subtext =n2+"台";
option_Progress.series[0].data[1].value =(maxg-n2);
y_gauge3.setOption(option_Progress);
option_Progress.title.text ="计划完成率";
option_Progress.series[0].data[0].value = n3;
option_Progress.title.subtext =n3+"%";
option_Progress.series[0].data[1].value =(100-n3);
y_gauge4.setOption(option_Progress);
//月进度条
maxg=Math.round(Math.random()*maxg)+1;
n1=Math.round(Math.random()*maxg)+1;
n2=Math.round(Math.random()*n1);
n3=(n2/maxg*100).toFixed(2);
option_Progress.title.text ="计划生产";
option_Progress.series[0].data[0].value = maxg;
option_Progress.title.subtext =maxg+"台";
option_Progress.series[0].data[1].value =0;
m_gauge1.setOption(option_Progress);
option_Progress.title.text ="已接订单";
option_Progress.series[0].data[0].value = n1;
option_Progress.title.subtext =n1+"台";
option_Progress.series[0].data[1].value =(maxg-n1);
m_gauge2.setOption(option_Progress);
option_Progress.title.text ="已经完成";
option_Progress.series[0].data[0].value = n2;
option_Progress.title.subtext =n2+"台";
option_Progress.series[0].data[1].value =(maxg-n2);
m_gauge3.setOption(option_Progress);
option_Progress.title.text ="计划完成率";
option_Progress.series[0].data[0].value = n3;
option_Progress.title.subtext =n3+"%";
option_Progress.series[0].data[1].value =(100-n3);
m_gauge4.setOption(option_Progress);
//日进度条
maxg=Math.round(Math.random()*maxg)+1;
n1=Math.round(Math.random()*maxg)+1;
n2=Math.round(Math.random()*n1);
n3=(n2/maxg*100).toFixed(2);
option_Progress.title.text ="计划生产";
option_Progress.series[0].data[0].value = maxg;
option_Progress.title.subtext =maxg+"台";
option_Progress.series[0].data[1].value =0;
d_gauge1.setOption(option_Progress);
option_Progress.title.text ="已接订单";
option_Progress.series[0].data[0].value = n1;
option_Progress.title.subtext =n1+"台";
option_Progress.series[0].data[1].value =(maxg-n1);
d_gauge2.setOption(option_Progress);
option_Progress.title.text ="已经完成";
option_Progress.series[0].data[0].value = n2;
option_Progress.title.subtext =n2+"台";
option_Progress.series[0].data[1].value =(maxg-n2);
d_gauge3.setOption(option_Progress);
option_Progress.title.text ="计划完成率";
option_Progress.series[0].data[0].value = n3;
option_Progress.title.subtext =n3+"%";
option_Progress.series[0].data[1].value =(100-n3);
d_gauge4.setOption(option_Progress);
//仪表盘刷新
option_gauge.series[0].axisLine.lineStyle.color=[[0.2, color[0]],[0.8, color[1]],[1, color[0]]];
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
option_gauge.series[0].data[0].name ="水";
$('#vg1').html(option_gauge.series[0].data[0].value);
gauge1.setOption(option_gauge);
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
option_gauge.series[0].data[0].name ="电";
$('#vg2').html(option_gauge.series[0].data[0].value);
gauge2.setOption(option_gauge);
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
option_gauge.series[0].data[0].name ="天然气";
$('#vg3').html(option_gauge.series[0].data[0].value);
gauge3.setOption(option_gauge);
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
option_gauge.series[0].data[0].name ="压缩空气";
$('#vg4').html(option_gauge.series[0].data[0].value);
gauge4.setOption(option_gauge);
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
option_gauge.series[0].data[0].name ="蒸汽";
$('#vg5').html(option_gauge.series[0].data[0].value);
gauge5.setOption(option_gauge);
//显示最后更新时间
$('#refresh').html("<span id=\"refreshTime\">最后刷新时间:"+myDate.toLocaleDateString()+" "+myDate.toLocaleTimeString()+"</span>");
}
//生成订单号
function getOrderNumber(n)
{
var no="000000"+n.toString();
return no.substring(no.length-6);
}
//前面补0
function insertZero(n)
{
var no="000000"+n.toString();
return no.substring(no.length-2);
}