<script type="text/javascript" src="<?php echo GLOBAL_ADMIN_JS_PATH; ?>highslide/highslide-with-gallery.js"></script>
<script type="text/javascript" src="<?php echo GLOBAL_ADMIN_JS_PATH; ?>jquery/ui/minified/jquery.ui.core.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo GLOBAL_ADMIN_JS_PATH; ?>highslide/highslide.css" />
<script type="text/javascript">


    hs.graphicsDir = '<?php echo GLOBAL_ADMIN_JS_PATH; ?>highslide/graphics/';
    hs.align = 'center';
    hs.transitions = ['expand', 'crossfade'];
    hs.wrapperClassName = 'dark borderless floating-caption';
    hs.fadeInOut = true;
    hs.dimmingOpacity = .75;
   
    // Add the controlbar
    if (hs.addSlideshow) hs.addSlideshow({
       
        slideshowGroup: 'group1',
        interval: 5000,
        repeat: false,
        useControls: true,
        fixedControls: 'fit',
        overlayOptions: {
            opacity: .6,
            position: 'bottom center',
            hideOnMouseOut: true
        }

    });
    
</script>
<script type="text/ecmascript">
    function verify()
    {

	SendGridBindRequest('<?= $banner->urlwithpara ?>','gridbody','D','chkgrow');
    }
</script>





<div class="web-booking-main" id="gridbody">
    <?php if($_REQUEST['action']!='') $action = ucwords($_REQUEST['action']);?>
