<?php
use WHMCS\ClientArea;
use WHMCS\Database\Capsule;
define('CLIENTAREA', true);
require __DIR__ . '/init.php';
$ProjectID = WHMCS\Database\Capsule::table("mod_hcloud_project")->get();
$id = App::getFromRequest("id");
$product = WHMCS\Product\Product::find(App::getFromRequest("id"));
$ProjectIDS = [];
foreach ($ProjectID as $HCloudProject) {
$ProjectIDS[$HCloudProject->id] = $HCloudProject->projectname;
}
$dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "userData";
$hideName = [".", "..", ".DS_Store"];
$files = scandir($dir);
$userData = [];
$userData["none"] = "None";
foreach ($files as $filename) {
if (!in_array($filename, $hideName)) {
$userData[$filename] = ucfirst($filename);
}
}
$projectIds = $product->moduleConfigOption1 ? $product->moduleConfigOption1 : $ProjectID[0]->id;
echo $projectIds;
$HetznerCloud = new WHMCS\Module\Server\HetznerCloud\HetznerCloud($projectIds);
$ServerTypeGetAll = $HetznerCloud->ServerTypeGetAll();
var_dump ($ServerTypeGetAll);