質問するログイン新規登録

質問編集履歴

3

誤字

2018/01/12 09:41

投稿

cofee
cofee

スコア44

title CHANGED
File without changes
body CHANGED
@@ -44,7 +44,7 @@
44
44
  series: [{ //グラフの中身(データの設定)
45
45
  pointWidth: 50,
46
46
  name: "本日の送信件数", //各データの名前
47
- data:[<?php echo $query; ?>
47
+ data:[<?php echo $sql; ?>
48
48
  ],
49
49
  dataLabels:{
50
50
  enabled:true,

2

ソース追加

2018/01/12 09:41

投稿

cofee
cofee

スコア44

title CHANGED
File without changes
body CHANGED
@@ -33,6 +33,28 @@
33
33
  </div>
34
34
  </div>
35
35
  {{ Form::close() }}
36
+
37
+ .
38
+ .
39
+ .
40
+ <script>
41
+ .
42
+ .
43
+ .
44
+ series: [{ //グラフの中身(データの設定)
45
+ pointWidth: 50,
46
+ name: "本日の送信件数", //各データの名前
47
+ data:[<?php echo $query; ?>
48
+ ],
49
+ dataLabels:{
50
+ enabled:true,
51
+ color:'#000000'//各データ(数値)
52
+ }
53
+ }]
54
+ .
55
+ .
56
+ .
57
+ </script>
36
58
  ```
37
59
 
38
60
  ```SearchController

1

ソース追加

2018/01/12 09:40

投稿

cofee
cofee

スコア44

title CHANGED
File without changes
body CHANGED
@@ -9,4 +9,61 @@
9
9
 
10
10
  初回アクセス時に変数を無いことにしたいのですができますでしょうか?
11
11
 
12
- よろしくお願いします。
12
+ よろしくお願いします。
13
+ ```search.blade.php
14
+ {{ Form::open(['route' => ['time.search'], 'method' => 'post', 'id' => 'searchForm', 'name' => 'searchForm', 'class' => 'form-horizontal']) }}
15
+ <div class="row">
16
+ <div class="col-md-12">
17
+ <div class="panel-body">
18
+ <div class="form-group">
19
+ {{ Form::label('hiduke', '日付:', array('class' => 'col-sm-2 control-label')) }}
20
+ <div class="col-sm-10">
21
+ <div class="input-daterange input-group" id="datepicker">
22
+ {{ Form::tel('hiduke', null, ['class' => 'input-sm form-control', 'placeholder' => '入力', 'id' => 'hiduke']) }}
23
+ </div>
24
+ </div>
25
+ </div>
26
+ <div class="form-group">
27
+ <div class="col-sm-offset-2 col-sm-10">
28
+ <input type="submit" class="btn btn-default" id='compositeBtn' value="検索">
29
+ <input type="button" class="btn btn-default" id='clearBtn' value="クリア">
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ {{ Form::close() }}
36
+ ```
37
+
38
+ ```SearchController
39
+ public function index(){
40
+
41
+ return view('admin::time.search');
42
+ }
43
+
44
+ /**
45
+ * 検索
46
+ */
47
+ public function search(){
48
+ //入力値取得
49
+ $hiduke = Request::Input('hiduke');
50
+
51
+ //日付が入力されていない場合エラー
52
+ if(!$hiduke){
53
+ return redirect()->route("time.search")->withErrors('日付を入力してください。')->withInput();
54
+ }
55
+
56
+ $sql = Read::select(DB::raw('CONVERT(varchar,work_dt,111)'))
57
+ ->join('arrival','comp.key_no','=','arrival.key_no')
58
+ ->where((DB::raw('CONVERT(varchar,send_dt,111)')),'like',"$hiduke%")
59
+ ->groupBy((DB::raw('CONVERT(varchar,work,111)')))
60
+ ->count('send_dt');
61
+
62
+ return view('admin::time.search',['sql' => $sql]);
63
+ }
64
+ ```
65
+
66
+ ```routes.php
67
+ Route::get('time/search',['as' => 'time.search', 'uses' => 'SearchController@index']);
68
+ Route::post('time/search', ['as' => 'time.search', 'uses' => 'SearchController@search']);
69
+ ```