830 lines
35 KiB
PHP
830 lines
35 KiB
PHP
<?php include('techsyn_header.php'); ?>
|
|
<?php include('log_entry.php'); ?>
|
|
<!-- Main Content Container for side bar and body-->
|
|
<div class="main-container ace-save-state" id="main-container">
|
|
<script type="text/javascript">
|
|
try {
|
|
ace.settings.loadState('main-container')
|
|
} catch (e) {}
|
|
</script>
|
|
<?php include('techsyn_sidebar.php'); ?>
|
|
|
|
<!--breadcrumb-->
|
|
<div class="main-content">
|
|
<div class="main-content-inner">
|
|
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
|
|
<ul class="breadcrumb">
|
|
|
|
<li class="#">Device</li>
|
|
<li class="active">Device Link</li>
|
|
</ul>
|
|
</div>
|
|
<?php
|
|
$i = 0;
|
|
if (isset($_REQUEST['link_id'])) {
|
|
$sql = "select a.*,b.* from checkup_parameter a left join device_param_map b on a.checkup_parameter_id = b.checkup_parameter_id where a.link_id= '" . $id . "' ";
|
|
// echo "query:".$sql;
|
|
$result = mysqli_query($conn, $sql);
|
|
$num_rows = @mysqli_num_rows($result);
|
|
$row = null;
|
|
if ($num_rows > 0) {
|
|
$row = @mysqli_fetch_array($result);
|
|
}
|
|
}
|
|
error_log("sql" . $sql);
|
|
// error_log("link_id".$result['link_id']);
|
|
// error_log("result".$result);
|
|
error_log("sql" . $sql);
|
|
?>
|
|
|
|
<div class="page-content">
|
|
<div class="box box-primary" style="padding: 10px; margin: 2px 0px 50px 5px; width: 99.5%;">
|
|
|
|
|
|
|
|
<form id="device_param_form" method="post">
|
|
<!-- box-body-->
|
|
|
|
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<input type="hidden" name="link_id" id="link_id" value="<?php echo $_REQUEST['link_id'] ?>">
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row" style="margin-left: 200px; margin-right: 200px">
|
|
<div class="col-sm-12">
|
|
<table id="myTable" class="table table-bordered order-list">
|
|
|
|
<thead>
|
|
<tr>
|
|
<th style="text-align: center">Parameter Name</th>
|
|
<th>Device</th>
|
|
<th>Device Param Code</th>
|
|
<th>Delete</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<?php
|
|
$row = null;
|
|
if (isset($_REQUEST['link_id'])) {
|
|
|
|
$sql = "select a.*,b.* from checkup_parameter a left join device_param_map b on a.checkup_parameter_id = b.checkup_parameter_id where link_id= '" . $_REQUEST['link_id'] . "' ";
|
|
$result = mysqli_query($conn, $sql);
|
|
$num_rows = @mysqli_num_rows($result);
|
|
$row = @mysqli_fetch_array($result);
|
|
error_log("sql" . $sql);
|
|
// error_log("link_id".$result['link_id']);
|
|
// error_log("result".$result);
|
|
error_log("sql" . $sql);
|
|
}
|
|
do {
|
|
?>
|
|
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
|
|
<td style="width: 40%"><input type="hidden" name="link_id" id="link_id" value="<?php echo $row['link_id'] ?>">
|
|
<select class="form-control select2" id="param_id<?php echo $i ?>" name="param_id<?php echo $i ?>" data-placeholder="Choose Parameter" style="width: 100%;">
|
|
<option value="">--select--</option>
|
|
<?php echo generate_options('select concat(c.parameter_name," SECTION ==> ",s.section_name) as name,c.checkup_parameter_id from checkup_parameter c left join checkup_form_section s on c.checkup_form_section_id=s.section_id where s.section_name != ""', $row['checkup_parameter_id'], 'checkup_parameter_id', 'name', '', '') ?>
|
|
</select>
|
|
</td>
|
|
|
|
|
|
<td style="width: 20%">
|
|
|
|
<select name="device<?= $i ?>" id="device<?= $i ?>" class="form-control">
|
|
<option value="">Please select a device</option>
|
|
<?php echo generateOption('device_master', 'device_name', 'device_id', $row['device_id'], ''); ?>
|
|
</select>
|
|
</td>
|
|
<td style="width: 20%">
|
|
<input type="text" name="code<?= $i ?>" id="code<?= $i ?>" class="form-control" value="<?= $row['device_param_code'] ?>">
|
|
</td>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
$i++;
|
|
} while ($row = @mysqli_fetch_array($result)) ?>
|
|
|
|
|
|
</tbody>
|
|
|
|
<tfoot>
|
|
<tr style="margin-left: 10px;">
|
|
<td colspan="6" style="text-align: left;"><input type="button" class="btn btn-lg btn-block " id="addrow" value="Add Row" /> <input type="hidden" name="count_items" id="count_items" value="1" /></td>
|
|
</tr>
|
|
</tfoot>
|
|
|
|
|
|
</table>
|
|
|
|
</div>
|
|
<div class="box-footer" style="text-align: center">
|
|
<button class="btn btn-info save_button" type="button" onclick="validate();">
|
|
<i class="ace-icon fa fa-floppy-o bigger-110"></i> Save
|
|
</button>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<!-- End of page-content -->
|
|
<!-- Main Content Container for side bar and body-->
|
|
<div class="main-container ace-save-state" id="main-container">
|
|
<script type="text/javascript">
|
|
try {
|
|
ace.settings.loadState('main-container')
|
|
} catch (e) {}
|
|
</script>
|
|
<!-- End of breadcrumb -->
|
|
<div class="main-content">
|
|
<div class="main-content-inner">
|
|
|
|
<!-- End of breadcrumb -->
|
|
|
|
<div class="page-content" style="margin-top: -47px;">
|
|
<div id="flexigridDiv" class="table-responsive">
|
|
<form name="device_param_form" method="post" action="" id="device_param_form">
|
|
<div id="flex1" style="width: 100%"></div>
|
|
<input type="hidden" name="link_id" id="link_id" />
|
|
|
|
</form>
|
|
<form name="export_form" method="post" id="export_form" action="">
|
|
|
|
|
|
<input type="hidden" name="pdf_action" id="pdf_action" value="ambulance_pdf.php" />
|
|
<input type="hidden" name="excel_action" id="excel_action" value="excel_ambulance.php" />
|
|
</form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
var w = screen.width * .90;
|
|
var h = 0;
|
|
h = (window.innerHeight - ($("#navbar").height() + $(".breadcrumbs").height())) * .75;
|
|
$("#flex1").flexigrid({
|
|
url: 'device_param_script.php',
|
|
dataType: 'json',
|
|
colModel: [{
|
|
display: ' ',
|
|
name: '',
|
|
width: w * .07,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Sr',
|
|
name: 'count',
|
|
width: w * .04,
|
|
sortable: false,
|
|
align: 'left'
|
|
},
|
|
|
|
{
|
|
display: 'Checkup Parameter',
|
|
name: 'param_id',
|
|
width: w * .6,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
|
|
{
|
|
display: 'Device',
|
|
name: 'device_id',
|
|
width: w * .2,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Device Code',
|
|
name: 'device_param_code',
|
|
width: w * .2,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
|
|
|
|
],
|
|
buttons: [
|
|
|
|
// {name: 'Add', bclass: 'add', onpress : add},
|
|
//{separator: true},
|
|
/*{name: 'PDF', bclass: 'print', onpress : pdf},
|
|
{separator: true},
|
|
{name: 'Excel', bclass: 'print_excel', onpress : excel},
|
|
{separator: true},*/
|
|
|
|
],
|
|
searchitems: [{
|
|
display: 'Device Name',
|
|
name: 'device_id',
|
|
isdefault: true
|
|
},
|
|
|
|
],
|
|
sortname: "a.device_id",
|
|
sortorder: "desc",
|
|
usepager: true, //pagination
|
|
|
|
useRp: true,
|
|
rp: 50, //records per page
|
|
showTableToggleBtn: false, //toggle button for the whole table
|
|
resizable: true,
|
|
//width: w,
|
|
height: h,
|
|
singleSelect: true
|
|
});
|
|
});
|
|
|
|
|
|
function delete_form(id) {
|
|
$("#link_id").val(id);
|
|
$.ajax({
|
|
url: 'delete_device_map.php',
|
|
data: {
|
|
link_id: id
|
|
},
|
|
type: 'POST',
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
|
|
if (data == 'SUCCESS') {
|
|
|
|
BootstrapDialog.alert('Deleted Successfully');
|
|
$("#flex1").flexReload();
|
|
return;
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error in deleting');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
function open_form(link_id, action) {
|
|
|
|
location.href = "device_param_link.php?link_id=" + link_id + "";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function pdf() {
|
|
window.open('pdf_procurement.php');
|
|
}
|
|
|
|
function excel() {
|
|
window.location = 'excel_procurement.php';
|
|
}
|
|
</script>
|
|
|
|
<script>
|
|
function validate() {
|
|
save();
|
|
}
|
|
$('.select2').select2()
|
|
</script>
|
|
|
|
<style>
|
|
#modal-add-ailment {
|
|
overflow-y: scroll;
|
|
}
|
|
</style>
|
|
|
|
|
|
|
|
<?php include('techsyn_footer.php'); ?>
|
|
<script type="text/javascript">
|
|
jQuery(function($) {
|
|
|
|
var myTable =
|
|
$('#dynamic-table')
|
|
|
|
.DataTable({
|
|
bAutoWidth: false,
|
|
"aoColumns": [{
|
|
"bSortable": false
|
|
},
|
|
null, null, null, null, null,
|
|
{
|
|
"bSortable": false
|
|
}
|
|
],
|
|
"aaSorting": [],
|
|
|
|
|
|
|
|
|
|
|
|
select: {
|
|
style: 'multi'
|
|
}
|
|
});
|
|
|
|
|
|
|
|
|
|
var defaultCopyAction = myTable.button(1).action();
|
|
myTable.button(1).action(function(e, dt, button, config) {
|
|
defaultCopyAction(e, dt, button, config);
|
|
$('.dt-button-info').addClass(
|
|
'gritter-item-wrapper gritter-info gritter-center white');
|
|
});
|
|
|
|
|
|
var defaultColvisAction = myTable.button(0).action();
|
|
myTable.button(0).action(function(e, dt, button, config) {
|
|
|
|
defaultColvisAction(e, dt, button, config);
|
|
|
|
|
|
if ($('.dt-button-collection > .dropdown-menu').length == 0) {
|
|
$('.dt-button-collection')
|
|
.wrapInner(
|
|
'<ul class="dropdown-menu dropdown-light dropdown-caret dropdown-caret" />'
|
|
)
|
|
.find('a').attr('href', '#').wrap("<li />")
|
|
}
|
|
$('.dt-button-collection').appendTo('.tableTools-container .dt-buttons')
|
|
});
|
|
|
|
|
|
|
|
setTimeout(function() {
|
|
$($('.tableTools-container')).find('a.dt-button').each(function() {
|
|
var div = $(this).find(' > div').first();
|
|
if (div.length == 1) div.tooltip({
|
|
container: 'body',
|
|
title: div.parent().text()
|
|
});
|
|
else $(this).tooltip({
|
|
container: 'body',
|
|
title: $(this).text()
|
|
});
|
|
});
|
|
}, 500);
|
|
|
|
|
|
|
|
|
|
|
|
myTable.on('select', function(e, dt, type, index) {
|
|
if (type === 'row') {
|
|
$(myTable.row(index).node()).find('input:checkbox').prop('checked',
|
|
true);
|
|
}
|
|
});
|
|
myTable.on('deselect', function(e, dt, type, index) {
|
|
if (type === 'row') {
|
|
$(myTable.row(index).node()).find('input:checkbox').prop('checked',
|
|
false);
|
|
}
|
|
});
|
|
|
|
|
|
|
|
|
|
$('th input[type=checkbox], td input[type=checkbox]').prop('checked', false);
|
|
|
|
|
|
$('#dynamic-table > thead > tr > th input[type=checkbox], #dynamic-table_wrapper input[type=checkbox]')
|
|
.eq(0).on('click', function() {
|
|
var th_checked = this.checked;
|
|
|
|
$('#dynamic-table').find('tbody > tr').each(function() {
|
|
var row = this;
|
|
if (th_checked) myTable.row(row).select();
|
|
else myTable.row(row).deselect();
|
|
});
|
|
});
|
|
|
|
|
|
$('#dynamic-table').on('click', 'td input[type=checkbox]', function() {
|
|
var row = $(this).closest('tr').get(0);
|
|
if (this.checked) myTable.row(row).deselect();
|
|
else myTable.row(row).select();
|
|
});
|
|
|
|
|
|
|
|
$(document).on('click', '#dynamic-table .dropdown-toggle', function(e) {
|
|
e.stopImmediatePropagation();
|
|
e.stopPropagation();
|
|
e.preventDefault();
|
|
});
|
|
|
|
|
|
|
|
|
|
var active_class = 'active';
|
|
$('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on('click', function() {
|
|
var th_checked = this.checked;
|
|
|
|
$(this).closest('table').find('tbody > tr').each(function() {
|
|
var row = this;
|
|
if (th_checked) $(row).addClass(active_class).find(
|
|
'input[type=checkbox]').eq(0).prop('checked', true);
|
|
else $(row).removeClass(active_class).find(
|
|
'input[type=checkbox]').eq(0).prop('checked', false);
|
|
});
|
|
});
|
|
|
|
$('#simple-table').on('click', 'td input[type=checkbox]', function() {
|
|
var $row = $(this).closest('tr');
|
|
if ($row.is('.detail-row ')) return;
|
|
if (this.checked) $row.addClass(active_class);
|
|
else $row.removeClass(active_class);
|
|
});
|
|
|
|
|
|
|
|
|
|
$('[data-rel="tooltip"]').tooltip({
|
|
placement: tooltip_placement
|
|
});
|
|
|
|
|
|
function tooltip_placement(context, source) {
|
|
var $source = $(source);
|
|
var $parent = $source.closest('table')
|
|
var off1 = $parent.offset();
|
|
var w1 = $parent.width();
|
|
|
|
var off2 = $source.offset();
|
|
|
|
|
|
if (parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2)) return 'right';
|
|
return 'left';
|
|
}
|
|
|
|
|
|
|
|
|
|
/***************/
|
|
$('.show-details-btn').on('click', function(e) {
|
|
e.preventDefault();
|
|
$(this).closest('tr').next().toggleClass('open');
|
|
$(this).find(ace.vars['.icon']).toggleClass('fa-angle-double-down')
|
|
.toggleClass('fa-angle-double-up');
|
|
});
|
|
/***************/
|
|
})
|
|
|
|
|
|
function save() {
|
|
$.ajax({
|
|
url: 'save_device_map.php ',
|
|
type: "POST",
|
|
data: $("#device_param_form").serialize(),
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
|
|
$("#link_id").val('');
|
|
|
|
|
|
// $("#flex1").flexReload();
|
|
// BootstrapDialog.alert("Saved Successfully");
|
|
|
|
BootstrapDialog.show({
|
|
title: 'Information',
|
|
message: 'Saved Successfully.',
|
|
buttons: [{
|
|
label: 'OK',
|
|
action: function(dialog) {
|
|
location.href = "device_param_link.php";
|
|
}
|
|
}]
|
|
});
|
|
|
|
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Saving');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
//location.href="requisition_list.php";
|
|
}
|
|
</script>
|
|
</div><!-- /.page-content -->
|
|
</div>
|
|
</div><!-- /.main-content -->
|
|
<!-- bootstrap & fontawesome -->
|
|
<link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />
|
|
|
|
<!-- page specific plugin styles -->
|
|
<link rel="stylesheet" href="assets/css/jquery-ui.custom.min.css" />
|
|
<link rel="stylesheet" href="assets/css/chosen.min.css" />
|
|
<link rel="stylesheet" href="assets/css/bootstrap-datepicker3.min.css" />
|
|
<link rel="stylesheet" href="assets/css/bootstrap-timepicker.min.css" />
|
|
<link rel="stylesheet" href="assets/css/daterangepicker.min.css" />
|
|
<link rel="stylesheet" href="assets/css/bootstrap-datetimepicker.min.css" />
|
|
<link rel="stylesheet" href="assets/css/bootstrap-colorpicker.min.css" />
|
|
<script type="text/javascript" src="js/typeahead.bundle.js"></script>
|
|
<script src="assets/js/jquery-ui.custom.min.js"></script>
|
|
<script src="assets/js/jquery.ui.touch-punch.min.js"></script>
|
|
<script src="assets/js/chosen.jquery.min.js"></script>
|
|
<script src="assets/js/spinbox.min.js"></script>
|
|
<script src="assets/js/bootstrap-datepicker.min.js"></script>
|
|
<script src="assets/js/bootstrap-timepicker.min.js"></script>
|
|
<script src="assets/js/jquery.dataTables.min.js"></script>
|
|
<script src="assets/js/jquery.dataTables.bootstrap.min.js"></script>
|
|
<script src="assets/js/dataTables.buttons.min.js"></script>
|
|
<script src="assets/js/buttons.flash.min.js"></script>
|
|
<script src="assets/js/buttons.html5.min.js"></script>
|
|
<script src="assets/js/buttons.print.min.js"></script>
|
|
<script src="assets/js/buttons.colVis.min.js"></script>
|
|
<script src="assets/js/dataTables.select.min.js"></script>
|
|
|
|
|
|
<script src="assets/js/moment.min.js"></script>
|
|
<script src="assets/js/daterangepicker.min.js"></script>
|
|
<script src="assets/js/bootstrap-datetimepicker.min.js"></script>
|
|
<script src="assets/js/bootstrap-colorpicker.min.js"></script>
|
|
<script src="assets/js/jquery.knob.min.js"></script>
|
|
<script src="assets/js/autosize.min.js"></script>
|
|
<script src="assets/js/jquery.inputlimiter.min.js"></script>
|
|
<script src="assets/js/jquery.maskedinput.min.js"></script>
|
|
<script src="assets/js/bootstrap-tag.min.js"></script>
|
|
<script src="assets/js/ace-elements.min.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
var counter = $("#count_items").val();
|
|
var itemOptions = "<?php echo generate_options('select concat(c.parameter_name," SECTION ==> ",s.section_name) as name,c.checkup_parameter_id from checkup_parameter c left join checkup_form_section s on c.checkup_form_section_id=s.section_id where s.section_name != ""', $row['checkup_parameter_id'], 'checkup_parameter_id', 'name', '', '') ?>";
|
|
|
|
var deviceOptions = "<?php echo generateOption('device_master', 'device_name', 'device_id', '', ''); ?>"
|
|
|
|
$("#addrow").on("click", function() {
|
|
var newRow = $("<tr>");
|
|
var cols = "";
|
|
var select_treatment = "";
|
|
var device_option = "";
|
|
select_treatment += "<select ";
|
|
select_treatment += "id=\"param_id" + counter + "\"name=\"param_id" + counter +
|
|
"\" class=\"form-control select2\" style=\"width:100%;\" data-placeholder=\"Choose Param\"";
|
|
|
|
|
|
select_treatment += ">";
|
|
|
|
select_treatment += "<option value=\"\"> </option>";
|
|
select_treatment += itemOptions
|
|
select_treatment += "</select>";
|
|
|
|
cols += ' <td>' + select_treatment + '</td>';
|
|
|
|
device_option += "<select ";
|
|
device_option += "id=\"device" + counter + "\"name=\"device" + counter +
|
|
"\" class=\"form-control\" style=\"width:100%;\" placeholder=\"Please select a Device \"";
|
|
|
|
|
|
device_option += ">";
|
|
|
|
device_option += "<option value=\"\"> </option>";
|
|
device_option += deviceOptions
|
|
device_option += "</select>";
|
|
|
|
|
|
cols +=
|
|
'<td>' + device_option + '</td>';
|
|
cols +=
|
|
'<td><input type="text" class="form-control" id="code' +
|
|
counter + '" name="code' + counter + '"/></td>';
|
|
|
|
cols +=
|
|
'<td align=\"center\"><a href="#" class="btn-lg" data-toggle="tooltip" title="Delete"><span class="glyphicon glyphicon-trash"></span></a></td>';
|
|
newRow.append(cols);
|
|
$("table.order-list").append(newRow);
|
|
|
|
|
|
counter++;
|
|
$('.select2').select2();
|
|
$("#count_items").val(counter);
|
|
$('.date-picker').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true
|
|
})
|
|
});
|
|
|
|
|
|
|
|
|
|
$("table.order-list").on("click", ".glyphicon", function(event) {
|
|
$(this).closest("tr").remove();
|
|
counter -= 1
|
|
$("#count_items").val(counter);
|
|
});
|
|
|
|
|
|
});
|
|
var unit_name = "";
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
jQuery(function($) {
|
|
$('#id-disable-check').on('click', function() {
|
|
var inp = $('#form-input-readonly').get(0);
|
|
if (inp.hasAttribute('disabled')) {
|
|
inp.setAttribute('readonly', 'true');
|
|
inp.removeAttribute('disabled');
|
|
inp.value = "This text field is readonly!";
|
|
} else {
|
|
inp.setAttribute('disabled', 'disabled');
|
|
inp.removeAttribute('readonly');
|
|
inp.value = "This text field is disabled!";
|
|
}
|
|
});
|
|
|
|
|
|
if (!ace.vars['touch']) {
|
|
$('.chosen-select').chosen({
|
|
allow_single_deselect: true
|
|
});
|
|
|
|
|
|
$(window)
|
|
.off('resize.chosen')
|
|
.on('resize.chosen', function() {
|
|
$('.chosen-select').each(function() {
|
|
var $this = $(this);
|
|
$this.next().css({
|
|
'width': $this.parent().width()
|
|
});
|
|
})
|
|
}).trigger('resize.chosen');
|
|
//resize chosen on sidebar collapse/expand
|
|
$(document).on('settings.ace.chosen', function(e, event_name, event_val) {
|
|
if (event_name != 'sidebar_collapsed') return;
|
|
$('.chosen-select').each(function() {
|
|
var $this = $(this);
|
|
$this.next().css({
|
|
'width': $this.parent().width()
|
|
});
|
|
})
|
|
});
|
|
|
|
|
|
$('#chosen-multiple-style .btn').on('click', function(e) {
|
|
var target = $(this).find('input[type=radio]');
|
|
var which = parseInt(target.val());
|
|
if (which == 2) $('#form-field-select-4').addClass('tag-input-style');
|
|
else $('#form-field-select-4').removeClass('tag-input-style');
|
|
});
|
|
}
|
|
|
|
|
|
$('[data-rel=tooltip]').tooltip({
|
|
container: 'body'
|
|
});
|
|
$('[data-rel=popover]').popover({
|
|
container: 'body'
|
|
});
|
|
|
|
autosize($('textarea[class*=autosize]'));
|
|
|
|
$('textarea.limited').inputlimiter({
|
|
remText: '%n character%s remaining...',
|
|
limitText: 'max allowed : %n.'
|
|
});
|
|
|
|
|
|
|
|
|
|
//"jQuery UI Slider"
|
|
//range slider tooltip example
|
|
$("#slider-range").css('height', '200px').slider({
|
|
orientation: "vertical",
|
|
range: true,
|
|
min: 0,
|
|
max: 100,
|
|
values: [17, 67],
|
|
slide: function(event, ui) {
|
|
var val = ui.values[$(ui.handle).index() - 1] + "";
|
|
|
|
if (!ui.handle.firstChild) {
|
|
$("<div class='tooltip right in' style='display:none;left:16px;top:-6px;'><div class='tooltip-arrow'></div><div class='tooltip-inner'></div></div>")
|
|
.prependTo(ui.handle);
|
|
}
|
|
$(ui.handle.firstChild).show().children().eq(1).text(val);
|
|
}
|
|
}).find('span.ui-slider-handle').on('blur', function() {
|
|
$(this.firstChild).hide();
|
|
});
|
|
|
|
|
|
$("#slider-range-max").slider({
|
|
range: "max",
|
|
min: 1,
|
|
max: 10,
|
|
value: 2
|
|
});
|
|
|
|
$("#slider-eq > span").css({
|
|
width: '90%',
|
|
'float': 'left',
|
|
margin: '15px'
|
|
}).each(function() {
|
|
// read initial values from markup and remove that
|
|
var value = parseInt($(this).text(), 10);
|
|
$(this).empty().slider({
|
|
value: value,
|
|
range: "min",
|
|
animate: true
|
|
|
|
});
|
|
});
|
|
|
|
$("#slider-eq > span.ui-slider-purple").slider('disable'); //disable third item
|
|
|
|
|
|
$('#id-input-file-1 , #id-input-file-2').ace_file_input({
|
|
no_file: 'No File ...',
|
|
btn_choose: 'Choose',
|
|
btn_change: 'Change',
|
|
droppable: false,
|
|
onchange: null,
|
|
thumbnail: false //| true | large
|
|
//whitelist:'gif|png|jpg|jpeg'
|
|
//blacklist:'exe|php'
|
|
//onchange:''
|
|
//
|
|
});
|
|
//pre-show a file name, for example a previously selected file
|
|
//$('#id-input-file-1').ace_file_input('show_file_list', ['myfile.txt'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//datepicker plugin
|
|
//link
|
|
$('.date-picker').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true
|
|
})
|
|
//show datepicker when clicking on the icon
|
|
.next().on(ace.click_event, function() {
|
|
$(this).prev().focus();
|
|
});
|
|
|
|
|
|
|
|
//chosen plugin inside a modal will have a zero width because the select element is originally hidden
|
|
//and its width cannot be determined.
|
|
//so we set the width after modal is show
|
|
$('#modal-form').on('shown.bs.modal', function() {
|
|
if (!ace.vars['touch']) {
|
|
$(this).find('.chosen-container').each(function() {
|
|
$(this).find('a:first-child').css('width', '210px');
|
|
$(this).find('.chosen-drop').css('width', '210px');
|
|
$(this).find('.chosen-search input').css('width', '200px');
|
|
});
|
|
}
|
|
})
|
|
/**
|
|
//or you can activate the chosen plugin after modal is shown
|
|
//this way select element becomes visible with dimensions and chosen works as expected
|
|
$('#modal-form').on('shown', function () {
|
|
$(this).find('.modal-chosen').chosen();
|
|
})
|
|
*/
|
|
|
|
|
|
|
|
$(document).one('ajaxloadstart.page', function(e) {
|
|
autosize.destroy('textarea[class*=autosize]')
|
|
|
|
$('.limiterBox,.autosizejs').remove();
|
|
$('.daterangepicker.dropdown-menu,.colorpicker.dropdown-menu,.bootstrap-datetimepicker-widget.dropdown-menu')
|
|
.remove();
|
|
});
|
|
|
|
});
|
|
</script>
|
|
|
|
<?php include('techsyn_footer.php'); ?>
|