
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html <?php if (Yii::app()->language == 'ar')
    echo "dir='rtl'"; ?> xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="language" content="en" />


	<!-- blueprint CSS framework -->
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->

	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/style.css" />

	<title><?php echo CHtml::encode($this->pageTitle); ?></title>

	<script language="javascript" type="text/javascript">

	    function addParam(url, param, value) {
		var a = document.createElement('a');
		a.href = url;
		a.search += a.search.substring(0,1) == "?" ? "&" : "?";
		a.search += encodeURIComponent(param);
		if (value)
		    a.search += "=" + encodeURIComponent(value);
		return a.href;
	    }
	</script>
    </head>

    <body>

	<div class="container" id="page">

	    <div id="header" >
                <div class="img_left">
                    <img src='<?php echo Yii::app()->request->baseUrl; ?>/css/images/slb_logo.png'  width="268px"  />
                </div>
                <div>
                    <img src='<?php echo Yii::app()->request->baseUrl; ?>/css/images/header-image_inside.jpg'  style="float:right;  " />
                </div>
            </div><!-- header -->

	    <?php
	    $this->widget('bootstrap.widgets.TbNavbar', array(
		//'color' => ,
		'brandLabel' => '',
		'display' => null, // default is static to top
		'collapse' => true, // requires bootstrap-responsive.css

		'items' => array(
		    array(
			'class' => 'bootstrap.widgets.TbNav',
			'items' => array(
			    array('label' => Yii::t('default', 'Dashboard'), 'url' => array('dashboardReport/view'),
				//'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE) || Yii::app()->user->checkAccess(User::LOGISTICS_ADMIN_ROLE),
			    ),
			    //------------------------------------------------------------
			    array(
				'label' => Yii::t('default', 'TIDs Management'),
				'url' => array('#'),
				//'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE) || Yii::app()->user->checkAccess(User::LOGISTICS_ADMIN_ROLE),
				'items' => array(
				    array(
					'label' => Yii::t('default', 'TIDs'),
					'url' => array('tid/index'),
					//'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE) || Yii::app()->user->checkAccess(User::LOGISTICS_ADMIN_ROLE),
				    ),
				    array(
					'label' => Yii::t('default', 'Invoices'),
					'url' => array('invoice/index'),
					//'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE) || Yii::app()->user->checkAccess(User::LOGISTICS_ADMIN_ROLE),
				    ),
				    array(
					'label' => Yii::t('default', 'Assets'),
					'url' => array('asset/index'),
					//'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE) || Yii::app()->user->checkAccess(User::LOGISTICS_ADMIN_ROLE),
				    )
				)
			    ),
			    array(
				'label' => Yii::t('default', 'Configurations'),
				'url' => array('#'),
				'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE),
				'items' => array(
				    array('label' => Yii::t('default', 'TID Configurations'), 'url' => array('#'),
					'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE),
					'items' => array(
					    array(
						'label' => Yii::t('default', 'Point of Entries'),
						'url' => array('/pointOfEntry/index'),
						'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE),
					    ),
					    array(
						'label' => Yii::t('default', 'TI Types'),
						'url' => array('/tiType/index'),
						'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE),
					    ),
					    array(
						'label' => Yii::t('default', 'CCAs'),
						'url' => array('/cca/index'),
						'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE),
					    ),
					    array(
						'label' => Yii::t('default', 'Contracts'),
						'url' => array('/contract/index'),
						'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE),
					    ),
					    array(
						'label' => Yii::t('default', 'Document Types'),
						'url' => array('/documentType/index'),
						'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE),
					    ),
					    array(
						'label' => Yii::t('default', 'Processing Stages'),
						'url' => array('renewalStage/index'),
						'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE),
					    ),
					)
				    ),
				    array('label' => Yii::t('default', 'Asset Configurations'), 'url' => array('#'),
					'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE),
					'items' => array(
					    array(
						'label' => Yii::t('default', 'Segments'),
						'url' => array('/segment/index'),
						'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE),
					    ),
					    array(
						'label' => Yii::t('default', 'Type of Assets'),
						'url' => array('/typeOfAsset/index'),
						'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE),
					    ),
					)
				    ),
				    array('label' => Yii::t('default', 'System Configurations'), 'url' => array('#'),
					'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE),
					'items' => array(
					    array(
						'label' => Yii::t('default', 'Users'),
						'url' => array('/user/index'),
						'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE),
					    ),
					    array(
						'label' => Yii::t('default', 'Settings'),
						'url' => array('/setting/index'),
						'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE),
					    ),
					    array(
						'label' => Yii::t('default', 'Backups'),
						'url' => array('/backup/index'),
						'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE),
					    ),
					    array(
						'label' => Yii::t('default', 'Audit Trail'),
						'url' => array('/auditTrail/index'),
						'visible' => Yii::app()->user->checkAccess(User::SYSTEM_ADMIN_ROLE),
					    ),
					)
				    ),
				)
			    ),
			    //------------------------------------------------------------
			    array('label' => Yii::t('default', 'Help'), 'url' => array('/dashboardLayout/help')),
			    array('label' => Yii::t('default', 'Login'), 'url' => array('/site/login'), 'visible' => Yii::app()->user->isGuest),
			    array('label' => Yii::app()->user->name, 'url' => array('#'),
				'visible' => !Yii::app()->user->isGuest,
				'items' => array(
				    array('label' => Yii::t('default', 'Logout'), 'url' => array('/site/logout')),
				    array('label' => Yii::t('default', 'Change Password'), 'url' => array('/user/changepassword')),
			    )),
			//array('label' => (Yii::app()->language == "en" ? "ar" : "en"), 'url' => array('/site/Language'))
			//,
			),
		    ),)));
	    ?>



	    <?php if (isset($this->breadcrumbs)): ?>
	    <?php
		$this->widget('zii.widgets.CBreadcrumbs', array(
		    'links' => $this->breadcrumbs,
		)); ?><!-- breadcrumbs -->
	    <?php endif ?>
	    <?php Yii::app()->bootstrap->register(); ?>
	    <?php echo $content; ?>
    	    <br/><br/>
    	    <div id="footer" class="footer" style="height: 35px">
    		<font style="font-weight: 500; font-size: 12px;">
		    <?php echo Yii::t('default', "TIDANS v 4.0.0 - Copyright Schlumberger 2014 | Schlumberger Project Manager:") ?> <font style="color:#02356a">Majd Ayoubi</font>
		    <br/>
		    <?php echo Yii::t('default', "Powered By") . ":" ?> <a href="#" style="color: orange;" onclick="window.open('http://www.FlexSolution.biz','_blank');">Flex Solutions</a>
                </font>
            </div><!-- footer -->
        </div><!-- page -->

    </body>
