|
|
@ -129,14 +129,14 @@ function getDataStat(respone){ |
|
|
|
|
|
|
|
|
|
|
|
function getData(respone) { |
|
|
|
function getData(respone) { |
|
|
|
// console.log(dataInstrument)
|
|
|
|
// console.log(dataInstrument)
|
|
|
|
console.log(respone) |
|
|
|
// console.log(respone)
|
|
|
|
console.log("---------------- Next") |
|
|
|
// console.log("---------------- Next")
|
|
|
|
console.log(respone.next)
|
|
|
|
// console.log(respone.next)
|
|
|
|
// console.log(respone.results)
|
|
|
|
// console.log(respone.results)
|
|
|
|
console.log(dataInstrument)
|
|
|
|
// console.log(dataInstrument)
|
|
|
|
dataInstrument = dataInstrument.concat(respone.results) |
|
|
|
dataInstrument = dataInstrument.concat(respone.results) |
|
|
|
console.log('*******ฬฬฬฬฬฬฬฬฬ*********')
|
|
|
|
// console.log('*******ฬฬฬฬฬฬฬฬฬ*********')
|
|
|
|
console.log(respone.results)
|
|
|
|
// console.log(respone.results)
|
|
|
|
var htmlText = '' |
|
|
|
var htmlText = '' |
|
|
|
var modalText = '' |
|
|
|
var modalText = '' |
|
|
|
|
|
|
|
|
|
|
@ -266,6 +266,10 @@ function getData(respone) { |
|
|
|
+'<div style="font-size:20px;margin-top:20px">ผู้ดูแล</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="cr'+i+'" name="cr'+i+'" placeholder="ผู้ดูแล" value="'+dataInstrument[i].caretaker+'"></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>' |
|
|
|
|
|
|
|
+'<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>' |
|
|
|
+'<div style="font-size:20px;margin-top:20px">วีดีโอ(youtube)</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>' |
|
|
|
+'<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 != ''){ |
|
|
|
if(document.getElementById("noteI").value != ''){ |
|
|
|
data.note = 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 != ''){ |
|
|
|
if(document.getElementById("YlI").value != ''){ |
|
|
|
data.model = document.getElementById("YlI").value |
|
|
|
data.model = document.getElementById("YlI").value |
|
|
|
} |
|
|
|
} |
|
|
|
if(dataUri.length != 0){ |
|
|
|
if(dataUri.length != 0){ |
|
|
|
data.clips = dataUri |
|
|
|
data.clips = dataUri |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(data) |
|
|
|
// console.log(data)
|
|
|
|
data = JSON.stringify(data) |
|
|
|
data = JSON.stringify(data) |
|
|
|
console.log(data) |
|
|
|
// console.log(data)
|
|
|
|
token = sessionStorage.getItem('token') |
|
|
|
token = sessionStorage.getItem('token') |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
type: "POST", |
|
|
|
type: "POST", |
|
|
@ -487,14 +494,15 @@ function addData(){ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function updateData(idData){ |
|
|
|
function updateData(idData){ |
|
|
|
console.log(document.getElementById("name"+idData)) |
|
|
|
// console.log(document.getElementById("name"+idData))
|
|
|
|
console.log(document.getElementById("note"+idData)) |
|
|
|
// console.log(document.getElementById("note"+idData))
|
|
|
|
console.log(document.getElementById("id"+idData)) |
|
|
|
// console.log(document.getElementById("id"+idData))
|
|
|
|
console.log(document.getElementById("cr"+idData)) |
|
|
|
// console.log(document.getElementById("cr"+idData))
|
|
|
|
dataUpdate = { |
|
|
|
dataUpdate = { |
|
|
|
'name':document.getElementById("name"+idData).value, |
|
|
|
'name':document.getElementById("name"+idData).value, |
|
|
|
'note':document.getElementById("note"+idData).value, |
|
|
|
'note':document.getElementById("note"+idData).value, |
|
|
|
'caretaker':document.getElementById("cr"+idData).value, |
|
|
|
'caretaker':document.getElementById("cr"+idData).value, |
|
|
|
|
|
|
|
'location':document.getElementById("lc"+idData).value, |
|
|
|
'instrument_id':document.getElementById("id"+idData).value, |
|
|
|
'instrument_id':document.getElementById("id"+idData).value, |
|
|
|
'model':document.getElementById("yl"+idData).value, |
|
|
|
'model':document.getElementById("yl"+idData).value, |
|
|
|
} |
|
|
|
} |
|
|
|