<?php include dirname(__FILE__) . '/../../../autoload.php'; include 'credentials.php'; /** * Fetch all the domain names from Tigron Control panel and output * all information */ $category = Tigron\CP\Product\Type\Category::get_by_identifier('domain'); $user = \Tigron\CP\User::Get(); if ($user->is_reseller) { $reseller = \Tigron\CP\Reseller::get_by_id($user->reseller_id); $users = \Tigron\CP\User::get_by_reseller($reseller); } else { $users = [$user]; } echo 'user;domain;firstname;lastname;company;email' . "\n"; foreach ($users as $user) { $products = Tigron\CP\Product::get_by_user_category(Tigron\CP\User::get(), $category); foreach ($products as $product) { $subdomains = Tigron\CP\Subdomain::get_by_domain_tld($product->domain, $product->tld); foreach ($subdomains as $subdomain) { echo $user->username . ';'; echo $product->domain . '.' . $product->tld . ';'; echo $subdomain->name . '.' . $product->domain . '.' . $product->tld . ';'; echo "\n"; } } }
/** * Get all * * @access public * @return array $users */ public static function get_all() { $client = new \Tigron\CP\Client\Soap('http://api.tigron.net/soap/invoice_queue?wsdl'); $details = $client->get_by_reseller(\Tigron\CP\User::get()->reseller_id); $users = array(); foreach ($details as $detail) { $temp_invoice_queue = new self(); $temp_invoice_queue->id = $detail['id']; $temp_invoice_queue->details = $detail; $invoice_queue[] = $temp_invoice_queue; } return $invoice_queue; }
/** * Get by id * * @access public * @return Product_Type $product_type */ public static function get_by_product_type_category(\Tigron\CP\Product\Type\Category $product_type_category) { $client = new \Tigron\CP\Client\Soap('http://api.tigron.net/soap/product_type?wsdl'); $details = $client->get_by_product_type_category_reseller($product_type_category->id, \Tigron\CP\User::get()->reseller_id); $types = []; foreach ($details as $detail) { $type = new self(); $type->id = $detail['id']; $type->details = $detail; $types[] = $type; } return $types; }