Hello, please I have started creating a new WHMCS module, I have predefined values for each package how can I set this predefined values on select option change ( i mean when I click and I change the option from the dropdown list )
<?php
/**
* Module Name : Centrix4WHMCS
* Author name : Amine Bouhaddi
* Phone Number :
* Email Adresse :
* Reason OF Creation :
* Version :
* More About me : @see
*/if(!defined("WHMCS"))die("This File Cannot be accessed directly");function centrix_MetaData(){return array("DisplayName"=>"Centrix","APIVersion"=>"1.1");}/*
* Define Configuration Module
* Required Fieds :
* x :
* y :
* z :
* @return array
*/function project_ConfigOptions(){
$x = array('Package'=> array('Type'=>'dropdown','Loader'=>'project_LoaderFunction','SimpleMode'=>true),'Maximum users'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Contacts & Leads'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Drive file storage'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Smartforms lead capture'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Email list Capacity'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Accounting soft Integration*'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Advanced filtering'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Sales & opportunity dashboard'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Mobile compatible'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Google Maps integration'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Customer document vault'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Sales material vault'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Import tool'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Reminders & notifications'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Task management & reminders'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Activity logs'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Email templates builder'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Built-in Gmail two-way sync'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Tasks and calendar integration '=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Emailing list engine'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Emailing list engine'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'2-way email sync capacity'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Pipeline management'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Social media enrichment'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Custom fields'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Google Analytics integration'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Social profiling'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Role-based permissions'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Sales activity & forecast reports'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'MS Office 365 two-way email sync'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Marketing automation rules engine'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Workflow automation'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Website & email event tracking'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Rule-based lead scoring'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true),'Lead assignment rules'=> array('Type'=>'text','Size'=>25,'SimpleMode'=>true));return $x;}function project_LoaderFunction(){// Make a call to the remote API endpoint
$ch = curl_init('http://project.club/api.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
$response = curl_exec($ch);// Check for any curl errors or an empty responseif(curl_error($ch)){thrownewException('Unable to connect: '. curl_errno($ch).' - '. curl_error($ch));} elseif (empty($response)){thrownewException('Empty response');}// We're done with curl so we can release the resource now
curl_close($ch);// Attempt to decode the response
$packageNames = json_decode($response,true);// Check to make sure valid json was returnedif(is_null($packageNames)){thrownewException('Invalid response format');}// Format the list of values for display// ['value' => 'Display Label']
$list =[];foreach($packageNames as $packageName){
$list[$packageName]= ucfirst($packageName);}return $list;}?>
Question
AmineBouhaddi1
Hello, please I have started creating a new WHMCS module, I have predefined values for each package how can I set this predefined values on select option change ( i mean when I click and I change the option from the dropdown list )
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.