2014-03-14 23:35:35 +00:00
|
|
|
function sm_delete(id, mod) {
|
2014-01-10 10:03:07 +00:00
|
|
|
var del = confirm("Are you sure you want to delete this record?");
|
2014-03-21 15:38:48 +00:00
|
|
|
if (del === true) {
|
2014-03-14 23:35:35 +00:00
|
|
|
var loc = 'index.php?action=delete&id=' + id + '&mod=' + mod;
|
2014-01-10 10:03:07 +00:00
|
|
|
window.location = loc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-21 15:38:48 +00:00
|
|
|
function psm_tooltips() {
|
|
|
|
$('input[data-toggle="tooltip"]').tooltip({
|
2014-03-28 15:24:03 +00:00
|
|
|
'trigger':'hover',
|
2014-03-21 15:38:48 +00:00
|
|
|
'placement': 'right',
|
|
|
|
'container': 'body'
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2014-01-10 10:03:07 +00:00
|
|
|
function trim(str) {
|
|
|
|
return str.replace(/^\s+|\s+$/g,"");
|
|
|
|
}
|
2014-01-28 23:57:36 +00:00
|
|
|
|
2014-01-10 10:03:07 +00:00
|
|
|
//left trim
|
|
|
|
function ltrim(str) {
|
|
|
|
return str.replace(/^\s+/,"");
|
|
|
|
}
|
|
|
|
|
|
|
|
//right trim
|
|
|
|
function rtrim(str) {
|
|
|
|
return str.replace(/\s+$/,"");
|
2014-02-08 17:40:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function psm_flash_message(message) {
|
|
|
|
var flashmessage = $('#flashmessage');
|
|
|
|
if(flashmessage.length){
|
|
|
|
if(typeof message != 'undefined') {
|
|
|
|
flashmessage.html(message);
|
|
|
|
}
|
|
|
|
var t = flashmessage.html();
|
|
|
|
var c = trim(t);
|
|
|
|
var t = c.replace(' ', '');
|
|
|
|
if(t){
|
|
|
|
flashmessage.slideDown();
|
|
|
|
}
|
|
|
|
}
|
2014-01-28 23:57:36 +00:00
|
|
|
}
|