Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Police_Traffic_Web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bruce
Police_Traffic_Web
Commits
187c3371
Commit
187c3371
authored
Aug 25, 2020
by
李崇誌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
account -v0.1
parent
bcb0ae80
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
246 additions
and
68 deletions
+246
-68
.name
.idea/.name
+1
-0
vcs.xml
.idea/vcs.xml
+6
-0
AccountController.php
app/Http/Controllers/AccountController.php
+1
-1
LogMiddleware.php
app/Http/Middleware/LogMiddleware.php
+1
-1
admin_acc.blade.php
resources/views/admin_acc.blade.php
+237
-66
No files found.
.idea/.name
0 → 100644
View file @
187c3371
Z:\
\ No newline at end of file
.idea/vcs.xml
0 → 100644
View file @
187c3371
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"Z:/"
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
app/Http/Controllers/AccountController.php
View file @
187c3371
...
...
@@ -63,6 +63,6 @@ class AccountController extends Controller
{
// 查詢
$user
=
User
::
where
(
'name'
,
$request
->
name
)
->
get
();
return
redirect
()
->
route
(
'account'
,[
'Users'
=>
$user
])
;
return
$user
;
}
}
app/Http/Middleware/LogMiddleware.php
View file @
187c3371
...
...
@@ -29,7 +29,7 @@ class LogMiddleware
else
{
$usernum
=
$request
->
user
(
'User'
)
->
id
;
//操作人(要自己獲取)
}
print
(
sprintf
(
"當前使用者ID: %s ,log 目前先不寫進資料庫,如果不想顯示此段訊息,或是想寫進資料庫,通知 Bruce"
,
$usernum
==
0
?
"訪客"
:
$usernum
));
//
print(sprintf("當前使用者ID: %s ,log 目前先不寫進資料庫,如果不想顯示此段訊息,或是想寫進資料庫,通知 Bruce",$usernum == 0 ? "訪客" : $usernum));
self
::
writeLog
(
$usernum
,
$input
,
$path
,
$method
,
$ip
);
return
$next
(
$request
);
...
...
resources/views/admin_acc.blade.php
View file @
187c3371
@
extends
(
'layouts.default'
)
@
section
(
'header'
)
<
link
rel
=
"stylesheet"
href
=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
>
<
link
rel
=
"stylesheet"
href
=
"
{
{asset('css/templatemo-style.css')}
}
"
>
{{
--
引入
jquery
相關套件
--
}}
<
script
src
=
"https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"
></
script
>
<
script
src
=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"
></
script
>
@
endsection
@
section
(
'content'
)
<
div
class
="
container
-
fluid
">
<div class="
tm
-
bg
-
light
tm
-
block
-
taller
"style="
padding
:
20
px
;
margin
-
bottom
:
100
px
">
<table class="
table
table
-
light
table
-
hover
">
<thead>
<tr>
<th scope="
col
">編號</th>
<th scope="
col
">車牌號碼</th>
<th scope="
col
">車種</th>
<th scope="
col
">經過日期</th>
<th scope="
col
">時間</th>
<th scope="
col
" >偵測地點</th>
<th scope="
col
">違規項目</th>
<th scope="
col
">違規案號</th>
<th scope="
col
" style="
text
-
align
:
center
">修改</th>
</tr>
</thead>
<tbody id="
result
">
<tr class="
car_info
" onclick="
toPhotos
()
">
<td>
<div class="
tm
-
status
-
circle
parking
">
</div>1
</td>
<td><b><a href="
#photos"></a>BMW-0857</b></td>
<
td
><
b
>
自小客車
</
b
></
td
>
<
td
><
b
>
2020
-
07
-
09
</
b
></
td
>
<
td
><
b
>
13
:
08
:
21
</
b
></
td
>
<
td
><
b
>
國道187km
</
b
></
td
>
<
td
><
b
>&
nbsp
;
</
b
></
td
>
<
td
><
b
>&
nbsp
;
</
b
></
td
>
<
td
>
{{
--
<
input
class
="
btn
btn
-
info
" disabled="
disabled
" type="
button
" value="
白
" style="
width
:
auto
;
text
-
align
:
center
;
font
-
weight
:
bold
;
">--}}
<input class="
btn
btn
-
primary4
" type="
button
" style="
width
:
auto
;
text
-
align
:
center
;
font
-
weight
:
bold
;
">
</td>
</tr>
<tr>
<td>
<div class="
tm
-
status
-
circle
cancelled
">
</div>2
</td>
<td><b>KLM-9999</b></td>
<td><b>大客車</b></td>
<td><b>2020-06-07</b></td>
<td><b>16:08:21</b></td>
<td><b>蘇花公路777km</b></td>
<td><b>未依速限行駛</b></td>
<td><b>9587654132</b></td>
<td>
{{-- <input class="
btn
btn
-
info
" disabled="
disabled
" type="
button
" value="
白
" style="
width
:
auto
;
text
-
align
:
center
;
font
-
weight
:
bold
;
">--}}
<input class="
btn
btn
-
primary4
" type="
button
" style="
width
:
auto
;
text
-
align
:
center
;
font
-
weight
:
bold
;
">
</td>
</tr>
</tbody>
</table> {{-- 表身 --}}
<hr style="
margin
:
0
px
;
">
<div class="
table
" style="
height
:
70
px
;
text
-
align
:
right
">
<span style="
margin
-
right
:
3
px
"class="
tm
-
block
-
title
">第1頁,共6頁</span>
<button style="
margin
-
top
:
20
px
" class="
btn
-
info
" >頁首</button>
<button class="
btn
-
info
">上一頁</button>
<button class="
btn
-
success
">1</button>
<button class="
btn
-
success
">2</button>
<button class="
btn
-
success
">3</button>
<button class="
btn
-
success
">4</button>
<button class="
btn
-
success
">5</button>
<span class="
tm
-
block
-
title
">...</span>
<button class="
btn
-
info
">下一頁</button>
<button style="
margin
-
right
:
5
px
" class="
btn
-
info
">頁尾</button>
</div> {{-- 表尾 --}}
<h2 style="
font
-
size
:
x
-
large
" class="
tm
-
block
-
title
">使用者管理介面</h2>
<ul class="
nav
nav
-
tabs
">
<li class="
active
"><a data-toggle="
tab
" href="
#home" id="show_account"><span class="glyphicon glyphicon-user"></span>帳號管理</a></li>
<
li
><
a
data
-
toggle
=
"tab"
href
=
"#Edit"
id
=
"edit_account"
style
=
"display: none"
><
span
class
="
glyphicon
glyphicon
-
pencil
"></span>編輯帳號</a></li>
<li><a data-toggle="
tab
" href="
#Create" id="create_account"><span class="glyphicon glyphicon-plus"></span>新增帳號</a></li>
</
ul
>
<
div
class
="
tab
-
content
">
<div id="
home
" class="
tab
-
pane
fade
in
active
" style="
padding
:
20
px
20
px
20
px
20
px
;
background
-
color
:
white
">
<table class="
table
tm
-
table
-
small
">
<thead>
<tr>
<th scope="
col
" style="
text
-
align
:
center
">姓名</th>
<th scope="
col
" style="
text
-
align
:
center
">權限等級</th>
<th scope="
col
" style="
text
-
align
:
center
">狀態</th>
<th scope="
col
" style="
text
-
align
:
center
">群組ID</th>
<th scope="
col
" style="
text
-
align
:
center
">編輯區</th>
</tr>
</thead>
<tbody>
@foreach(
$Users
as
$user
)
<form method="
post
" id="
send_S
" onsubmit="
return
false
" style="
display
:
inline
-
block
">
@csrf
<tr>
<td style="
vertical
-
align
:
middle
;
text
-
align
:
center
" id="
id
">{{$user -> name}}</td>
<td style="
vertical
-
align
:
middle
;
text
-
align
:
center
" id="
Auth_level
">{{$user -> Auth_level}}</td>
<td style="
vertical
-
align
:
middle
;
text
-
align
:
center
" id="
Status
">
<label style="
background
-
color
:
#2a9055;color: white;border-radius: 45px;padding: 3px;font-family: 'Microsoft JhengHei UI';">{{$user -> Status}}</label>
</
td
>
<
td
style
=
"vertical-align: middle;text-align: center"
id
=
"Group_ID"
>
{{
$user
->
Group_ID
}}
</
td
>
<
td
style
=
"vertical-align: middle;text-align: center"
>
<
input
type
=
"hidden"
value
=
"{{$user -> name}}"
name
=
"name"
>
<
input
class
="
btn
btn
-
primary4
" type="
submit
" value="" style="
width
:
auto
;
height
:
40
px
;
text
-
align
:
center
;
font
-
weight
:
bold
;
display
:
inline
-
block
;
" id="
btn_edit
" name="
{{
$user
->
name
}}
">
</form>
<form method="
post
" id="
send_D
" onsubmit="
return
false
" style="
display
:
inline
-
block
">
@csrf
<input type="
hidden
" value="
test2
" name="
name
">
<input class="
btn
btn
-
primary3
" type="
submit
" value="" style="
width
:
auto
;
height
:
40
px
;
text
-
align
:
center
;
font
-
weight
:
bold
;
display
:
inline
-
block
;
" id="
btn_delete
">
</td>
</tr>
</form>
@endforeach
</tbody>
</table>
{{-- <form method="
post
" id="
send_S
" onsubmit="
return
false
">--}}
{{-- @csrf--}}
{{-- --}}
{{-- </form>--}}
</div>
<div id="
Edit
" class="
tab
-
pane
fade
" style="
padding
:
20
px
20
px
20
px
20
px
;
background
-
color
:
white
">
<form method="
post
" id="
send_U
" onsubmit="
return
false
">
@csrf
<table class="
table
tm
-
table
-
small
" border="
1
">
<thead>
<th scope="
col
">資料欄位</th>
<th scope="
col
"></th>
</thead>
<tbody>
<tr>
<td width=20%>
帳號
</td>
<td width=max>
<input class="" type="
text
" style="
width
:
80
%
;
color
:
black
" id="
name
" name="
name
">
</td>
</tr>
<tr>
<td>
密碼
</td>
<td width=max>
<input class="" type="
password
" style="
width
:
80
%
;
color
:
black
" id="
password
" name="
password
">
</td>
</tr>
<tr>
<td>
權限等級
</td>
<td width=max>
<input class="" type="
number
" style="
width
:
80
%
;
color
:
black
" id="
Auth_level
" name="
Auth_level
">
</td>
</tr>
<tr>
<td>
群組ID
</td>
<td width=max>
<input class="" type="
text
" style="
width
:
80
%
;
color
:
black
" id="
Group_ID
" name="
Group_ID
">
</td>
</tr>
<tr align="
center
">
<td></td>
<td align="
left
">
<button class="
btn
btn
-
danger
" style="
vertical
-
align
:
middle
" type="
submit
"><label style="
font
-
family
:
'Microsoft JhengHei UI'
;
font
-
size
:
16
px
;
height
:
16
px
">保存</label></button>
<button class="
btn
btn
-
danger
" style="
vertical
-
align
:
middle
" type="
submit
"><label style="
font
-
family
:
'Microsoft JhengHei UI'
;
font
-
size
:
16
px
;
height
:
16
px
">取消</label></button>
</td>
</tr>
</tbody>
</table>
</form>
</div>
<div id="
Create
" class="
tab
-
pane
fade
" style="
padding
:
20
px
20
px
20
px
20
px
;
background
-
color
:
white
">
<form id="
send_C
" method="
post
" action="
{{
route
(
'acc_C'
)}}
">
{{ csrf_field() }}
<table class="
table
tm
-
table
-
small
" border="
1
">
<thead>
<th scope="
col
">資料欄位</th>
<th scope="
col
"></th>
</thead>
<tbody>
<tr>
<td width=20%>
帳號
</td>
<td width=max>
{{-- <input class="" type="
text
" style="
width
:
80
%
;
color
:
black
" id="
name
" name="
name
">--}}
<input id="
name
" type="
text
" class="
@
error
(
'name'
)
is
-
invalid
@
enderror
" name="
name
" value="
{{
old
(
'name'
)
}}
" required autocomplete="
name
" autofocus style="
width
:
80
%
;
color
:
black
">
@if(session('error'))
<span class="
text
-
danger
">
<strong>{{ session('error')}}</strong>
</span>
@endif
</td>
</tr>
<tr>
<td>
密碼
</td>
<td width=max>
<input class="" type="
text
" style="
width
:
80
%
;
color
:
black
" id="
password
" name="
password
">
</td>
</tr>
<tr>
<td>
權限等級
</td>
<td width=max>
<input class="" type="
text
" style="
width
:
80
%
;
color
:
black
" id="
Auth_level
" name="
Auth_level
">
</td>
</tr>
<tr>
<td>
狀態
</td>
<td width=max>
<input class="" type="
text
" style="
width
:
80
%
;
color
:
black
" id="
Status
" name="
Status
">
</td>
</tr>
<tr>
<td>
群組ID
</td>
<td width=max>
<input class="" type="
text
" style="
width
:
80
%
;
color
:
black
" id="
Group_ID
" name="
Group_ID
">
</td>
</tr>
<tr align="
center
">
<td></td>
<td align="
left
">
<button class="
btn
btn
-
danger
" style="
vertical
-
align
:
middle
" type="
submit
"><label style="
font
-
family
:
'Microsoft JhengHei UI'
;
font
-
size
:
16
px
;
height
:
16
px
">新增</label></button>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
</div>
<form action="
{{
route
(
'acc_C'
)}}
" method="
POST
">
{{ csrf_field() }}
帳號:<input id="
name
" type="
text
" class="
form
-
control
@
error
(
'name'
)
is
-
invalid
@
enderror
" name="
name
" value="
{{
old
(
'name'
)
}}
" required autocomplete="
name
" autofocus>
...
...
@@ -102,5 +209,69 @@
<input type="
submit
" value="
刪除
" />
</form>
</div>
<script>
$("
#send_S").submit(function(e) {
var
form
=
$
(
this
);
var
url
=
'{{route('
acc_R
')}}'
;
$
.
ajax
({
type
:
"POST"
,
url
:
url
,
data
:
form
.
serialize
(),
dataType
:
'json'
,
success
:
function
(
data
)
{
alert
(
JSON
.
stringify
(
data
))
$
(
'#show_account'
)
.
hide
();
$
(
'#create_account'
)
.
hide
();
$
(
'#edit_account'
)
.
show
();
$
(
'#edit_account'
)
.
click
();
},
error
:
function
(
data
){
alert
(
JSON
.
stringify
(
data
))
}
});
e
.
preventDefault
();
// avoid to execute the actual submit of the form.
});
</
script
>
<
script
>
$
(
"#send_D"
)
.
submit
(
function
(
e
)
{
var
form
=
$
(
this
);
var
url
=
'{{route('
acc_D
')}}'
;
$
.
ajax
({
type
:
"POST"
,
url
:
url
,
data
:
form
.
serialize
(),
dataType
:
'json'
,
success
:
function
(
data
)
{
alert
(
JSON
.
stringify
(
data
))
},
error
:
function
(
data
){
alert
(
JSON
.
stringify
(
data
))
}
});
e
.
preventDefault
();
// avoid to execute the actual submit of the form.
});
</
script
>
<
script
>
$
(
"#send_U"
)
.
submit
(
function
(
e
)
{
var
form
=
$
(
this
);
var
url
=
'{{route('
acc_U
')}}'
;
$
.
ajax
({
type
:
"POST"
,
url
:
url
,
data
:
form
.
serialize
(),
dataType
:
'json'
,
success
:
function
(
data
)
{
alert
(
"success"
)
},
error
:
function
(
data
)
{
alert
(
JSON
.
stringify
(
data
))
}
})
e
.
preventDefault
();
// avoid to execute the actual submit of the form.
})
</
script
>
{{
$Users
}}
@
endsection
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment