<?php
namespace WHMCS\Module\Addon\ProxyCheap\Commands;

use WHMCS\Module\Addon\ProxyCheap\AbstractCommand;
use WHMCS\Database\Capsule as DB;
class ProductConfigOptions extends AbstractCommand
{
    public function get()
    {
        $pid = (int)$_GET['pid'];
        $billing = trim($_GET['billing']);
        $co = $_GET['co'];

        include ROOTDIR .'/includes/configoptionsfunctions.php';
        $pricing = getCartConfigOptions($pid, $co, $billing, "", true);

        foreach($pricing as $k=>$co)
        {
            $pricing[$k]['optionraw'] = DB::table('tblproductconfigoptions')->where('id', $co['id'])->value('optionname');
        }
        return $pricing;
    }
}