웹마스터 팁

http://www.allware.co.kr/popup.html군대간 친구 남은날짜 구하기를 만드신 분을 보구
새삼 부럽기두 해서리 ... 감동두 쪼굼 ...
걍 수퍼노가다루 ... 날짜계산 만들어 올립니다 .
아직 단축기간 알고리즘을 정확히 깨닫지 못해서리 ㅡ.ㅡ;;
그럼 늘 행복한 하루 되시길 ^^
응용 링크 걸어두었습니다. 함보시길 이렇게 쓸수있답니다.
http://www.allware.co.kr/popup.html



<?
$name=신민경;
$enter_day=26;
$enter_month=3;
$enter_year=2002;


$start_army_second=mktime(0,0,0,$enter_month,$enter_day,$enter_year);//입대일

$end_army_secound=mktime(0,0,0,$enter_month+2,$enter_day-1,$enter_year+2);//전역일

$termday=7; //기본 단축기간

$termday2=31; //기본 단축기간

// 단축된 기간에 따른 전역일 재계산

//2001년 8월초 군번

if($enter_year==2001&&$enter_month==8&&$enter_day<=6) {
$demising_army_secound=($enter_day-1)*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound; }

//2001년 8월-2001년 10월 군번

else if($enter_year==2001&&$enter_month==8&&$enter_day>=6) {
$demising_army_secound=$termday*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

else if($enter_year==2001&&$enter_month==9&&$enter_day>=1) {
$demising_army_secound=$termday*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

else if($enter_year==2001&&$enter_month==10&&$enter_day>=1) {
$demising_army_secound=$termday*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

//2001년 11월초 군번

else if($enter_year==2001&&$enter_month==11&&$enter_day<=6){
$termdays=$termday+$enter_day;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound; }

//2001년 11월-2002년 1월 군번

else if($enter_year==2001&&$enter_month==11&&$enter_day>=6) {
$termdays=$termday*2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound; }

else if($enter_year==2001&&$enter_month==12&&$enter_day>=1) {
$termdays=$termday*2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound; }

else if($enter_year==2002&&$enter_month==1&&$enter_day>=1) {
$termdays=$termday*2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound; }

//2002년 2월초 군번

else if($enter_year==2002&&$enter_month==2&&$enter_day<=6) {
$termdays=$termday*2+$enter_day;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

//2002년 2월-2002년 5월 군번

else if($enter_year==2002&&$enter_month==2&&$enter_day>=6) {
$termdays=$termday*3;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

else if($enter_year==2002&&$enter_month==3&&$enter_day>=1) {
$termdays=$termday*3;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

else if($enter_year==2002&&$enter_month==4&&$enter_day>=1) {
$termdays=$termday*3;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

else if($enter_year==2002&&$enter_month==5&&$enter_day>=1) {
$termdays=$termday*3;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

//2002년 6월초 군번

else if($enter_year==2002&&$enter_month==6&&$enter_day<=9) {
$termdays=$termday*3+$enter_day;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

//2002년 6월 -2002년 9월

else if($enter_year==2002&&$enter_month==6&&$enter_day>=9) {
$termdays=$termday2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

else if($enter_year==2002&&$enter_month==7&&$enter_day>=1) {
$termdays=$termday2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

else if($enter_year==2002&&$enter_month==8&&$enter_day>=1) {
$termdays=$termday2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

else if($enter_year==2002&&$enter_month==9&&$enter_day>=1) {
$termdays=$termday2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

//2002년 10월초 군번

else if($enter_year==2002&&$enter_month==10&&$enter_day<=6) {
$termdays=$termday2+$enter_day+1;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

//2002년 10월 -2003년 2월

else if($enter_year==2002&&$enter_month==10&&$enter_day>=6) {
$termdays=$termday+$termday2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

else if($enter_year==2002&&$enter_month==11&&$enter_day>=1) {
$termdays=$termday+$termday2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

else if($enter_year==2002&&$enter_month==12&&$enter_day>=1) {
$termdays=$termday+$termday2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

else if($enter_year==2003&&$enter_month==1&&$enter_day>=1) {
$termdays=$termday+$termday2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

//2003년 2월초 군번

else if($enter_year==2003&&$enter_month==2&&$enter_day<=9) {
$termdays=$termday2+$enter_day+4;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

//2003년 2월-2003년 5월 군번

else if($enter_year==2003&&$enter_month==2&&$enter_day>=9) {
$termdays=$termday*2+$termday2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

else if($enter_year==2003&&$enter_month==3&&$enter_day>=1) {
$termdays=$termday*2+$termday2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

else if($enter_year==2003&&$enter_month==4&&$enter_day>=1) {
$termdays=$termday*2+$termday2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

else if($enter_year==2003&&$enter_month==5&&$enter_day>=1) {
$termdays=$termday*2+$termday2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

//2003년 6월초 군번

else if($enter_year==2003&&$enter_month==6&&$enter_day<=7) {
$termdays=$termday*2+$termday2+($enter_day-1);
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

//2003년 6월 -8월군번

else if($enter_year==2003&&$enter_month==6&&$enter_day>=7) {
$termdays=$termday*3+$termday2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

else if($enter_year==2003&&$enter_month==7&&$enter_day>=1) {
$termdays=$termday*3+$termday2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

else if($enter_year==2003&&$enter_month==8&&$enter_day<=28) {
$termdays=$termday*3+$termday2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

//8월말 군번

else if($enter_year==2003&&$enter_month==8&&$enter_day>=28) {
$termdays=$termday*3+$termday2+($enter_day-28);
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

//9월 군번

else if($enter_year==2003&&$enter_month==9&&$enter_day<=25) {
$termdays=$termday*3+$termday2+3;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

else if($enter_year==2003&&$enter_month==9&&$enter_day>=25) {
$termdays=$termday*3+$termday2+($enter_day-22);
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound;}

//단축기간 이전군번
else if($enter_year<=2002&&$enter_month<8&&$enter_day<=31) {
$termdays="빵";}

//03년 10월 이후 군번
else {
$termdays=$termday2*2;
$demising_army_secound=$termdays*24*3600;
$end_army_secound=$end_army_secound-$demising_army_secound; }


$left_army_secound=$end_army_secound-time();//남은기간

$being_army_secound=time()-$start_army_second;//복무기간

$left_army_day=intval($left_army_secound/3600/24);//남은기간을 일로 표시

$being_army_day=intval($being_army_secound/3600/24);//복무기간을 일로 표시

$endday=date("Y년 m월 d일 전역예정입니다.",$end_army_secound);


echo"
$name 님은 $endday<br>
복무기간 : $being_army_day<br>
남은기간 : $left_army_day <br>
줄어든 기간 : $termdays 일 이나 줄었군요. 땡보네 ... ";
?>