</html>
 <script type="text/javascript" language="javascript">
        var error_url= "<?php echo $this->createAbsoluteUrl("site/error"); ?>";

        $.ajaxSetup({
            error: function (event, xhr, ajaxOptions, thrownError) { window.location.href=(error_url); }
        });

        setHeight();

        function setHeight(){	    
            if((window.fullScreen) ||
                (window.innerWidth == screen.width && window.innerHeight == screen.height)) {
                //		$("#container").css('height',screen.height - 180+'px');
                $("#page").css('min-height',screen.height - 100+'px');


            } else {
                var contentheight = $("#content").css('height');
                var span19height = $(".span-19").css('height');
                var breadcrumbs = $(".breadcrumbs").css('height');

                var newH = 0;
                if(span19height != undefined)
                    newH = span19height.substring(0,span19height.length-2);
                else
                    newH = contentheight.substring(0,contentheight.length-2);

                var avail = screen.availHeight - 230;

                var DIFF = avail - newH;

                if(DIFF > 0 && DIFF > 80){		   
                    //		$("#container").css('height',screen.availHeight - 245+'px');
                    if(span19height != undefined){
                        var cH = contentheight.substring(0,contentheight.length-2);
                        if(cH < screen.availHeight - 292)
                            $(".span-19").css('min-height',screen.availHeight - 372+'px');

                    }
                    else{
                        if(breadcrumbs != undefined)
                            $("#content").css('min-height',screen.availHeight - 463+'px');
                        else
                            $("#content").css('min-height',screen.availHeight - 463 + 28+'px');
                    }
                    $("#page").css('min-height',screen.availHeight - 125+'px');
                }

            }

        }


        $( window ).resize(function() {
            setHeight();
        });




    </script>