<?php
include("R71.html");

$db_server = "localhost";
$db_user ="root";
$db_pass ="";
$db_name ="e0";
$conn ="";

try{
$conn = mysqli_connect($db_server, $db_user, 
                        $db_pass, $db_name);
}catch(mysqli_sql_exception){
    echo "SQL Problem perhaps brother ...";
}
if($conn){
    echo "Connected to test";
}else{
    echo "No connection";
}
$Nama = isset($_GET['Nama']) ? $_GET['Nama'] : '';
$Umur = isset($_GET['Umur']) ? $_GET['Umur'] :'';
$Tinggi = isset($_GET['Tinggi']) ? $_GET['Tinggi']:'';
$Berat = isset($_GET['Berat']) ? $_GET['Berat']:'';
$Profesi = isset($_GET['Profesi']) ? $_GET['Profesi']:'';
$Afiliasi = isset($_GET['Afiliasi']) ? $_GET['Afiliasi']:'';
$Jenis = isset($_GET['Jenis']) ? $_GET['Jenis']:'';
echo $Jenis;
/*
$sql = "INSERT INTO r71 (Nama,Afiliasi,Umur,Tinggi,Profesi,Berat,)
    VALUES ('$Nama','$Afiliasi',$Umur,$Tinggi,'$Profesi',$Berat)";
    mysqli_query($conn,$sql);
    mysqli_close($conn);
*/
include('Sirius.php');
$CONS;$CHA;$STR;$HEX;$IQ;$WIS;$HP;
$Lv = Integrity_Dice($min);
$HP = Integrity_Dice($min);

    $CONS = Attribute_Dice($min)*Symbolic_Dice($min);
    $STR = Attribute_Dice($min)*Symbolic_Dice($min);
    $HEX = Attribute_Dice($min)*Symbolic_Dice($min);    
    $CHA = Attribute_Dice($min)*Symbolic_Dice($min);
    $IQ = Attribute_Dice($min)*Symbolic_Dice($min);
    $WIS = Attribute_Dice($min)*Symbolic_Dice($min);


echo "<br> CONS : $CONS";
echo "<br> STR  : $STR";
echo "<br> HEX  : $HEX";
echo "<br> CHA  : $CHA";
echo "<br> INT  : $IQ";
echo "<br> WIS  : $WIS";


$sql = "INSERT INTO formalhault (Nama) VALUES ('$Nama')";
    mysqli_query($conn,$sql);

$sql = "INSERT INTO sirius (Jenis,Nama,Afiliasi,Umur,Lv,Tinggi,CONS,CHA,STR,HEX,IQ,WIS,HP,Profesi,Berat)
    VALUES ($Jenis,'$Nama','$Afiliasi',$Umur,$Lv,$Tinggi,$CONS,$CHA,$STR,$HEX,$IQ,$WIS,$HP,'$Profesi',$Berat)";
    mysqli_query($conn,$sql);
    mysqli_close($conn);



?>