$count = ""; //Initialization value;
function getOlder($startdate) {
$startdate=substr($startdate, 0, 7);
$startdate=$startdate.'-01';
$pf_date=strtotime('-1 month', strtotime($startdate));
$pf_date=date('Y-m-d', $pf_date);
return $pf_date;
}
function getNewer($startdate) {
$startdate=substr($startdate, 0, 7);
$startdate=$startdate.'-01';
$pf_date=strtotime('+1 month', strtotime($startdate));
$pf_date=date('Y-m-d', $pf_date);
if ($pf_date<=date('Y-m-t')) {
return $pf_date;
}
}
function xp_ConvertCharacters($String, $ConvertTo='entity') {
// Build character map list
$exclude = array(129, 141, 143, 144, 157);
for($i=128; $i<=255; $i++)
$characterMap[''.$i.';'] = chr($i);
foreach($exclude as $i)
unset($characterMap[''.$i.';']);
// Assign find and replace variables
switch($ConvertTo)
{
case 'ascii': // To ascii characters
$find = array_keys($characterMap);
$replace = array_values($characterMap);
break;
case 'entity': // To numbered entities
default:
$find = array_values($characterMap);
$replace = array_keys($characterMap);
break;
}
// Convert characters within string and return results
return str_replace($find, $replace, $String);
} // ConvertCharacters()
if (isset($_REQUEST['startdate'])) {
$startdate=$_REQUEST['startdate'];
$startdate=substr($startdate, 0, 7);
$startdate=htmlspecialchars($startdate);
}
if (!isset($startdate)) { $startdate=date('Y-m-01'); $enddate=date('Y-m-31'); } else { $enddate=$startdate.'-31'; $startdate=$startdate.'-01'; }
?>