<?php
	$aryPgAct=array("page_id"=>$pgMod,"action"=>"add");
	$aryList=$db->getRows("SELECT * FROM content "); $i=0;
	if(is_array($aryList) && count($aryList)>0)
	{
		?>

        <table class="table" id="example">
            <thead>
                <tr>
                    <th>LinkName</th>

        			<th>Name</th>
        
                    <th>Image</th>
        
                    <th>Status</th>
        
                    <th>Action</th>
                    
	            </tr>
            </thead>
            <tbody>
            <?php foreach($aryList as $clist){ $i++; 
            $aryPgAct["id"]=$clist['id'];
            ?>
                <tr class="grade<?php if($i%2==0)echo "C";else "U";?>">
                    <td><?php echo $clist["link"] ?></td>
                    <td><?php echo $clist["Name"] ?></td>
                    <td><?php echo "<a href='".URL_ROOT."uploads/content/".$clist['image']."' >Download</a>" ?></td>				
                    <td><?php echo $clist["status"] ?></td>
                    <td>
                    <?php $aryPgAct['action']="edit"; ?>
                         <a style="float:left" href="<?php echo URL_ADMIN_HOME.getQueryString($aryPgAct); ?>"><button type="button" class="btn btn-info">Edit</button></a>
                    <?php $aryPgAct['action']="delete"; ?>
                         <a href="javascript:;" onclick="del('<?php echo URL_ADMIN_HOME.getQueryString($aryPgAct); ?>')" class="confirmation"><button type="button" class="btn btn-danger">Delete</button></a>  
                    </td>
                </tr>
            <?php } ?>
            </tbody>
            <tfoot>
                <tr>
                	<th></th>
                    <th></th>
                    <th colspan="2"></th>
                </tr>
            </tfoot>
        </table>
		<?php
	}
	else{
		?>
        <div class="alert alert-info">
          <a class="close" data-dismiss="alert">×</a>
          <i class="icon icon-warning-sign"></i> <b>Notice</b> Record not found </i>
        </div>
        <?php
	}
	?>
	
    
    
    
    
                           http://192.168.1.100:8081/sms//index.php?page_id=content_head&action=edit&id=8
                       
