<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Open Script Solution&#187; time</title>
	<atom:link href="http://www.openscriptsolution.com/tag/time/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.openscriptsolution.com</link>
	<description>... where solutions for script programming are found ...</description>
	<lastBuildDate>Tue, 31 Jan 2012 03:22:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How To Know the Difference or Time Duration Between Two Dates in PHP</title>
		<link>http://www.openscriptsolution.com/2009/12/14/how-to-know-the-difference-or-time-duration-between-two-dates-in-php/</link>
		<comments>http://www.openscriptsolution.com/2009/12/14/how-to-know-the-difference-or-time-duration-between-two-dates-in-php/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 15:39:42 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[calculate]]></category>
		<category><![CDATA[dates]]></category>
		<category><![CDATA[days]]></category>
		<category><![CDATA[difference]]></category>
		<category><![CDATA[duration]]></category>
		<category><![CDATA[hours]]></category>
		<category><![CDATA[minutes]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[seconds]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1028</guid>
		<description><![CDATA[Have you ever got difficulty when you want to calculate the difference or the time duration between two dates by using PHP? For example, the first date is &#8217;2009-12-01 11:12:13&#8242;, and the second date is &#8217;2009-12-04 14:15:16&#8242;, so the difference or the time duration between this two dates will give a result as: &#8217;3 Day(s), [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever got difficulty when you want to calculate the difference or the time duration between two dates by using PHP? For example, the first date is &#8217;2009-12-01 11:12:13&#8242;, and the second date is &#8217;2009-12-04 14:15:16&#8242;, so the difference or the time duration between this two dates will give a result as: &#8217;3 Day(s), 3 Hour(s), 3 Minute(s), 3 Second(s).&#8217;. We will make the function in order to make you easy to implement this calculation in your PHP code. Please note that your date format must be in this order: &#8216;yyyy-MM-dd hh:mm:ss&#8217; as possible, otherwise, this function will not work properly, I guess. <span id="more-1028"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * @author Masino Sinaga, http://www.openscriptsolution.com
 * @copyright December 14, 2009
 */</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Display the result...</span>
<span style="color: #b1b100;">echo</span> Duration<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'2009-12-01 11:12:13'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'2009-12-04 14:15:16'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">function</span> Duration<span style="color: #009900;">&#40;</span><span style="color: #000088;">$parambegindate</span><span style="color: #339933;">,</span> <span style="color: #000088;">$paramenddate</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$begindate</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$parambegindate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$enddate</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$paramenddate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$diff</span> <span style="color: #339933;">=</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$enddate</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$begindate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>                 
    <span style="color: #000088;">$diffday</span> <span style="color: #339933;">=</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$diff</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">86400</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$modday</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$diff</span><span style="color: #339933;">%</span><span style="color:#800080;">86400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$diffhour</span> <span style="color: #339933;">=</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$modday</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">3600</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$diffminute</span> <span style="color: #339933;">=</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$modday</span><span style="color: #339933;">%</span><span style="color:#800080;">3600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$diffsecond</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$modday</span><span style="color: #339933;">%</span><span style="color:#800080;">60</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$diffday</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; Day(s), &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$diffhour</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; Hour(s), &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$diffminute</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; Minute(s), &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$diffsecond</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; Second(s).&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F12%2F14%2Fhow-to-know-the-difference-or-time-duration-between-two-dates-in-php%2F&amp;title=How%20To%20Know%20the%20Difference%20or%20Time%20Duration%20Between%20Two%20Dates%20in%20PHP" id="wpa2a_2"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/12/14/how-to-know-the-difference-or-time-duration-between-two-dates-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sum Time with Format hh:mm:ss by Using PHP</title>
		<link>http://www.openscriptsolution.com/2009/10/14/sum-time-with-format-hh-mm-ss-by-using-php/</link>
		<comments>http://www.openscriptsolution.com/2009/10/14/sum-time-with-format-hh-mm-ss-by-using-php/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 01:09:01 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[hh:mm:ss]]></category>
		<category><![CDATA[hours]]></category>
		<category><![CDATA[minutes]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[result]]></category>
		<category><![CDATA[seconds]]></category>
		<category><![CDATA[sum]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=597</guid>
		<description><![CDATA[Have you ever got the difficulty when you want to sum the two time and display its result with format hours:minutes:seconds by using PHP? Well, now you don&#8217;t have to worry about it. This following code will give you the solution. Here is the code: 1 2 3 4 5 6 7 8 9 10 [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever got the difficulty when you want to sum the two time and display its result with format <strong>hours:minutes:seconds</strong> by using PHP? Well, now you don&#8217;t have to worry about it. This following code will give you the solution. <span id="more-597"></span></p>
<p>Here is the code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * @author Masino Sinaga, http://www.openscriptsolution.com
 * @copyright October 13, 2009
 */</span>
&nbsp;
<span style="color: #b1b100;">echo</span> sum_the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'01:45:22'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'17:27:03'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// this will give you a result: 19:12:25</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> sum_the_time<span style="color: #009900;">&#40;</span><span style="color: #000088;">$time1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$time2</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$times</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$time1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$time2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$seconds</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$times</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$time</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$hour</span><span style="color: #339933;">,</span><span style="color: #000088;">$minute</span><span style="color: #339933;">,</span><span style="color: #000088;">$second</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">':'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$time</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$seconds</span> <span style="color: #339933;">+=</span> <span style="color: #000088;">$hour</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">3600</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$seconds</span> <span style="color: #339933;">+=</span> <span style="color: #000088;">$minute</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$seconds</span> <span style="color: #339933;">+=</span> <span style="color: #000088;">$second</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000088;">$hours</span> <span style="color: #339933;">=</span> <span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$seconds</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">3600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$seconds</span> <span style="color: #339933;">-=</span> <span style="color: #000088;">$hours</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">3600</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$minutes</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$seconds</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$seconds</span> <span style="color: #339933;">-=</span> <span style="color: #000088;">$minutes</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// return &quot;{$hours}:{$minutes}:{$seconds}&quot;;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%02d:%02d:%02d'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$hours</span><span style="color: #339933;">,</span> <span style="color: #000088;">$minutes</span><span style="color: #339933;">,</span> <span style="color: #000088;">$seconds</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Thanks to Patrick</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Enjoy it and have a nice code!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F10%2F14%2Fsum-time-with-format-hh-mm-ss-by-using-php%2F&amp;title=Sum%20Time%20with%20Format%20hh%3Amm%3Ass%20by%20Using%20PHP" id="wpa2a_4"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/10/14/sum-time-with-format-hh-mm-ss-by-using-php/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Add Post Number, Sender Name, and Time Duration in Each Message of osTicket</title>
		<link>http://www.openscriptsolution.com/2009/09/09/add-post-number-sender-name-and-time-duration-in-each-message-of-osticket/</link>
		<comments>http://www.openscriptsolution.com/2009/09/09/add-post-number-sender-name-and-time-duration-in-each-message-of-osticket/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 02:42:26 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[duration]]></category>
		<category><![CDATA[message]]></category>
		<category><![CDATA[name]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[sender]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=248</guid>
		<description><![CDATA[Both osTicket version 1.6 RC4 and 1.6 RC5 have not included the post number, the sender name of client, and duration time in each message. That is why I made this modification. It is important for you as staff or admin of your ticketing system, if you want to know quickly how much time needed [...]]]></description>
			<content:encoded><![CDATA[<p>Both osTicket version 1.6 RC4 and 1.6 RC5 have not included the post number, the sender name of client, and duration time in each message. That is why I made this modification. It is important for you as staff or admin of your ticketing system, if you want to know quickly how much time needed to respond between one post and the next post in one current ticket. Moreover, you will also know how much total time taken for the opened ticket when you view the certain ticket in full-mode. <span id="more-248"></span></p>
<p>Follow these instructions below.</p>
<ol>
<li>Create a new file, copy-paste the following code to this file, then put it to <strong>\include\</strong> sub directory of your osTicket System, and save it as <strong>class.duration.php</strong>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/**************************************************************************/</span>
<span style="color: #666666; font-style: italic;">/* [MOD] Add #Post, SenderName, Time Duration in Each Message,            */</span> 
<span style="color: #666666; font-style: italic;">/*       by Masino Sinaga, May 7, 2009                                    */</span> 
<span style="color: #666666; font-style: italic;">/* Website: - http://www.masinosinaga.com                                 */</span>
<span style="color: #666666; font-style: italic;">/*          - http://osticket.masinosinaga.com                            */</span>
<span style="color: #666666; font-style: italic;">/**************************************************************************/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> Duration <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$begindate</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$enddate</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">function</span> Duration<span style="color: #009900;">&#40;</span><span style="color: #000088;">$parambegindate</span><span style="color: #339933;">,</span> <span style="color: #000088;">$paramenddate</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">begindate</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$parambegindate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">enddate</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$paramenddate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$diff</span> <span style="color: #339933;">=</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">enddate</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">begindate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>                 
    <span style="color: #000088;">$diffday</span> <span style="color: #339933;">=</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$diff</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">86400</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$modday</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$diff</span><span style="color: #339933;">%</span><span style="color:#800080;">86400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$diffhour</span> <span style="color: #339933;">=</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$modday</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">3600</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$diffminute</span> <span style="color: #339933;">=</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$modday</span><span style="color: #339933;">%</span><span style="color:#800080;">3600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$diffsecond</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$modday</span><span style="color: #339933;">%</span><span style="color:#800080;">60</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$diffday</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; Day(s), &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$diffhour</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; Hour(s), &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$diffminute</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; Minute(s), &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$diffsecond</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; Second(s).&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</li>
<li>Open <strong>\scp\tickets.php</strong> file, and find this code:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>21
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span>INCLUDE_DIR<span style="color: #339933;">.</span><span style="color: #0000ff;">'class.banlist.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>after that code, add the following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>22
23
24
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// MOD Show Post#, SenderName, and Duration on Each Message by Masino Sinaga, July 20, 2009</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span>INCLUDE_DIR<span style="color: #339933;">.</span><span style="color: #0000ff;">'class.duration.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// MOD Show Post#, SenderName, and Duration on Each Message by Masino Sinaga, July 20, 2009</span></pre></td></tr></table></div>

</li>
<li>Open <strong>\include\staff\viewticket.inc.php</strong> file, and find this code:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>274
275
276
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #000088;">$msgres</span> <span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$msg_row</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$msgres</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>replace with:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">      <span style="color: #000088;">$msgres</span> <span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$msg_row</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$msgres</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">!=</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
          <span style="color: #000088;">$dateend</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$msg_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'created'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000088;">$datebegin</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$msg_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'created'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
          <span style="color: #000088;">$firstdate</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$datebegin</span><span style="color: #339933;">;</span>
          <span style="color: #000088;">$dateend</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$msg_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'created'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000088;">$lastdate</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dateend</span><span style="color: #339933;">;</span>                 
        <span style="color: #000088;">$datediff</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Duration<span style="color: #009900;">&#40;</span><span style="color: #000088;">$datebegin</span><span style="color: #339933;">,</span><span style="color: #000088;">$dateend</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$resultdiff</span><span style="color: #339933;">=</span><span style="color: #000088;">$datediff</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Duration</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$datebegin</span><span style="color: #339933;">,</span><span style="color: #000088;">$dateend</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$datebegin</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dateend</span><span style="color: #339933;">;</span>        
        <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>288
289
290
291
292
293
294
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">            &lt;table align=&quot;center&quot; class=&quot;message&quot; cellspacing=&quot;0&quot; cellpadding=&quot;1&quot; width=&quot;100%&quot; border=0&gt;
                &lt;tr&gt;&lt;th&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">db_daydatetime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$msg_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'created'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/th&gt;&lt;/tr&gt;
                <span style="color: #000000; font-weight: bold;">&lt;?</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$msg_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attachments'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
                &lt;tr class=&quot;header&quot;&gt;&lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttachmentStr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$msg_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'msg_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'M'</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;&lt;/tr&gt; 
                <span style="color: #000000; font-weight: bold;">&lt;?</span><span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
                &lt;tr&gt;&lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">display</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$msg_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'message'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
            &lt;/table&gt;</pre></td></tr></table></div>

<p>replace with:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>288
289
290
291
292
293
294
295
296
297
298
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        &lt;table align=&quot;center&quot; class=&quot;message&quot; cellspacing=&quot;0&quot; cellpadding=&quot;1&quot; width=&quot;100%&quot; border=0&gt;
          &lt;tr&gt;&lt;th&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;(#&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$i</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;) &quot;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> Format<span style="color: #339933;">::</span><span style="color: #004000;">db_daydatetime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$msg_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'created'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot; - &quot;</span><span style="color: #339933;">.</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">htmlchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/th&gt;
          &lt;/tr&gt;
          <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$msg_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attachments'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
          &lt;tr class=&quot;header&quot;&gt;&lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttachmentStr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$msg_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'msg_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'M'</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;&lt;/tr&gt; 
          <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
          &lt;tr&gt;&lt;td&gt;
          <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> Format<span style="color: #339933;">::</span><span style="color: #004000;">display</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$msg_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'message'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
          &lt;/td&gt;&lt;/tr&gt;
          &lt;tr class=&quot;header&quot;&gt;&lt;td align=&quot;right&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Duration: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$resultdiff</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>    <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;&lt;/tr&gt;
        &lt;/table&gt;</pre></td></tr></table></div>

<p>find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">            $resp =db_query($sql);
            while ($resp_row = db_fetch_array($resp)) {
                $respID=$resp_row['response_id'];
                ?&gt;
                &lt;table align=&quot;center&quot; class=&quot;response&quot; cellspacing=&quot;0&quot; cellpadding=&quot;1&quot; width=&quot;100%&quot; border=0&gt;
                    &lt;tr&gt;&lt;th&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">db_daydatetime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resp_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'created'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&amp;nbsp;-&amp;nbsp;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$resp_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'staff_name'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/th&gt;&lt;/tr&gt;
                    <span style="color: #000000; font-weight: bold;">&lt;?</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resp_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attachments'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
                    &lt;tr class=&quot;header&quot;&gt;
                        &lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttachmentStr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$respID</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'R'</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;&lt;/tr&gt;
                    <span style="color: #000000; font-weight: bold;">&lt;?</span><span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
                    &lt;tr&gt;&lt;td&gt; <span style="color: #000000; font-weight: bold;">&lt;?=</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">display</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resp_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'response'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;&lt;/tr&gt;
                &lt;/table&gt;
            <span style="color: #000000; font-weight: bold;">&lt;?</span><span style="color: #009900;">&#125;</span>
            <span style="color: #000088;">$msgid</span> <span style="color: #339933;">=</span><span style="color: #000088;">$msg_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'msg_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;/div&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>replace with:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        $resp =db_query($sql);
        $j=1;
        while ($resp_row = db_fetch_array($resp)) {
          $i++;
          $respID=$resp_row['response_id'];
          $dateend = $resp_row['created']; 
          $lastdate = $dateend;          
          $datediff = new Duration($datebegin,$dateend);
          $resultdiff=$datediff-&gt;Duration($datebegin,$dateend);            
          ?&gt;
          &lt;table align=&quot;center&quot; class=&quot;response&quot; cellspacing=&quot;0&quot; cellpadding=&quot;1&quot; width=&quot;100%&quot; border=0&gt;
            &lt;tr&gt;&lt;th&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;(#&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$i</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;) &quot;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> Format<span style="color: #339933;">::</span><span style="color: #004000;">db_daydatetime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resp_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'created'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&amp;nbsp;-&amp;nbsp;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$resp_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'staff_name'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/th&gt;
            &lt;/tr&gt;
            <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resp_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attachments'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
            &lt;tr class=&quot;header&quot;&gt;
              &lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttachmentStr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$respID</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'R'</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;&lt;/tr&gt;
            <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
            &lt;tr&gt;&lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> Format<span style="color: #339933;">::</span><span style="color: #004000;">display</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resp_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'response'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;&lt;/tr&gt;
            &lt;tr class=&quot;header&quot;&gt;&lt;td align=&quot;right&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Duration: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$resultdiff</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>    <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;&lt;/tr&gt;
          &lt;/table&gt;            
          <span style="color: #000000; font-weight: bold;">&lt;?php</span>     
          <span style="color: #000088;">$datebegin</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dateend</span><span style="color: #339933;">;</span>
          <span style="color: #000088;">$j</span><span style="color: #339933;">++;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000088;">$msgid</span> <span style="color: #339933;">=</span><span style="color: #000088;">$msg_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'msg_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> 
        <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span>
      <span style="color: #009900;">&#125;</span> 
      <span style="color: #000088;">$datediff</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Duration<span style="color: #009900;">&#40;</span><span style="color: #000088;">$firstdate</span><span style="color: #339933;">,</span><span style="color: #000088;">$lastdate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$resultdiff</span><span style="color: #339933;">=</span><span style="color: #000088;">$datediff</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Duration</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$firstdate</span><span style="color: #339933;">,</span><span style="color: #000088;">$lastdate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
      <span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;/div&gt;
&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> 
  <span style="color: #000088;">$totalpost</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$i</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getStatus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'open'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;div align='right'&gt;&lt;br /&gt;&lt;b&gt;Total: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$totalpost</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; post(s), Duration: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$resultdiff</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/b&gt;&lt;/div&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$lastdate</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y-m-d H:i:s&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//userdate();   //date(&quot;Y-m-d H:i:s&quot;);</span>
    <span style="color: #000088;">$datediff</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Duration<span style="color: #009900;">&#40;</span><span style="color: #000088;">$firstdate</span><span style="color: #339933;">,</span><span style="color: #000088;">$lastdate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$resultdiff</span><span style="color: #339933;">=</span><span style="color: #000088;">$datediff</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Duration</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$firstdate</span><span style="color: #339933;">,</span><span style="color: #000088;">$lastdate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;div align='right'&gt;&lt;br /&gt;&lt;b&gt;Ticket still opened, Total Duration: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$resultdiff</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/b&gt;&lt;/div&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;div align='right'&gt;&lt;br /&gt;&lt;b&gt;Total: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$totalpost</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; post(s), Duration: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$resultdiff</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/b&gt;&lt;/div&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>    
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</li>
</ol>
<p>Now you can see that there is post number, sender name, and time duration in each message of the current ticket thread. You can also see in the bottom of the ticket thread, duration total for that current ticket. At least, you will get warning especially about the duration total of the opened ticket, thus you can take the respond as quick as you can for that ticket number.</p>
<p><img src="http://img136.imageshack.us/img136/3842/osticketviewticketimpro.jpg" alt="Post Number, Sender Name, and Time Duration in Each Post in osTicket" /></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F09%2F09%2Fadd-post-number-sender-name-and-time-duration-in-each-message-of-osticket%2F&amp;title=Add%20Post%20Number%2C%20Sender%20Name%2C%20and%20Time%20Duration%20in%20Each%20Message%20of%20osTicket" id="wpa2a_6"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/09/09/add-post-number-sender-name-and-time-duration-in-each-message-of-osticket/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
