Dimofinf Posted January 31, 2010 Share Posted January 31, 2010 Hi, I made this for WHMCS users as a thanks to Matt. Note : Forgive me if already programmed. WHAT DOES IT DO ? It displays in the client area home: 1- open issues (num) , scheduled issues (num) , resolved issues (num) if any. 2- latest 3 open issues if any. 3- check if the user is affected by any of those issues. 4- fixes ( {if $issue.type eq $LANG.networkissuestypeserver}{$issue.server}{else}{$issue.affecting}{/if}) for another languages this was made for portal template so you may have to copy some parts from your selected networkissues.tpl template. INSTRUCTIONS: 1- OPEN "clientareahome.tpl" FROM YOUR DEFAULT WHMCS TEMPLATE. 2- FIND : <p>{$LANG.clientareaheader}</p> 3-INSERT AFTER IT : {php} $data = mysql_fetch_array (mysql_query ('SELECT COUNT(*) AS total FROM tblnetworkissues WHERE status!=\'Scheduled\' AND status!=\'Resolved\'')); $this->_tpl_vars[opencount] = $data[total]; if($data[total]){ if($this->_tpl_vars[clientsstats][productsnumactive]>0) { $and=",tblhosting.server AS clientaffected"; $join="LEFT JOIN tblhosting ON(tblhosting.userid=".$this->_tpl_vars[clientsdetails][id]." AND tblhosting.server=tblnetworkissues.server)"; } $query = 'SELECT tblnetworkissues.title, tblnetworkissues.priority AS priority, tblnetworkissues.status AS status, tblnetworkissues.startdate, tblnetworkissues.enddate, tblnetworkissues.type, tblnetworkissues.affecting, tblnetworkissues.lastupdate, tblnetworkissues.description, tblservers.name AS server'.$and.' FROM tblnetworkissues LEFT JOIN tblservers ON(tblservers.id=tblnetworkissues.server) '.$join.' WHERE tblnetworkissues.status!=\'Scheduled\' AND tblnetworkissues.status!=\'Resolved\' GROUP BY tblnetworkissues.id ORDER BY tblnetworkissues.lastupdate DESC LIMIT 3'; $result = mysql_query ($query); while($data = mysql_fetch_array ($result)){ $status[status]="networkissuesstatus".strtolower(str_replace(' ','',$data[status])); $data[status]=$this->_tpl_vars[LANG][$status[status]]; $priority[priority]="networkissuespriority".strtolower(str_replace(' ','',$data[priority])); $data[priority]=$this->_tpl_vars[LANG][$priority[priority]]; $type[type]="networkissuestype".strtolower(str_replace(' ','',$data[type])); $data[type]=$this->_tpl_vars[LANG][$type[type]]; $this->_tpl_vars[issues][]=$data; } } $query = 'SELECT COUNT(*) FROM tblnetworkissues WHERE status=\'Scheduled\''; $result = mysql_query ($query); $data = mysql_fetch_array ($result); $this->_tpl_vars[scheduledcount] = $data[0]; $query = 'SELECT COUNT(*) FROM tblnetworkissues WHERE status=\'Resolved\''; $result = mysql_query ($query); $data = mysql_fetch_array ($result); $this->_tpl_vars[resolvedcount] = $data[0]; {/php} {if $opencount || $scheduledcount || $resolvedcount} <div class="contentbox"> <a href="{$smarty.server.PHP_SELF}?view=open" class="networkissuesopen">{$opencount} {$LANG.networkissuesstatusopen}</a> | <a href="{$smarty.server.PHP_SELF}?view=scheduled" class="networkissuesscheduled">{$scheduledcount} {$LANG.networkissuesstatusscheduled}</a> | <a href="{$smarty.server.PHP_SELF}?view=resolved" class="networkissuesclosed">{$resolvedcount} {$LANG.networkissuesstatusresolved}</a> </div> {/if} {php} if($this->_tpl_vars[opencount]){ {/php} {foreach from=$issues item=issue} {if $issue.clientaffected} <div class="networkissueaffected">{/if} <h2>{$issue.title} ({$issue.status})</h2> <h3>{$LANG.networkissuesaffecting} {$issue.type} - {if $issue.type eq $LANG.networkissuestypeserver}{$issue.server}{else}{$issue.affecting}{/if} | {$LANG.networkissuespriority} - {$issue.priority}</h3> <p>{$issue.description} <strong>{$LANG.networkissuesdate}</strong> - {$issue.startdate}{if $issue.enddate} - {$issue.enddate}{/if}<br /> <strong>{$LANG.networkissueslastupdated}</strong> - {$issue.lastupdate}</p> {if $issue.clientaffected}</div> {/if}<br /> {/foreach} <br /> {if $loggedin} <p>{$LANG.networkissuesaffectingyourservers}</p> {/if}<br /> {php} } {/php} THATS ALL. IF YOU WANT TO SHOW MORE THAN 3 OPEN ISSUES, THEN YOU HAVE TO EDIT THE NUMBER IN THE ABOVE CODE : LIMIT [color="RED"]3[/color] I hope it is useful to you Best Regards, 0 Quote Link to comment Share on other sites More sharing options...
yahoohost Posted April 2, 2010 Share Posted April 2, 2010 thanks, very useful 0 Quote Link to comment Share on other sites More sharing options...
chrismfz Posted June 22, 2010 Share Posted June 22, 2010 A quick n dirty fix if someone tries that, <div class="contentbox"> <a href="{$smarty.server.PHP_SELF}?view=open" class="networkissuesopen">{$opencount} {$LANG.networkissuesstatusopen}</a> | <a href="{$smarty.server.PHP_SELF}?view=scheduled" class="networkissuesscheduled">{$scheduledcount} {$LANG.networkissuesstatusscheduled}</a> | <a href="{$smarty.server.PHP_SELF}?view=resolved" class="networkissuesclosed">{$resolvedcount} {$LANG.networkissuesstatusresolved}</a> </div> change: {$smarty.server.PHP_SELF} with networkissues.php Works like a charm by the way, thanks Dimofinf edit*** By the way this should be on the customization & integration category. 0 Quote Link to comment Share on other sites More sharing options...
JohnnyD Posted April 24, 2011 Share Posted April 24, 2011 I'm very sorry for digging a dead thread but i love this code very much and use it myself with a tiny change (http://gyazo.com/711771cbb938597e50cc15545a2258db.png) I was wondering if anyone can help me change it so that it will say "You currently have ___ Open support tickets" 0 Quote Link to comment Share on other sites More sharing options...
Alistair Posted April 27, 2011 Share Posted April 27, 2011 Edit clientareahome.tpl 0 Quote Link to comment Share on other sites More sharing options...
JohnnyD Posted May 3, 2011 Share Posted May 3, 2011 Not meaning to be rude but that is fairly obvious i mean i need a script to do so, it should not be that hard just a small modification of the above already made. 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.