190 lines
6.5 KiB
PHP
190 lines
6.5 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
require_once("/var/www/furatalog/data/script/furatalog.sessions.php");
|
||
|
|
$fs = new furatalogSessions();
|
||
|
|
|
||
|
|
/*
|
||
|
|
if (isset($_POST["data"])) {
|
||
|
|
$fs->setSessionData("jinxxyData", $_POST["data"]);
|
||
|
|
}
|
||
|
|
|
||
|
|
if ($fs->issetSessionData("tmpdata")) {
|
||
|
|
$_POST["data"] = $fs->getSessionData("tmpdata");
|
||
|
|
$fs->unsetSessionData("tmpdata");
|
||
|
|
}
|
||
|
|
|
||
|
|
if (!$fs->issetSessionData("login") && ($fs->getSessionData("login") != "true-as-hell")) {
|
||
|
|
$fs->setSessionData("tmpdata", $_POST["data"]);
|
||
|
|
$fs->setSessionData("ref", "redirectFromJinxxy");
|
||
|
|
header("Location: login.php");
|
||
|
|
die();
|
||
|
|
}
|
||
|
|
|
||
|
|
if ($fs->issetSessionData("jinxxyData")) {
|
||
|
|
$_POST["data"] = $fs->getSessionData("jinxxyData");
|
||
|
|
$fs->unsetSessionData("jinxxyData");
|
||
|
|
}*/
|
||
|
|
|
||
|
|
$creator_name;
|
||
|
|
$creator_pb;
|
||
|
|
$creator_jinxxyURL;
|
||
|
|
|
||
|
|
$content_name;
|
||
|
|
$content_price;
|
||
|
|
$content_rating;
|
||
|
|
|
||
|
|
$content_creator_id;
|
||
|
|
$content_currency_id;
|
||
|
|
|
||
|
|
$content_url;
|
||
|
|
$content_image;
|
||
|
|
|
||
|
|
$userData;
|
||
|
|
$productData;
|
||
|
|
|
||
|
|
$data = json_decode($_POST["data"]);
|
||
|
|
|
||
|
|
print_r($data);
|
||
|
|
|
||
|
|
$product = $data->product;
|
||
|
|
$seller = $data->seller;
|
||
|
|
|
||
|
|
|
||
|
|
// set creator name
|
||
|
|
$creator_name = $seller->name;
|
||
|
|
|
||
|
|
// set creator jinxxy url
|
||
|
|
$creator_jinxxyURL = $seller->url;
|
||
|
|
|
||
|
|
// set creator pb
|
||
|
|
$creator_pb = $seller->image;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
// set content name
|
||
|
|
$content_name = $product->name;
|
||
|
|
|
||
|
|
// set content price
|
||
|
|
$content_price = $product->price;
|
||
|
|
|
||
|
|
// set procuct url
|
||
|
|
$content_url = $product->url;
|
||
|
|
|
||
|
|
// set content image
|
||
|
|
$content_image = $product->image;
|
||
|
|
|
||
|
|
// set no rating
|
||
|
|
$content_rating = "null";
|
||
|
|
|
||
|
|
// currency type
|
||
|
|
$currency_currency = $product->currencySymbol;
|
||
|
|
|
||
|
|
$databaseConnection = new mysqli("10.0.0.100", "furatalog_usr", "1yRNpaUtXu[cw@-m", "furatalog");
|
||
|
|
$result = $databaseConnection->query("SELECT * FROM `currency` WHERE symbol=\"" . $currency_currency . "\";")->fetch_assoc();
|
||
|
|
|
||
|
|
$content_currency_id = $result["id"];
|
||
|
|
$currency_tag = $result["currency"];
|
||
|
|
|
||
|
|
$result2 = $databaseConnection->query("SELECT * FROM `creator` WHERE jinxxy_url=\"" . $creator_jinxxyURL . "\";");
|
||
|
|
|
||
|
|
if ($result2->num_rows > 0) {
|
||
|
|
$content_creator_id = $result2->fetch_assoc()["id"];
|
||
|
|
} else {
|
||
|
|
$content_creator_id = "";
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/*
|
||
|
|
echo '<br><span style="font-family: consolas">Creator Name </span>' . $creator_name;
|
||
|
|
echo '<br><span style="font-family: consolas">Creator PB </span>' . $creator_pb;
|
||
|
|
echo '<br><span style="font-family: consolas">Creator JinxxyURL </span>' . $creator_jinxxyURL;
|
||
|
|
echo '<br>';
|
||
|
|
echo '<br>';
|
||
|
|
echo '<br>';
|
||
|
|
echo '<br><span style="font-family: consolas">Content Name </span>' . $content_name;
|
||
|
|
echo '<br><span style="font-family: consolas">Content Price </span>' . $content_price;
|
||
|
|
echo '<br><span style="font-family: consolas">Content Rating </span>' . $content_rating;
|
||
|
|
echo '<br>';
|
||
|
|
echo '<br><span style="font-family: consolas">Content CreatorID </span>' . $content_creator_id;
|
||
|
|
echo '<br><span style="font-family: consolas">Content CurrencyID </span>' . $content_currency_id;
|
||
|
|
echo '<br>';
|
||
|
|
echo '<br><span style="font-family: consolas">Content URL </span>' . $content_url;
|
||
|
|
echo '<br><span style="font-family: consolas">Content Image </span>' . $content_image;
|
||
|
|
echo '<br>';
|
||
|
|
echo '<br><span style="font-family: consolas">Currency Code </span>' . $currency_currency;
|
||
|
|
*/
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
?>
|
||
|
|
|
||
|
|
|
||
|
|
<!DOCTYPE html>
|
||
|
|
<html lang="en">
|
||
|
|
<head>
|
||
|
|
<?php echo file_get_contents("/var/www/furatalog-cdn/mainHead.html"); ?>
|
||
|
|
<title>Insert From Jinxxy - Admin Panel - Furatalog.xyz</title>
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<div class="main">
|
||
|
|
<form action="insert-jinxxy.php" class="insert" method="post">
|
||
|
|
<select name="section" id="section">
|
||
|
|
<option value="1">Assets</option>
|
||
|
|
<option value="2">Avatars</option>
|
||
|
|
<option value="3">Bases</option>
|
||
|
|
<option value="4">Worlds</option>
|
||
|
|
</select>
|
||
|
|
<div>
|
||
|
|
<?php
|
||
|
|
$furatalog = new mysqli("10.0.0.100", "furatalog_admin_usr", "NR6tLk7c56bPT5[]", "furatalog");
|
||
|
|
$requestSpeciesResult = $furatalog->query("SELECT * FROM `species`");
|
||
|
|
while ($row = $requestSpeciesResult->fetch_assoc()) {
|
||
|
|
echo "
|
||
|
|
<label>
|
||
|
|
<input type=\"checkbox\" name=\"" . $row["tag"] . "\">" . $row["name"] . "
|
||
|
|
</label><br>";
|
||
|
|
}
|
||
|
|
?>
|
||
|
|
</div>
|
||
|
|
<input type="text" name="creator_name" value="<?php echo $creator_name; ?>"><br>
|
||
|
|
<input type="text" name="creator_pb" value="<?php echo $creator_pb; ?>"><br>
|
||
|
|
<input type="text" name="creator_jinxxyURL" value="<?php echo $creator_jinxxyURL; ?>"><br>
|
||
|
|
<input type="text" name="content_name" value="<?php echo $content_name; ?>"><br>
|
||
|
|
<input type="text" name="content_price" value="<?php echo $content_price; ?>"><br>
|
||
|
|
<input type="text" name="content_rating" value="<?php echo $content_rating; ?>"><br>
|
||
|
|
<input type="text" name="content_creator_id" value="<?php echo $content_creator_id; ?>"><br>
|
||
|
|
<input type="text" name="content_currency_id" value="<?php echo $content_currency_id; ?>"><br>
|
||
|
|
<input type="text" name="content_url" value="<?php echo $content_url; ?>"><br>
|
||
|
|
<input type="text" name="content_image" value="<?php echo $content_image; ?>"><br>
|
||
|
|
<input type="text" name="currency_currency" value="<?php echo $currency_tag; ?>"><br>
|
||
|
|
<input type="text" name="species" id="speciesIncluded" style="display: none;" value="props">
|
||
|
|
<input type="submit" value="Insert">
|
||
|
|
</form>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
// Select all checkboxes and the result input field
|
||
|
|
const checkboxes = document.querySelectorAll('input[type="checkbox"]');
|
||
|
|
const resultInput = document.getElementById('speciesIncluded');
|
||
|
|
|
||
|
|
// Function to update the result input field
|
||
|
|
function updateResult() {
|
||
|
|
const selectedNames = Array.from(checkboxes) // Convert NodeList to Array
|
||
|
|
.filter(checkbox => checkbox.checked) // Filter only checked checkboxes
|
||
|
|
.map(checkbox => checkbox.name); // Map to their name attributes
|
||
|
|
|
||
|
|
// Join the names with a comma and update the result input
|
||
|
|
resultInput.value = selectedNames.join(' ');
|
||
|
|
|
||
|
|
if (resultInput.value == "" || resultInput.value == " ") {
|
||
|
|
resultInput.value = "props";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// Add event listeners to all checkboxes
|
||
|
|
checkboxes.forEach(checkbox => {
|
||
|
|
checkbox.addEventListener('change', updateResult); // Listen for 'change' event
|
||
|
|
});
|
||
|
|
</script>
|
||
|
|
</body>
|
||
|
|
</html>
|