<div class="breadcrumbs"><a href="index.php">Home </a>&nbsp;>&nbsp; <a href="index.php?module=pages">Manage Pages </a> &nbsp;>&nbsp;<span class="current">Manage Banners </span>  </div>

    <div class="clear"></div>
    <?= $messagebox; ?>		
    <?php echo $headerpanel; ?>
    <?php echo $pagingTop; ?>
    <?=$notemessagebox?>

   

    <div class="grid-list-subtitle-bg" style="margin-top:10px;">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td width="2%" align="left" valign="middle" class="grid-td-left"><input name="chkall" id="chkall" type="checkbox" onclick="checkall('chkgrow')"  /></td>

                <td width="3%" align="left" valign="middle" class="grid-td-top">&nbsp;</td>

                <td width="50%" align="left" valign="middle" class="grid-td-top"><a href="javascript:;" onclick="SendGridBindRequest('<?= $banner->urlwithoutsort ?>&orderby=var_title&sorting=Y','gridbody','ST')">Title<?= $setsortimgvar_title ?></a></td>
                <td width="20%" align="center" valign="middle" class="grid-td-top">Banner</td>
                <td width="15%" align="center" valign="middle" class="grid-td-top">
                <?php if($configObj->glSessionObj->value('admin_id') == '1' || DISPLAY_ORDER_VIEW=='Y')  { ?>
                <a href="javascript:;" onclick="SendGridBindRequest('<?= $banner->urlwithoutsort ?>&orderby=int_displayorder&sorting=Y','gridbody','ST')">Display Order<?= $setsortimgint_displayorder ?></a><a href="javascript:;" onclick="javascript:SendGridBindRequest('<?= $banner->urlwithoutsort ?>','gridbody','DO');">&nbsp;<img src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>save.png" width="16" height="16" alt="save" title="save" border="0" /></a>
                <? } ?>
               </td>
               

                <td width="10" align="center" valign="top" class="grid-td-top"><a href="javascript:;" onclick="SendGridBindRequest('<?= $banner->urlwithoutsort ?>&orderby=chr_publish&sorting=Y','gridbody','ST')">Publish<?= $setsortimgchr_publish ?></a></td>




            </tr>
        </table>
    </div>

    <div class="information-white-bg" id="dvpersonalinformation" >
        <div class="clear"></div>
        <input type="hidden" value="banner" name="hdnmodule" id="hdnmodule">
        <div class="grid-list-inner-table-text">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
            </table> 

            <table width="100%" border="0" cellspacing="0" cellpadding="0">

                <?php
                if ($numofrows > 0) {
                    $rowcount = 0;
                    while ($row = $configObj->glDbObj->fetch_array($result)) {
                        $clsname = ($row['chr_read'] == 'N') ? "grid-list-inner-table-text-active" : "grid-list-inner-table-text"; // For read unread class
                        $starimg = ($row['chr_star'] == 'Y') ? "gstar.png" : "gstar-disable.png"; // Displaying the stat and unstart image
                        $tickimg = ($row['chr_publish'] == 'Y') ? "tick.png" : "tick_cross.png"; // Displaying the stat and unstart image
                       if($row['chr_publish']=='Y') {
                            $title= "This means the display is on, if you would like to hide this menu item please click on the logo.";
                        }
                        else {
                            $title="This means the display is off, if you would like to Display this menu item please click on the logo.";
                        }

                        if ($row['chr_history_read'] == 'Y') {
                            $trackimage = "histry-icon.png";
                        } else {
                            $trackimage = "histry-unread-icon.png";
                        }
                        if($row['chr_star'] == 'Y')
                        {
                            $title_stared='starred';
                        }
                        else
                        {
                            $title_stared='Not starred';
                        }

                        
                        
                        ?>

                        <tr id="gtr-<?= $row['int_glcode'] ?>"  style="background-color: transparent;"  class="<?= $clsname ?>" onmouseover="this.style.backgroundColor='#f6f6f6'" onmouseout="this.style.backgroundColor='transparent'" >                       
                            <td width="2%" align="left" valign="middle" class="grid-td-left"><input name="chkgrow" id="chkgrow" type="checkbox" value="<?php echo $row['int_glcode'] ?>" /></td>
                            
                            <?php if ($configObj->glSessionObj->value('admin_id') == '1') { ?>
                                 <td width="3%" align="center" valign="middle" class="grid-left1"><img id="star-<?= $row['int_glcode'] ?>" height="16" width="16" alt="<?= $title_stared?>" title="<?= $title_stared?>" src="<?= GLOBAL_ADMIN_IMAGES_PATH ?><?= $starimg ?>" style="vertical-align:middle;cursor:pointer;"onclick="UpdateStar('<?= DB_PREFIX ?>banner','chr_star','<?= $row['int_glcode'] ?>');"></td>
                            <?php } else {?>
                                 <td width="3%" align="center" valign="middle" class="grid-left1"></td>
                             <? } ?>
                            
                                <td width="50%" align="left" valign="middle" class="grid-td-top">
                                    <a href="<?= $banner->urlwithpara; ?>&amp;action=edit&amp;eid=<?php echo $row['int_glcode']; ?>"><span><?= $configObj->glLibraryObj->add_special_chars($row['var_title']); ?></span></a>
                                </td>
                            
                               


                            
                            <td width="20%" align="center" valign="middle" class="grid-td-top">

                                <?
                                if ($row['var_imagepath'] != "") {
                                    ?>
                                    <a href="../upimages/banner/images/thumb_<?= $row['var_imagepath']; ?>"  title="view banner" onClick="return hs.expand(this);">
                                        <img src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>preview.png" /></a>
                                    <?
                                } else {
                                    ?>  &nbsp;
                                    <? } ?>

                            </td>


                            <td width="15%" align="center" valign="middle" class="grid-td-top">
                            <?php if($configObj->glSessionObj->value('admin_id') == '1' || DISPLAY_ORDER_VIEW=='Y')  { ?>
                                <input type="text" class="order" name="displayorder<?= $rowcount ?>" id="displayorder<?= $rowcount ?>"  onkeypress="return KeycheckOnlyNumeric(event);" value="<?= $row['int_displayorder']; ?>" />
                                <input type="hidden" name="hdndisplayorder<?= $rowcount ?>" id="hdndisplayorder<?= $rowcount ?>" value="<?= $row['int_displayorder'] ?>" />
                                <input type="hidden" name="hdnintglcode<?= $rowcount ?>" id="hdnintglcode<?= $rowcount ?>"  value="<?= $row['int_glcode'] ?>" />
                                <? } ?>
                            </td>

                            <td width="10%" align="center" valign="middle" class="grid-td-top">
                                <a href="javascript:void(0);"><img id="tick-<?= $row['int_glcode'] ?>" height="16" width="16" alt="<?= $title ?>" title="<?= $title ?>" src="<?= GLOBAL_ADMIN_IMAGES_PATH ?><?= $tickimg ?>" style="vertical-align:middle;cursor:pointer;" onclick="UpdatePublish('<?= DB_PREFIX ?>banner','chr_publish','<?= $row['int_glcode'] ?>','');"></a>
                            </td>

                        </tr>
                        <?php
                        $rowcount++;
                    }
                } else {
                    ?>
                    <tr style="background-color: transparent;"  class="<?= $clsname ?>" onmouseover="this.style.backgroundColor='#f6f6f6'" onmouseout="this.style.backgroundColor='transparent'"> 
                        <td height="25" align="center" valign="middle" colspan="6" class="form_titles">Sorry! No records are available.</td>
                    </tr>
                    <?
                }
                ?>
                <input type="hidden" name="ptrecords" id="ptrecords" value="<?= $rowcount ?>">      

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

    <?php echo $pagingBottom; ?>
    <?php
     if($numofrows > 0){   
    ?>
    <div class="add-new-user-button"><a href="javascript:" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image47','','<?= GLOBAL_ADMIN_IMAGES_PATH ?>delete-button-hover.jpg',0)"><img src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>delete-button.jpg" alt="Delete" name="Image47" width="80" height="25" border="0" id="Image47" onclick="return verify();" /></a></div>
    <?}?>
</div>