Forum'da ara:
Ara


« Önceki başlık :: Sonraki başlık »  
Yazar Mesaj
Mesaj24.04.2009, 12:24 (UTC)    
Mesaj konusu: Gebelik hesablama kodu

Kod:
<p><strong><font face="Arial TUR" color="#0000ff" size="4">GEBELİK HAFTASI HESAPLAYICISI<br />
<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
        <tr>
            <td colspan="2"><font face="Arial Tur" color="#0000ff" size="3">Son adet tarihinizin <strong>ilk g&uuml;n&uuml;n&uuml;</strong> girin:</font></td>
        </tr>
        <tr>
            <td colspan="2"><hr size="1" color="#c0c0c0" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
            <div align="left">
            <table cellspacing="0" width="100%" border="0">
                <tbody>
                    <tr>
                        <td valign="bottom">
                        <form name="dates">
                            <div align="left">
                            <table cellspacing="0" width="90%" border="0">
                                <tbody>
                                    <tr>
                                        <td valign="top">
                                        <p align="left"><font color="#0080ff"><script language="JavaScript" type="text/javascript"><!--




//general purpose function to see if an input value has been entered at all

function isEmpty(inputStr){if(inputStr==""||inputStr==null){return true

}return false

}//general purpose function to see if a suspected numeric input

//is a positive integer

function isNumber(inputStr){for(var i=0;i<inputStr.length;i++){var oneChar=inputStr.charAt(i)

if(oneChar<"0"||oneChar>"9"){return false

}}return true

}//function to determine if value is in acceptable range for this application

function inRangeDay(inputStr){num=parseInt(inputStr)

if(num<1||num>31){return false

}return true

}//function to determine if value is in acceptable range for this application

function inRangeYear(inputStr){num=parseInt(inputStr)

if(num<1900||num>3000){return false

}return true

}//Master value validator routine for day

function isValidDay(inputStr){if(isEmpty(inputStr)){alert("Lütfen son adet tarihinizin gününü giriniz.")

return false

}else{if(!isNumber(inputStr)){alert("Belirttiğiniz gün sayısal bir değer olmalıdır")

return false

}else{if(!inRangeDay(inputStr)){alert("Lütfen geçerli bir gün belirtiniz.")

return false

}}}return true

}//Master value validator routine for year

function isValidYear(inputStr){if(isEmpty(inputStr)){alert("Lütfen son adet tarihinizin yılını giriniz.")

return false

}else{if(!isNumber(inputStr)){alert("Belirttiğiniz yıl sayısal bir değer olmalıdır.")

return false

}else{if(!inRangeYear(inputStr)){alert("Lütfen geçerli bir yıl belirtiniz.")

return false

}}}return true

}function makeArray(n){this.length=n

for(var i=1;i<=n;i++)

this[i]=null

return this

}var maxday=new makeArray(12)

maxday[1]=31

maxday[2]=28

maxday[3]=31

maxday[4]=30

maxday[5]=31

maxday[6]=30

maxday[7]=31

maxday[8]=31

maxday[9]=30

maxday[10]=31

maxday[11]=30

maxday[12]=31



var monthname=new makeArray(12)

monthname[1]="Ocak"

monthname[2]="Şubat"

monthname[3]="Mart"

monthname[4]="Nisan"

monthname[5]="Mayıs"

monthname[6]="Haziran"

monthname[7]="Temmuz"

monthname[8]="Ağustos"

monthname[9]="Eylül"

monthname[10]="Ekim"

monthname[11]="Kasım"

monthname[12]="Aralık"



var adddays=new makeArray(7)

adddays[1]=14

adddays[2]=35

adddays[3]=70

adddays[4]=84

adddays[5]=161

adddays[6]=189

adddays[7]=280



//Calculate the date string

function calcNewDate(month,day,year,adddays){newday=eval(day)+adddays

newmonth=month+1

newyear=eval(year)

var max



for(var i=0;i<12;i++){if(newmonth==2&&(newyear%4)==0){max=29

}else

max=maxday[newmonth]



if(newday>max){newday=newday-max

newmonth=newmonth+1

if(newmonth>12){newyear=newyear+1

newmonth=1

}}else

break

}var datestring=monthname[newmonth]+" "+newday+", "+newyear

return datestring

}//Get the date entered and calculate the rest of the dates

