angelcosta Posted April 5, 2012 Share Posted April 5, 2012 I am a customer at media temple and decided to mimic their "response time" thing. So now we can show off the average time it takes us to reply tickets. You can get the code for the widget and client area at: http://portaldohost.com.br/whmcs/media-do-tempo-de-resposta-de-tickets-no-whmcs#.T334EtXNmg8 The code for the email template: http://www.whmcs.blog.br/principal/media-do-tempo-de-resposta-de-tickets-no-whmcs/#.T332CdXNmg8 0 Quote Link to comment Share on other sites More sharing options...
jmanuel Posted April 6, 2012 Share Posted April 6, 2012 ¡Gracias por el aporte! 0 Quote Link to comment Share on other sites More sharing options...
minadreapta Posted April 6, 2012 Share Posted April 6, 2012 nice one, thanks. 0 Quote Link to comment Share on other sites More sharing options...
ouwejan Posted April 10, 2012 Share Posted April 10, 2012 How many tickets does this module count? Or in what time period? 0 Quote Link to comment Share on other sites More sharing options...
angelcosta Posted April 10, 2012 Author Share Posted April 10, 2012 It takes in consideration the latest 10 opened tickets and gets the average time between the opening time and the reply time. 0 Quote Link to comment Share on other sites More sharing options...
openmind Posted April 10, 2012 Share Posted April 10, 2012 How would you display this in the new ticket template so it shows up when a user creates a new ticket? 0 Quote Link to comment Share on other sites More sharing options...
openmind Posted April 10, 2012 Share Posted April 10, 2012 Not to worry, I found it. Nice hook For those that are interested in adding this to the submit ticket template, I've attached my version (Default theme)... Just place {php}echo $desc;{/php} where you want the message to appear. supportticketsubmit-steptwo.zip 0 Quote Link to comment Share on other sites More sharing options...
angelcosta Posted April 10, 2012 Author Share Posted April 10, 2012 Thanks openmind The links for that were in the post, i should have attached here. 0 Quote Link to comment Share on other sites More sharing options...
openmind Posted April 11, 2012 Share Posted April 11, 2012 No worries. My Brazilian is not brilliant but I fumbled my way through 0 Quote Link to comment Share on other sites More sharing options...
inline3 Posted May 14, 2012 Share Posted May 14, 2012 I tried this in a plain php file and got this result Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in /home/dreamweb/public_html/time.php on line 2 $ User = "myusername" / / user database Any ideas why I got this result 0 Quote Link to comment Share on other sites More sharing options...
angelcosta Posted May 14, 2012 Author Share Posted May 14, 2012 It is not supposed to be used in a plain php only in whmcs client's area. 0 Quote Link to comment Share on other sites More sharing options...
inline3 Posted May 14, 2012 Share Posted May 14, 2012 Is there any way I could get this to work outside of whmcs and I would like to add it in my joomla template. 0 Quote Link to comment Share on other sites More sharing options...
angelcosta Posted May 15, 2012 Author Share Posted May 15, 2012 Yes, let me do that. I'll post later on today (Diablo 3 is holding me back today). 0 Quote Link to comment Share on other sites More sharing options...
angelcosta Posted May 17, 2012 Author Share Posted May 17, 2012 Actually the first code works in any php page: <?php $servidor = "localhost"; // database server $usuario = "usuario"; // user $senha = "senha"; // password $banco = "login_banco"; // database name $conecta = mysql_connect($servidor,$usuario,$senha); if (!$conecta){ die('Error connecting: ' . mysql_error()); } mysql_select_db($banco, $conecta); $result = mysql_query("SELECT tk.date, rp.date, tk.id FROM tbltickets as tk, tblticketreplies as rp WHERE tk.id=rp.tid AND tk.admin='' GROUP BY tk.id ORDER BY tk.date DESC LIMIT 0,10"); while($row = mysql_fetch_array($result)) { $tempo = abs(strtotime($row['0']) - strtotime($row['1'])); $minutos = floor(($tempo)/ 60); $tempos[] = $minutos; } $media = round(array_sum($tempos)/10); $horas = (int)($media / 60); $h = $horas."h"; $minutos = $media - ($horas * 60); $m = $minutos."min"; echo "Our average response time: ".$h."".$m; mysql_close($conecta); ?> Hope it helps 0 Quote Link to comment Share on other sites More sharing options...
zelatech Posted June 12, 2012 Share Posted June 12, 2012 hello, i've edited the script to take the last 30 tickets like this: $result = mysql_query("SELECT tk.date, rp.date, tk.id FROM tbltickets as tk, tblticketreplies as rp WHERE tk.id=rp.tid AND tk.admin='' GROUP BY tk.id ORDER BY tk.date DESC LIMIT 0,30"); and $media = round(array_sum($tempos)/30); My response time for last 30 tickets are this: 0 0 5 5 0 0 2 20 0 0 7 58 0 0 4 10 0 0 27 29 0 0 1 5 0 1 20 57 0 3 51 41 0 0 6 26 0 1 58 34 0 0 36 34 0 0 40 18 0 0 12 15 0 0 10 42 0 0 21 23 0 0 17 18 0 1 12 2 0 0 4 5 0 0 5 45 0 0 10 43 0 0 5 25 0 0 2 3 0 0 42 8 0 1 3 45 0 0 36 51 0 0 27 59 0 0 16 34 0 0 22 55 0 6 33 43 0 0 1 56 (days-hours-minuts-seconds) The average is supposed to be of about 44 minutes, but the script is saying 49 minutes, where is the error? thanks. 0 Quote Link to comment Share on other sites More sharing options...
angelcosta Posted June 25, 2012 Author Share Posted June 25, 2012 It rounds the number, maybe that was it. 0 Quote Link to comment Share on other sites More sharing options...
msaunders Posted August 31, 2012 Share Posted August 31, 2012 Hi Anyway to modify this so it shows average response time over last 24Hours or even 7 days etc? 0 Quote Link to comment Share on other sites More sharing options...
angelcosta Posted September 3, 2012 Author Share Posted September 3, 2012 Yeah, gonna try this till the end of the week. 0 Quote Link to comment Share on other sites More sharing options...
msaunders Posted September 5, 2012 Share Posted September 5, 2012 Yeah, gonna try this till the end of the week. Great thanks ! 0 Quote Link to comment Share on other sites More sharing options...
willow Posted August 22, 2013 Share Posted August 22, 2013 Love the idea but i'm a bit worried about the security...As you need to add the username and password to the code could that not then be read in the source? 0 Quote Link to comment Share on other sites More sharing options...
angelcosta Posted December 5, 2013 Author Share Posted December 5, 2013 I will be adjusting this so you dont have to insert your mysql data. 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.