<script type="text/javascript" src="<?= base_url() ?>global/site/js/jquery.infinitecarousel.js"></script>

<script type="text/javascript">
    $(function() {
        $('#carousel').infiniteCarousel({imagePath: 'images/'});
        $('div.thumb').parent().css({'margin': '20px auto', 'width': '600px'});
    });
</script>

<div id="middleContent">                

    <!-- Gallery Script Strat -->
    <div class="block">
        <div class="title">اسر منتجة (حرفيات)</div>
        <div id="carousel" style="direction:ltr">
            <ul>
                <?php foreach ($photos as $ph) { ?>
                    <?php if ($ph['ph_url'] != null) { ?>
                        <?php if (file_exists(PUBPATH . "global/uploads/" . $ph['ph_url'])) { ?>
                            <li><img src="<?= base_url() ?>global/uploads/<?php echo $ph['ph_url'] ?>" alt="" width="400" height="325"/></li>
                            <?php
                        }
                    } else {
                        ?>
                        <li><img alt="" src="<?= base_url() ?>global/site/data/images(1).jpg" width="400" height="325"/></li>
                        <li><img alt="" src="<?= base_url() ?>global/site/data/images(1).jpg" width="400" height="325"/></li>
                        <li><img alt="" src="<?= base_url() ?>global/site/data/images(1).jpg" width="400" height="325"/></li>
                        <li><img alt="" src="<?= base_url() ?>global/site/data/images(1).jpg" width="400" height="325"/></li>
                        <li><img alt="" src="<?= base_url() ?>global/site/data/images(1).jpg" width="400" height="325"/></li>
                        <li><img alt="" src="<?= base_url() ?>global/site/data/images(1).jpg" width="400" height="325"/></li>
                        <li><img alt="" src="<?= base_url() ?>global/site/data/images(1).jpg" width="400" height="325"/></li>
                        <li><img alt="" src="<?= base_url() ?>global/site/data/images(1).jpg" width="400" height="325"/></li>
                    <?php } ?>
                <?php } ?>
            </ul>
        </div>

        <?php foreach ($videos as $ph) { ?>
            <iframe style="display:inline-block;margin:0 10px 10px 0" width="331" height="260" frameborder="0" allowfullscreen="" src="http://www.youtube.com/embed/<?= $ph['vi_url'] ?>"></iframe>
        <?php } ?>

    </div>               
    <!-- Gallery Script End -->
</div>               

