Commit 5d70fc55 authored by Elias's avatar Elias

Cad Jogo

parent 04daa81a
<?php
$Pagina = "Cadastro";
?>
<!--Começa Header-->
<?php
session_start();
session_destroy();
$Titulo = "Cadastro de Jogos";
include 'Header.php';
?>
<!--Termina Header-->
<!--Começa Menu-->
<?php
include 'Menu.php';
?>
<!--Termina Menu-->
</div>
</div>
</div>
</div>
<div class="col-md-3"></div>
</div>
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<div class="Area">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6 text-center" align="center">
<br />
<h1>Cadastro de Jogos</h1>
<br />
<?php
if(isset($_GET["Time1"])==true){
if(isset($_GET["Time2"])==true){
if(isset($_GET["Horario"])==true){
if(isset($_GET["Data"])==true){
$idTime1 = $_GET["Time1"];
$idTime2 = $_GET["Time2"];
$sqlTime1 = "select Nome from Time where idTime = $idTime1";
$sqlTime2 = "select Nome from Time where idTime = $idTime2";
$resultadoTime1 = mysqli_query($conexao, $sqlTime1);
while($row = mysqli_fetch_assoc($resultadoTime1)){
$Time1 = $row['Nome'];
}
$resultadoTime2 = mysqli_query($conexao, $sqlTime2);
while($row = mysqli_fetch_assoc($resultadoTime2)){
$Time2 = $row['Nome'];
}
$Horario = $_GET["Horario"];
$Data = $_GET["Data"];
include 'JogoCadSuc.php';
}
}
}
}
?>
<hr />
<form action="processarjogos.php" method="post" enctype="multipart/form-data">
<div class="form-group">
<div class="row">
<div class="col-md-5" align="Center">
<label>Time 1:</label>
<select class="form-control" name="Time1" id="Time1" required onchange="VerificaSubmit2()" >
<option value="None">Escolher Time</option>
<?php
$sqlModalidades = "select idTime, Nome from Time";
$resultModalidade = mysqli_query($conexao,$sqlModalidades);
while($row = mysqli_fetch_assoc($resultModalidade)){
$idTime = $row["idTime"];
$Nome = $row["Nome"];
echo "<option value='$idTime'>$Nome</option>";
}
?>
</select>
</div>
<div class="col-md-2" align="Center">
<h1 class="Versus">X</h1>
</div>
<div class="col-md-5" align="Center">
<label>Time 2:</label>
<select class="form-control" name="Time2" id="Time2" required onchange="VerificaSubmit2()" >
<option value="None">Escolher Time</option>
<?php
$sqlModalidades = "select idTime, Nome from Time";
$resultModalidade = mysqli_query($conexao,$sqlModalidades);
while($row = mysqli_fetch_assoc($resultModalidade)){
$idTime = $row["idTime"];
$Nome = $row["Nome"];
echo "<option value='$idTime'>$Nome</option>";
}
?>
</select>
</div>
</div>
</div>
<hr />
<div class="form-group">
<label>Horário do jogo:</label>
<input type="Time" class="form-control" name="Horario" id="Horario" required />
</div>
<br />
<div class="form-group">
<label>Data do jogo</label>
<input type="Date" class="form-control" name="Data" id="Data" required />
</div>
<hr />
<input type="submit" class="btn btn-success" id="CadSubmit" disabled />
</form>
<br />
</div>
<div class="col-md-3"></div>
</div>
</div>
</div>
<div class="col-md-3"></div>
</div>
</body>
</html>
<div class="alert alert-success" id="AvisoJogo" role="alert">
Jogo: <b><?php echo $Time1; ?></b> <span class="VersusB"> X </span> <b><?php echo $Time2; ?></b> cadastrado com sucesso! Data e Hora: <b><?php echo "$Data, $Horario";?> </b><button onclick="Fechar('Jogo')" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>
</div>
......@@ -55,7 +55,7 @@
<br />
<div class="form-group">
<label>Modalidade</label>
<select class="form-control" name="Modalidade" id="Modalidade" required onchange="VerificaSubmit()" >
<select class="form-control" name="Modalidade" id="Modalidade" required onchange="VerificaSubmit('Modalidade')" >
<option value="None">Modalidade ; Sexo</option>
<?php
$sqlModalidades = "select idModalidades,Nome,Sexo from Modalidades";
......
......@@ -8,6 +8,12 @@ body{
.MgT{
margin-top: 2px;
}
.Versus{
color: #E5E5E5;
}
.VersusB{
color: #000000;
}
#Pad10{
padding: 5px;
}
......
......@@ -59,20 +59,23 @@ function EscolheuImagem(Imagem){
document.getElementById("ImagemCad").value = Imagem;
}
function Fechar(Janela){
if(Janela=="Atleta"){
document.getElementById("AvisoAtleta").style.visibility = "hidden";
document.getElementById("AvisoAtleta").style.position = "absolute";
}
if(Janela=="Time"){
document.getElementById("AvisoTime").style.visibility = "hidden";
document.getElementById("AvisoTime").style.position = "absolute";
}
document.getElementById("Aviso"+Janela).style.visibility = "hidden";
document.getElementById("Aviso"+Janela).style.position = "absolute";
}
function VerificaSubmit(){
var opcao = document.getElementById("Modalidade").value;
function VerificaSubmit(id){
var opcao = document.getElementById(id).value;
if(opcao == "None"){
document.getElementById("CadSubmit").disabled = true;
}else{
document.getElementById("CadSubmit").disabled = false;
}
}
function VerificaSubmit2(){
var opcao1 = document.getElementById('Time1').value;
var opcao2 = document.getElementById('Time2').value;
if(opcao1 == "None" || opcao2 == "None"){
document.getElementById("CadSubmit").disabled = true;
}else{
document.getElementById("CadSubmit").disabled = false;
}
}
<?php
require "Conexao.php";
$Time1 = $_POST["Time1"];
$Time2 = $_POST["Time2"];
$Horario = $_POST["Horario"];
$Data = $_POST["Data"];
$sqlJogo = "insert into Jogo(Time1,Time2, Horario, Data) value($Time1,$Time2,'$Horario','$Data');";
$resultado = mysqli_query($conexao, $sqlJogo);
echo "<script>
location.href='Jogo.php?Time1=$Time1&&Time2=$Time2&&Data=$Data&&Horario=$Horario';
</script>";
?>
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -38,6 +38,7 @@ CREATE TABLE `Atleta` (
LOCK TABLES `Atleta` WRITE;
/*!40000 ALTER TABLE `Atleta` DISABLE KEYS */;
INSERT INTO `Atleta` VALUES (1,99),(1,99999999999),(1,99999999999),(1,99999999998),(1,99999999998),(1,99999999998),(1,99999999998),(1,99999999997),(1,99999999996),(1,99999999996),(1,99999999995);
/*!40000 ALTER TABLE `Atleta` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
......@@ -50,4 +51,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-05-09 11:18:28
-- Dump completed on 2016-06-06 15:10:11
......@@ -50,4 +50,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-05-09 11:18:28
-- Dump completed on 2016-06-06 15:10:11
......@@ -47,4 +47,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-05-09 11:18:28
-- Dump completed on 2016-06-06 15:10:11
......@@ -53,4 +53,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-05-09 11:18:28
-- Dump completed on 2016-06-06 15:10:12
......@@ -49,4 +49,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-05-09 11:18:27
-- Dump completed on 2016-06-06 15:10:10
......@@ -51,4 +51,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-05-09 11:18:28
-- Dump completed on 2016-06-06 15:10:12
-- MySQL dump 10.13 Distrib 5.6.24, for linux-glibc2.5 (x86_64)
--
-- Host: localhost Database: Olimpiadas
-- ------------------------------------------------------
-- Server version 5.6.27
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `Jogo`
--
DROP TABLE IF EXISTS `Jogo`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Jogo` (
`idJogo` int(11) NOT NULL AUTO_INCREMENT,
`Data` date DEFAULT NULL,
`Horario` time DEFAULT NULL,
`Time1` int(11) DEFAULT NULL,
`Time2` int(11) DEFAULT NULL,
PRIMARY KEY (`idJogo`),
KEY `fk_Time2_Time_idx` (`Time2`),
KEY `fk_Time1_Time_idx` (`Time1`),
CONSTRAINT `fk_Time1_Time` FOREIGN KEY (`Time1`) REFERENCES `Time` (`idTime`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_Time2_Time` FOREIGN KEY (`Time2`) REFERENCES `Time` (`idTime`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `Jogo`
--
LOCK TABLES `Jogo` WRITE;
/*!40000 ALTER TABLE `Jogo` DISABLE KEYS */;
INSERT INTO `Jogo` VALUES (1,'2016-01-10','11:00:00',1,2);
/*!40000 ALTER TABLE `Jogo` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-06-06 15:10:11
......@@ -52,4 +52,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-05-09 11:18:28
-- Dump completed on 2016-06-06 15:10:11
......@@ -28,7 +28,7 @@ CREATE TABLE `Modalidades` (
`Sexo` varchar(20) DEFAULT NULL,
`Descricao` text,
PRIMARY KEY (`idModalidades`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -37,6 +37,7 @@ CREATE TABLE `Modalidades` (
LOCK TABLES `Modalidades` WRITE;
/*!40000 ALTER TABLE `Modalidades` DISABLE KEYS */;
INSERT INTO `Modalidades` VALUES (1,'Hue','Ambos','\r\nRegras:\r\n\r\nNão possui regras.\r\n\r\nFunção:\r\n\r\nZuar.\r\n\r\n'),(2,'Hue2','Ambos','<p>\n <b>Regras:</b>\n</p>\n<p>\n Não possui regras.\n</p>\n<p>\n <b>Função:</b>\n</p>\n<p>\n Zuar.\n</p>\n\n\n'),(3,'Hue3','Masculino','<p>\r\n <b>Regras:</b>\r\n</p>\r\n<p>\r\n Não possui regras.\r\n</p>\r\n<p>\r\n <b>Função:</b>\r\n</p>\r\n<p>\r\n Zuar.\r\n</p>\r\n\r\n\r\n'),(4,'Teste','Ambos','<p>\r\n <b>Regras:</b>\r\n</p>\r\n<p>\r\n 1º Não possui regras.\r\n</p>\r\n<p>\r\n <b>Função:</b>\r\n</p>\r\n<p>\r\n Zuar.\r\n</p>\r\n\r\n\r\n'),(5,'Futebol','Masculino','<p>\n <b>Regras:</b>\n</p>\n<p>\n 1. Não Quebrar.\n</p>\n<p>\n <b>Função:</b>\n</p>\n<p>\n Jogar Bola !.\n</p>\n\n\n');
/*!40000 ALTER TABLE `Modalidades` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
......@@ -49,4 +50,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-05-09 11:18:28
-- Dump completed on 2016-06-06 15:10:11
......@@ -29,7 +29,7 @@ CREATE TABLE `Time` (
PRIMARY KEY (`idTime`),
KEY `fktimeidmodalidade_idx` (`idModalidade`),
CONSTRAINT `fktimeidmodalidade` FOREIGN KEY (`idModalidade`) REFERENCES `Modalidades` (`idModalidades`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -38,6 +38,7 @@ CREATE TABLE `Time` (
LOCK TABLES `Time` WRITE;
/*!40000 ALTER TABLE `Time` DISABLE KEYS */;
INSERT INTO `Time` VALUES (1,'Viagras',5),(2,'Arroz',5);
/*!40000 ALTER TABLE `Time` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
......@@ -50,4 +51,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-05-09 11:18:28
-- Dump completed on 2016-06-06 15:10:11
......@@ -47,4 +47,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-05-09 11:18:29
-- Dump completed on 2016-06-06 15:10:11
......@@ -50,4 +50,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-05-09 11:18:27
-- Dump completed on 2016-06-06 15:10:10
......@@ -49,7 +49,7 @@ CREATE TABLE `Usuario` (
LOCK TABLES `Usuario` WRITE;
/*!40000 ALTER TABLE `Usuario` DISABLE KEYS */;
INSERT INTO `Usuario` VALUES (99,'99','2222-02-11','afssf','dfd',NULL,NULL,'11','99@99.1','2016-04-19','14:08:19',NULL),(99997999985,'Tony Junior','4244-02-24','(+55) 047 7070-7070','(+55) 047 3333-4444',NULL,NULL,'lol','TonyJunior@tooony.jr','2016-04-19','13:34:18',NULL),(99999999474,'99','2222-02-11','afssf','dfd',NULL,NULL,'1','99@99.1','2016-04-19','13:38:11',NULL),(99999999989,'111','1111-11-11','1111','111',NULL,NULL,'11111','1111@111.1.1','2016-04-25','13:05:12',NULL),(99999999995,'Gabriel Silveira','1999-07-15','12345678','34568977',NULL,NULL,'Gabe','GabrielSilveira@hotmail.com','2016-04-18','15:11:29',NULL),(99999999996,'Gabriel Silveira','1999-07-15','12345678','34568977',NULL,NULL,'gabe','GabrielSilveira@hotmail.com','2016-04-18','14:44:04',NULL),(99999999997,'Gabriel Silveira','1999-07-15','12345678','34568977',NULL,NULL,'gabe','GabrielSilveira@hotmail.com','2016-04-18','14:43:10',NULL),(99999999998,'Gabriel Silveira','1999-07-15','12345678','34568977',NULL,NULL,'Gabriel','GabrielSilveira@hotmail.com','2016-04-18','14:32:21',NULL),(99999999999,'Gabriel Silveira','2016-04-15','12345678','34568977',NULL,NULL,'Gabriel','GabrielSilveira@hotmail.com','2016-04-18','14:12:56',NULL);
INSERT INTO `Usuario` VALUES (99,'99','2222-02-11','afssf','dfd',NULL,NULL,'11','99@99.1','2016-04-19','14:08:19','Anonimo'),(11111115111,'121','1111-11-11','1','1',NULL,NULL,'11','121@1','2016-05-10','14:30:57','Anonimo'),(99997799999,'123','1231-03-12','123','123',NULL,NULL,'1','123@132','2016-05-10','14:28:54','Anonimo'),(99997999985,'Tony Junior','4244-02-24','(+55) 047 7070-7070','(+55) 047 3333-4444',NULL,NULL,'lol','TonyJunior@tooony.jr','2016-04-19','13:34:18','Anonimo'),(99999999474,'99','2222-02-11','afssf','dfd',NULL,NULL,'1','99@99.1','2016-04-19','13:38:11','Anonimo'),(99999999989,'111','1111-11-11','1111','111',NULL,NULL,'11111','1111@111.1.1','2016-04-25','13:05:12','Anonimo'),(99999999995,'Gabriel Silveira','1999-07-15','12345678','34568977',NULL,NULL,'Gabe','GabrielSilveira@hotmail.com','2016-04-18','15:11:29','Anonimo'),(99999999996,'Gabriel Silveira','1999-07-15','12345678','34568977',NULL,NULL,'gabe','GabrielSilveira@hotmail.com','2016-04-18','14:44:04','Anonimo'),(99999999997,'Gabriel Silveira','1999-07-15','12345678','34568977',NULL,NULL,'gabe','GabrielSilveira@hotmail.com','2016-04-18','14:43:10','Anonimo'),(99999999998,'Gabriel Silveira','1999-07-15','12345678','34568977',NULL,NULL,'Gabriel','GabrielSilveira@hotmail.com','2016-04-18','14:32:21','Anonimo'),(99999999999,'Gabriel Silveira','2016-04-15','12345678','34568977',NULL,NULL,'Gabriel','GabrielSilveira@hotmail.com','2016-04-18','14:12:56','Anonimo');
/*!40000 ALTER TABLE `Usuario` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
......@@ -62,4 +62,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-05-09 11:18:28
-- Dump completed on 2016-06-06 15:10:10
......@@ -50,4 +50,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-05-09 11:18:28
-- Dump completed on 2016-06-06 15:10:11
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment