dglynch Posted March 1, 2013 Share Posted March 1, 2013 I am attempting to create a new custom page in WHMCS so I can pull client details when a client is logged in to pass to the page that sets up the autopay service. It will be several pages but this first one seems to be the hardest, its where I am gather which service the customer wants to setup on autopay. I am trying to use an array to pull all the Active services that do not have a subscription field in it. It seems the code I am using is maybe pulling only the first row in MySQL?????? This is the code I have in autopay.php $result2 = mysql_query("SELECT * FROM tblhosting WHERE subscriptionid=' ' AND userid=".(int)$_SESSION['uid']); $servicearray = mysql_fetch_array($result2); $smartyvalues["servicearray"] = $servicearray; Then in autopay.tpl I have the following right now: {foreach from=$servicearray key=id item=i} <li>{$i.id} - {$i.packageid} - {i.amount}</li> {foreachelse} <p>There are no services that qualify for AutoPay at this time.</p> {/foreach} I know I am missing ALOT from the tpl right now. I am basically wanting to know how to list the following from the tblhosting table that matches the SQL query: ServiceID - PackageID - Amount Next_ServiceID - Next_PackageID - Next_Amount There will be more then just these three but I am using them as as example, I will then code that I need into the appropriate variables to pass to the next page. Also not as important but just curious instead of showing the numeric packageid how do I pull from the service table and enter the common name for the service so instead of "10" it shows "Web Hosting Package Name". I am sure its a few simple tweaks and that I am doing things wrong. Everyones help is much appreciated in advance. 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.