Показать сообщение отдельно
  #4 (permalink)  
Старый 19.02.2011, 12:26
Новичок на форуме
Отправить личное сообщение для winchester7 Посмотреть профиль Найти все сообщения от winchester7
 
Регистрация: 19.02.2011
Сообщений: 7

Наверное он довольно неуклюжий, но все же..

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />&nbsp;
<title>Калькулятор стоимости админки</title>

<style type="text/css">
<!--
.style1 {
	color: #333333;
	font-size: 14px;
	font-weight:bold;
}
body {
font-family:Arial, Helvetica, sans-serif;
font-size:11px;
}
div {
color:#CCCCCC;
font-size:11px;
font-family:Georgia, "Times New Roman", Times, serif;
}
a:hover, a{
color:#CCCCCC;
text-decoration: none;
}
-->
</style>

[JS]
<SCRIPT LANGUAGE="JavaScript">
   function checkBox()
{
    if (document.form.all.checked)
    {
        document.form.perevod.checked = true;
        document.form.teleport.checked = true;
        document.form.mapmenu.checked = true;
        document.form.weaponmenu.checked = true;
        document.form.vote.checked = true;
        document.form.clientcommands.checked = true;
        document.form.grenades.checked = true;
        document.form.chat.checked = true;
        document.form.provwh.checked = true;
    }
    else
    {
        document.form.perevod.checked = false;
        document.form.teleport.checked = false;
        document.form.mapmenu.checked = false;
        document.form.weaponmenu.checked = false;
        document.form.vote.checked = false;
        document.form.clientcommands.checked = false;
        document.form.grenades.checked = false;
        document.form.chat.checked = false;
        document.form.provwh.checked = false;
    }
}

function price(form) {
if (form.perevod.checked){
var perevod=parseFloat(form.perevod.value);
}
else perevod=0;
if (form.teleport.checked){
var teleport=parseFloat(form.teleport.value);
}
else teleport=0;
if (form.mapmenu.checked){
var mapmenu=parseFloat(form.mapmenu.value);
}
else mapmenu=0;
if (form.weaponmenu.checked){
var weaponmenu=parseFloat(form.weaponmenu.value);
}
else weaponmenu=0;
if (form.vote.checked){
var vote=parseFloat(form.vote.value);
}
else vote=0;
if (form.clientcommands.checked){
var clientcommands=parseFloat(form.clientcommands.value);
}
else clientcommands=0;
if (form.grenades.checked){
var grenades=parseFloat(form.grenades.value);
}
else grenades=0;
if (form.chat.checked){
var chat=parseFloat(form.chat.value);
}
else chat=0;
if (form.provwh.checked){
var provwh=parseFloat(form.provwh.value);
}
else provwh=0;

if (form.vremia[1].checked){
var vremia=2;
}
else if (form.vremia[2].checked){
var vremia=3;
}
else if (form.vremia[3].checked){
var vremia=4;
}
else if (form.vremia[4].checked){
var vremia=5;
}
else if (form.vremia[5].checked){
var vremia=6;
}
else vremia=1;

var total=(50+perevod+teleport+mapmenu+weaponmenu+vote+clientcommands+grenades+chat+provwh)*vremia;
document.getElementById("total_price").innerHTML=total;
}
</SCRIPT>
[/JS]
</head>


<body>
<center>
<div class="style1">Расчет стоимости админки</div><br />
<form name="form"  onclick="price(this)">
<table width="350" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td colspan="3" align="center"><b>Модули</b></td>
    </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="left"><input type="checkbox" value="50" name="adminka" disabled checked />Пустая админка<hr></td>
    <td>- 50</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="left"><input type="checkbox" value="20" name="grenades" />&nbsp;Бесплатная броня и гранаты</td>
    <td>- 20</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="left"><input type="checkbox" value="20" name="perevod" />&nbsp;Перевод игрока</td>
    <td>- 20</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="left"><input type="checkbox" value="20" name="teleport" />&nbsp;Меню телепорта</td>
    <td>- 20</td>
  </tr>
    <tr>
    <td>&nbsp;</td>
    <td align="left"><input type="checkbox" value="20" name="chat" />&nbsp;Пакет "Чат"</td>
    <td>- 20</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="left"><input type="checkbox" value="30" name="mapmenu" />&nbsp;Смена карты</td>
    <td>- 30</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="left"><input type="checkbox" value="30" name="weaponmenu" />&nbsp;Меню оружия</td>
    <td>- 30</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="left"><input type="checkbox" value="40" name="vote" />&nbsp;Пакет "Голосование"</td>
    <td>- 40</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="left"><input type="checkbox" value="40" name="clientcommands" />&nbsp;Пакет "Client Commands"</td>
    <td>- 40</td>
  </tr>
   <tr>
    <td>&nbsp;</td>
    <td align="left"><input type="checkbox" value="40" name="provwh" />&nbsp;Дополнительная проверка на Вх<hr></td>
    <td>- 40</td>
  </tr>
   <tr>
    <td>&nbsp;</td>
    <td align="left"><input type="checkbox" name="all" onclick="checkBox();" />&nbsp;Подключить все</td>
    <td>- 310</td>
  </tr>
  <tr>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
<td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3" align="center"><b>Длительность покупки</b></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="left"><INPUT type="radio" name="vremia" value="1">&nbsp;1 месяц</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="left"><INPUT type="radio" name="vremia"  value="2">&nbsp;2 месяца</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="left"><INPUT type="radio" name="vremia" value="3">&nbsp;3 месяца</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="left"><INPUT type="radio" name="vremia" value="4">&nbsp;4 месяца</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="left"><INPUT type="radio" name="vremia" value="5">&nbsp;5 месяцев</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="left"><INPUT type="radio" name="vremia" value="6">&nbsp;6 месяцев</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
		<td align="center"><input type="submit" value="Проба" /></td>
    <td align="center"><input type="button" value="Заказать" onclick="tf1.style.display = 'inline';"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Итого:</b></td>

    <td align="center" id="total_price" style="color: #993300;font-weight:bold; font-size:14px">0</td>
  </tr>
</table>
</form>

<form action="sendmail.php" method="post">
<table width="350" border="0" cellspacing="0" cellpadding="0" style="display:none" id="tf1">
  <tr>
    <td colspan="2" align="left">&nbsp;&nbsp;&nbsp;<b>Заказ админки</b></td>
    </tr>
  <tr>
    <td width="90" align="left">Ник *</td>
    <td width="260" align="left"><input type="text" value="" name="name" style="width:95%;"/></td>
  </tr>
  <tr>
    <td align="left">Skype/ICQ *</td>
    <td align="left"><input type="text" value="" name="skype" style="width:95%;"/></td>
  </tr>
  <tr>
    <td align="left">Возраст *</td>
    <td align="left"><input type="text" value="" name="age" style="width:95%;"/></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><input type="submit" value="Отправить уведомление" />&nbsp;</td>
    </tr>
</table>
</form>
</center>

</body>
</html>
Ответить с цитированием