<?php
/**
 * [ACTIVE-LAYOUT]
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       app.View.Layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */

$cakeDescription = __d('cake_dev', 'Foqas');
?>
<!DOCTYPE html> 
<html>
<head>
	<?php echo $this->Html->charset(); ?>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>
		<?php echo $cakeDescription ?>
	</title>
	<link rel="shortcut icon" type="image/x-icon" href="<?php echo $this->webroot; ?>img/foqas_symbol.png">
		<?php
//		echo $this->Html->meta('icon');
        echo $this->Html->meta('foqas_symbol.png','/img/foqas_symbol.png',array('type' => 'icon'));
		echo $this->Html->css(array('bootstrap_new','bootstrap','bootstrap-responsive','grid','style','custom','opaicons','bootextra','media-queries','chat','4','font'));
		echo $this->Html->script(array('jquery.min','menu','4'));

		//echo $this->fetch('meta');
		//echo $this->fetch('css');
		//echo $this->fetch('script');
	?>
        <style>   
            body{
                min-width: 850px;
            }
            .logo img {
                    height: 43px;
                    /*padding: 3px 5px 3px 33px;*/
                    max-width: 100%;
                }
            /*==========  Mobile First Method  ==========*/

                .partXPro{
                    border-left: 1px solid #ccc !important;
                }
                
        </style>
        
        <script type="text/javascript">
        function validate(file) {
    	    var ext = file.split(".");
    	    ext = ext[ext.length-1].toLowerCase();      
    	    var arrayExtensions = ["jpg" , "jpeg", "png", "bmp", "gif"];

    	    if (arrayExtensions.lastIndexOf(ext) == -1) {
    	        alert("Wrong extension type. Only below file types that can be uploaded: jpg, jpeg, png, bmp, gif");
    	        $("#image").val("");
    	    }
    	}

        function validate1(file) {
    	    var ext = file.split(".");
    	    ext = ext[ext.length-1].toLowerCase();      
    	    var arrayExtensions = ["mp4"];

    	    if (arrayExtensions.lastIndexOf(ext) == -1) {
    	        alert("Wrong extension type. Only below file types that can be uploaded: mp4");
    	        $("#image").val("");
    	    }
    	}
        function validate2(file) {
    	    var ext = file.split(".");
    	    ext = ext[ext.length-1].toLowerCase();      
    	    var arrayExtensions = ["docx" , "docm", "dotx", "dotm", "xlsx","xlsm" , "xltx", "xltm", "xlsb", "xlam","pptx" , "pptm", "potx", "potm", "ppam","ppsx" , "ppsm", "doc", "ppt", "pdf","odt" , "gif", "jpeg", "avi", "txt","tiff" , "jpg", "bmp", "rtf", "png","csv" , "xls", "html", "mp3", "zip","pps"];

    	    if (arrayExtensions.lastIndexOf(ext) == -1) {
    	        alert("Wrong extension type. Only below file types that can be uploaded: docx , docm, dotx, dotm, xlsx,xlsm , xltx, xltm, xlsb, xlam,pptx , pptm, potx, potm, ppam,ppsx , ppsm, doc, ppt, pdf,odt , gif, jpeg, avi, txt,tiff , jpg, bmp, rtf, png,csv , xls, html, mp3, zip,pps");
    	        $("#image").val("");
    	    }
    	}
        
        $(document).ready(function(){
            $("").click(function (){
              $("").toggleClass("");  
            });
        }); 
        </script>
</head>
<body>
	<div class="container1">
		<?php echo $this->element('head');?>
	</div>
	
	<?php 
		$urlcss=substr($this->here,0,18);
	?>
	<?php if ($urlcss=='/contents/add/Blog'){?>
	<div class="container3" style="height: 99.5%">
	<?php }else{?>
	<div class="container3">
	<?php }?>
		<!-- MAIN-CONTENT[LEFT-MENU] -->
                <div class="divONE" id="Menuhidden">
                    <div class="tac">
                        <div class="" style="overflow: hidden;">
                            <?php 
                            $software_title = $loggedUser['Profile']['fname'];
                            $user_title = $loggedUser['Profile']['fname'].' '.$loggedUser['Profile']['lname'];
                            $url1=substr($this->here,0,14); 
                            $url=$this->webroot.'contents/blog';
                            $url2=$this->webroot.'wikidetails/i';  
                            if ($url==$url1){  
                                $params=$this->params['pass'][2];
                                    if($params){
                                            if(is_numeric($params)){
                                                 $params;
                                                $owner_profileId = substr($params,4, 120);
                                            } else {
                                                $params=$this->params['pass'][1];
                                                $owner_profileId = substr($params,4, 120);
                                                
                                            }
                                             

                                        } else {
                                            $params=$this->params['pass'][1];
                                            
                                            $owner_profileId = substr($params,4, 120);
                                            
                                        }

                            }elseif ($url2==$url1){
                                    $owner_profileId = substr($this->params['pass'][1],4, 120);
                                    $params=$this->params['pass'][1];
                            }else {
                                if (empty($this->params['pass'][2])) {
                                      $owner_profileId = $this->Session->read('owner_profileId');
                                }else{
                                    if($this->params['pass'][2]=='friendsblog'){
                                            $owner_profileId = substr($this->params['pass'][1],4, 120);
                                        } elseif(is_numeric ($this->params['pass'][2])){
                                            
                                            $owner_profileId = substr($this->params['pass'][2],4, 120);
                                        }else {
                                            $owner_profileId = $this->Session->read('owner_profileId');
                                        }
                                }         
                            $params= (isset($this->params['pass'][1]) ? $this->params['pass'][1] : '');
                            }
                            if($owner_profileId){
                                    $software_title=$profileNames[$owner_profileId];
                                     $photo=$link1[$owner_profileId];
                            }else {
                            	$photo=$link1[$loggedUser['profile_id']];
                            };
                            ?>
                            <?php 
                            if(!empty($photo)){
                            ?>
                            <img src="<?php echo $photo;?>" height="164px;" width="164px;"  style="margin:auto;">
                            <?php }else {
                                    echo $this->Html->image('profile.jpg',array('style'=>'width="164px" height="164px"'));

                            }?>	
                        </div>
                    </div>
                    <div class="activeModule bold" title="<?php echo $user_title;?>" style="overflow-wrap: break-word; word-wrap: break-word;"><?php echo $software_title;?></div>			
                    <div id="updateMenu">                            
                            <?php echo $this->element('menu');?>
                    </div>
		</div>
		<div class="divTWO">
		
			<div class="partA mrT">                            
				<div class="pd5 pSMtop" id="ajaxData">    
					<?php echo $this->fetch('content'); ?>
				</div>
			</div>
			<div class="partXPro">
				<?php //echo $this->element('right_part'); ?>
				<?php echo $this->element('right_part_update'); ?>
			</div>
		</div>
	</div>
	
	<div class="clearall"></div>
	<br/>
	
	<?php echo $this->Html->script(array('bootstrap-transition','bootstrap-collapse'));?>
	<?php  echo $this->element('sql_dump'); ?>
	<?php //echo $this->Js->writeBuffer();?>
        
    <script>

        /*jQuery(document).ready(function(){
            jQuery('#menu-toggle').change(function(){
                   if(this.checked)
                    jQuery('#Menuhidden').fadeOut('slow');
                   else
                    jQuery('#Menuhidden').fadeIn('slow');

               });
        }); */
    </script>
</body>
</html>
