diff --git a/pokemon-db/banco.php b/pokemon-db/banco.php new file mode 100644 index 00000000..6652de13 --- /dev/null +++ b/pokemon-db/banco.php @@ -0,0 +1,40 @@ +getMessage()); + } + } + return self::$cont; + } + + public static function desconectar() + { + self::$cont = null; + } +} + +?> diff --git a/pokemon-db/create.php b/pokemon-db/create.php new file mode 100644 index 00000000..6bdae1f7 --- /dev/null +++ b/pokemon-db/create.php @@ -0,0 +1,325 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $sql = "INSERT INTO pokemon (Name,Pokedex_Number,Img_name, Generation, Evolution_Stage, FamilyID, Cross_gen, Type_1, Type_2, Weather_1, Weather_2, STAT_TOTAL, ATK, DEF, STA, Legendary, Aquireable, Spawns, Regional, Raidable, Hatchable, Shiny, Nest, New, NotGettable, Future_Evolve, 100_CP_40, 100_CP_39) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + $q = $pdo->prepare($sql); + $q->execute(array($nome,$num_pokedex, $img_name, $geracao, $evolucao, $IDfamilia, $cross_gen, $tipo1, $tipo2, $tempo1, $tempo2, $stats, $ataque, $defesa, $stamina, + $legendary, $aquireable, $spawns, $regional, $raid, $quebravel, $shiny, $nest, $novo, $naocapturavel, $futuraevol, + $cp39, $cp40)); + Banco::desconectar(); + header("Location: index.php"); + } + catch (PDOException $e){ + print "Erro!:" . $e->getMessage() . "
"; + die(); + } + } +?> + + + + + + + + + + + +
+
+
+

Adicionar Pokemon

+
+
+
+
+
+ +
+ + +
+
+ +
+ + +
+ + +
+
+ +
+ +
+ + +
+
+ +
+
+ +
+ + +
+
+ +
+
+ +
+ + +
+
+ +
+
+ +
+ + +
+
+ + +
ID da familia +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ + +
+
+ + + Voltar + +
+ +
+
+ + + + + diff --git a/pokemon-db/css/main.css b/pokemon-db/css/main.css new file mode 100644 index 00000000..f349e3aa --- /dev/null +++ b/pokemon-db/css/main.css @@ -0,0 +1,13 @@ +body{ + font-family: 'Niramit', sans-serif; +} + + +.stats{ + text-align: justify; + padding-bottom: 3rem; + margin: 0 auto; + font-size: 3em; + font-weight: bold; + color:red; +} diff --git a/pokemon-db/delete.php b/pokemon-db/delete.php new file mode 100644 index 00000000..d5bedbf1 --- /dev/null +++ b/pokemon-db/delete.php @@ -0,0 +1,53 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $sql = "DELETE FROM pokemon where Row = ?"; + $q = $pdo->prepare($sql); + $q->execute(array($Row)); + Banco::desconectar(); + header("Location: index.php"); +} +?> + + + + + + + + + + +
+
+
+

Excluir Pokemon

+
+
+ +
Deseja excluir o Pokemon? +
+
+ + Não +
+
+
+
+ + diff --git a/pokemon-db/index.php b/pokemon-db/index.php new file mode 100644 index 00000000..7338200f --- /dev/null +++ b/pokemon-db/index.php @@ -0,0 +1,76 @@ + + + + + + + + + + + + + +
+
+
+ +
+ +
+

+ Adicionar +

+ + + + + + + + + + + + + + + query($sql); + + + + // foreach fara com que as variaveis passadas do db aparecam na tabela + foreach($result as $row) + { + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + Banco::desconectar(); + ?> + +
IDNomeTipo 1Tipo 2Stat TotalATKDEFAção
'. $row["Row"] . ''. $row['Name'] . ''. $row['Type_1'] . ''. $row['Type_2'] . ''. $row['STAT_TOTAL'] . ''. $row['ATK'] . ''. $row['DEF'] . ''; + //botoes para o crud + echo 'Listar'; + echo ' '; + echo 'Atualizar'; + echo ' '; + echo 'Excluir'; + echo '
+
+
+
+ + diff --git a/pokemon-db/read.php b/pokemon-db/read.php new file mode 100644 index 00000000..aee95adf --- /dev/null +++ b/pokemon-db/read.php @@ -0,0 +1,123 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $sql = "SELECT * FROM pokemon where Row = ?"; + $q = $pdo->prepare($sql); + $q->execute(array($Row)); + $data = $q->fetch(PDO::FETCH_ASSOC); + Banco::desconectar(); + } +?> + + + + + + + + + + +
+
+
+ Stats completos do Pokemon + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDNomeNúmero PokedexNúmero ImagemGeraçãoEstágio da EvoluçãoEvoluçãoID da familiaCross GenTipo 1Tipo 2Tempo 1Tempo 2Stats TotaisAtaqueDefesaStaminaLendárioAdquirívelSpawnRegionalRaidableHatchableShinyNestNewNao é possivel pegarFutura evoluçãoCP 100% 40CP 100% 30
+ +
+ Voltar +
+ +
+
+
+ + diff --git a/pokemon-db/update.php b/pokemon-db/update.php new file mode 100644 index 00000000..5b589c53 --- /dev/null +++ b/pokemon-db/update.php @@ -0,0 +1,341 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $sql = "UPDATE pessoa set Name = ?, Pokedex_Number = ?, Img_name = ?, Generation = ?, Evolution_Stage = ?, Evolved = ?, FamilyID = ?, Cross_Gen = ?, Type_1 = ?, Type_2 = ?, Weather_1 = ?, Weather_2 = ?, STAT_TOTAL = ?, ATK = ?, DEF = ?, STA = ?, Legendary = ?, Aquireable = ?, Spawns = ?, Regional = ?, Hatchable = ?, Shiny = ?, Nest = ?, New = ?, NotGettable = ?, Future_Evolve = ?, 100_CP_39 = ?, 100_CP_40 = ? WHERE Row = ?"; + $q = $pdo->prepare($sql); + $q->execute(array($nome,$num_pokedex,$img_name,$geracao,$evolucao,$Evolved,$IDfamilia,$cross_gen,$tipo1,$tipo2,$tempo1,$tempo2,$ataque,$defesa,$stamina,$legendary,$aquireable,$spawns,$regional,$raid,$quebravel,$shiny,$nest,$novo,$naocapturavel,$futuraevol,$cp39,$cp40)); + Banco::desconectar(); + header("Location: index.php"); + } + } + + +?> + + + + + + + + + + + + + +
+
+
+ Alterar Pokemon +
+
+
+
+
+
+ + + + + +
+ +
+ + + + + + +
+ +
+ + + +
+ +
+ +
+
+ + + +
+ + +
+ + + + + + +
+ +
+ + + + + +
+
+ +
+
+ + + + +
+ +
+ + + +
+ + +
+ + + +
+
+ +
+
+ + + + + +
+ +
+ + + + +
+ + +
+ + + +
+
+ +
+
+ + + + + +
+ +
+ + + + +
+ + +
+ + + + +
+
+ +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + Voltar +
+ + + + + +