http://192.168.1.100:8081/sms//index.phpcontent&id=120&action=edit
                       
                        
  http://192.168.1.100:8081/sms//index.php?content&id=119&action=edit    
  http://192.168.1.100:8081/sms//index.php?page_id=content&action=edit&id=130
  
  
  <?php
	{
		
		//$aryList=$db->getRows("SELECT * FROM question ");
		$aryPgAct=array("page_id"=>$pgMod);
		
			$range=$LinksDetails["record_per_page"];
		//$range=20;
		
		$page="";$filterAry=array();
		if(isset($_GET["range"]))$range=$_GET["range"];
		if(isset($_GET['nextpage'])) $page=$_GET['nextpage'];
		if (isset($_GET['search']))
		{
			$search = $_GET['search'];
			$filterAry[] =" (class like '%" . $search . "%' or subject like '%" . $search . "%' or answer like '%" . $search . "%' ) ";
		
		}
		if (isset($_GET['online']))
		{
			$filterAry[] =" is_online=1 ";
		}
		if (isset($_GET['pending']))
		{
			$filterAry[] =" status=1 ";
		}
		if (isset($_GET['active']))
		{
			$filterAry[] =" status=2 ";
		}
		if(is_array($filterAry) && count($filterAry)>0)$sqlfilter=implode(" AND ",$filterAry);
		if($sqlfilter=="")$sqlfilter =" 1 ";
		$pagination['table']		=	"content" ;
		$pagination['targetpage']	=	"index.php" ;
		$pagination['sqlfilter']	=	$sqlfilter ;
		$pagination['size']			=	$range;
		$pagination['nextpage']		= 	$page ;
		$pagination['option']		= 	"page_id=".$pgMod ;
		$resultData 				= 	$objPagination->getData($pagination);
		$i=0;
	//print_r($resultData);
	
	//echo"error==><pre>yesss";echo $db->getLastQuery();exit;
		$aryList=$resultData["data"];//$db->getRows($sql);
		//echo"error==><pre>";echo $db->getLastQuery();exit;
		//$sqlLimit="SELECT * FROM ".EVENT." ORDER BY event_id ASC ";
		//$aryList=$db->getRows($sqlLimit);
		if(is_array($aryList))
		{
		  if(count($aryList)>0)
		   { 
			 ?>
        <div class="pull-right">
          <form method="get" action="index.php" style="float:right; margin:3px;">
            <div class="input-group margin-bottom">
              <input type="hidden" name="page_id" value="<?php echo $pgMod; ?>" />
              <input style="width:200px" class="search-bar form-control" placeholder="Enter username or emailid" value="<?php echo $_GET["search"] ?>" id="appendedInputButton" size="26" name="search" type="text">
              <button class="input-group-addon" type="submit">Go!</button>
            </div>
          </form>
        </div>

        <div class="table-responsive">
          <table  class="table table-bordered">
            <thead>
              <tr>
                <th class="first"><div></div></th>
                <th><a href="#" title="linkname">LinkName </a></th>
                <th><a href="#" title="linkname">Name</a></th>
                <th><a href="#" title="Underof">Image</a></th>
                
                
                <th><a href="#" title="status">Status</a></th>
                <th class="last" >Actions</th>
              </tr>
            </thead>
            <tbody>
              <?php
			 
				foreach($aryList as $iList)
				{
					 //echo"==>error<pre>";print_r($iList);exit;
					$aryPgAct["id"]=$iList['userId'];
					
				    $aryPgAct['page_id']=$pgMod;
					//echo"==>error<pre>";print_r($iList);exit;
					//echo"==>error<pre>";print_r($iList['class']);exit;
					
					$question_ary=json_decode($iList["question"],true);
					//$question_ary=json_decode($clist["question"],true);
					//echo"==>error<pre>";print_r($iList);print_r($clist["question"]);exit;
					
					
				 ?>
              <tr id="tr_<?php echo $iList['userId'] ?>">
                <td></td>
                
                
                <td class="text-slash"><?php echo $iList['link']; ?></td>
                <td class="text-slash"><?php echo ucwords($iList['Name']); ?></td>
               
			    <td class="text-slash">
				
				<?php echo "<a href='".URL_ROOT."uploads/content/".$clist['image']."' >Download</a>" ?>
				
				
				</td>
               
			   <td class="text-slash">
                 
                  <?php if( $iList["status"]==1){ ?>
                  <span class="btn btn-info" >Active</span>
                  <?php }else{ ?>
                  <span  class="btn btn-danger">Inactive</span>
                  <?php } ?>
                 
                 
                 </td>
                 
                 
                 
                  <td class="text-slash">
                    <?php $aryPgAct['action']="edit"; ?>
                          <a href="<?php echo URL_ADMIN_HOME."?".$pgMod."&id=".$iList['id']."&action=edit";?>"><button type="button" class="btn btn-info">Edit</button></a>
                       
                       

                         
                    <?php $aryPgAct['action']="delete"; ?>
                         <a href="javascript:;" onclick="del('<?php echo URL_ADMIN_HOME."?page_id=".$pgMod."&id=".$iList['id']."&action=delete";?>')"><button type="button" class="btn btn-danger">Delete</button></a> 
                       
                        
                    </td> 
				
				
                
               
              </tr>
              <?php			
				  }
				?>
            </tbody>
          </table>
        </div>
        <?php echo $resultData["pagestring"]; ?>
        
        <?php
		   }
			else
			{
			  echo '<div class="alert alert-info alert-dismissable">
						<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
						<strong>Notice !</strong> Sorry No record Found. </div>';
			}
		}
		else
		{
			echo '<div class="alert alert-danger alert-dismissable">
						<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
						<strong>error !</strong> '.$db->getErMsg().'. </div>';
		}
	}
			  ?>