Está en la página 1de 5

MainActivity

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="estilo.css">
<title>Document</title>
</head>
<body>
<style>
body{
margin:0;
padding: 0;
font-family: Verdana, Geneva, Tahona, sans-serif;
background: #003c71;
}
.caja{
width: 1000px;
padding: 50px;
position:absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%);
background: #061e26;
text-align: center;
}
.caja h1{
color: white;
font-size:16px;
text-transform: uppercase;
}
.caja input[type="text"]
{
border:0;
background:none;
display:block;
margin: 20px auto;
text-align:center;
border:2px solid #3498db;
padding: 14px 10px;
width: 200px;
outline: none;
color:white;
border-radius: 24px;
transition:0.25s;
}
.caja input[type="text"]:focus
{
width: 280px;
border-color: #2ecc71;
MainActivity
}
.caja p{
color: white;
padding: 0;
}
.tarifario{
color: white;
padding: 0;
}
.descuentos{
color: white;
padding: 0;
}
.caja output[type="number"]
{
color:#2ecc71;
/*font-size:40px;
}
/*
.caja input[type="radio" value="local"]
{
border:0;
background:none;
color:white;
/*display:block;
margin: 20px auto;
/*text-align:center;
border:2px solid #3498db;
padding: 14px 10px;
width: 200px;
outline: none;

border-radius: 24px;
transition:0.25s;*/
}
</style>
<form class="caja" action="telecomunicacionesxyz.php" method="get">
<br><br>
<h1>COBRO DE LLAMADAS EMPRESA DE TELECOMUNICACIONES XYZ</h1>
<input type="text" name="minutos" value="" placeholder="ingrese la
cantidad de minutos">
<input type="submit" value="RESPUESTA">
<br>
<p>Seleccione la tarifa:
<br>
Local <input type="radio" name="tarifa" value="local"
placeholder="local">
Nacional <input type="radio" name="tarifa" value="nacional">
Internacional <input type="radio" name="tarifa"
value="internacional">
MainActivity
Celular <input type="radio" name="tarifa" value="celular">
<br>
Seleccione el plan:
<br>
Normal <input type="radio" name="plan" value="normal">
Reducido <input type="radio" name="plan" value="reducido">
Super reducido <input type="radio" name="plan"
value="superreducido">
<br></p>
<output type="number" name="">
</form>
<?php
if(isset($_GET['minutos']) &&
is_numeric($_GET['minutos']))
{
$minutos = $_GET['minutos'];
$total=0;
if($_REQUEST['tarifa']=='local')
{
if($_REQUEST['plan']=='normal')
$total=$minutos*0.20;
if($_REQUEST['plan']=='reducido')
$total=$minutos*0.20;
if($_REQUEST['plan']=='superreducido')
$total=$minutos*0.20;
}
if($_REQUEST['tarifa']=='nacional')
{
if($_REQUEST['plan']=='normal')
$total=$minutos*1.45;
if($_REQUEST['plan']=='reducido')
$total=$minutos*0.65;
if($_REQUEST['plan']=='superreducido')
$total=$minutos*0.45;
}
if($_REQUEST['tarifa']=='internacional')
{
if($_REQUEST['plan']=='normal')
$total=$minutos*2.5;
if($_REQUEST['plan']=='reducido')
$total=$minutos*2.10;
if($_REQUEST['plan']=='superreducido')
$total=$minutos*1.90;
}
if($_REQUEST['tarifa']=='celular')
{
if($_REQUEST['plan']=='normal')
$total=$minutos*1.5;
if($_REQUEST['plan']=='reducido')
$total=$minutos*0.70;
MainActivity
if($_REQUEST['plan']=='superreducido')
$total=$minutos*0.50;
}
if($minutos>=11 && $minutos<=30)
$total=$total-$total*0.05;
else if($minutos>=31 && $minutos<=50)
$total=$total-$total*0.10;
else if($minutos>50)
$total=$total-$total*0.15;
$total=round($total,2);
echo "TOTAL: $total Bs.";
}
?>
<h1>TARIFARIO</h1>
<table border="1" class="tarifario" align="center">
<tr>
<th>TARIFA/PLAN</th>
<th>NORMAL (Bs./min.)</th>
<th>REDUCIDO (Bs./min.)</th>
<th>SUPER REDUCIDO (Bs./min.)</th>
</tr>
<tr>
<th>Local</th>
<th>0.20</th>
<th>0.20</th>
<th>0.20</th>
</tr>
<tr>
<th>Nacional</th>
<th>1.45</th>
<th>0.65</th>
<th>0.45</th>
</tr>
<tr>
<th>Internacional</th>
<th>2.5</th>
<th>2.10</th>
<th>1.90</th>
</tr>
<tr>
<th>Celular</th>
<th>1.5</th>
<th>0.70</th>
<th>0.50</th>
</tr>
</table>
<h1>TABLA DE DESCUENTOS</h1>
<table border="1" class="descuentos" align="center">
<tr>
<th>N°</th>
MainActivity
<th>MINUTOS</th>
<th>DESCUENTOS (%)</th>
</tr>
<tr>
<th>1</th>
<th>0 - 10</th>
<th>0</th>
</tr>
<tr>
<th>2</th>
<th>11 - 30</th>
<th>5</th>
</tr>
<tr>
<th>3</th>
<th>31 - 50</th>
<th>10</th>
</tr>
<tr>
<th>4</th>
<th>>50</th>
<th>15</th>
</tr>
</table>
<br>
</body>
</html>

También podría gustarte