<?php
include_once('inc.function.php');
?>

 		<table class="table table-striped table-bordered table-hover">
            <thead>
                <tr>
                    <th class="center">Item Selected</th>
                    <th class="center">Layout</th>
                    <th class="center">Capacity</th>
                    <th class="center">Action</th>
               </tr>
            </thead>
            <tbody>
            	<?php
            	    foreach ( $_SESSION['ITEM_SELECTED'] AS $row_session ) 
					{  
						$CART_ID = $row_session['SETUP_ID'];
                        $FAC_SELECTED[] = $row_session['ITEM_AVAILABILITY'];
						$FAC_MODAL[] = $row_session['SETUP_ID'];
				?>
            	<tr>
            		<td class="center"><?php echo $row_session['ITEM_DESCRIPTION']; ?></td>
            		<td class="center"><?php echo $row_session['SETUP_LAYOUT']; ?></td>
            		<td class="center"><?php echo $row_session['SETUP_CAPACITY']; ?></td>
            		<td class="center"><a href="#RemoveCart<?php echo $CART_ID; ?>" class="hidden-sm" data-toggle="modal"><button type="button" class="btn btn-danger btn-sm"><i class="glyphicon glyphicon-trash"></i>Remove</button></a></p></td>
            	</tr>
            	<?php 
					}
				?>
            </tbody>
        </table>

        <?php
        if(isset($_SESSION['ITEM_SELECTED']) && !empty($_SESSION['ITEM_SELECTED'])) {
   			echo '<a href="booking_event.php"><button class="btn btn-primary btn-lg pull-right">Next</button></a>';
		} 
		?>
        

       <?php
            foreach ($FAC_MODAL as $key => $val) {
       ?>

       <form method="POST" action="delete_cart.php">
       		<input type="hidden" name="PAGE_ID" id="PAGE_ID" value="1">
       		<input type="hidden" name="SETUP_ID" id="SETUP_ID" value="<?php echo $val; ?>">
            <!-- Modal Add Layout -->
            <div id="RemoveCart<?php echo $val; ?>" class="modal fade">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                           <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title">Cart Removal </h4>
                            </div>
                                 <div class="modal-body">

                                 	<p>Are you sure you want to remove this cart?</p>

                                 </div>
                        <div class="modal-footer">
                                <button type="button" class="btn btn-default btn-lg" data-dismiss="modal">Cancel</button>
                                <input type="submit" class="btn btn-danger btn-lg" value="Remove" />
                       </div>
                    </div>
                </div>
            </div>
        </form>
                        
		<?php
             }
        ?>