LemonBarley Posted November 27, 2008 Share Posted November 27, 2008 hi, in the client details home page, (the page after logging in as client), there is a "Due Invoices" and it shows all the due invoice only. is there a way to change the "Due Invoices" to "Invoices". Basically it shows all the invoices the client has instead of only the due invoice. and with the status "Paid" or "Unpaid" (the status table is already there). And maybe limiting the invoices to 5 or 10? 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted November 27, 2008 Share Posted November 27, 2008 yes, remove the block showing the due invoices and add your own, or direct them straight to the "my invoices" page, where it is all there anyway 0 Quote Link to comment Share on other sites More sharing options...
LemonBarley Posted November 27, 2008 Author Share Posted November 27, 2008 i don't really know how to "add my own" tried it but cannot figure it out 0 Quote Link to comment Share on other sites More sharing options...
hightekhosting Posted November 27, 2008 Share Posted November 27, 2008 Open the clientareahome.tpl in your template files and change the following: <p align="left"><img src="images/supporttickets.gif" border="0" hspace="5" align="absmiddle" alt="" /> <strong>{$stats.numactivetickets} {$LANG.supportticketsopentickets}</strong> (<a href="submitticket.php">{$LANG.supportticketssubmitticket}</a>)</p> <div align="center"> <table align="center" style="width:100%" class="clientareatable" cellspacing="1"> <tr class="clientareatableheading"><td>{$LANG.supportticketsdate}</td><td>{$LANG.supportticketssubject}</td><td>{$LANG.supportticketsstatus}</td><td>{$LANG.supportticketsticketurgency}</td></tr> {foreach key=num item=ticket from=$tickets} <tr class="clientareatableactive"><td>{$ticket.date}</td><td><div align="left"><img src="images/article.gif" hspace="5" align="middle" alt="" /><a href="viewticket.php?tid={$ticket.tid}&c={$ticket.c}">{if $ticket.unread}<strong>{/if}#{$ticket.tid} - {$ticket.subject}{if $ticket.unread}</strong>{/if}</a></div></td><td width="120">{$ticket.status}</td><td width="80">{$ticket.urgency}</td></tr> {foreachelse} <tr class="clientareatableactive"><td colspan="4">{$LANG.norecordsfound}</td></tr> {/foreach} </table> </div> <br /> Change to: <div align="center"> <table class="clientareatable" cellspacing="1"> <tr class="clientareatableheading"> <td>{$LANG.invoicestitle}</td><td>{$LANG.invoicesdatecreated}</td><td>{$LANG.invoicesdatedue}</td><td>{$LANG.invoicestotal}</td><td>{$LANG.invoicesstatus}</td><td></td></tr> {foreach key=num item=invoice from=$invoices} <tr class="clientareatableactive"><td>{$invoice.invoicenum}</td><td>{$invoice.datecreated}</td><td>{$invoice.datedue}</td><td>{$currencysymbol}{$invoice.total} {$currency}</td><td>{$invoice.status}</td><td><a href="viewinvoice.php?id={$invoice.id}" target="_blank">{$LANG.invoicesview}</a></td></tr> {foreachelse} <tr class="clientareatableactive"><td colspan=6>{$LANG.norecordsfound}</td></tr> {/foreach} </table> </div> <br /> I believe that will get you out of trouble. Someone please correct me if I am wrong. Cheers, Dale 0 Quote Link to comment Share on other sites More sharing options...
LemonBarley Posted November 27, 2008 Author Share Posted November 27, 2008 i think you have misunderstand what my question is.. i was intending to change the "due invoice" to "invoices" it basically shows all the invoice that the client has. from your changes, i have no idea why do you want to change support ticket table to due invoice table. the code you given, is still used for the due invoice.. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted November 27, 2008 Share Posted November 27, 2008 The $invoices array is an array of due invoices only. To get all the customer invoices a DB lookup to get all invoices for that user is required. 0 Quote Link to comment Share on other sites More sharing options...
LemonBarley Posted November 27, 2008 Author Share Posted November 27, 2008 from clientareainvoice.tpl <table class="clientareatable" cellspacing="1"> <tr class="clientareatableheading"> <td>{$LANG.invoicestitle}</td><td>{$LANG.invoicesdatecreated}</td><td>{$LANG.invoicesdatedue}</td><td>{$LANG.invoicestotal}</td><td>{$LANG.invoicesstatus}</td><td></td></tr> {foreach key=num item=invoice from=$invoices} <tr class="clientareatableactive"><td>{$invoice.invoicenum}</td><td>{$invoice.datecreated}</td><td>{$invoice.datedue}</td><td>{$currencysymbol}{$invoice.total} {$currency}</td><td>{$invoice.status}</td><td><a href="viewinvoice.php?id={$invoice.id}" target="_blank">{$LANG.invoicesview}</a></td></tr> {foreachelse} <tr class="clientareatableactive"><td colspan=6>{$LANG.invoicesnoinvoices}</td></tr> {/foreach} </table> now my problem is, how to limit it.... 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted November 27, 2008 Share Posted November 27, 2008 i was intending to change the "due invoice" to "invoices" just delete the block of code from the .tpl file and train them to click on the invoices link thats already there and shoes them all 0 Quote Link to comment Share on other sites More sharing options...
LemonBarley Posted November 28, 2008 Author Share Posted November 28, 2008 i am enhancing my client detail login page. so i want to put the invoices there. Anyone know the code to call out the invoices and limit them? please post it. it helps. and i can put it as a release to enhance the details page. 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted November 28, 2008 Share Posted November 28, 2008 select * from tblinvoices, tblinvoiceitems where userid = .... 0 Quote Link to comment Share on other sites More sharing options...
LemonBarley Posted November 28, 2008 Author Share Posted November 28, 2008 hi othellotech if i am able to give you this code which shows the soon to expire domain, can you please help me to change it to show the invoices? {php}$display_domain=0; $result = mysql_query("SELECT * FROM tbldomains WHERE userid = ".$_SESSION['uid']." AND status = 'Active' LIMIT 1"); while($data = mysql_fetch_array($result)) { $display_domain=1; } if($display_domain){ {/php} <p><strong>Upcoming Domain Renewals</strong></p> <table align="center" style="width:90%" class="clientareatable" cellspacing="1"> <tr class="clientareatableheading"><td>Domain</td><td>Expiration Date</td><td></td></tr> {php} $i=1; $range = "<= 30"; $result = mysql_query("SELECT * FROM tbldomains WHERE userid='".$_SESSION['uid']."' AND DATEDIFF(expirydate, NOW()) ".$range." AND status='Active' ORDER BY `expirydate` ASC "); while($data = mysql_fetch_array($result)) { echo '<tr class="clientareatableactive"><td>'.$data['domain'].'</td><td>'.$data['expirydate'].'</td><td><form method="post" action="clientarea.php?action=domainrenew"><input name="domainid" value="'.$data['id'].'" type="hidden"><input value="Renew Domain" class="button" type="submit"></form></td></tr>'; $i=0; } if($i)echo '<tr class="clientareatableactive"><td colspan="2">No upcoming domain renewals</td><td><a href="clientarea.php?action=domains">View Domains</a></td></tr>'; {/php} </table> {php} } {/php} 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted December 8, 2008 Share Posted December 8, 2008 For anyone else wanting to list all invoices in the clientareahome page replace the due invoices table with this one <p class="heading2">{$LANG.invoices}</p> <br /> <table class="clientareatable" cellspacing="1"> <tr class="clientareatableheading"> <td>{$LANG.invoicestitle}</td><td>{$LANG.invoicesdatecreated}</td><td>{$LANG.invoicesdatedue}</td><td>{$LANG.invoicestotal}</td><td>{$LANG.invoicesstatus}</td><td></td></tr> {php} $ii=1; $result = mysql_query("SELECT * FROM tblinvoices WHERE userid='".$_SESSION['uid']."' ORDER BY `date` DESC"); while($data = mysql_fetch_array($result)) { echo '<tr class="clientareatableactive"><td>'.$data['id'].'</td><td>'.fromMySQLDate($data['date']).'</td><td>'.fromMySQLDate($data['duedate']).'</td><td>';{/php}{$currencysymbol}{php} echo $data['total'] .' ';{/php}{$currency}{php} echo '</td><td>'.$data['status'].'</td><td><a href="viewinvoice.php?id='.$data['id'].'" target="_blank">';{/php}{$LANG.invoicesview}{php} echo '</a></td></tr>'; $ii=0; } if ($ii) { echo '<tr class="clientareatableactive"><td colspan=6>';{/php}{$LANG.norecordsfound}{php} echo '</td></tr>'; } {/php} </table> 0 Quote Link to comment Share on other sites More sharing options...
chrismfz Posted June 3, 2010 Share Posted June 3, 2010 For anyone else wanting to list all invoices in the clientareahome page replace the due invoices table with this one Is there a way to order / sort by the invoice id in clientareainvoice.tpl ? I saw that most of invoices are ...random in there. With sparky's code you can play with SQL's order by (date/id/whatever). Is there something similar for smarty to change this: {foreach key=num item=invoice from=$invoices} <tr> <td><a href="viewinvoice.php?id={$invoice.id}" target="_blank">{$invoice.invoicenum}</a></td> <td>{$invoice.datecreated}</td> <td>{$invoice.datedue}</td> <td>{$invoice.total}</td> <td>{$invoice.status}</td> <td><a href="viewinvoice.php?id={$invoice.id}" target="_blank">{$LANG.invoicesview}</a></td> </tr> {foreachelse} <tr> <td colspan="6">{$LANG.norecordsfound}</td> </tr> {/foreach} and make it output the invoices in a right order ? 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.