Click . Call . Deal
';
}
if (custom_field['type'] == 'file') {
html += '
';
html += '';
html += '';
html += '';
html += '
';
}
if (custom_field['type'] == 'date') {
html += '
';
html += '
';
html += '
';
html += '';
html += '';
html += '';
html += '
';
html += '
';
}
if (custom_field['type'] == 'time') {
html += '
';
html += '
';
html += '
';
html += '';
html += '';
html += '';
html += '
';
html += '
';
}
if (custom_field['type'] == 'datetime') {
html += '
';
html += '
';
html += '
';
html += '';
html += '';
html += '';
html += '
';
html += '
';
}
}
}
html += '
';
$('#custom-fields').html(html);
$('.date').datetimepicker({
language: 'en-gb',
pickTime: false
});
$('.datetime').datetimepicker({
language: 'en-gb',
pickDate: true,
pickTime: true
});
$('.time').datetimepicker({
language: 'en-gb',
pickDate: false
});
$('button[id^=\'button-custom-field\']').on('click', function() {
var element = this;
$('#form-upload').remove();
$('body').prepend('
');
$('#form-upload input[name=\'file\']').trigger('click');
if (typeof timer != 'undefined') {
clearInterval(timer);
}
timer = setInterval(function() {
if ($('#form-upload input[name=\'file\']').val() != '') {
clearInterval(timer);
$.ajax({
url: 'index.php?route=tool/upload/upload',
type: 'post',
dataType: 'json',
data: new FormData($('#form-upload')[0]),
cache: false,
contentType: false,
processData: false,
beforeSend: function() {
$(element).button('loading');
},
complete: function() {
$(element).button('reset');
},
success: function(json) {
$(element).parent().find('.text-danger').remove();
if (json['error']) {
$(element).parent().find('input').after('
' + json['error'] + '
');
}
if (json['success']) {
alert(json['success']);
$(element).parent().find('input').val(json['code']);
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
}
}, 500);
});
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
$('select[name=\'filter_category\']').trigger('change');
//-->