<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Seating Plan</title>
</head>
<body>
    <div style="margin: 0 auto;display: block;width: 500px;">
        <table width="100%" border="1">
            <thead>
                <tr>
                    <?php if(isset($fields['profile_image'])): ?><td>Image</td><?php endif; ?>
                    <?php if(isset($fields['name'])): ?><td>Name</td><?php endif; ?>
                    <?php if(isset($fields['country'])): ?><td>Country</td><?php endif; ?>
                    <?php if(isset($fields['seating'])): ?><td>Seating</td><?php endif; ?>
                    <?php if(isset($fields['stage'])): ?><td>Table/Row</td><?php endif; ?>
                </tr>
            </thead>
            <?php
            helper('functions');
            $ids = array();
            foreach($booked as $obj):
                $ids[] = $obj['id'];
                $img = "";
                if(isset($fields['profile_image']) && $fields['profile_image'] != "")
                    $img = imageToBase64(base_url('assets/images/profiles/' . $obj['profile_image']));
            ?>
            <tr>
                <?php if(isset($fields['profile_image'])): ?><td><img height="30px" width="30px" src="<?=$img?>" alt="face"></td><?php endif; ?>
                <?php if(isset($fields['name'])): ?><td><?=$obj['name']?></td><?php endif; ?>
                <?php if(isset($fields['country'])): ?><td><?=$obj['country']?></td><?php endif; ?>
                <?php if(isset($fields['seating'])): ?><td><?=$obj['seating']?></td><?php endif; ?>
                <?php if(isset($fields['stage'])): ?><td><?=$obj['stage']?></td><?php endif; ?>
            </tr>
            <?php
            endforeach;
            ?>
        </table>
    </div>
</body>
</html>