<?php

function cleaninput($array) {
            if(is_array($array)) {
                foreach($array as $key => $value) {
                    if(is_array($array[$key]))
                        $array[$key] = cleaninput($array[$key]);
                    if(is_string($array[$key]))
                        $array[$key] = mysqli_escape_string($array[$key]);
                }           
            }
            if(is_string($array))
                $array = mysqli_escape_string($array);
           
            return $array;
       
        }
	function date_query($start,$end,$column) {
	
	$date_query = "";
	if($start != '' && $end != '') {
		$start_date_clean = date("Y-m-d",strtotime("$start"));	
		$end_date_clean = date("Y-m-d",strtotime("$end"));
		$date_query = "AND (DATE(".$column.") >= DATE('".$start_date_clean."') AND DATE(".$column.") <= DATE('".$end_date_clean."'))";
	}
	return $date_query;
}	



		
?>