Jump to content

module Admin Services tab issue


xauen

Recommended Posts

I have a custom Admin Services Tab function in our module. It is not getting errors on page but it is not showing on the Admin Product/Services tab (image link http://prntscr.com/fto3h).

My WHMCS install is version 5.03

Please see below the module code:

 

 

 

function thismodule_AdminServicesTabFields($params) {

$link = mysql_connect($params["configoption1"], $params["configoption3"], $params["configoption4"]);
if (!$link) {
return 'Could not connect to MySQL';
}

# Select DB
$db_select = mysql_select_db($params["configoption2"], $link);
if (!$db_select) {
return 'Could not select database';
}


# Select row from database
$sql1 = mysql_query("SELECT `port` FROM `userdata` WHERE `username` = '".$params["username"]."'", $link);
$sql2 = mysql_query("SELECT `port2` FROM `userdata` WHERE `username` = '".$params["username"]."'", $link);
$sql3 = mysql_query("SELECT `port3` FROM `userdata` WHERE `username` = '".$params["username"]."'", $link);

if (!$sql1) {
return 'Could not select row from database '.mysql_error($link);
} else {
return 'success';
}

$fieldsarray = array(
'Field 1' => '<input type="text" name="modulefields[0]" size="30" value="'.$sql1.'" />',
'Field 2' => '<input type="text" name="modulefields[1]" size="30" value="'.$sql2.'" />',
'Field 3' => '<input type="text" name="modulefields[2]" size="30" value="'.$sql3.'" />',
);

return $fieldsarray;

}

 

 

Hope you can help me with this :cry:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated