Deprecated: define(): Declaration of case-insensitive constants is deprecated in /home/bafflesol411/Bfs/application/config/constants.php on line 6
Deprecated: define(): Declaration of case-insensitive constants is deprecated in /home/bafflesol411/Bfs/application/config/constants.php on line 7
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/bafflesol411/Bfs/index.php:2)
Filename: hooks/Assets_handle.php
Line Number: 82
Backtrace:
File: /home/bafflesol411/Bfs/application/hooks/Assets_handle.php
Line: 82
Function: header
File: /home/bafflesol411/Bfs/application/hooks/Assets_handle.php
Line: 75
Function: handleFile
File: /home/bafflesol411/Bfs/application/hooks/Assets_handle.php
Line: 16
Function: handle_assets
File: /home/bafflesol411/Bfs/index.php
Line: 327
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/bafflesol411/Bfs/index.php:2)
Filename: hooks/Assets_handle.php
Line Number: 83
Backtrace:
File: /home/bafflesol411/Bfs/application/hooks/Assets_handle.php
Line: 83
Function: header
File: /home/bafflesol411/Bfs/application/hooks/Assets_handle.php
Line: 75
Function: handleFile
File: /home/bafflesol411/Bfs/application/hooks/Assets_handle.php
Line: 16
Function: handle_assets
File: /home/bafflesol411/Bfs/index.php
Line: 327
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/bafflesol411/Bfs/index.php:2)
Filename: hooks/Assets_handle.php
Line Number: 84
Backtrace:
File: /home/bafflesol411/Bfs/application/hooks/Assets_handle.php
Line: 84
Function: header
File: /home/bafflesol411/Bfs/application/hooks/Assets_handle.php
Line: 75
Function: handleFile
File: /home/bafflesol411/Bfs/application/hooks/Assets_handle.php
Line: 16
Function: handle_assets
File: /home/bafflesol411/Bfs/index.php
Line: 327
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/bafflesol411/Bfs/index.php:2)
Filename: hooks/Assets_handle.php
Line Number: 85
Backtrace:
File: /home/bafflesol411/Bfs/application/hooks/Assets_handle.php
Line: 85
Function: header
File: /home/bafflesol411/Bfs/application/hooks/Assets_handle.php
Line: 75
Function: handleFile
File: /home/bafflesol411/Bfs/application/hooks/Assets_handle.php
Line: 16
Function: handle_assets
File: /home/bafflesol411/Bfs/index.php
Line: 327
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/bafflesol411/Bfs/index.php:2)
Filename: hooks/Assets_handle.php
Line Number: 86
Backtrace:
File: /home/bafflesol411/Bfs/application/hooks/Assets_handle.php
Line: 86
Function: header
File: /home/bafflesol411/Bfs/application/hooks/Assets_handle.php
Line: 75
Function: handleFile
File: /home/bafflesol411/Bfs/application/hooks/Assets_handle.php
Line: 16
Function: handle_assets
File: /home/bafflesol411/Bfs/index.php
Line: 327
Function: require_once
var app = angular.module('myApp',[]);
var scope=null,scope1={};
var rb_ang=200;
function set_scope(obj1,obj){
obj1=param_check(obj1,false);
obj=param_check(obj,false);
if(obj===false){
if(scope!==null){
obj=scope;
}else{
obj=scope1;
}
}
if(obj1===false && Object.keys(scope1)<1){
return false;
}else if(obj1===false){
obj1=scope1;
}
var obj2=obj;
for(var key in obj1){
if(typeof obj1[key]==='object'){
if(typeof obj2[key]==='undefined'){
obj2[key]={};
}
set_scope(obj1[key],obj2[key]);
}else{
obj2[key]=obj1[key];
}
}
}
app.controller('myCtrl', function($scope,$interval,$http,$timeout) {
scope=$scope;
scope.rb_pills={};
var tick = function() {
$scope.clock = Date.now();
}
scope.modelsel='all';
scope.login=['Login','Sign In to your account','1'];
$interval(tick,rb_ang);
$scope.page_url=function(){
return window.location.href;
};
$scope.base_url=function(str){
if(str=='home'){
str='';
}
str=param_check(str,'');
return base_url(str);
};
$scope.handle_current=function(data,index){
if(data.match(/\[\d+]+$/)){
index--;
}
return index;
}
$scope.obj_merge=function(obj,obj1){
var obj2=obj;
for(var key in obj1){
if(obj2[key] && typeof obj1[key]=='object'){
obj2[key]=scope.obj_merge(obj2[key],obj1[key]);
}else{
obj2[key]=obj1[key];
}
}
return obj2;
}
$scope.check_multiple=function(index){
index=parseInt(index);
var ret=true;
if(scope.rb_data['fields-multiple']['multiple-'+(index-1)] && scope.rb_data['fields-multiple'][index][1]){
if(scope.count(scope.rb_data['fields-multiple']['multiple-'+(index-1)])>=scope.rb_data['fields-multiple'][index][1] && scope.rb_data['fields-multiple'][index][1]>0){
ret=false;
}
}
return ret;
}
$scope.handle_pills=function(data,index){
if(!scope.count(data)){
return true;
}
if(scope.count(scope.rb_pills)<1){
scope.rb_pills['tabs']=0;
var j=0,k=0;
for(var key in data){
for(var i=0;i0){
ret+=1;
}
}
return ret;
};
$scope.renameKey=function(obj,old,val){
var str=JSON.stringify(obj);
str=str.replace('"'+old+'":','"'+val+'":');
obj=JSON.parse(str);
return obj;
};
$scope.json_parse=function(e){
return JSON.parse(e);
};
$scope.json_stringify=function(e){
return JSON.stringify(e);
};
$scope.base64_encode=function(e){
e=e.toString();
return base64_encode(e);
};
$scope.base64_decode=function(e){
e=e.toString();
return base64_decode(e);
};
$scope.recompile=function(elem){
$scope1=elem.scope();
$injector=elem.injector();
$injector.invoke(function($compile){
$compile(elem)($scope1)
});
};
$scope.field_multiple=function(object){
if(json=json_parse(object)){
if(json[1][0]limit){
str=str.substr(0,limit);
if(more){
str+='...';
}
}
return str;
};
$scope.sluggify=function(str){
return str.trim().toLowerCase().replace(/^-+/g, "").replace(/[^\w-]+/g, "-").replace(/-+/g, "-").replace(/-+$/g, "");
}
$scope.object_key=function(object,value){
var ret='';
for(key in object){
if(object[key]===value){
ret=key;
break;
}
}
return ret;
}
$scope.toCamelCase=function(str){
return str.toLowerCase().replace(/\b[a-z]/g, function(letter) {
return letter.toUpperCase();
});
}
$scope.field_error=function(thus,error){
error=param_check(error,false);
var name=thus.attr('name');
var err='';
if(error==true){
if(scope.rb_data['page-form']['field-type'][name] && typeof scope.rb_data['page-form']['field-type'][name]['errors']!=='undefined'){
var errors=scope.rb_data['page-form']['field-type'][name]['errors'];
if(typeof errors=='object'){
if(thus.val().length<1){
err=errors[0];
}else{
err=errors[1];
}
}else{
err=errors;
}
}else{
// err='Enter '+scope.toCamelCase(name.replace('-',' '));
err='This field is required';
}
}
scope.rb_data['page-form']['field-type'][name]['error-text']=err;
}
setTimeout(function(){
rb_ang_load();
},500);
}).directive('rbStyle', function($compile){
return function($scope,elem,attr){
attr.$observe('rbStyle', function(actual_value){
var actual_value=elem.attr('rb-style');
elem.removeAttr('rb-style');
elem.attr('style',actual_value);
});
}
}).directive('ngHtmlBind', function($compile){
return function($scope,elem,attr){
attr.$observe('ngHtmlBind', function(actual_value){
var actual_value=elem.attr('ng-html-bind');
elem.removeAttr('ng-html-bind');
if(typeof elem.attr('ng-compile')!=='undefined'){
actual_value=$compile(actual_value)(scope);
}
elem.html(actual_value);
});
}
}).directive('ngAppendHtml', function($compile){
return function($scope,elem,attr){
attr.$observe('ngAppendHtml', function(actual_value){
var actual_value=elem.attr('ng-append-html');
elem.removeAttr('ng-append-html');
if(typeof elem.attr('ng-compile')!=='undefined'){
actual_value=$compile(actual_value)(scope);
}
elem.append(actual_value);
});
}
}).directive('ngPrependHtml', function($compile){
return function($scope,elem,attr){
attr.$observe('ngPrependHtml', function(actual_value){
var actual_value=elem.attr('ng-prepend-html');
elem.removeAttr('ng-prepend-html');
if(typeof elem.attr('ng-compile')!=='undefined'){
actual_value=$compile(actual_value)(scope);
}
elem.append(actual_value);
});
}
}).directive('ngRecompile', function($compile){
return function($scope,elem,attr){
attr.$observe('ngRecompile', function(actual_value){
setTimeout(function(){
elem.removeAttr('ng-recompile');
scope.recompile(elem);
},1000);
});
}
}).directive('ngRbBind', function(){
return function($scope,elem,attr) {
var key='',ret='';
attr.$observe('ngRbBind', function(actual_value) {
var key_value=0;
if(json=json_parse(actual_value)){
key=json[0];
key_value=json[1];
}else{
key=actual_value;
}
if(scope.rb_data && scope.rb_data['page-form']['field-type'] && scope.rb_data['page-form']['field-type'][key]){
var fields=scope.rb_data['page-form']['field-type'][key];
var attr='',option='';
if(typeof fields['attr']['option']!=='undefined'){
for(var k in fields['attr']['option']){
var sel='';
if(json_parse(fields['attr']['value'])[key_value]==k){
sel='selected';
}else if(fields['attr']['value']==k){
sel='selected';
}
option+='';
}
}
if(!fields['attr']){
fields['attr']={};
}
if(!fields['attr']['class']){
fields['attr']['class']='form-control';
}else{
fields['attr']['class']+=' form-control';
}
if(!fields['attr']['name']){
fields['attr']['name']=key;
}
if(['checkbox','radio'].indexOf(fields['attr']['type'])>-1){
fields['attr']['class']+=' custom-control-input';
}
var field_value='';
for(var key1 in fields['attr']){
if(key1.length>0){
if(fields['attr'][key1]==null){
fields['attr'][key1]='';
}
if(key1=='value' || key1=='option'){
continue;
}else if(key1=='name'){
var key2=key;
var val1;
if(fields['attr']['value']){
val1=fields['attr']['value'];
}else{
val1=null;
}
fields['attr']['name']=key2;
attr+=key1+'="'+fields['attr'][key1]+'" ';
if(val1!==null){
field_value=val1;
if(fields['type']!='textarea'){
attr+='value="'+val1+'" ';
}
}
}else{
attr+=key1+'="'+fields['attr'][key1]+'" ';
}
}
}
attr=attr.trim();
if(fields['type'] && fields['type']!='input'){
if(fields['type']=='textarea'){
ret='';
}else if(fields['type']=='select'){
ret='';
}
}else{
if(['checkbox','radio'].indexOf(fields['attr']['type'])>-1){
attr='';
ret=
''
;
}else{
ret='';
if(fields['attr']['type']=='file'){
// ret+='';
}
}
}
if(fields['prepend']){
ret=
''+
''+fields['prepend']+''+
'
'
+ret;
}else if(fields['append']){
ret+=
''+
''+fields['append']+''+
'
'
;
}
}else{
ret='';
}
elem.html(ret);
if(fields && fields['attr']['data-editor']){
$('[data-editor]:visible').each(function(){
new FroalaEditor(this);
});
}
});
}
});
function showError(title,msg,data){
data=param_check(data,false);
// swal({
// title: title,
// text:msg,
// timer: 2000,
// showConfirmButton: false
// });
if(data['ajax-redirect']){
setTimeout(function(){
location.href=data['ajax-redirect'];
},2000);
}
}
function base64_decode(e){
var _keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(f>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=_utf8_decode(t);return t;
}
function _utf8_encode(e){
e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t;
}
function _utf8_decode(e){
var t="";var n=0;var r=c1=c2=0;while(n191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t;
}
function base64_encode(e){
var _keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var t="";var n,r,i,s,o,u,a;var f=0;e=_utf8_encode(e);while(f>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+_keyStr.charAt(s)+_keyStr.charAt(o)+_keyStr.charAt(u)+_keyStr.charAt(a)}return t;
}
function rb_ang_load(){
setTimeout(function(){
scope.rb_ang_load=true;
setTimeout(function(){
$('[data-remove="true"]').remove();
},rb_ang);
},500);
if(scope.rb_data && typeof scope.rb_data['api']==='undefined'){
scope.rb_data['api']={loader:{}};
}
}
var ua = navigator.userAgent.toLowerCase();
var isAndroid = ua.indexOf("android") > -1;
var isIphone = ua.indexOf("iphone") > -1;
(function( $ ){
$.fn.errorShow=function(e){
e=param_check(e,{keyCode:0});
if(e.keyCode!=9){
scope.field_error(this,true);
if(!this.hasClass('is-invalid') || e.keyCode==0){
var name=this.attr('name');
this.addClass('is-invalid state-invalid ng-checked');
if(typeof this.attr('data-valid-target')!=='undefined' && $(this.attr('data-valid-target')).length>0){
$(this.attr('data-valid-target')).attr('disabled',true);
}
}
}
};
$.fn.errorHide=function(){
scope.field_error(this,false);
if(this.hasClass('is-invalid')){
this.removeClass('is-invalid').removeClass('state-invalid');
//this.addClass('is-valid state-invalid');
if(typeof this.attr('data-valid-target')!=='undefined' && $(this.attr('data-valid-target')).length>0){
$(this.attr('data-valid-target')).removeAttr('disabled');
}
}
};
})( jQuery );
$(document).ready(function(){
var request=[],userAjax=null;
// angular function
angular.element(function(){
});
// Resize Javascript Start
// applyOrientation();
// window.onresize=function(event){
// applyOrientation();
// }
// function applyOrientation(){
// var view;
// if(typeof scope.orientation==='undefined'){
// scope.orientation={};
// }
// if(window.innerHeight > window.innerWidth){
// view='portrait';
// }else{
// view='landscape';
// }
// if(scope.orientation['view']!=view){
// scope.orientation['view']=view;
// }
// if(typeof scope.orientation[view]==='undefined'){
// scope.orientation[view]='';
// $.get(base_url('assets/css/'+view+'.css'),function(data,status){ scope.orientation[view]=data; }).fail(function(){ delete scope.orientation[view]; });
// }
// }
// Resize Javascript end
$('form').on('keypress','[data-required-type]',function(e){
var type=$(this).attr('data-required-type');
if(type=='email' && e.keyCode==32){
return false;
}
});
$('form').on('blur input change','[data-required-type]',function(e){
if(e.type!='focusout'){
if(!$(this).hasClass('ng-checked')){
return false;
}
}
var type=$(this).attr('data-required-type');
var min=$(this).attr('minlength');
var max=$(this).attr('maxlength');
handleError($(this),0,e,type);
});
$('form').on('blur input change','[data-required-name]',function(e){
if(e.type!='focusout'){
if(!$(this).hasClass('ng-checked')){
return false;
}
}
var name=$(this).attr('data-required-name');
var target=$(this).closest('form').find('[name="'+name+'"]');
var thus=$(this);
var minLength=parseInt(target.attr('data-required'))-1;
setTimeout(function(){
if(target.val()==thus.val()){
if(thus.next('.input-group-append').length>0){
thus.next('.input-group-append').html('');
}
handleError(thus,minLength,e);
}else{
if(thus.next('.input-group-append').length>0){
thus.next('.input-group-append').html('');
}
thus.errorShow(e);
}
},10);
});
$('form').on('blur input change','div[data-editor="input"]',function(e){
if(e.type!='focusout'){
if(!$(this).hasClass('ng-checked')){
return false;
}
}
var data=$(this).find('[contenteditable]').html();
var thus=$(this);
if(thus.find('[contenteditable]').text().length<=1 && e.keyCode==8){
data='';
$(this).errorShow();
}else{
$(this).errorHide(e);
}
var name=thus.attr('name');
$('[name="'+name+'"]').val(data);
});
$('form').on('keypress','[data-required]',function(e){
var val=$(this).val() + String.fromCharCode(e.keyCode);
var name=$(this).attr('name');
if(field_validate($(this),val,false)==false){
return false;
}
// scope.rb_data['page-form']['field-type'][name]['value']=val;
});
$('form').on('blur input change','[data-required]',function(e){
var attr=$(this).attr('type');
if(attr==='file' && !$(this).hasClass('is-invalid')){
return false;
}
if(e.type!='focusout'){
if(!$(this).hasClass('ng-checked')){
return false;
}
}
var minLength=$(this).attr('data-required');
handleError($(this),minLength-1,e);
});
$('form').on('change','[data-submit-active]',function(e){
var val=$(this).prop('checked');
var btn=$(this).closest('form').find('[data-submit]');
if(btn.length>0){
if(val==true){
btn.removeAttr('disabled');
}else{
btn.attr('disabled',true);
}
}
});
$('form').on('click','button[data-submit]',function(e){
var fom=$(this).closest('form');
var formName=fom.attr('name');
var x=0;
if(fom.find('.g-recaptcha-response').length>0 && fom.find('.g-recaptcha-response').val().length<1){
scope.captcha_error='Please click on the captcha.';
showError('Captcha Error','Please verify your captcha code first.');
x++;
}else{
scope.captcha_error='';
}
fom.find('[data-required]').each(function(e){
var val=$(this).val();
val=val==null?'':val;
var minLength=$(this).attr('data-required');
if(val.length<1 && typeof $(this).attr('required')==='undefined'){
}else if(((val.length0 || $(this).attr('required')){
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if(!filter.test($(this).val()) || field_validate($(this))==false){
$(this).errorShow();
x++;
}
}
}
});
if(x>0){
return false;
}
});
function field_validate(thus,val,pat){
val=param_check(val,false);
pat=param_check(pat,true);
if(val===false){
val=thus.val();
}
var type=thus.attr('type');
var ret=true;
if(type=='file'){
var accept=thus.attr('accept');
if(typeof accept!=='undefined' && accept.length>0){
pat='('+accept.replace(/,/g,'|')+')$';
if(!new RegExp(pat).test(val)){
ret=false;
}
}
}else{
var pattern=thus.attr('pattern');
var max=thus.attr('max');
if(typeof pattern!=='undefined'){
if(pat==false){
pattern=pattern.replace(/{\d}/g,'{0}').replace(/{\d,/g,'{0,');
}
pat='^('+pattern+')$';
if(!new RegExp(pat).test(val)){
ret=false;
}
}
if(typeof max!=='undefined'){
if(parseInt(val)>parseInt(max)){
ret=false;
}
}
if(typeof min!=='undefined'){
if(parseInt(val)length && type=='') || (type.toLowerCase()=='email' && filter.test(val)) || (type=='webmail' && check_webmail(val) && filter.test(val))) && field_validate(thus)){
thus.errorHide();
}else if(val.length<1 && typeof thus.attr('required')==='undefined'){
thus.errorHide();
}else{
thus.errorShow(e);
}
},10);
}
function check_webmail(val){
if(val.indexOf('@gmail')>0 || val.indexOf('@yahoo')>0 || val.indexOf('@facebook')>0 || val.indexOf('@linkedin')>0 || val.indexOf('@pinterest')>0 || val.indexOf('@instagram')>0){
return false;
}else{
return true;
}
}
});
function json_parse(json){
try{
json=JSON.parse(json);
}catch(err){
json=false;
}
return json;
}
// cookies script
function setCookie(cname, cvalue, exdays){
exdays=param_check(exdays,365);
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires="+ d.toUTCString();
document.cookie = cname + '=' + cvalue + ';' + expires + ';path=/';
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i ');
}else if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
mobile=true;
$('head').append('');
}
if(mobile==true){
$('head').append('');
}
}