<?php
foreach ($random_patient as $rf) {
    ?>
    <div class="sections sml">
        <p class="gallery">
            <?php if ($rf['ph_url'] != null) { ?>
                <?php if (file_exists(PUBPATH . "global/uploads/" . $rf['ph_url'])) { ?>
                    <a href="<?= base_url() ?>global/uploads/<?php echo $rf['ph_url'] ?>" title="اضغط هنا لعرض الصورة">
                        <img src="<?= base_url() ?>global/uploads/<?php echo $rf['ph_url'] ?>" alt=""/>
                        <br />
                    </a>

                    <?php } else {
                    ?>
                    <a href="javascript:void(0)"><img src="<?= base_url() ?>global/site/images/ramzya/<?= $rf['pt_img'] ?>" alt="صورة رمزية" /></a>
                <?php
                }
            } else {
                ?>
                <a href="javascript:void(0)"><img src="<?= base_url() ?>global/site/images/ramzya/<?= $rf['pt_img'] ?>" alt="صورة رمزية" /></a>
            <?php } ?>
        </p>
        <a href="<?= base_url() ?>patient/show/<?= $rf['pi_id']; ?>"><?= $rf['pi_name']; ?></a>
        <p><?= $rf['pi_product_desc']; ?></p>
    </div>
    <?php
}
?>






