function index()
 {
     $gal = new Gallery();
     $arrGal = $gal->getWhere("gallery_active = 1 AND gallery_carousel = 0 ORDER BY gallery_name ASC");
     //        pr($arrGal);
     $arr['arrGal'] = $arrGal;
     $layout_id = "Gallery_index";
     $file = Layout::getFile($layout_id);
     //        echo "Pages/".$layout_id."/".$file;
     Mold::theme("Pages/" . $layout_id . "/" . $file, $arr);
     //        Mold::theme("Pages/Gallery_index",$arr);
 }
    function galleryLoad()
    {
        $gal = new Gallery();
        $arrGal = $gal->getWhere("gallery_name != '' ORDER BY gallery_date DESC");
        foreach ($arrGal as $gal) {
            $gp = new Galleryphoto();
            $gp->getMainpic($gal->gallery_id);
            ?>
            <div class="gallery-item col-md-4">
                <div class="paddingmargingallery">
                    <?php 
            if ($gp->photo_filename != "") {
                ?>
                        <div class="col-md-4 col-sm-4 col-xs-4">
                            <img class="img-responsive img-rounded"
                                 src="<?php 
                echo _SPPATH;
                echo $this->uploadURLThumb;
                echo $gp->photo_filename;
                ?>
">
                        </div>
                    <?php 
            }
            ?>
                    <div class="col-md-8 col-sm-8 col-xs-8">
                        <div class="gallery-date ">
                            <small><?php 
            echo indonesian_date($gal->gallery_date);
            ?>
</small>
                        </div>
                        <div class="gallery-name" onclick="gallery_open(<?php 
            echo $gal->gallery_id;
            ?>
);">

                            <?php 
            echo $gal->gallery_name;
            ?>

                        </div>
                    </div>

                    <div class="clearfix"></div>
                    <div class="gp_menu" style="margin:0 auto; padding-top: 5px;">
                        <button type="button"
                                onclick="if(confirm('<?php 
            echo Lang::t("Are You Sure? This will delete the selected album and all the pictures within the album");
            ?>
'))gallery_delete(<?php 
            echo $gal->gallery_id;
            ?>
);event.preventDefault();"
                                class="btn btn-default"><?php 
            echo Lang::t('delete');
            ?>
</button>
                    </div>
                </div>
            </div>
        <?php 
        }
    }
    function galleryLoad()
    {
        $gal = new Gallery();
        $arrGal = $gal->getWhere("gallery_name != '' ORDER BY gallery_date DESC");
        foreach ($arrGal as $gal) {
            $gp = new Galleryphoto();
            $gp->getMainpic($gal->gallery_id);
            ?>
            <div class="gallery-item col-md-4" >
                <div style="position: absolute; width: 20px; height: 20px; padding: 5px; z-index:1;">
                    <input onclick="gallery_actived('<?php 
            echo $gal->gallery_id;
            ?>
');"  type="checkbox" <?php 
            if ($gal->gallery_active) {
                echo "checked";
            }
            ?>
>
                </div>
                <div class="paddingmargingallery">
                    <?php 
            if ($gp->photo_filename != "") {
                ?>

                            <img style="cursor: pointer;"  onclick="gallery_open(<?php 
                echo $gal->gallery_id;
                ?>
);" width="100%" src="<?php 
                echo _SPPATH . _PHOTOURL;
                ?>
thumbnail/<?php 
                echo $gp->photo_filename;
                ?>
">

                    <?php 
            }
            ?>

                        <div class="gallery-date ">
                            <small><?php 
            echo indonesian_date($gal->gallery_date);
            ?>
</small>
                        </div>
                        <div style="cursor: pointer;" class="gallery-name" onclick="gallery_open(<?php 
            echo $gal->gallery_id;
            ?>
);">

                            <?php 
            echo $gal->gallery_name;
            ?>

                        </div>


                    <div class="clearfix"></div>
                    <div class="gp_menu" style="margin:0 auto; padding-top: 5px;">
                        <button type="button" onclick="if(confirm('<?php 
            echo Lang::t("Are You Sure? This will delete the selected album and all the pictures within the album");
            ?>
'))gallery_delete(<?php 
            echo $gal->gallery_id;
            ?>
);event.preventDefault();" class="btn btn-default"><?php 
            echo Lang::t('delete');
            ?>
</button>
                    </div>
                </div>
            </div>
        <?php 
        }
    }