ok

Mini Shell

Direktori : /home2/selectio/www/y1jobportal.in/admin/data-tables/
Upload File :
Current File : //home2/selectio/www/y1jobportal.in/admin/data-tables/plan-dt.php

<?php
include("../api/config/config.php");
$requestData= $_REQUEST;
$condition='';
if(isset($_POST['date'])){
    $condition.=" and date between '".$_POST['date']."' and '".$_POST['date']."' ";
}


/*Fetch Database column Details*/
        $columns = array( 
            0 =>'id',
            1 =>'name',
            2 =>'duration',
            3 =>'amount',
        );
        
/*Fetch All Data Start*/        
    	$statement = $pdo->prepare("SELECT * FROM subscription ORDER BY id DESC");
		$statement->execute();
		$query = $statement->fetchAll(PDO::FETCH_ASSOC);
		$totalData = $statement->rowCount();
/*Fetch All Data End*/       
        
/*Fetch Filter Data Start*/    
          $sql="SELECT * FROM subscription where 1=1 $condition";
         
        if( !empty($requestData['search']['value']) ) 
        {   
        	$sql.=" AND ( id LIKE '%".$requestData['search']['value']."%' ";    
        	$sql.=" OR name LIKE '%".$requestData['search']['value']."%' ";    
        	$sql.=" OR duration LIKE '%".$requestData['search']['value']."%' ";
        	$sql.=" OR amount LIKE '%".$requestData['search']['value']."%' ) ";
        	}
        	 
        $statement = $pdo->prepare($sql);
        $statement->execute();
		$query = $statement->fetchAll(PDO::FETCH_ASSOC);
        $totalFiltered = $statement->rowCount();
        
/*Fetch Filter Data End*/       

        $sql.=" ORDER BY ". $columns[$requestData['order'][0]['column']]."   ".$requestData['order'][0]['dir']."  LIMIT ".$requestData['start']." ,".$requestData['length']."   ";
        $statement = $pdo->prepare($sql);
        $statement->execute();
		$query = $statement->fetchAll(PDO::FETCH_ASSOC);

$data = array();
$i=$requestData['start']+1;
foreach($query as $row ) {  // preparing an array
	$nestedData=array(); 
	
		$action= "<div class='text-center'><div class='btn-group'>";

	               $action.="<a style='padding: 0px 0px 0px 5px; height: 30px; margin-right: 3px;' href='edit-employee.php?id=".$row["id"]."' title='Edit District' class='tip btn btn-warning btn-xs'>
	                    <i class='bi bi-pencil'></i>
	                </a> ";
	                
	               
	                
	 	$action.="</div></div>";
	
	$name='<b>'.$row['name'].'</b>';
	$amount='<b>'.$row['amount'].'</b>';
	$duration='<b>'.$row['duration'].'</b>';
	
	
	 

	
    $nestedData[] = $action;
    $nestedData[] = $i;
    $nestedData[] = $name;
    $nestedData[] = $duration;
    $nestedData[] = $amount;
    if( 1 =="1"){$status="<span class='span-success'> Active </span>";	} else{$status="<span class='span-danger'> In-Active </span>";}
    $nestedData[] = $status;
	$data[] = $nestedData;
	$i++;
}

$json_data = array(
			"draw"            => intval( $requestData['draw'] ),   // for every request/draw by clientside , they send a number as a parameter, when they recieve a response/data they first check the draw number, so we are sending same number in draw. 
			"recordsTotal"    => intval( $totalData ),  // total number of records
			"recordsFiltered" => intval( $totalFiltered ), // total number of records after searching, if there is no searching then totalFiltered = totalData
			"data"            => $data   // total data array
			);

echo json_encode($json_data);  // send data as json format

?>

Zerion Mini Shell 1.0