Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
queue
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
5
Merge Requests
5
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
Indra Raja
queue
Commits
98b4b32f
Commit
98b4b32f
authored
4 years ago
by
Indra Raja
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
menambahkan validasi dan udpate database
parent
0f6047ed
v1.10
2 merge requests
!9
V1.10
,
!8
V1.12
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
538 additions
and
763 deletions
+538
-763
module/Application/src/Controller/AdminController.php
module/Application/src/Controller/AdminController.php
+5
-5
module/Application/src/Controller/ApiController.php
module/Application/src/Controller/ApiController.php
+2
-4
module/Application/view/application/admin/dasboard.phtml
module/Application/view/application/admin/dasboard.phtml
+6
-0
module/Application/view/application/admin/keloladokter.phtml
module/Application/view/application/admin/keloladokter.phtml
+2
-2
public/action-js/antrian-js/action-admin.js
public/action-js/antrian-js/action-admin.js
+2
-0
public/action-js/antrian-js/action-panggil.js
public/action-js/antrian-js/action-panggil.js
+115
-0
public/action-js/antrian-js/action-registrasidokter.js
public/action-js/antrian-js/action-registrasidokter.js
+131
-138
public/antrian.sql
public/antrian.sql
+275
-614
No files found.
module/Application/src/Controller/AdminController.php
View file @
98b4b32f
...
...
@@ -28,12 +28,12 @@ class AdminController extends \Application\Master\GlobalActionController
$view
=
new
ViewModel
();
$result
=
new
Result
();
/* get url */
// $uri = $this->getRequest()->getUri();
// $baseurl = sprintf('//%s', $uri->getHost());
// $this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
// $this->headScript->appendFile('/action-js/index-js/action-listdata.js');
$uri
=
$this
->
getRequest
()
->
getUri
();
$baseurl
=
sprintf
(
'//%s'
,
$uri
->
getHost
());
$this
->
headScript
->
appendScript
(
' var baseURL = "'
.
$baseurl
.
'"'
);
$this
->
headScript
->
appendFile
(
'/action-js/antrian-js/action-panggil.js'
);
$this
->
layout
(
"layout/layoutAdmin"
);
return
$view
;
...
...
This diff is collapsed.
Click to expand it.
module/Application/src/Controller/ApiController.php
View file @
98b4b32f
...
...
@@ -54,7 +54,7 @@ class ApiController extends \Application\Master\GlobalActionController {
}
public
function
savedataAction
(){
if
(
$this
->
isLoggedIn
()){
$result
=
new
Result
();
$request
=
$this
->
getRequest
();
$post
=
$request
->
getPost
();
...
...
@@ -123,9 +123,7 @@ class ApiController extends \Application\Master\GlobalActionController {
}
catch
(
\Exception
$exc
)
{
$result
=
new
Result
(
0
,
1
,
$exc
->
getMessage
()
.
'-'
.
$exc
->
getTraceAsString
());
}
}
else
{
$result
=
new
Result
(
0
,
401
,
'Silahkan masuk untuk melanjutkan'
);
}
}
return
$this
->
getOutput
(
$result
->
toJson
());
}
...
...
This diff is collapsed.
Click to expand it.
module/Application/view/application/admin/dasboard.phtml
View file @
98b4b32f
<section
class=
"warn"
></section>
<select
name=
"voice"
id=
"voices"
disabled
>
</select><br><br>
<textarea
disabled
></textarea>
<button
id=
"submit"
onclick=
"speaker.speak();"
disabled
>
Text to Speech
</button>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
module/Application/view/application/admin/keloladokter.phtml
View file @
98b4b32f
...
...
@@ -97,7 +97,7 @@
<div
class=
"modal-body"
>
<form
id=
"myForm"
>
<input
type=
"
input
"
id=
"id_dokter"
class=
"form-control"
/></input>
<input
type=
"
hidden
"
id=
"id_dokter"
class=
"form-control"
/></input>
<div
class=
"form-group"
>
<label>
Nama Poli
</label>
...
...
This diff is collapsed.
Click to expand it.
public/action-js/antrian-js/action-admin.js
View file @
98b4b32f
...
...
@@ -152,6 +152,8 @@ $('#dokter').on('change', function () {
tampilangka
();
});
$
(
'
#no_antrian
'
).
html
(
'
-
'
);
function
tampilangka
()
{
var
iddokter
=
$
(
'
#dokter
'
).
val
();
...
...
This diff is collapsed.
Click to expand it.
public/action-js/antrian-js/action-panggil.js
0 → 100644
View file @
98b4b32f
const
SpeechRecognition
=
window
.
SpeechRecognition
||
window
.
webkitSpeechRecognition
;
var
recognition
=
new
SpeechRecognition
();
recognition
.
onresult
=
function
(
event
)
{
if
(
event
.
results
.
length
>
0
)
{
query
.
value
=
event
.
results
[
0
][
0
].
transcript
;
query
.
form
.
submit
();
}
}
var
Speaker
=
function
()
{
var
synth
var
utterance
var
voices
this
.
init
=
function
()
{
// CHECK FOR SPEECHSYNTHESIS API
if
(
!
(
window
.
speechSynthesis
))
{
warn
(
"
Your browser is not capable of speech synthesis.
"
)
return
}
// INITIALIZE SPEECH SYNTHESIS API ELEMENTS
synth
=
window
.
speechSynthesis
voices
=
synth
.
getVoices
()
utterance
=
new
SpeechSynthesisUtterance
(
"
Hello World!
"
);
// CHECK FOR AVAILABLE VOICES
if
(
voices
.
length
<=
0
)
{
warn
(
"
No voices are provided by either your browser or system.
"
)
return
}
// ADD VOICE INDICES
voices
.
forEach
(
function
(
voice
,
a
)
{
voice
.
voice_index
=
a
})
// POPULATE VOICES LIST AND ENABLE INPUT ELEMENTS
populateVoicesList
();
$
(
"
.warn
"
).
css
(
"
display
"
,
"
none
"
);
$
(
"
button#submit
"
).
removeAttr
(
"
disabled
"
);
$
(
"
textarea
"
).
removeAttr
(
"
disabled
"
);
$
(
"
select#voices
"
).
removeAttr
(
"
disabled
"
);
// SET AN ENGLISH VOICE AS DEFAULT
var
englishes
=
voices
.
filter
(
function
(
voice
)
{
return
voice
.
default
&&
voice
.
lang
.
substr
(
0
,
2
)
==
"
en
"
})
if
(
englishes
.
length
>
0
)
{
$
(
"
#voices option[value=
\"
"
+
englishes
[
0
].
voice_index
+
"
\"
]
"
).
prop
(
"
selected
"
,
true
)
}
clearInterval
(
timer
)
}
function
addVoices
(
languageName
,
filterBy
)
{
// Filter voices by filterBy function
var
filteredVoices
=
voices
.
filter
(
filterBy
)
// Add group only if there is at least one voice
if
(
filteredVoices
.
length
>
0
)
{
// Add optgroup
$
(
"
#voices
"
).
append
(
'
<optgroup label="
'
+
languageName
+
'
">
'
)
// Add option for each voice
filteredVoices
.
forEach
(
function
(
el
,
idx
,
arr
)
{
$
(
"
#voices
"
).
append
(
'
<option value="
'
+
el
.
voice_index
+
'
">
'
+
el
.
name
+
'
(
'
+
el
.
lang
+
'
)
'
+
'
</option>
'
)
})
// End optgroup
$
(
"
#voices
"
).
append
(
'
</optgroup>
'
)
}
}
function
warn
(
str
)
{
$
(
"
.warn
"
).
css
(
"
display
"
,
"
block
"
);
// $(".reason").append(str);
$
(
"
button#submit
"
).
attr
(
"
disabled
"
);
$
(
"
textarea
"
).
attr
(
"
disabled
"
);
$
(
"
select#voices
"
).
attr
(
"
disabled
"
);
}
function
getSelectedVoice
()
{
return
voices
[
$
(
"
#voices option:selected
"
).
val
()]
}
this
.
speak
=
function
()
{
// Cancel current voice if it's currently talking so new text can be read immediately
synth
.
cancel
();
// CREATE NEW UTTERANCE AND SPEAK IF VOICE IS AVAILABLE
utterance
=
new
SpeechSynthesisUtterance
(
$
(
"
textarea
"
).
val
());
var
selectedVoice
=
getSelectedVoice
()
if
(
selectedVoice
)
{
utterance
.
voice
=
selectedVoice
}
synth
.
speak
(
utterance
);
}
}
var
speaker
=
new
Speaker
()
var
timer
$
(
document
).
ready
(
function
()
{
$
(
"
.warn
"
).
css
(
"
display
"
,
"
none
"
);
timer
=
setInterval
(
function
()
{
speaker
.
init
();
},
3
);
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
public/action-js/antrian-js/action-registrasidokter.js
View file @
98b4b32f
...
...
@@ -26,8 +26,8 @@ $(document).ready(function () {
required
:
true
,
separator
:
'
:
'
,
duration
:
true
,
minimum
:
'
00:
10
'
,
maximum
:
'
00:
20
'
,
minimum
:
'
00:
01
'
,
maximum
:
'
00:
59
'
,
durationNegative
:
true
});
});
...
...
@@ -36,8 +36,8 @@ $(document).ready(function () {
required
:
true
,
separator
:
'
:
'
,
duration
:
true
,
minimum
:
'
0
6
:00
'
,
maximum
:
'
18
:00
'
,
minimum
:
'
0
0
:00
'
,
maximum
:
'
23
:00
'
,
durationNegative
:
true
});
});
...
...
@@ -233,7 +233,20 @@ function LoadDadta(id) {
});
}
function
kondisi
()
{
$
(
'
#tambah
'
).
on
(
'
click
'
,
function
()
{
SaveDataRegister
()
})
function
SaveDataRegister
(
param
)
{
let
ruang
=
$
(
"
#ruang option:selected
"
).
attr
(
"
value
"
);
let
poli
=
$
(
'
#poli option:selected
'
).
attr
(
"
value
"
);
let
dokter
=
$
(
'
#dokter option:selected
'
).
attr
(
"
value
"
);
...
...
@@ -242,6 +255,30 @@ function kondisi() {
let
antrian_akhir
=
$
(
'
#antrian_akhir
'
).
val
();
let
waktu_antrian
=
$
(
'
#waktu_antrian
'
).
val
();
let
jam_mulai
=
$
(
'
#jam_mulai
'
).
val
();
/* save data */
$
.
ajax
({
type
:
'
POST
'
,
dataType
:
'
json
'
,
url
:
baseURL
+
'
/api/saveregister
'
,
data
:
{
iruang
:
ruang
,
id
:
param
,
iantrian_all
:
antrian_all
,
//variable json diisi oleh variable yang menyimpan data inputan
iantrian_awal
:
antrian_awal
,
iantrian_akhir
:
antrian_akhir
,
iwaktu_antrian
:
waktu_antrian
,
ipoli
:
poli
,
idokter
:
dokter
,
ijam_mulai
:
jam_mulai
,
},
success
:
function
(
result
)
{
if
(
ruang
==
null
||
ruang
==
""
)
{
swal
({
title
:
""
,
...
...
@@ -362,51 +399,7 @@ function kondisi() {
});
return
false
;
}
}
$
(
'
#tambah
'
).
on
(
'
click
'
,
function
()
{
kondisi
()
SaveDataRegister
()
})
function
SaveDataRegister
(
param
)
{
let
ruang
=
$
(
"
#ruang option:selected
"
).
attr
(
"
value
"
);
let
poli
=
$
(
'
#poli option:selected
'
).
attr
(
"
value
"
);
let
dokter
=
$
(
'
#dokter option:selected
'
).
attr
(
"
value
"
);
let
antrian_all
=
$
(
'
#antrian_all
'
).
val
();
let
antrian_awal
=
$
(
'
#antrian_awal
'
).
val
();
let
antrian_akhir
=
$
(
'
#antrian_akhir
'
).
val
();
let
waktu_antrian
=
$
(
'
#waktu_antrian
'
).
val
();
let
jam_mulai
=
$
(
'
#jam_mulai
'
).
val
();
/* save data */
$
.
ajax
({
type
:
'
POST
'
,
dataType
:
'
json
'
,
url
:
baseURL
+
'
/api/saveregister
'
,
data
:
{
iruang
:
ruang
,
id
:
param
,
iantrian_all
:
antrian_all
,
//variable json diisi oleh variable yang menyimpan data inputan
iantrian_awal
:
antrian_awal
,
iantrian_akhir
:
antrian_akhir
,
iwaktu_antrian
:
waktu_antrian
,
ipoli
:
poli
,
idokter
:
dokter
,
ijam_mulai
:
jam_mulai
,
},
success
:
function
(
result
)
{
// console.log(result);
if
(
result
.
code
==
0
)
{
else
if
(
result
.
code
==
0
)
{
swal
({
title
:
"
<span style='color:#222'>Good Job!</span>
"
,
confirmButtonColor
:
"
#66BB6A
"
,
...
...
This diff is collapsed.
Click to expand it.
public/antrian.sql
View file @
98b4b32f
This diff is collapsed.
Click to expand it.
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