

<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>
<div id="modelpopup" title="Share on Facebook & Twitter"></div>
<?php
$i = 1;
$photo_int_glcode = "";
if (!empty($photosArr)) {
    foreach ($photosArr as $key => $photo) {
//        echo "<pre/>";
//        print_r($photo);
        $photo_thumb = $photo['var_image'];
        $thumb = "../upimages/photogallery/images/thumb_" . $photo_thumb;
        if (file_exists($thumb)) {
            $thumbphoto = SITE_PATH . "upimages/photogallery/images/thumb_" . $photo_thumb;
            $mainphoto = SITE_PATH . "upimages/photogallery/images/" . $photo_thumb;
        } else {
            $thumbphoto = 'images/admin-image.jpg';
        }
        $display = ($photo['chr_publish'] == 'Y') ? 'publish-icon active' : 'publish-icon';
        $display_title = ($photo['chr_publish'] == 'Y') ? 'Hide me' : 'Display me';
        $photo_int_glcode .= $photo['int_displayorder'] . ',';
        ?>
        <li data-itemid="<?php echo $photo['int_displayorder']; ?>" id="<?= $photo['int_glcode'] ?>">
            <div class="photo-wrapper">
                <div class="photo-wrapper-img" >
                    <table border="0" cellspacing="0" cellpadding="0">
                        <tr id="drg-img-div">
                            <td width="269" height="161" align="center" valign="middle" id="drg-img-div">
                                <img src="<?php echo $thumbphoto ?>" alt="photos" id="drg-img" style="cursor: pointer;"/></td>
                        </tr>
                    </table>
                </div>
                <div class="photo-caption">
                    <?php
                    $shareimg = "1-push.png";
                    if ($photo['varphotocaption'] == '') {
                        $imagename = $photo['albumTitle'];
                    } else {
                        $imagename = $photo['varphotocaption'];
                    }
                    ?>
                    <textarea name="varphotocaption" cols="" rows="" id="varphotocaption_<?= $photo['int_glcode'] ?>" ><?php echo $imagename; ?></textarea>
                </div>
                <div class="photo-icons" >
                    <a href="javascript:void(0);" onclick="deletealbumphoto('<?= $photo['int_glcode'] ?>','<?= $_REQUEST['fk_album'] ?>','<?= $photo['chr_delete'] ?>')" class="delete-icon" title="Delete Photo"></a>
                    <a href="javascript:void(0);" onclick="savealbumcaption('<?= $photo['int_glcode'] ?>','<?= $_REQUEST['fk_album'] ?>')" class="save-icon" title="Save Caption"></a>
                    <a href="javascript:void(0);" onclick="setpublish_unpublish('<?= $photo['int_glcode'] ?>','<?= $_REQUEST['fk_album'] ?>','<?= $photo['chr_publish'] ?>');" class="<?= $display ?>" title="<?= $display_title ?>"></a>
                    <a onClick="return hs.expand(this);"  title="View Photo" href="<?php echo $mainphoto ?>" >
                        <img src="<?php echo $thumbphoto ?>" alt="View" width="33" height="30" border="0" align="absmiddle" id="myimage" style="height: 30px; width: 33px;" /></a>
                    <img id="shar-<?= $photo['int_glcode'] ?>" height="25" width="77" alt="<?= $photo["varphotocaption"] . "share" ?>" title="<?= $photo["varphotocaption"] . " is share." ?>" src="<?= GLOBAL_ADMIN_IMAGES_PATH ?><?= $shareimg ?>" style="vertical-align:middle;cursor:pointer;<?= $display ?>" onclick="share('<?= $photo['int_glcode'] ?>','<?=$_REQUEST["fk_album"]?>');">
                </div>
                
            </div>  
            
        </li>
        <?php
        $i++;
    }
} else {
    echo '<div style="text-align: center;padding: 10px;" id="nophoto">No photos uploaded</div>';
}
?>  
