- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
function get_doc_status($date_valid) {
$cur_mk = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
$date_valid = explode(".", $date_valid);
$valid_mk = mktime(0, 0, 0, $date_valid[1], $date_valid[0], $date_valid[2]);
if($valid_mk <= $cur_mk) {
return 2;
}
$month = intval($date_valid[1]);
$year = intval($date_valid[2]);
if(($month > 1) && ($month < 12)) {
$prev_month = $month - 1;
$prev_year = $year;
} elseif($month == 1) {
$prev_month = 12;
$prev_year = $year - 1;
}
$month_mk = 60 * 60 * 24 * 30;
$prev_mk = mktime(0, 0, 0, $prev_month, $date_valid[0], $prev_year);
if(($valid_mk - $prev_mk) <= $month_mk) {
return 1;
}
return 0;
}