
     <!-- Core Vendors JS -->
    <script src="<?php echo $dir; ?>j_js/vendors.min.js"></script>

    <?php 
    if(strtolower($full_url)=="".$dir."" || strtolower($full_url)=="".$dir."index.php"){ //for dashboard
    ?>
    <script src="<?php echo $dir; ?>j_js/vendors/chartjs/Chart.min.js"></script>
    <script src="<?php echo $dir; ?>j_js/pages/dashboard-default.js"></script>
    <?php } ?>
    
    <?php if(strpos($full_url,'notifications') !== false ){  //notify messages ?>
    <script src="<?php echo $dir; ?>j_js/vendors/quill/quill.min.js"></script>
    <script src="<?php echo $dir; ?>j_js/pages/mail.js"></script>
    <?php } ?>

    <?php if(strpos($full_url,'profile-picture') !== false ){  //for image upload and crop ?>
    <script src="<?php echo $dir; ?>j_js/croppie.js"></script>
    <?php } ?>
	
	<script src="<?php echo $dir; ?>j_js/vendors/datatables/jquery.dataTables.min.js"></script>
    <script src="<?php echo $dir; ?>j_js/vendors/datatables/dataTables.bootstrap.min.js"></script>

    <script src="<?php echo $dir; ?>j_js/app.min.js"></script>


    <?php if(strpos($full_url,'profile-picture') !== false  || strpos($full_url,'musics-upload') !== false){  //for image upload and crop ?>
     <script>  
        $(document).ready(function(){
            $image_crop = $('#image_demo').croppie({
            enableExif: true,
            viewport: {
              width:290,
              height:290,
              type:'square' //circle or square
            },
            boundary:{
              width:300,
              height:300
            }
          });

          $('#upload_image').on('change', function(){
            $('#image_demo').show();
            var reader = new FileReader();
            reader.onload = function (event) {
              $image_crop.croppie('bind', {
                url: event.target.result
              }).then(function(){
                console.log('jQuery bind complete');
              });
            }
            reader.readAsDataURL(this.files[0]);
          });

        });  
    </script>

    <?php } ?>
    <script src="<?php echo $dir; ?>j_js/main.js?v=<?php echo $version; ?>"></script>


    <?php 
    //record that this page was visited
	//add to base the page record
    /*
	$mfc_page_url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; //complete url with get
	$mfc_page_url_en = urlencode("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"); //complete url with get
	$mfc_page_url_main = substr($mfc_page_url,0,strpos($mfc_page_url,'?')); //no get ? 
	//get browser details
 	$mfc_browser = $_SERVER['HTTP_USER_AGENT'];
	$mfc_ip=$_SERVER['REMOTE_ADDR'];
	$geopluginURL='http://www.geoplugin.net/php.gp?ip='.$mfc_ip;
	$addrDetailsArr = unserialize(file_get_contents($geopluginURL)); 
	$mfc_city = $addrDetailsArr['geoplugin_city']; 
	$mfc_country = $addrDetailsArr['geoplugin_countryName'];
	$mfc_username = $id;
	if (strpos($mfc_page_url, '?') !== false) {
		$mfc_page_is_get = 1;
		$chat_url = "".$dir."myfirstchat/?url=".urlencode($mfc_page_url_en)."";
	}else{
		$chat_url = "".$dir."myfirstchat/";
		$mfc_page_is_get = 0;
	}
	//
	$sql4="INSERT INTO j_page_visits
	(j_page, j_page_main,j_page_is_get,j_browser, j_ip, j_country,j_username)
	VALUES
	('".$mfc_page_url."','".$mfc_page_url_main."','".$mfc_page_is_get."','".$mfc_browser."','".$mfc_ip."','".$mfc_country."','".$mfc_username."')
	";
 	$result4 = runSQL($sql4);
	if(!$result4){
		die("Error with Page Visit");
	}
    */
    ?>

	
    <!--modal-->
    <div class="modal fade" id="loadingModal" style="display:none;">
        <div class="modal-dialog modal-dialog-centered" >
            <div class="" style="margin:0px auto; background-color:transparent; border:0px;">
                <!--
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalCenterTitle">Modal title</h5>
                    <button type="button" class="close" data-dismiss="modal">
                        <i class="anticon anticon-close"></i>
                    </button>
                </div>
                -->
                <div class="" style="border:0px; text-align:center; color:#fff; background-color:transparent; font-size:50px;">
                    <i class='anticon anticon-loading' style="color:#fff !important;"></i>
                </div>
                <!--
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary">Save changes</button>
                </div>
                -->
            </div>
        </div>
    </div>
    <script>
        $('a').click(function(event){
            //event.preventDefault();
            var link = $(this).attr('href');
            var value = link.toLowerCase();
            if(value=="javascript:void(0);" || value=="javascript:void(0)" || value=="javascript:void();" || value=="javascript:void()" || value=="#" || value=="#0" || value=="" || value==" "){
                //do nothing
            }else{
                if(value.indexOf("download.php") >= 0 || value.indexOf("<?php echo $dir; ?>") < 0){
                    //do noting
                }else{
                    $('#loadingModal').modal('show');
                }
            }
        });
    </script>



