Jump to content

Cannot Get Table Values To Custom Page In Provisioning Module


Recommended Posts

I'm new to creating provisioning modules, so please forgive if this is a stupid question.

In the Product Details page, I've setup 3 buttons that go to their corresponding secondary custom pages. On one of the secondary pages, I have a button to display a table when clicked, but I can't make it work. I've tried putting variables inside the Client Area function, and tried configuring a custom function and with no luck.

I used this post as well as reading the github documentation as best I could.

 Custom Function:

Quote

function mycustomprovision_customfunction($params)
{
    $pagearray = array(
        'templatefile' => 'templates/customfunction.tpl',
        'vars' => array(
            'var1' => 'demo1',
            'var2' => 'demo2',
        ),
    );
    return $pagearray;
    //get all rows
    try {
        $finalarray=array();
        $response=array();
        $i=1;
        while($row=mysqli_fetch_assoc($run))
        {        

            foreach($row as $rows)
            {
                $response = array(
                'field1'.$i => $row['userid'],
                'field2'.$i => $row['firstname'],
                'field3'.$i => $row['lastname'],
                );
            }
    
            $finalarray=$finalarray+$response;
            $i++;

    
        return array(
            'tabOverviewReplacementTemplate' => $templateFile,
            'templateVariables' => $finalarray,
        ); 

Button:

Quote

<div class="row">
    <div class="col-sm-5">
        <form method="post" action="clientarea.php?action=productdetails">
        <input type="hidden" name="id" value="{$serviceid}" />
        <input type="hidden" name="modop" value="custom" />
        <input type="hidden" name="a" value="customfunction" />
        <input type="submit" value="Show Table" />
        </form>
    </div>

 

Template:

Quote

{$field1}
{$field2}
{$field3}

Thanks in advance.

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