function calc(form){day=form.day.value

year=form.year.value

monthnum=form.month.selectedIndex



if(isValidDay(day)){if(isValidYear(year)){form.duedate2.value=calcNewDate(monthnum,day,year,adddays[7])

{day=form.day.value;year=form.year.value;aybul=form.month.selectedIndex+1;var aybul;var now=new Date();var mil=aybul+'/'+day+'/'+year
var mildate=new Date(mil)
var fark=now.getTime()-mildate.getTime()
var gun
var top=Math.floor(fark/(1000))
gun=Math.floor(top/(60*60*24)/7)
top=-gun*(24*60*60)


form.duedate.value=gun
if(isValidDay(day)){if(isValidYear(year)){form.duedate.value=gun

var gun1
var top=Math.floor(fark/(1000))
gun1=Math.floor(top/(60*60*24))-(7*form.duedate.value)
top-=gun1*(24*60*60)
form.duedate1.value=gun1
if(isValidDay(day)){if(isValidYear(year)){form.duedate1.value=gun1
}}}}}}}}//--></script></font><font face="Arial,Helvetica" color="#000000" size="2"><strong>G&uuml;n:</strong></font></p>
                                        </td>
                                        <td valign="top">
                                        <p align="left"><font face="Arial,Helvetica" color="#000000" size="2"><strong><input size="2" name="day" type="text" /></strong></font></p>
                                        </td>
                                        <td valign="top">
                                        <p align="left"><font face="Arial,Helvetica" color="#000000" size="2"><strong>Ay:</strong></font></p>
                                        </td>
                                        <td valign="top">
                                        <p align="left"><font face="Arial,Helvetica" color="#000000" size="2"><strong><select size="1" name="month">
                                        <option selected="selected">Ocak</option>
                                        <option>Şubat</option>
                                        <option>Mart</option>
                                        <option>Nisan</option>
                                        <option>Mayıs</option>
                                        <option>Haziran</option>
                                        <option>Temmuz</option>
                                        <option>Ağustos</option>
                                        <option>Eyl&uuml;l</option>
                                        <option>Ekim</option>
                                        <option>Kasım</option>
                                        <option>Aralık</option>
                                        </select></strong></font></p>
                                        </td>
                                        <td valign="top" colspan="2">
                                        <p align="left"><font face="Arial,Helvetica" color="#000000" size="2"><strong>Yıl:</strong></font></p>
                                        </td>
                                        <td valign="top" colspan="2">
                                        <p align="left"><font face="Arial,Helvetica" color="#0080ff" size="2"><input size="4" name="year" type="text" /></font></p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="center" colspan="8"><font face="Arial,Helvetica" color="#0080ff" size="3"><input style="cursor: hand" type="button" onclick="calc(this.form)" value="Hesapla!" /></font><font face="Arial,Helvetica" color="#ffffff" size="3">-</font><font face="Arial,Helvetica" color="#0080ff" size="3"><input style="cursor: hand" type="reset" value="Temizle" /></font></td>
                                    </tr>
                                </tbody>
                            </table>
                            </div>
                            <div align="left">
                            <table cellspacing="0" cellpadding="0" width="100%" border="0">
                                <tbody>
                                    <tr>
                                        <td><hr size="1" color="#c0c0c0" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><font face="Arial Tur" color="#ff0000" size="2"><strong>Bu verilere g&ouml;re şu anda </strong></font><font face="Arial,Helvetica" color="#ff0000" size="3"><strong><input size="6" name="duedate" type="text" /></strong></font><font face="Arial,Helvetica" color="#ff0000" size="2"><strong> hafta </strong></font><font face="Arial,Helvetica" color="#ff0000" size="3"><strong><input size="5" name="duedate1" type="text" /></strong></font><font face="Arial,Helvetica" color="#ff0000" size="2"><strong> g&uuml;nl&uuml;k hamilesiniz </strong></font><font face="Arial,Helvetica" color="#ff0000" size="1"><strong>(&plusmn;3 g&uuml;n hatapayı!).</strong></font></td>
                                    </tr>
                                    <tr>
                                        <td><font face="Arial Tur" color="#0080ff" size="2"><strong>ve bebeğinizin muhtemel doğum tarihi (yani 40 haftayı doldurduğu tarih) :</strong></font><font face="Arial,Helvetica" color="#0080ff" size="3"><br />
                                        <input size="13" name="duedate2" type="text" /></font><font face="Arial Tur" color="#0080ff" size="2"><strong>olarak belirlendi.</strong></font></td>
                                    </tr>
                                </tbody>
                            </table>
                            </div>
                        </form>
                        </td>
                    </tr>
                </tbody>
            </table>
            </div>
            umarım işinize yarar trggweb ekibi</td>
        </tr>
    </tbody>
</table>
</font></strong></p>

______________
Önceki mesajları göster:   


Powered by phpBB © 2001, 2005 phpBB Group
Türkçe Çeviri: phpBB Türkiye & Erdem Çorapçıoğlu