/www/wwwroot/contract-miner.com/build/pages/home/property-ui.php
$puiUserid = $usernameDetails['id'];
$puiUsername = $ctr_username;
} else {
$puiUserid = 0;
}
} else { # Logged user / Dashboard version
$puiUserid = $config_userid;
}
// Check if the user has a active property else default to a default property UI
$propertyCheck=$conn->prepare("SELECT property_id FROM property WHERE userid=? AND status = 1");
$propertyCheck->execute([$puiUserid]);
if($propertyCheck->rowCount() > 0) {
$propertyDetails = $propertyCheck->fetch(PDO::FETCH_ASSOC);
$property_inventory_id = $propertyDetails['property_id'];
// We check to see if the selected user has any property UI changes
$propertyUserUISql=$conn->prepare("SELECT * FROM property_ui_user WHERE userid = ? AND property_id = ? LIMIT 1");
$propertyUserUISql->execute([$puiUserid, $config_property_id_act]);
if($propertyUserUISql->rowCount() > 0) { # User has customized their property
$propertyUserUI = $propertyUserUISql->fetch(PDO::FETCH_ASSOC);
$pCustomFloor = $propertyUserUI['ui_floor'];
$pCustomWindow = $propertyUserUI['ui_window'];
$pCustomWallLeft = $propertyUserUI['ui_wall_left'];
$pCustomWallMiddle = $propertyUserUI['ui_wall_middle'];
$pCustomWallRight = $propertyUserUI['ui_wall_right'];
$pCustomPosterPosOne = $propertyUserUI['ui_poster_spot1'];
$pCustomPosterPosTwo = $propertyUserUI['ui_poster_spot2'];
$pCustomPosterPosThree = $propertyUserUI['ui_poster_spot3'];
// Check to see what has been edited. This is done very basic for now and will be edited later on
// If the user has a stored ID we will run a check in the proeprty UI config table
// Table will give the UI image based on the stored ID
// Helper function to fetch UI item image
function getUIItemImage($conn, $itemId, $itemStatus = 2) {
if (!$itemId || $itemId === '0') {
/www/wwwroot/contract-miner.com/build/pages/home/property-ui.php
$puiUserid = $usernameDetails['id'];
$puiUsername = $ctr_username;
} else {
$puiUserid = 0;
}
} else { # Logged user / Dashboard version
$puiUserid = $config_userid;
}
// Check if the user has a active property else default to a default property UI
$propertyCheck=$conn->prepare("SELECT property_id FROM property WHERE userid=? AND status = 1");
$propertyCheck->execute([$puiUserid]);
if($propertyCheck->rowCount() > 0) {
$propertyDetails = $propertyCheck->fetch(PDO::FETCH_ASSOC);
$property_inventory_id = $propertyDetails['property_id'];
// We check to see if the selected user has any property UI changes
$propertyUserUISql=$conn->prepare("SELECT * FROM property_ui_user WHERE userid = ? AND property_id = ? LIMIT 1");
$propertyUserUISql->execute([$puiUserid, $config_property_id_act]);
if($propertyUserUISql->rowCount() > 0) { # User has customized their property
$propertyUserUI = $propertyUserUISql->fetch(PDO::FETCH_ASSOC);
$pCustomFloor = $propertyUserUI['ui_floor'];
$pCustomWindow = $propertyUserUI['ui_window'];
$pCustomWallLeft = $propertyUserUI['ui_wall_left'];
$pCustomWallMiddle = $propertyUserUI['ui_wall_middle'];
$pCustomWallRight = $propertyUserUI['ui_wall_right'];
$pCustomPosterPosOne = $propertyUserUI['ui_poster_spot1'];
$pCustomPosterPosTwo = $propertyUserUI['ui_poster_spot2'];
$pCustomPosterPosThree = $propertyUserUI['ui_poster_spot3'];
// Check to see what has been edited. This is done very basic for now and will be edited later on
// If the user has a stored ID we will run a check in the proeprty UI config table
// Table will give the UI image based on the stored ID
// Helper function to fetch UI item image
function getUIItemImage($conn, $itemId, $itemStatus = 2) {
if (!$itemId || $itemId === '0') {
/www/wwwroot/contract-miner.com/build/pages/user/contractor.php
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2 text-center">
<div>
<h5><?= $ctr_username; ?> Miners</h5>
<canvas id="MinersOChart"></canvas>
</div>
<div>
<h5><?= $ctr_username; ?> Timed-Mh/s</h5>
<canvas id="HashrateChart"></canvas>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
require_once(__BUILD_COMMON_JS__);
require_once($_SERVER["DOCUMENT_ROOT"] . '/build/pages/home/property-ui.php');
?>
<script type="text/javascript">
$(function() {
'use strict';
// Chart Options
var doughnutOptions = {
responsive: true,
animation: {
animateScale: true,
animateRotate: true
}
};
// Miners Overview Chart
if($("#MinersOChart").length) {
var CMU1 = <?php echo $ctr_miners_total; ?>; // Total Miners
var CMU2 = <?php echo $ctr_miners_active; ?>; // Active Miners || Property Miners
var CMU3 = <?php echo $ctr_miners_inactive; ?>; // Inactive Miners || No Property
var CMU4 = <?php echo $ctr_miners_market; ?>; // Miners on Market
/www/wwwroot/contract-miner.com/routes/user.php
<?php
/***** USER PROFILE // LOGGED IN / OUT PAGE // *****/
app()->all('/user/{ctr_username}', function ($ctr_username) { # Contractor Profile
require_once(__WEBSITE_CORE_ROOT__ . '/core/common_globals.php');
require_once(__WEBSITE_CORE_ROOT__ . '/build/pages/user/contractor.php');
});
if(isset($_SESSION['username'])) {
/***** TASKS *****/
app()->match('GET|POST', '/tasks', function () {
require_once(__WEBSITE_CORE_ROOT__ . '/core/common_globals.php');
require_once(__WEBSITE_CORE_ROOT__ . '/build/pages/user/tasks/overview.php');
});
/***** LEADERBOARD *****/
app()->match('GET|POST', '/leaderboard', function () { # Leaderboard
require_once(__WEBSITE_CORE_ROOT__ . '/core/common_globals.php');
require_once(__WEBSITE_CORE_ROOT__ . '/build/pages/user/leaderboard/index.php');
});
/***** VETERAN *****/
app()->match('GET|POST', '/veteran', function () { # Premium Feature
require_once(__WEBSITE_CORE_ROOT__ . '/core/common_globals.php');
require_once(__WEBSITE_CORE_ROOT__ . '/build/pages/user/veteran/overview.php');
});
}
?>
/www/wwwroot/contract-miner.com/vendor/leafs/router/src/Router/Core.php
}, $matches, array_keys($matches));
// Call the handling function with the URL parameters if the desired input is callable
static::invoke($route['handler'], $params);
++$numHandled;
if ($quitAfterRun) {
break;
}
}
}
return $numHandled;
}
private static function invoke($handler, $params = [])
{
if (is_callable($handler)) {
call_user_func_array(
$handler,
$params
);
}
// If not, check the existence of special parameters
elseif (stripos($handler, '@') !== false) {
list($controller, $method) = explode('@', $handler);
if (!class_exists($controller)) {
trigger_error("$controller not found. Cross-check the namespace if you're sure the file exists");
}
if (!method_exists($controller, $method)) {
trigger_error("$method method not found in $controller");
}
// First check if is a static method, directly trying to invoke it.
// If isn't a valid static method, we will try as a normal method invocation.
if (call_user_func_array([new $controller(), $method], $params) === false) {
// Try to call the method as a non-static method. (the if does nothing, only avoids the notice)
if (forward_static_call_array([$controller, $method], $params) === false);
/www/wwwroot/contract-miner.com/vendor/leafs/router/src/Router/Core.php
}, $matches, array_keys($matches));
// Call the handling function with the URL parameters if the desired input is callable
static::invoke($route['handler'], $params);
++$numHandled;
if ($quitAfterRun) {
break;
}
}
}
return $numHandled;
}
private static function invoke($handler, $params = [])
{
if (is_callable($handler)) {
call_user_func_array(
$handler,
$params
);
}
// If not, check the existence of special parameters
elseif (stripos($handler, '@') !== false) {
list($controller, $method) = explode('@', $handler);
if (!class_exists($controller)) {
trigger_error("$controller not found. Cross-check the namespace if you're sure the file exists");
}
if (!method_exists($controller, $method)) {
trigger_error("$method method not found in $controller");
}
// First check if is a static method, directly trying to invoke it.
// If isn't a valid static method, we will try as a normal method invocation.
if (call_user_func_array([new $controller(), $method], $params) === false) {
// Try to call the method as a non-static method. (the if does nothing, only avoids the notice)
if (forward_static_call_array([$controller, $method], $params) === false);
/www/wwwroot/contract-miner.com/vendor/leafs/router/src/Router/Core.php
$route['pattern'] = preg_replace('/\/{(.*?)}/', '/(.*?)', $route['pattern']);
// we have a match!
if (preg_match_all('#^' . $route['pattern'] . '$#', $uri, $matches, PREG_OFFSET_CAPTURE)) {
// Rework matches to only contain the matches, not the orig string
$matches = array_slice($matches, 1);
// Extract the matched URL parameters (and only the parameters)
$params = array_map(function ($match, $index) use ($matches) {
// We have a following parameter: take the substring from the current param position until the next one's position (thank you PREG_OFFSET_CAPTURE)
if (isset($matches[$index + 1]) && isset($matches[$index + 1][0]) && is_array($matches[$index + 1][0])) {
return trim(substr($match[0][0], 0, $matches[$index + 1][0][1] - $match[0][1]), '/');
}
// We have no following parameters: return the whole lot
return isset($match[0][0]) ? trim($match[0][0], '/') : null;
}, $matches, array_keys($matches));
// Call the handling function with the URL parameters if the desired input is callable
static::invoke($route['handler'], $params);
++$numHandled;
if ($quitAfterRun) {
break;
}
}
}
return $numHandled;
}
private static function invoke($handler, $params = [])
{
if (is_callable($handler)) {
call_user_func_array(
$handler,
$params
);
}
// If not, check the existence of special parameters
/www/wwwroot/contract-miner.com/vendor/leafs/router/src/Router/Core.php
$middleware[0]->call();
}
}
static::callHook('router.before.route');
static::$requestedMethod = \Leaf\Http\Request::getMethod();
if (isset(static::$routeSpecificMiddleware[static::$requestedMethod])) {
static::handle(static::$routeSpecificMiddleware[static::$requestedMethod]);
}
static::callHook('router.before.dispatch');
$numHandled = 0;
if (isset(static::$routes[static::$requestedMethod])) {
$numHandled = static::handle(
static::$routes[static::$requestedMethod],
true
);
}
static::callHook('router.after.dispatch');
if ($numHandled === 0) {
if (!static::$notFoundHandler) {
if (class_exists('Leaf\App')) {
static::$notFoundHandler = function () {
\Leaf\Exception\General::default404();
};
} else {
static::$notFoundHandler = function () {
echo 'Route not found';
};
}
}
static::invoke(static::$notFoundHandler);
}
/www/wwwroot/contract-miner.com/vendor/leafs/leaf/src/App.php
if (class_exists('Leaf\Http\Cors')) {
Http\Cors::config($options);
} else {
trigger_error('Cors module not found! Run `composer require leafs/cors` to install the CORS module. This is required to configure CORS.');
}
}
/**
* @inheritdoc
*/
public static function run(?callable $callback = null)
{
if (class_exists('Leaf\Eien\Server')) {
server()
->wrap(function () use ($callback) {
parent::run($callback);
})
->listen();
} else {
return parent::run($callback);
}
}
}
/www/wwwroot/contract-miner.com/index.php
/***** EVENTS ROUTER *****/
require_once(__WEBSITE_CORE_ROOT__ . '/routes/events.php'); # Events Router
require_once(__WEBSITE_CORE_ROOT__ . '/routes/userAuth.php'); # User Auth Route
require_once(__WEBSITE_CORE_ROOT__ . '/routes/user.php'); # User pages (Public Profile / Leaderboards)
/***** MEDIA ROUTER - BLOGS // NEWS *****/
require_once(__WEBSITE_CORE_ROOT__ . '/routes/media.php');
/***** SERVICE PAGES *****/
require_once(__WEBSITE_CORE_ROOT__ . '/routes/service.php');
app()->run(); # Run the router