<?php include("links/top.php");
$action=$_GET['action'];
?>
<?php
if($action=='delete'){
$id=$_GET['id'];

$del="delete from subscribe where id='$id'";
$DB->executeQuery($del);

header('Location:subscribe.php?action=list');
}
?>
<?php
if(isset($_POST['update'])){
$id=$_GET['id'];
extract($_POST);

$arr=array('delivery'  => $delivery,'updated' 	=> date('Y-m-d H:i:s'));
$DB->update('subscribe',$arr,"id='$id'");

header('Location: subscribe.php?action=list&oid='.$oid);
}
?>
		<div id="content">
			<div class="container">
				<div class="page-header">
					<div class="page-title">
						<h3>Subscribe Management</h3>
					</div>
				</div>
				<div class="row">

					<div class="col-md-12">
                     
					<div class="widget box">
                        <div class="widget-header">
                            <h4>Subscribe List</h4>
							</div>
                        <div class="widget-content">
                             <?php if($action=='list'){
								 $sno=1;
								$sel=executeQuery("select * from subscribe");
								?>

								<table class="table table-striped table-bordered table-hover table-checkable datatable">
									<thead>
										<tr>
											<!-- <th class="checkbox-column"><input type="checkbox" class="uniform"></th> -->
                                 <th>S.No</th>
								 <th>Name</th>
                                 <th>Email</th>
                                
										</tr>
									</thead>
									<tbody>
                                    <?php
								  $sno=1;
								 while($rec=getAssoc($sel)){
								 	
								 	?>
										<tr>
											<!--<td class="checkbox-column"><input type="checkbox" class="uniform"></td>-->
                                 <td><?php echo $sno;?></td>
                                 <td><?php echo $rec['name'];?></td>
                                 <td><?php echo $rec['email'];?></td>
                                  
										</tr>
                                        <?php $sno++;}?>
									</tbody>
								</table>

                            <?php }?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
	<?php include("links/bottom.php");?>