<script type="text/javascript" src="<?php echo GLOBAL_ADMIN_JS_PATH;?>highslide/highslide-with-html.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/javascript">
	hs.graphicsDir = '<?php echo GLOBAL_ADMIN_JS_PATH;?>highslide/graphics/';
	hs.outlineType = 'rounded-white';
	hs.showCredits = false;
	hs.wrapperClassName = 'draggable-header';
</script>
<script type="text/javascript">


    function enableQuickEdit(intglcode)
    {

        var label = "label_" + intglcode;
        var text = "text_" + intglcode;

        if(document.getElementById(label).style.display=='block')
        {
            document.getElementById(label).style.display='none';
            document.getElementById(text).style.display='block';
        }
        else if(document.getElementById(text).style.display=='block')
        {
            document.getElementById(text).style.display='none';
            document.getElementById(label).style.display='block';
        }

    }

    function verify()
    {
        SendGridBindRequest('<?=$photogalleryObj->urlwithpara.'&flag=u'?>','gridbody','D','chkgrow');
    }

function photo_title_update(update_url,id)
{
    xmlHttp = GetXmlHttpObject();
    if(xmlHttp != null)
	{
            var textvalue=document.getElementById('var_title_'+id).value;
            if(textvalue=='')
                {
                    alert("Please Enter Title");
                    return false;
                }
            textvalue = new String(textvalue);
            textvalue =  textvalue.replace(/[#]+/g,'');

            xmlHttp.onreadystatechange = function()
            {
                if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
                {
                    var str=xmlHttp.responseText;
                    document.getElementById('gridbody').innerHTML = '';
                    document.getElementById('gridbody').innerHTML = str;
                    alert("Congrats! Image title updated successfully.");
                }
            };
            url=update_url+'&action=updatephototitle&title='+textvalue+'&eid='+id;
            xmlHttp.open('GET', url + '&ajax=Y', true);
            xmlHttp.send(null);
	}
	else
	{
            alert("Caution! Your browser does not support HTTP request.");
	}
    return true;
}
</script>
<div class="highslide-html-content" id="person_info">
   <div class="highslide-header">
      <ul>
         <li class="highslide-close">
            <a href="#" onclick="return hs.close(this)"></a>
         </li>
      </ul>
   </div>
   <div class="highslide-body">
      <p>This picture can be best viewed if size is <?=$photogalleryObj->thumb_width?> x <?=$photogalleryObj->thumb_height?> pixels or more. </p>
   </div>
</div>
<div class="web-booking-main" id="gridbody">
    <div class="breadcrumbs"><a href="index.php">&nbsp;Home</a>&nbsp;>&nbsp;<a href="index.php?module=pages">Manage Pages</a>&nbsp;&nbsp;>  <span class="current">Manage Banner Gallery </span>  </div>
    <div class="clear"></div>
    <?=$messagebox;?>
    <?php echo $headerpanel;?>
    <?php echo $pagingTop;?>
    <?=$notemessagebox?>
    

    <div class="grid-list-subtitle-bg" style="margin-top:10px;margin-right: 2px;">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td width="3%" align="left" valign="middle" class="grid-td-left"><input name="chkall" id="chkall" type="checkbox" onclick="checkall('chkgrow')"  /></td>
                <td width="28%" align="left" valign="middle" class="grid-td-top">
                    <a href="javascript:;" onclick="SendGridBindRequest('<?=$photogalleryObj->urlwithoutsort?>&orderby=var_title&sorting=Y','gridbody','ST')">Banner Title<?=$setsortimgvar_title?></a>
                </td>
                  <td width="9%" align="center" valign="middle" class="grid-td-top">Edit</td>
                <td width="8%" align="center" valign="middle" class="grid-td-top"style="padding-left:0px;">Banner Image</a></td>
                <td width="15%" align="center" valign="middle" class="grid-td-top">
                    <a href="javascript:;" onclick="SendGridBindRequest('<?=$photogalleryObj->urlwithoutsort?>&orderby=int_displayorder&sorting=Y','gridbody','ST')">Display Order<?=$setsortimgint_displayorder?></a>
                    <a href="javascript:;" onclick="javascript:SendGridBindRequest('<?=$photogalleryObj->urlwithpara?>','gridbody','DO');"><img src="<?=GLOBAL_ADMIN_IMAGES_PATH?>save.png" width="16" height="16" alt="save" title="save" border="0" /></a>
                </td>
               <td width="7%" align="center" valign="middle" class="grid-td-top" ><a onclick="SendGridBindRequest('<?=$photogalleryObj->urlwithoutsort?>&orderby=chr_publish&sorting=Y','gridbody','ST')">Publish<?=$setsortimgchr_publish?></a>
            </tr>
        </table>
  </div>

    <div class="information-white-bg" id="dvpersonalinformation" style="margin-right: 2px;">
        <div class="clear"></div>
        <input type="hidden" value="pagephoto" name="hdnmodule" id="hdnmodule">
        <div class="grid-list-inner-table-text">
           <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
                       $checked = ($row['chr_defaultimage'] == 'Y')?"checked":""; // Displaying the stat and unstart image
                        ?>
                <tr id="gtr-<?=$row['int_glcode']?>"  style="background-color: transparent;"  class="<?=$clsname?>" onmouseover="this.style.backgroundColor='#f6f6f6'" onmouseout="this.style.backgroundColor='transparent'" >
                    <td width="3%" align="left" valign="middle" class="grid-td-left"><input name="chkgrow" id="chkgrow" type="checkbox" value="<?php echo $row['int_glcode']?>" /></td>
                    <td width="28%" align="left" valign="middle" class="grid-td-top">
                    <div class="caption">
                    <label id="label_<?=$row['int_glcode'];?>" ondblclick="enableQuickEdit(<?=$row['int_glcode'];?>)" style="display:block;"><?=$row['var_title'];?>&nbsp;&nbsp;&nbsp;
                    <a href="javascript:" onclick="return enableQuickEdit(<?=$row['int_glcode'];?>);"><img src="<?=GLOBAL_ADMIN_IMAGES_PATH?>edit-icon.png" /></a>
                    </label>
                    <label id="text_<?=$row['int_glcode'];?>" name="textable" style="display:none">
                    <input type="text" class="title-text-listing" name="var_title_<?=$row['int_glcode'];?>" id="var_title_<?=$row['int_glcode'];?>" value="<?=$row['var_title'];?>" />
                    <a href="javascript:" onclick="return photo_title_update('<?=$photogalleryObj->urlwithpara?>','<?=$row['int_glcode']?>');"><b>Update</b></a>&nbsp;
                    <a href="javascript:enableQuickEdit(<?=$row['int_glcode'];?>)"><b>Cancel</b></a>
                    </label>
                    </div>
                    </td>
                   <td width="9%" align="center" valign="middle" class="grid-td-top"><a href="<?=$photogalleryObj->urlwithoutsort?>&action=edit&eid=<?=$row['int_glcode']?>" >Edit</a></td>
                    <td width="8%" align="center" valign="middle" class="grid-td-top">

            <?php if(file_exists("../upimages/pagephoto/images/thumb_".trim($row['var_image']))&& $row['chr_validthumb']=='Y'){  ?>
                     <a onClick="return hs.expand(this);" href="<?php echo "../upimages/pagephoto/images/thumb_".trim($row['var_image'])?>">
                     <img border="0" src="<?=GLOBAL_ADMIN_IMAGES_PATH?>/photo-gallery-icon.png" >
                     </a>
            <?php } ?>
                    </td>
                      <td width="15%" align="center" valign="middle" class="grid-td-top">
                        <input name="displayorder<?=$rowcount?>" type="text" class="order" id="displayorder<?=$rowcount?>"  onkeypress="return KeycheckOnlyNumeric(event);" value="<?=$row['int_displayorder'];?>" size="7%" />
                        <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="7%" align="center" valign="middle" class="grid-td-top">
                    <?php
                        if($row['chr_publish'] == 'Y')
                        {
                            $publishtext = "Hide me";
                        }
                        else
                        {
                            $publishtext = "Publish me";
                        }
                    ?>
                
                        <a href="#">
                        <img id="tick-<?=$row['int_glcode']?>" height="16" width="16" alt="publish me" title="" src="<?=GLOBAL_ADMIN_IMAGES_PATH?><?=$tickimg?>" style="vertical-align:middle;cursor:pointer;" onclick="UpdatePublish('<?=DB_PREFIX ?>pagephoto','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">No records are available.</td>
                </tr>
                <?php  } ?>
                <input type="hidden" name="ptrecords" id="ptrecords" value="<?=$rowcount?>">
            </table>
        </div>
    </div>
    <div class="clear"></div>
<?php echo $pagingBottom;
    
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>
    <?php } ?>
</div> 