1
0
Fork 0
Browse Source

Add Location field

master
sipp11 8 years ago
parent
commit
9339793c8f
  1. 4
      instrument.html
  2. 32
      js/stdb.js

4
instrument.html

@ -129,6 +129,10 @@
<div style="font-size:20px;margin-top:10px">แล</div>
<div style="font-size:16px;margin-top:5px;margin-left:5px"><input type="text" id="CrI" name="CrI" value="" placeholder="ชอ นามสกล"></div>
</div>
<div>
<div style="font-size:20px;margin-top:10px">สถานท</div>
<div style="font-size:16px;margin-top:5px;margin-left:5px"><input type="text" id="LcI" name="LcI" value="" placeholder="สถานท"></div>
</div>
<div>
<div style="font-size:20px;margin-top:10px">โอ(youtube)</div>
<div style="font-size:16px;margin-top:5px;margin-left:5px"><input type="text" id="YlI" name="YlI" value="" placeholder="https://www.youtube.com/watch?v=xxxxx"></div>

32
js/stdb.js

@ -129,14 +129,14 @@ function getDataStat(respone){
function getData(respone) {
// console.log(dataInstrument)
console.log(respone)
console.log("---------------- Next")
console.log(respone.next)
// console.log(respone)
// console.log("---------------- Next")
// console.log(respone.next)
// console.log(respone.results)
console.log(dataInstrument)
// console.log(dataInstrument)
dataInstrument = dataInstrument.concat(respone.results)
console.log('*******ฬฬฬฬฬฬฬฬฬ*********')
console.log(respone.results)
// console.log('*******ฬฬฬฬฬฬฬฬฬ*********')
// console.log(respone.results)
var htmlText = ''
var modalText = ''
@ -266,6 +266,10 @@ function getData(respone) {
+'<div style="font-size:20px;margin-top:20px">ผแล</div>'
+'<div style="font-size:16px;margin-top:5px;margin-left:5px"><input type="text" id="cr'+i+'" name="cr'+i+'" placeholder="ผแล" value="'+dataInstrument[i].caretaker+'"></div>'
+'</div>'
+'<div>'
+'<div style="font-size:20px;margin-top:20px">สถานท</div>'
+'<div style="font-size:16px;margin-top:5px;margin-left:5px"><input type="text" id="lc'+i+'" name="lc'+i+'" placeholder="สถานท" value="'+dataInstrument[i].location+'"></div>'
+'</div>'
+'<div>'
+'<div style="font-size:20px;margin-top:20px">วโอ(youtube)</div>'
+'<div style="font-size:16px;margin-top:5px;margin-left:5px"><input type="text" id="yl'+i+'" name="yl'+i+'" placeholder="https://www.youtube.com/watch?v=xxxxx" value="'+dataInstrument[i].model+'"></div>'
@ -459,15 +463,18 @@ function addData(){
if(document.getElementById("noteI").value != ''){
data.note = document.getElementById("noteI").value
}
if(document.getElementById("LcI").value != ''){
data.location = document.getElementById("LcI").value
}
if(document.getElementById("YlI").value != ''){
data.model = document.getElementById("YlI").value
}
if(dataUri.length != 0){
data.clips = dataUri
}
console.log(data)
// console.log(data)
data = JSON.stringify(data)
console.log(data)
// console.log(data)
token = sessionStorage.getItem('token')
$.ajax({
type: "POST",
@ -487,14 +494,15 @@ function addData(){
}
function updateData(idData){
console.log(document.getElementById("name"+idData))
console.log(document.getElementById("note"+idData))
console.log(document.getElementById("id"+idData))
console.log(document.getElementById("cr"+idData))
// console.log(document.getElementById("name"+idData))
// console.log(document.getElementById("note"+idData))
// console.log(document.getElementById("id"+idData))
// console.log(document.getElementById("cr"+idData))
dataUpdate = {
'name':document.getElementById("name"+idData).value,
'note':document.getElementById("note"+idData).value,
'caretaker':document.getElementById("cr"+idData).value,
'location':document.getElementById("lc"+idData).value,
'instrument_id':document.getElementById("id"+idData).value,
'model':document.getElementById("yl"+idData).value,
}

Loading…
Cancel
Save