date_default_timezone_set('America/Los_Angeles');
include("../../meta/mysql/mysqli_connect_wigglefish2016.php");
// PAGE KEYS
$key_table = "activity";
$key_type = "WebAR App Usage";
// tractor: https://rigmodels.com/model.php?view=Tractor_Low-poly-3d-model__01EGONQFHVIZDI8LCY2JZT5AA
// tank https://rigmodels.com/model.php?view=Russian_Tank-3d-model__BF2PGEVX12Z3E0F64AJEQ24W7&searchkeyword=russian%20tank&manualsearch=1
function getVisitorIP()
{
if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}
return $ip;
}
function generateRG($x,$y,$z)
{
$seed = rand(1,7);
switch ($seed)
{
case "1":
$asset = "RG-Red.png";
break;
case "2":
$asset = "RG-Orange.gif";
break;
case "3":
$asset = "RG-Mustard.png";
break;
case "4":
$asset = "RG-Plum.gif";
break;
case "5":
$asset = "RG-White.png";
break;
case "6":
$asset = "RG-Yellow.gif";
break;
case "7":
$asset = "RG-Orange.gif";
break;
default:
$asset = "RG-Orange.png";
}
return $asset;
}
// INITIALIZE OBJECTS WITH RANDOMLY ASSIGNED COLORS
// FUTURE ADMIN POWER ABUSE VIA PARAMETER B
$rgAlpha = generateRG("cement",4,"mystery");
$rgBravo = generateRG(null,7,"emoji");
$rgCharlie = generateRG("fart",1,"pizza");
$rgDelta = generateRG("baby yoda",4,null);
// GENERATE SPAWN POINTS BY ILLOGICAL USE OF TIME OF DAY
$additional = "";
$i = 0;
while ($i <= 10)
{
// DETERMINE SIZE, ROTATION PATTERN, DRIFT PATTERN, SPIN SPEED
// GENERATE EASTER EGG IF SPECIAL TIME WINDOW
//
$rgRandom = generateRG("Rome",25,"Mestizo Dispossessed");
$x = rand(-3,3);
$y = rand(-6,6);
$z = rand(-3,-15);
$rx = rand(0,360);
$ry = rand(0,360);
$rz = rand(0,360);
$scale = rand(1,4);
$duration = rand(500,2000);
$ax = rand(0,360);
$ay = rand(0,360);
$az = rand(0,360);
$additional .="
";
$i++;
}
$additionalPrimo = "";
$i = 0;
while ($i <= 40)
{
// DETERMINE SIZE, ROTATION PATTERN, DRIFT PATTERN, SPIN SPEED
// GENERATE EASTER EGG IF SPECIAL TIME WINDOW
// echo "
while $i";
$rgRandom = generateRG("Rome",25,"Mestizo Dispossessed");
$x = rand(-15,15);
$y = rand(-7,7);
$z = rand(-9,9);
$rx = rand(0,360);
$ry = rand(0,360);
$rz = rand(0,360);
$scale = rand(1,4);
$duration = rand(1000,8000);
$ax = rand(0,360);
$ay = rand(0,360);
$az = rand(0,360);
$additionalPrimo .="
";
$i++;
}
// ONE SPECIAL EVENT FOR THE SISTER SHOWS
$specialEvent = "";
$rgRandom = generateRG(230218,230320,"LosAngelesAlbania");
$x = rand(-20,23);
$y = rand(-2,18);
$z = rand(-3,20);
$rx = rand(0,360);
$ry = rand(0,360);
$rz = rand(0,360);
$scale = rand(2,3);
$duration1 = rand(230218,230320);
$duration2 = rand(230218,230320);
$specialEvent .="
";
// SAVE SPECIAL EVENT DATA
$mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
// assign all states based on session
$thisTarget = $key_table;
$thisType = $key_type;
$thisCreateAuthor = "WebAR App";
// process all record inputs that cannot be null
$appID = "31337"; // no app id means the content is universal
$thisStatus = 1000; // assume status 1000, not open to all
$thisIP = getVisitorIP();
// escape certain incoming variables registered above
// name should be figured out based on the incoming key variable. but we will hard code it for now
$thisName = "Oasis Mirage WebAR App Usage - $thisIP";
$insert = mysqli_query($mysqli,"
INSERT INTO
$thisTarget
VALUES
(
null,
'$appID',
'$thisStatus',
'$thisType',
'$thisName',
now(),
'$thisCreateAuthor',
now(),
'$thisCreateAuthor'
)
");
// get the id that was just created
$thisID = $mysqli->insert_id;
// echo "Added $thisName as $thisID.
";
// now register the attributes
// we have url, headline, source, and author, all optional. so we check if it exists, and if it does, then write it as an artifact content
$thisTarget_content = $thisTarget . "_content";
$thisTarget_attribute = $thisTarget . "_attribute";
// $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
if ($thisID != null)
{
/*
$rgRandom = generateRG(230218,230320,"LosAngelesAlbania");
$x = rand(-20,23);
$y = rand(-2,18);
$z = rand(-3,20);
$rx = rand(0,360);
$ry = rand(0,360);
$rz = rand(0,360);
$scale = rand(2,3);
$duration1 = rand(230218,230320);
$duration2 = rand(230218,230320);
*/
$insert = mysqli_query($mysqli,"
INSERT INTO
$thisTarget_attribute
VALUES
(
$thisID,
'$appID',
'$thisStatus',
'RG',
'',
'',
'$rgRandom',
null,
null,
null,
now(),
'$thisCreateAuthor',
now(),
'$thisCreateAuthor'
)
");
$insert = mysqli_query($mysqli,"
INSERT INTO
$thisTarget_attribute
VALUES
(
$thisID,
'$appID',
'$thisStatus',
'X',
'',
'',
'$x',
null,
null,
null,
now(),
'$thisCreateAuthor',
now(),
'$thisCreateAuthor'
)
");
$insert = mysqli_query($mysqli,"
INSERT INTO
$thisTarget_attribute
VALUES
(
$thisID,
'$appID',
'$thisStatus',
'Y',
'',
'',
'$y',
null,
null,
null,
now(),
'$thisCreateAuthor',
now(),
'$thisCreateAuthor'
)
");
$insert = mysqli_query($mysqli,"
INSERT INTO
$thisTarget_attribute
VALUES
(
$thisID,
'$appID',
'$thisStatus',
'Z',
'',
'',
'$z',
null,
null,
null,
now(),
'$thisCreateAuthor',
now(),
'$thisCreateAuthor'
)
");
$insert = mysqli_query($mysqli,"
INSERT INTO
$thisTarget_attribute
VALUES
(
$thisID,
'$appID',
'$thisStatus',
'RX',
'',
'',
'$rx',
null,
null,
null,
now(),
'$thisCreateAuthor',
now(),
'$thisCreateAuthor'
)
");
$insert = mysqli_query($mysqli,"
INSERT INTO
$thisTarget_attribute
VALUES
(
$thisID,
'$appID',
'$thisStatus',
'RY',
'',
'',
'$ry',
null,
null,
null,
now(),
'$thisCreateAuthor',
now(),
'$thisCreateAuthor'
)
");
$insert = mysqli_query($mysqli,"
INSERT INTO
$thisTarget_attribute
VALUES
(
$thisID,
'$appID',
'$thisStatus',
'RZ',
'',
'',
'$rz',
null,
null,
null,
now(),
'$thisCreateAuthor',
now(),
'$thisCreateAuthor'
)
");
$insert = mysqli_query($mysqli,"
INSERT INTO
$thisTarget_attribute
VALUES
(
$thisID,
'$appID',
'$thisStatus',
'Scale',
'',
'',
'$scale',
null,
null,
null,
now(),
'$thisCreateAuthor',
now(),
'$thisCreateAuthor'
)
");
$insert = mysqli_query($mysqli,"
INSERT INTO
$thisTarget_attribute
VALUES
(
$thisID,
'$appID',
'$thisStatus',
'Duration 1',
'',
'',
'$duration1',
null,
null,
null,
now(),
'$thisCreateAuthor',
now(),
'$thisCreateAuthor'
)
");
$insert = mysqli_query($mysqli,"
INSERT INTO
$thisTarget_attribute
VALUES
(
$thisID,
'$appID',
'$thisStatus',
'Duration 2',
'',
'',
'$duration2',
null,
null,
null,
now(),
'$thisCreateAuthor',
now(),
'$thisCreateAuthor'
)
");
$insert = mysqli_query($mysqli,"
INSERT INTO
$thisTarget_attribute
VALUES
(
$thisID,
'$appID',
'$thisStatus',
'IP Address',
'',
'',
'$thisIP',
null,
null,
null,
now(),
'$thisCreateAuthor',
now(),
'$thisCreateAuthor'
)
");
}
?>
Oasis Mirage | Mestizo Dispossessed | Revolutions Generator Evolutions