質問編集履歴

3

誤字

2018/01/12 09:41

投稿

cofee
cofee

スコア44

test CHANGED
File without changes
test CHANGED
@@ -90,7 +90,7 @@
90
90
 
91
91
  name: "本日の送信件数", //各データの名前
92
92
 
93
- data:[<?php echo $query; ?>
93
+ data:[<?php echo $sql; ?>
94
94
 
95
95
  ],
96
96
 

2

ソース追加

2018/01/12 09:41

投稿

cofee
cofee

スコア44

test CHANGED
File without changes
test CHANGED
@@ -68,6 +68,50 @@
68
68
 
69
69
  {{ Form::close() }}
70
70
 
71
+
72
+
73
+ .
74
+
75
+ .
76
+
77
+ .
78
+
79
+ <script>
80
+
81
+ .
82
+
83
+ .
84
+
85
+ .
86
+
87
+ series: [{ //グラフの中身(データの設定)
88
+
89
+ pointWidth: 50,
90
+
91
+ name: "本日の送信件数", //各データの名前
92
+
93
+ data:[<?php echo $query; ?>
94
+
95
+ ],
96
+
97
+ dataLabels:{
98
+
99
+ enabled:true,
100
+
101
+ color:'#000000'//各データ(数値)
102
+
103
+ }
104
+
105
+ }]
106
+
107
+ .
108
+
109
+ .
110
+
111
+ .
112
+
113
+ </script>
114
+
71
115
  ```
72
116
 
73
117
 

1

ソース追加

2018/01/12 09:40

投稿

cofee
cofee

スコア44

test CHANGED
File without changes
test CHANGED
@@ -21,3 +21,117 @@
21
21
 
22
22
 
23
23
  よろしくお願いします。
24
+
25
+ ```search.blade.php
26
+
27
+ {{ Form::open(['route' => ['time.search'], 'method' => 'post', 'id' => 'searchForm', 'name' => 'searchForm', 'class' => 'form-horizontal']) }}
28
+
29
+ <div class="row">
30
+
31
+ <div class="col-md-12">
32
+
33
+ <div class="panel-body">
34
+
35
+ <div class="form-group">
36
+
37
+ {{ Form::label('hiduke', '日付:', array('class' => 'col-sm-2 control-label')) }}
38
+
39
+ <div class="col-sm-10">
40
+
41
+ <div class="input-daterange input-group" id="datepicker">
42
+
43
+ {{ Form::tel('hiduke', null, ['class' => 'input-sm form-control', 'placeholder' => '入力', 'id' => 'hiduke']) }}
44
+
45
+ </div>
46
+
47
+ </div>
48
+
49
+ </div>
50
+
51
+ <div class="form-group">
52
+
53
+ <div class="col-sm-offset-2 col-sm-10">
54
+
55
+ <input type="submit" class="btn btn-default" id='compositeBtn' value="検索">
56
+
57
+ <input type="button" class="btn btn-default" id='clearBtn' value="クリア">
58
+
59
+ </div>
60
+
61
+ </div>
62
+
63
+ </div>
64
+
65
+ </div>
66
+
67
+ </div>
68
+
69
+ {{ Form::close() }}
70
+
71
+ ```
72
+
73
+
74
+
75
+ ```SearchController
76
+
77
+ public function index(){
78
+
79
+
80
+
81
+ return view('admin::time.search');
82
+
83
+ }
84
+
85
+
86
+
87
+ /**
88
+
89
+ * 検索
90
+
91
+ */
92
+
93
+ public function search(){
94
+
95
+ //入力値取得
96
+
97
+ $hiduke = Request::Input('hiduke');
98
+
99
+
100
+
101
+ //日付が入力されていない場合エラー
102
+
103
+ if(!$hiduke){
104
+
105
+ return redirect()->route("time.search")->withErrors('日付を入力してください。')->withInput();
106
+
107
+ }
108
+
109
+
110
+
111
+ $sql = Read::select(DB::raw('CONVERT(varchar,work_dt,111)'))
112
+
113
+ ->join('arrival','comp.key_no','=','arrival.key_no')
114
+
115
+ ->where((DB::raw('CONVERT(varchar,send_dt,111)')),'like',"$hiduke%")
116
+
117
+ ->groupBy((DB::raw('CONVERT(varchar,work,111)')))
118
+
119
+ ->count('send_dt');
120
+
121
+
122
+
123
+ return view('admin::time.search',['sql' => $sql]);
124
+
125
+ }
126
+
127
+ ```
128
+
129
+
130
+
131
+ ```routes.php
132
+
133
+ Route::get('time/search',['as' => 'time.search', 'uses' => 'SearchController@index']);
134
+
135
+ Route::post('time/search', ['as' => 'time.search', 'uses' => 'SearchController@search']);
136
+
137
+ ```