hmaddy Posted February 2, 2023 Share Posted February 2, 2023 <?php function hmk_config() { $configarray = array( "name" => "myname", "description" => "Config function for hm addonmodule", "version" => "1.0", "author" => "WHMCS", "fields" => array( "option1" => array ("FriendlyName" => "AdminUser", "Type" => "dropdown", "Options" => "1,2,3,4,5", "Description" => "Sample Dropdown", "Default" => "1", ), "option2" => array ("FriendlyName" => "Department", "Type" => "dropdown", "Options" => "1,2,3,4,5", "Description" => "Sample Dropdown", "Default" => "1", ), "option3" => array ("FriendlyName" => "KYC Period (Months)", "Type" => "dropdown", "Options" => "12,24,36", "Description" => "Sample Dropdown", "Default" => "1", ), )); return $configarray; } This is my config function. on this config function, i need to add the existing admin users from the database to option1 drop down and the all the existing departments to option2 dropdown. Anybody please help me to add these. 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted February 2, 2023 Share Posted February 2, 2023 You can use WHMCS\User\Admin to get all admins. <?php $admins = WHMCS\User\Admin::all(); Loop over the data and add the name, id or whatever you need to an array. 0 Quote Link to comment Share on other sites More sharing options...
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.