Files
amble_api/views/licensing.hbs
2025-07-15 15:54:43 +05:30

88 lines
3.2 KiB
Handlebars

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">window.jQuery || document.write('<script src="classes/commons/jquery/jquery-1.7.1.min.js"><\/script>')</script>
<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
</head>
<body>
<input type="checkbox" name="toggle" id="toggle" data-toggle="toggle" data-off="Disabled" data-on="Enabled">
<br><br>
<div class="panel panel-default">
<div class="panel-heading" id="heading">Status</div>
<div class="panel-body" id="body"></div>
</div>
<script>
$(document).ready(function() {
$('#toggle').prop('checked', false);
$.post("/api/getlicensingtoggledata",
{
toggleid : 3,
togglename : "BattleOfPerastQuest"
},
function(data,status){
console.log(data.message);
var defmode = data.message == 0 ? false : true ;
console.log(defmode);
if(defmode == false){
$("#body").html("inactive");
$.post("/api/updatelicensingtoggledata",
{
toggleid : 3,
togglename : "BattleOfPerastQuest",
togglestatus: "0"
},
function(data,status){
console.log(data.message);
});
}
else{
$("#body").html("active");
$('#toggle').prop("checked", true).change();
$.post("/api/updatelicensingtoggledata",
{
toggleid : 3,
togglename : "BattleOfPerastQuest",
togglestatus: "1"
},
function(data,status){
console.log(data.message);
});
}
});
$('#toggle').change(function(){
var mode= $(this).prop('checked');
if(mode){
$("#body").html("active");
$.post("/api/updatelicensingtoggledata",
{
toggleid : 3,
togglename : "BattleOfPerastQuest",
togglestatus: "1"
},
function(data,status){
console.log(data.message);
});
}else{
$("#body").html("inactive");
$.post("/api/updatelicensingtoggledata",
{
toggleid : 3,
togglename : "BattleOfPerastQuest",
togglestatus: "0"
},
function(data,status){
console.log(data.message);
});
}
});
});
</script>
</body>
</html>