*/ $whmcs = App::self(); $pid = (int) $whmcs->get_req_var('pid'); $id = (int) $whmcs->get_req_var('id'); $get = $whmcs->get_req_var('get'); $language = $whmcs->get_req_var('language') ?: null; $data = array(); $name = $description = ''; // Verify user input for pid exists, is greater than 0, and as is a valid id if ($pid > 0) { $data = Capsule::table('tblproducts') ->where('id', '=', $pid) ->first(); $pid = (int) $data->id; // If there is a user logged in, we will use the client language if (((int) $userId = Session::get('userid'))) { $language = Client::find($userId, array('language'))->language ?: null; } $name = Product::getProductName($pid, $data->name, $language); $description = Product::getProductDescription($pid, $data->description, $language); } // Verify that the pid is not less than 1 to in order to continue. if ($pid < 1) { widgetOutput('Product ID Not Found'); } $configOptionsGroupID = Capsule::table('tblproductconfiglinks') ->where('pid', '=', $pid) ->select('gid') ->first(); $configOptions = Capsule::table('tblproductconfigoptions') ->where('gid', '=', $configOptionsGroupID->gid) ->select('optionname','qtyminimum') ->get(); $ressource = new ResourceManager(); $ressource->setProductId($id); print_r($ressource); widgetOutput($ressource->vcpus()->getUsed()); function widgetOutput($value) { echo "document.write('".addslashes($value)."');"; throw new ProgramExit(); }