<?php
@ob_start();
@session_start();
$baseUrl = Yii::app()->request->baseUrl;
?>
<?php if (!empty($content)): ?> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html 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" href="../bootstrap/css/bootstrap.css" />
            <link rel="stylesheet" href="../bootstrap/css/bootstrap-theme.css" />

            <!--<link rel="stylesheet" href="../jquery-ui/css/ui-lightness/jquery-ui-1.10.4.css" />-->
            <link rel="stylesheet" href="../style2.css" />

            <?php
            Yii::app()->clientScript->registerScriptFile("../jquery.js");
// Yii::app()->clientScript->registerScriptFile("../jquery-ui/js/jquery-ui-1.10.4.js");
            Yii::app()->clientScript->registerScriptFile("../bootstrap/js/bootstrap.js");
//  Yii::app()->clientScript->registerScriptFile("../script.js");
            ?>
            <title><?php echo CHtml::encode($this->pageTitle); ?></title>
        </head>

        <body>

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

                <div class="nav navbar-default" style="color:#252525; padding: 30px;">
                    <i class="glyphicon glyphicon-tree-deciduous"></i>
                    <?php echo CHtml::link("Food V1.0", array("Admin/index")); ?>
                </div><!-- header -->

                <div class="nav navbar-default">
                    <?php if (Yii::app()->session["ad_id"] != null): ?>
                        <?php
                        $this->widget('ext.mbmenu.MbMenu', array(
                            'items' => array(
                                array(
                                    'label' => 'อาหาร',
                                    'items' => array(
                                        array('label' => 'ประเภทอาหาร', 'url' => array('/admin/TypeFood')),
                                        array('label' => 'ข้อมูลอาหาร', 'url' => array('/admin/ViewFood'))
                                    )
                                ),
                                array('label' => 'ส่วนเสริม',
                                    'items' => array(
                                        array('label' => 'การชำระเงิน', 'url' => array('admin/ViewBank')),
                                        array('label' => 'สีเว็บไซต์', 'url' => array('admin/ViewColor'))
                                    )),
                                array('label' => 'ผู้ใช้งานระบบ',
                                    'items' => array(
                                        array('label' => 'สมาชิก', 'url' => array('admin/ViewMember'))
                                    )),
                                array('label' => 'ออกจากระบบ', 'url' => array('admin/Logout')
                                )
//				array('label'=>'อาหาร', 'url'=>array('/admin/ViewFood')),
//				array('label'=>'ประเภทอาหาร', 'url'=>array('/admin/TypeFood')),
//				array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
//				array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
                            )
                        ));
                        ?>

                    </div><!-- mainmenu -->
                    <div><?php echo $content; ?></div>
                <?php else: ?>
                    <div><?php echo $content; ?><div>
                        <?php endif ?>


                        <div class="clear"></div>

                        <div id="footer">
                            Copyright &copy; Kamla Food CMS MVC 
                        </div><!-- footer -->

                    </div><!-- page -->

                    </body>
                    </html>
                <?php endif; ?>