<?php
session_start();
define('Admin_USER',true);

require_once("../../../php/defines.php");
require_once("../../../php/classes/mainClass.php");
require_once("../../../php/classes/galleryClass.php");
$gal = new galleryClass;

$display = '';

switch($_POST['Option']){
  
      case "Albums":
            
            $display .= '<h1 style="width:100%;text-align:center; padding-bottom:35px;">Photo Gallery Albums</h1>';

            $albums = $gal->getAlbumDisplayList();
            
            $display .= '<section id="Image_Listing">';
            
            if($albums[0]['Nbr'] != ''){
                                
                for($i=0;$i<count($albums);$i++){

                    $display .= '<div class="img_container" id="Album_'.$albums[$i]['Nbr'].'" name="Album_'.$albums[$i]['Nbr'].'">';
                    $display .= '<figure>';
                    $display .= '<figcaption title="'.$albums[$i]['Name'].'" id="Title_'.$albums[$i]['Nbr'].'" name="Title_'.$albums[$i]['Nbr'].'">';
                    $display .= substr($albums[$i]['Name'],0,14);
                    if(strlen($albums[$i]['Name']) > 14){

                        $display .= ' ...';

                    }
                    $display .= '</figcaption>';
                    if($albums[$i]['Display_Image_Name'] != ''){
                    
                        $display .= '<img src="'.WEBSITE_ADDY.'/'.GALLERY_IMAGES.'/small/'.$albums[$i]['Display_Image_Name'].'"  class="thumb-img" onclick="getImages(\''.$albums[$i]['Nbr'].'\');"/>';
                        
                    }else{
                        
                        $display .= '<img src="images/default-thumb.jpg"  class="thumb-img" onclick="getImages(\''.$albums[$i]['Nbr'].'\');" title="View Images"/>';
                        
                    }
                    $display .= '</figure>';
                    $display .= '<span>';
                    $display .= '<select id="Album_Options_'.$albums[$i]['Nbr'].'" onchange="initiateAlbumPopup(\''.$albums[$i]['Nbr'].'\');" title="View Images">';
                    $display .= '<option value="">Options</option>';
                    $display .= '<option value="album-view-images">View Images</option>';
                    $display .= '<option value="add-images">Add Images</option>';
                    $display .= '<option value="album-change-name">Change Name</option>';
                    $display .= '<option value="album-change-status">Change Status</option>';
                    $display .= '<option value="album-set-display-image">Set Display Image</option>';
                    $display .= '<option value="album-change-category">Change Album Category</option>';
                    $display .= '<option value="album-delete">Delete</option>';
                    $display .= '</select>';                    
                    $display .= '</span>';
                    $display .= '<input type="hidden" value="'.$albums[$i]['Name'].'" id="AlbumName_'.$albums[$i]['Nbr'].'" name="AlbumName_'.$albums[$i]['Nbr'].'">';
                    $display .= '</div>';

                }
                
            }else{
                
                $display .= '<p class="empty_msg">You do not have any photo albums to display.</p>';
                
            }
            $display .= '</section>';
          
      break;
      case "All_Albums":
            
        $display .= '<h1 style="width:100%;text-align:center; padding-bottom:35px;">All Photo Gallery Albums</h1>';

        $albums = $gal->getAlbumDisplayList();
        
        $display .= '<section id="Image_Listing">';
        $display .= '<input type="hidden" value="All" id="All" name="All">'; 
        if($albums[0]['Nbr'] != ''){
                            
            for($i=0;$i<count($albums);$i++){

                $display .= '<div class="img_container" id="Album_'.$albums[$i]['Nbr'].'" name="Album_'.$albums[$i]['Nbr'].'">';
                $display .= '<figure>';
                $display .= '<figcaption title="'.$albums[$i]['Name'].'" id="Title_'.$albums[$i]['Nbr'].'" name="Title_'.$albums[$i]['Nbr'].'">';
                $display .= '<strong>'.substr($albums[$i]['Category_Name'],0,14).'</strong><br/>';
                $display .= substr($albums[$i]['Name'],0,14);
                if(strlen($albums[$i]['Name']) > 14){

                    $display .= ' ...';

                }
                $display .= '</figcaption>';
                if($albums[$i]['Display_Image_Name'] != ''){
                
                    $display .= '<img src="'.WEBSITE_ADDY.'/'.GALLERY_IMAGES.'/small/'.$albums[$i]['Display_Image_Name'].'"  class="thumb-img" onclick="getImages(\''.$albums[$i]['Nbr'].'\');"/>';
                    
                }else{
                    
                    $display .= '<img src="images/default-thumb.jpg"  class="thumb-img" onclick="getImages(\''.$albums[$i]['Nbr'].'\');" title="View Images"/>';
                    
                }
                $display .= '</figure>';
                $display .= '<span>';
                $display .= '<select id="Album_Options_'.$albums[$i]['Nbr'].'" onchange="initiateAlbumPopup(\''.$albums[$i]['Nbr'].'\');" title="View Images">';
                $display .= '<option value="">Options</option>';
                $display .= '<option value="album-view-images">View Images</option>';
                $display .= '<option value="add-images">Add Images</option>';
                $display .= '<option value="album-change-name">Change Name</option>';
                $display .= '<option value="album-change-status">Change Status</option>';
                $display .= '<option value="album-set-display-image">Set Display Image</option>';
                $display .= '<option value="album-change-category">Change Album Category</option>';
                $display .= '<option value="album-delete">Delete</option>';
                $display .= '</select>';                    
                $display .= '</span>';                               
                $display .= '</div>';

            }
            
        }else{
            
            $display .= '<p class="empty_msg">You do not have any photo albums to display.</p>';
            
        }
        $display .= '</section>';
      
      break;      
      case "Images":
          
            $display .= '<h1 style="width:100%;text-align:center;padding-bottom:35px;">Photo Gallery Images</h1>';
          
            $albums = $gal->getAlbums();
            $images = $gal->getDisplayImages();
               
            if($images[0]['Nbr'] != ''){
            
                $display .= '<form>';
                $display .= '<div class="form-group">';
                $display .= '<select  class="col-md-12" id="Albums" name="Albums" onchange="getImages(\'\',\'\');">';
                $display .= '<option value="">All Albums</option>';
                for($i=0;$i<count($albums);$i++){

                    if($albums[$i]['Name'] != ''){

                    $display .= '<option value="'.$albums[$i]['Nbr'].'">'.$albums[$i]['Name'].'</option>';

                    }

                }
                $display .= '</select>';
                $display .= '</div>';       
                $display .= '</form>';  
                $display .='<div id="AnimationAlt" style="margin-top:50px;">';
                $display .='<div class="blockG" id="rotateG_01"></div>';
                $display .='<div class="blockG" id="rotateG_02"></div>';
                $display .='<div class="blockG" id="rotateG_03"></div>';
                $display .='<div class="blockG" id="rotateG_04"></div>';
                $display .='<div class="blockG" id="rotateG_05"></div>';
                $display .='<div class="blockG" id="rotateG_06"></div>';
                $display .='<div class="blockG" id="rotateG_07"></div>';
                $display .='<div class="blockG" id="rotateG_08"></div>';                                          
                $display .='</div>';              
                $display .= '<section id="Image_Listing">';
                for($i=0;$i<count($images);$i++){

                    $display .= '<div class="img_container" id="Image_'.$images[$i]['Nbr'].'" name="Image_'.$images[$i]['Nbr'].'">';
                    $display .= '<figure>';
                    $display .= '<img src="'.WEBSITE_ADDY.'/'.GALLERY_IMAGES.'/small/'.$images[$i]['Name'].'"  class="thumb-img"/ onclick="initiatePopup(\'image-view\',\''.$images[$i]['Nbr'].'\');">';
                    $display .= '</figure>';
                    $display .= '<span>';
                    $display .= '<select id="Image_Options_'.$images[$i]['Nbr'].'" onchange="initiateImagePopup(\''.$images[$i]['Nbr'].'\');">';
                    $display .= '<option value="">Options</option>';
                    $display .= '<option value="image-change-album">Change Album/Category</option>';
                    $display .= '<option value="image-edit-description">Edit Description</option>';
                    $display .= '<option value="image-change-status">Change Status</option>';
                    $display .= '<option value="image-delete">Delete</option>';
                    $display .= '</select>';
                    $display .= '</span>';
                    $display .= '<input type="hidden" value="'.$images[$i]['Name'].'" id="ImageName_'.$images[$i]['Nbr'].'" name="ImageName_'.$images[$i]['Nbr'].'">';                    
                    $display .= '</div>';                    

                }
                $display .= '</section>';
                
            }else{
                
                $display .= '<p class="empty_msg">You do not have any photos to display.</p>';
                
            }                
          
      break;
      case "Album_Images":
          
            $images = $gal->getDisplayImages($_POST['Album']);
            $albumInfo = $gal->getAlbumInfo($_POST['Album']);

            $display .= '<form>';
            $display .= '<div class="form-group">';
            if(isset($_POST['All']) && $_POST['All'] == 'All'){

                $display .= '<div class="return-div"><span onclick="galleryDisplay();"><< RETURN TO All ALBUMS</span></div>';

            }else{
                if(isset($_POST['AlbumCategoryId']) && $_POST['AlbumCategoryId'] != ''){
                 
                    $albumCatId = $_POST['AlbumCategoryId'];

                }else{

                    $albumCatId = $albumInfo['Category'];

                }                
                $display .= '<div class="return-div"><span onclick="galleryDisplay(\''.$albumCatId.'\');"><< RETURN TO ALBUMS</span></div>';

            }
            $display .= '</div>';       
            $display .= '</form>';  

            $display .= '<h1 style="width:100%;text-align:center; padding-bottom:35px;">'.$albumInfo['Name'].' </h1>';        

            $display .= '<section id="Image_Listing">';   
             
           if($images[0]['Nbr'] != ''){                 
             
            for($i=0;$i<count($images);$i++){
                
                $display .= '<div class="img_container" id="Image_'.$images[$i]['Nbr'].'" name="Image_'.$images[$i]['Nbr'].'">';
                $display .= '<figure>';
                $display .= '<img src="'.WEBSITE_ADDY.'/'.GALLERY_IMAGES.'/small/'.$images[$i]['Name'].'"  class="thumb-img" onclick="initiatePopup(\'image-view\',\''.$images[$i]['Nbr'].'\');"/>';
                $display .= '</figure>';
                if($_POST['DisplayImage'] != 'Display'){
                    
                    $display .= '<span>';                    
                    $display .= '<select id="Image_Options_'.$images[$i]['Nbr'].'" onchange="initiateImagePopup(\''.$images[$i]['Nbr'].'\');">';
                    $display .= '<option value="">Options</option>';
                    $display .= '<option value="image-change-album">Change Album/Category</option>';
                    $display .= '<option value="image-edit-description">Edit Description</option>';
                    $display .= '<option value="image-change-status">Change Status</option>';
                    $display .= '<option value="image-delete">Delete</option>';
                    $display .= '</select>';
                    $display .= '</span>';
                    
                }
                if($_POST['DisplayImage'] == 'Display'){
                    
                      $display .= '<span>'; 
                      $display .= '<div class="form-group">';
                      $display .= '<label style="text-align:left;">Set As Display Image</label>';
                      $display .= '<div>';
                      $display .= '<input type="checkbox" id="Display_'.$images[$i]['Nbr'].'" value="1" name="Display_'.$images[$i]['Nbr'].'"';
                      if($images[$i]['Display_Image'] == 'Yes'){
                          
                          $display .= ' checked="checked"';
                          
                      }
                      $display .= ' onclick="setDisplayImage(\''.$images[$i]['Nbr'].'\',\''.$images[$i]['Album'].'\');">';
                      $display .= '</div>';
                      $display .= '</div>';
                      $display .= '</span>';
                    
                }
                $display .= '<input type="hidden" value="'.$images[$i]['Name'].'" id="ImageName_'.$images[$i]['Nbr'].'" name="ImageName_'.$images[$i]['Nbr'].'">';
                $display .= '</div>';
            
            }
                      
            
           }else{
               
               $display .= '<p class="empty_msg">You do not have any photos in this album to display.</p>';
               
           }
            $display .= '</section>';
          
      break;   
      case "Categories":
            
        $display .= '<h1 style="width:100%;text-align:center; padding-bottom:35px;">Photo Gallery Categories</h1>';
       
         $cats = $gal->getAlbumCategoryDisplayList();  
         
         $display .= '<section id="Image_Listing">';
         
         if($cats[0]['Nbr'] != ''){
                             
             for($i=0;$i<count($cats);$i++){

                 $display .= '<div class="img_container" id="Cat_'.$cats[$i]['Nbr'].'" name="Cat_'.$cats[$i]['Nbr'].'">';
                 $display .= '<figure>';
                 $display .= '<figcaption title="'.$cats[$i]['Name'].'" id="Title_'.$cats[$i]['Nbr'].'" name="Title_'.$cats[$i]['Nbr'].'">';
                 $display .= substr($cats[$i]['Name'],0,14);
                 if(strlen($cats[$i]['Name']) > 14){

                     $display .= ' ...';

                 }
                 $display .= '</figcaption>';
                 if($cats[$i]['Display_Image_Name'] != ''){
                 
                     $display .= '<img src="'.WEBSITE_ADDY.'/'.GALLERY_IMAGES.'/small/'.$cats[$i]['Display_Image_Name'].'"  class="thumb-img" onclick="getAlbumsByCategory(\''.$cats[$i]['Nbr'].'\');" title="View Albums"/>';
                     
                 }else{
                     
                     $display .= '<img src="images/default-thumb.jpg"  class="thumb-img" onclick="getAlbumsByCategory(\''.$cats[$i]['Nbr'].'\');" title="View Albums"/>';
                     
                 }
                 $display .= '</figure>';
                 $display .= '<span>';
                 $display .= '<select id="Album_Category_Options_'.$cats[$i]['Nbr'].'" onchange="initiateAlbumCategoryPopup(\''.$cats[$i]['Nbr'].'\');">';
                 $display .= '<option value="">Options</option>';
                 $display .= '<option value="album-category-albums">View All Albums</option>';                 
                 $display .= '<option value="album-category-view-images">View All Images</option>';
                 $display .= '<option value="album-category-change-name">Change Name</option>';
                 $display .= '<option value="album-category-change-status">Change Status</option>';
                 $display .= '<option value="album-category-set-display-image">Set Display Image</option>';
                 $display .= '<option value="album-category-delete">Delete</option>';
                 $display .= '</select>';                    
                 $display .= '</span>';
                 $display .= '<input type="hidden" value="'.$cats[$i]['Name'].'" id="CategoryName_'.$cats[$i]['Nbr'].'" name="CategoryName_'.$cats[$i]['Nbr'].'">';
                 $display .= '</div>';

             }
             
         }else{
             
             $display .= '<p class="empty_msg">You do not have any photo album categories to display.</p>';
             
         }
         $display .= '</section>';
       
      break;      
      case "Album_Category_Images":
          
        $images = $gal->getDisplayImages('',$_POST['AlbumCategoryId']);

        $display .= '<form>';
        $display .= '<div class="form-group">';
        $display .= '<div class="return-div"><span onclick="galleryDisplay();"><< RETURN TO ALBUM CATEGORIES</span></div>';
        $display .= '</div>';       
        $display .= '</form>'; 
        
        $albumCategoryInfo = $gal->getAlbumCategoryInfo($_POST['AlbumCategoryId']);

        $display .= '<h1 style="width:100%;text-align:center; padding-bottom:35px;">'.$albumCategoryInfo['Name'].' | Images All Albums</h1>';        
        $display .= '<input type="hidden" value="'.$_POST['AlbumCategoryId'].'" id="CategoryId" name="CategoryId">';
        
        $display .= '<section id="Image_Listing">';   
         
       if($images[0]['Nbr'] != ''){                 
         
        for($i=0;$i<count($images);$i++){
            
            $display .= '<div class="img_container" id="Image_'.$images[$i]['Nbr'].'" name="Image_'.$images[$i]['Nbr'].'">';
            $display .= '<figure>';
            $display .= '<img src="'.WEBSITE_ADDY.'/'.GALLERY_IMAGES.'/small/'.$images[$i]['Name'].'"  class="thumb-img" onclick="initiatePopup(\'image-view\',\''.$images[$i]['Nbr'].'\');"/>';
            $display .= '</figure>';
            if($_POST['DisplayImage'] != 'Display'){
                
                $display .= '<span>';                    
                $display .= '<select id="Image_Options_'.$images[$i]['Nbr'].'" onchange="initiateImagePopup(\''.$images[$i]['Nbr'].'\');">';
                $display .= '<option value="">Options</option>';
                $display .= '<option value="image-change-album">Change Album/Category</option>';
                $display .= '<option value="image-edit-description">Edit Description</option>';
                $display .= '<option value="image-change-status">Change Status</option>';
                $display .= '<option value="image-delete">Delete</option>';
                $display .= '</select>';
                $display .= '</span>';
                
            }
            if($_POST['DisplayImage'] == 'Display'){
                
                  $display .= '<span>'; 
                  $display .= '<div class="form-group">';
                  $display .= '<label style="text-align:left;">Set As Display Image</label>';
                  $display .= '<div>';
                  $display .= '<input type="checkbox" id="Display_'.$images[$i]['Nbr'].'" value="1" name="Display_'.$images[$i]['Nbr'].'"';
                  if($images[$i]['Album_Category_Display_Image'] == 'Yes'){
                      
                      $display .= ' checked="checked"';
                      
                  }
                  $display .= ' onclick="setAlbumCategoryDisplayImage(\''.$images[$i]['Nbr'].'\',\''.$images[$i]['Category'].'\');">';
                  $display .= '</div>';
                  $display .= '</div>';
                  $display .= '</span>';
                
            }
            $display .= '<input type="hidden" value="'.$images[$i]['Name'].'" id="ImageName_'.$images[$i]['Nbr'].'" name="ImageName_'.$images[$i]['Nbr'].'">';
            $display .= '</div>';
        
        }
                  
        
       }else{
           
           $display .= '<p class="empty_msg">You do not have any photos in this album category to display.</p>';
           
       }
        $display .= '</section>';
      
      break; 
      case "Albums_By_Category":
            
        $display .= '<form>';
        $display .= '<div class="form-group">';
        $display .= '<div class="return-div"><span onclick="galleryDisplay();"><< RETURN TO ALBUM CATEGORIES</span></div>';
        $display .= '</div>';       
        $display .= '</form>';  

        $albumCategoryInfo = $gal->getAlbumCategoryInfo($_POST['AlbumCategoryId']);

        $display .= '<h1 style="width:100%;text-align:center; padding-bottom:35px;">'.$albumCategoryInfo['Name'].' | Photo Gallery Albums </h1>';

        $albums = $gal->getAlbumDisplayList($_POST['AlbumCategoryId']);
        
        $display .= '<input type="hidden" value="'.$_POST['AlbumCategoryId'].'" id="CategoryId" name="CategoryId">';
        $display .= '<section id="Image_Listing">';
        
        if($albums[0]['Nbr'] != ''){
                            
            for($i=0;$i<count($albums);$i++){

                $display .= '<div class="img_container" id="Album_'.$albums[$i]['Nbr'].'" name="Album_'.$albums[$i]['Nbr'].'">';
                $display .= '<figure>';
                $display .= '<figcaption title="'.$albums[$i]['Name'].'" id="Title_'.$albums[$i]['Nbr'].'" name="Title_'.$albums[$i]['Nbr'].'">';
                $display .= substr($albums[$i]['Name'],0,14);
                if(strlen($albums[$i]['Name']) > 14){

                    $display .= ' ...';

                }
                $display .= '</figcaption>';
                if($albums[$i]['Display_Image_Name'] != ''){
                
                    $display .= '<img src="'.WEBSITE_ADDY.'/'.GALLERY_IMAGES.'/small/'.$albums[$i]['Display_Image_Name'].'"  class="thumb-img" onclick="processGetImages(\''.$albums[$i]['Nbr'].'\');"/>';
                    
                }else{
                    
                    $display .= '<img src="images/default-thumb.jpg"  class="thumb-img" onclick="getImages(\''.$albums[$i]['Nbr'].'\');" title="View Images"/>';
                    
                }
                $display .= '</figure>';
                $display .= '<span>';
                $display .= '<select id="Album_Options_'.$albums[$i]['Nbr'].'" onchange="initiateAlbumCategoryAlbumPopup(\''.$albums[$i]['Nbr'].'\');" title="View Images">';
                $display .= '<option value="">Options</option>';
                $display .= '<option value="album-view-images">View Images</option>';
                $display .= '<option value="add-images">Add Images</option>';
                $display .= '<option value="album-change-name">Change Name</option>';
                $display .= '<option value="album-change-status">Change Status</option>';
                $display .= '<option value="album-set-display-image">Set Display Image</option>';
                $display .= '<option value="album-change-category">Change Album Category</option>';
                $display .= '<option value="album-delete">Delete</option>';
                $display .= '</select>';                    
                $display .= '</span>';
                $display .= '<input type="hidden" value="'.$albums[$i]['Name'].'" id="AlbumName_'.$albums[$i]['Nbr'].'" name="AlbumName_'.$albums[$i]['Nbr'].'">';
                $display .= '</div>';

            }
            
        }else{
            
            $display .= '<p class="empty_msg">You do not have any photo albums to display.</p>';
            
        }
        $display .= '</section>';
      
      break;
      case "Update_Album_Menu":
        if($_POST['CategoryId'] != ''){

            $albums = $gal->getAlbums($_POST['CategoryId']);

        }else{

            $albums = array();

        }
        $display .= '<select  class="col-md-12" id="Album" name="Album" onchange="galleryAlbum();" ';
        if($_POST['CategoryId'] == ''){

            $display .= 'disabled="disabled" ';

        }
        $display .= '>';
        $display .= '<option value="">Choose Album</option>';
        for($i=0;$i<count($albums);$i++){
            
            if($albums[$i]['Name'] != ''){
            
                $display .= '<option value="'.$albums[$i]['Nbr'].'"';
                if(isset($_GET['Id']) && $_GET['Id'] == $albums[$i]['Nbr']){
                    
                    $display .= ' selected="selected"';
                    
                }    
                $display .= '>'.$albums[$i]['Name'].'</option>';
                
            }
            
        }
        $display .= '</select>';
      break;
      case "Category_Album_Images":
          
        $images = $gal->getDisplayImages($_POST['Album']);
        $albumCategoryInfo = $gal->getAlbumCategoryInfo($_POST['AlbumCategoryId']);
        $albumInfo = $gal->getAlbumInfo($_POST['Album']);

        $display .= '<form>';
        $display .= '<div class="form-group">';
        $display .= '<div class="return-div"><span onclick="galleryDisplay(\''.$_POST['AlbumCategoryId'].'\');"><< RETURN TO ALBUMS</span></div>';
        $display .= '</div>';       
        $display .= '</form>';  

        $display .= '<h1 style="width:100%;text-align:center; padding-bottom:35px;">'.$albumCategoryInfo['Name'].' | '.$albumInfo['Name'].' </h1>';        

        $display .= '<section id="Image_Listing">';   
         
       if($images[0]['Nbr'] != ''){                 
         
        for($i=0;$i<count($images);$i++){
            
            $display .= '<div class="img_container" id="Image_'.$images[$i]['Nbr'].'" name="Image_'.$images[$i]['Nbr'].'">';
            $display .= '<figure>';
            $display .= '<img src="'.WEBSITE_ADDY.'/'.GALLERY_IMAGES.'/small/'.$images[$i]['Name'].'"  class="thumb-img" onclick="initiatePopup(\'image-view\',\''.$images[$i]['Nbr'].'\');"/>';
            $display .= '</figure>';
            if($_POST['DisplayImage'] != 'Display'){
                
                $display .= '<span>';                    
                $display .= '<select id="Image_Options_'.$images[$i]['Nbr'].'" onchange="initiateImagePopup(\''.$images[$i]['Nbr'].'\');">';
                $display .= '<option value="">Options</option>';
                $display .= '<option value="image-change-album">Change Album/Category</option>';
                $display .= '<option value="image-edit-description">Edit Description</option>';
                $display .= '<option value="image-change-status">Change Status</option>';
                $display .= '<option value="image-delete">Delete</option>';
                $display .= '</select>';
                $display .= '</span>';
                
            }
            if($_POST['DisplayImage'] == 'Display'){
                
                  $display .= '<span>'; 
                  $display .= '<div class="form-group">';
                  $display .= '<label style="text-align:left;">Set As Display Image</label>';
                  $display .= '<div>';
                  $display .= '<input type="checkbox" id="Display_'.$images[$i]['Nbr'].'" value="1" name="Display_'.$images[$i]['Nbr'].'"';
                  if($images[$i]['Display_Image'] == 'Yes'){
                      
                      $display .= ' checked="checked"';
                      
                  }
                  $display .= ' onclick="setDisplayImage(\''.$images[$i]['Nbr'].'\',\''.$images[$i]['Album'].'\');">';
                  $display .= '</div>';
                  $display .= '</div>';
                  $display .= '</span>';
                
            }
            $display .= '<input type="hidden" value="'.$images[$i]['Name'].'" id="ImageName_'.$images[$i]['Nbr'].'" name="ImageName_'.$images[$i]['Nbr'].'">';
            $display .= '</div>';
        
        }
                  
        
       }else{
           
           $display .= '<p class="empty_msg">You do not have any photos in this album to display.</p>';
           
       }
        $display .= '</section>';
      
  break;        

}

echo $display;
exit;



?>