<?php
session_start();
$where 					= " WHERE 1=1 ";
$next_page_condition 	= "";
$paging ="";
if($_REQUEST['start']){
	$paging .="&start=".$_REQUEST['start'];
}
###########################################  STRAT FILTER CONITIONS    #####################################

###########################################  	END  FILTER CONITIONS 	#####################################
###########################################  PAGING WITH PER PAGE  #####################################
$file_name		= "index"; // this is file name which is used during paging  , included at the bottom of the page
$table_name		= "dynamic_form";
$paging_table_name	= $table_name;
$paging_query		= $where;
$join_query_for_paging = "SELECT * FROM $table_name  $where ";
$page_header = "Dynamic Form List";
include("paging/paging_query.inc.php");
############################################ END PAGING WITH PER PAGE  ################
$query = "SELECT * FROM $table_name $where ORDER BY id ASC LIMIT $eu, $limit";
$sql=mysqli_query($conn,$query);
$result=mysqli_num_rows($sql);
#######################################################################################
?>
<section class="content-header">
  <h1>
	<?=$page_header;?>
  </h1>
</section>
<section class="content">
	<div class="row">
		<div class="col-xs-12">
			<!----------------------- Message ------------------------------->
			<? if(isset($_SESSION['info_message'])){ ?>
			  <div class="alert alert-success alert-dismissable">
				<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
				<? echo $_SESSION['info_message']; unset($_SESSION['info_message']);?>
			  </div>
			  <? } ?>
			<!----------------------- End Message ------------------------------->
			<div class="box">
				<div class="box-body">
				<!-- search form -->
				<?php //include_once('county_search_options.inc.php');?>
				<!-- /.search form -->
					<form action="index?page=add" method="post" name="form1" id="form1">
					<? if($result>0){?>
					 <table id="example1" class="table table-bordered table-striped">
						<thead>
						  <tr>
							<th>Form Name</th>
						  </tr>
						</thead>
						<tbody>
							<?
								while($row = mysqli_fetch_array($sql)){ 
							?>
						  <tr>
							<td><a href="<?php echo $siteURL ?>/dynamic_form_management/index?page=dynamic_form_creation_view&dynamic_form_id=<?=$row["id"];?>"><?php echo ucfirst($row['form_name']); ?></a></td>
						  </tr>
							<? } ?>
							<!-- Paging starts here  -->
							<? 
								$next_page_condition .="&page=dynamic_form_list";
								include("paging/paging_row.inc.php") ?>
							<!-- Paging ends starts here  -->
						</tbody>
					 </table>
					 <? }else{ ?>
						No form found...
					 <? } ?>
				</div>
				</form>
			</div>
		</div>
	</div>
</section>