<?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</title>
	<atom:link href="http://www.openscriptsolution.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.openscriptsolution.com</link>
	<description>... where solutions for script programming are found ...</description>
	<lastBuildDate>Mon, 01 Mar 2010 00:21:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to Set Auto Focus on The Username TextBox in Staff Login Form of osTicket</title>
		<link>http://www.openscriptsolution.com/2010/03/01/how-to-set-auto-focus-on-the-username-textbox-in-staff-login-form-of-osticket/</link>
		<comments>http://www.openscriptsolution.com/2010/03/01/how-to-set-auto-focus-on-the-username-textbox-in-staff-login-form-of-osticket/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 00:21:38 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[auto focus]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[staff-side]]></category>
		<category><![CDATA[textbox]]></category>
		<category><![CDATA[ticket]]></category>
		<category><![CDATA[username]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1151</guid>
		<description><![CDATA[Each time I open the staff login form in osTicket, I have to move the mouse&#8217;s cursor and then clicking my mouse to the first textbox on that form in order to make it focus then ready to enter the login information. Unfortunately, this condition is really annoying me, although it looks like not too [...]]]></description>
			<content:encoded><![CDATA[<p>Each time I open the staff login form in osTicket, I have to move the mouse&#8217;s cursor and then clicking my mouse to the first textbox on that form in order to make it focus then ready to enter the login information. Unfortunately, this condition is really annoying me, although it looks like not too difficult to do this activity. It should be automatically set focus by system each time staff visit the page. So I modify the login form in staff panel in order to set focus automatically each time staff visit that page. <span id="more-1151"></span></p>
<ol>
<li>
Open <strong>/include/staff/login.tpl.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>body id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;loginBody&quot;</span><span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>body id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;loginBody&quot;</span> onload<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;document.frmLogin.username.focus()&quot;</span><span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>16
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #339933;">&lt;</span>form action<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;login.php&quot;</span> method<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;post&quot;</span><span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>16
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #339933;">&lt;</span>form name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;frmLogin&quot;</span> action<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;login.php&quot;</span> method<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;post&quot;</span><span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

</li>
</ol>
<p>Now each time you open or visit the login form page in your osTicket system, then you do not have to move your mouse and click the username textbox. Enjoy it!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F03%2F01%2Fhow-to-set-auto-focus-on-the-username-textbox-in-staff-login-form-of-osticket%2F&amp;linkname=How%20to%20Set%20Auto%20Focus%20on%20The%20Username%20TextBox%20in%20Staff%20Login%20Form%20of%20osTicket"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/03/01/how-to-set-auto-focus-on-the-username-textbox-in-staff-login-form-of-osticket/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Auto Staff Time Sheet in Editing Ticket of osTicket v1.6 RC5</title>
		<link>http://www.openscriptsolution.com/2010/02/28/auto-staff-time-sheet-in-editing-ticket-of-osticket-v1-6-rc5/</link>
		<comments>http://www.openscriptsolution.com/2010/02/28/auto-staff-time-sheet-in-editing-ticket-of-osticket-v1-6-rc5/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 08:38:36 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[edit]]></category>
		<category><![CDATA[otomatis]]></category>
		<category><![CDATA[staff]]></category>
		<category><![CDATA[ticket]]></category>
		<category><![CDATA[time sheet]]></category>
		<category><![CDATA[waktu kerja]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1146</guid>
		<description><![CDATA[This following modification is the continuation of another modification that I created in the article: Add Auto Staff Time Sheet Feature into osTicket v1.6 RC5. Since I received the feedback from osTicket Discussion Forum that informed me about the SQL error after editing a ticket by staff, then I found that the original one need [...]]]></description>
			<content:encoded><![CDATA[<p>This following modification is the continuation of another modification that I created in the article: <a href="http://www.openscriptsolution.com/2009/11/08/add-auto-staff-time-sheet-feature-into-osticket-v1-6-rc5/" target="_blank">Add Auto Staff Time Sheet Feature into osTicket v1.6 RC5</a>. Since I received <a href="http://www.osticket.com/forums/showthread.php?t=3619" target="_blank">the feedback from osTicket Discussion Forum</a> that informed me about the SQL error after editing a ticket by staff, then I found that the original one need to be improved. So, here is the additional modification that you should apply if you want to avoid SQL error after implementing the first modification while editing a ticket. Please note that if you want to implement the modification in this article, first of all, you have to implement the original modification via that link above. <span id="more-1146"></span></p>
<ol>
<li>Open your <strong>/include/staff/editticket.inc.php</strong> file, and find this code:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>36
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">'hidden'</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">'a'</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">'update'</span><span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>after that line, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>37
38
39
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">// Begin of MOD Auto Staff Time Sheet, by Masino Sinaga, February 28, 2010 ?&gt;</span>
    &lt;input type=&quot;hidden&quot; name=&quot;start_time&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y-m-d H:i:s'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">// End of MOD Auto Staff Time Sheet, by Masino Sinaga, February 28, 2010 ?&gt;</span></pre></td></tr></table></div>

</li>
<li>
Open your <strong>/include/class.ticket.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1183
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">function</span> update<span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #339933;">,&amp;</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1183
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">function</span> update<span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #339933;">,&amp;</span><span style="color: #000088;">$errors</span><span style="color: #339933;">,</span><span style="color: #000088;">$start_time</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  <span style="color: #666666; font-style: italic;">// MOD Auto Staff Time Sheet, by Masino Sinaga, February 28, 2010</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1249
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">postNote</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Ticket Edit'</span><span style="color: #339933;">,</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1249
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">postNote</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Ticket Edit'</span><span style="color: #339933;">,</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'true'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$start_time</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// MOD Auto Staff Time Sheet, by Masino Sinaga, February 28, 2010</span></pre></td></tr></table></div>

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

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>216
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">            <span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">update</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #339933;">,</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>216
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">            <span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">update</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #339933;">,</span><span style="color: #000088;">$errors</span><span style="color: #339933;">,</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'start_time'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// MOD Auto Staff Time Sheet, by Masino Sinaga, February 28, 2010</span></pre></td></tr></table></div>

</li>
</ol>
<p>Now you should not receive SQL error anymore after editing a ticket if you implement the Auto Staff Time Sheet modification that I created above. Have a nice code, everyone!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F02%2F28%2Fauto-staff-time-sheet-in-editing-ticket-of-osticket-v1-6-rc5%2F&amp;linkname=Auto%20Staff%20Time%20Sheet%20in%20Editing%20Ticket%20of%20osTicket%20v1.6%20RC5"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/02/28/auto-staff-time-sheet-in-editing-ticket-of-osticket-v1-6-rc5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Closed Ticket Alert for All Department Members in osTicket v1.6 ST (Stable)</title>
		<link>http://www.openscriptsolution.com/2010/02/27/closed-ticket-alert-for-all-department-members-in-osticket-v1-6-st-stable/</link>
		<comments>http://www.openscriptsolution.com/2010/02/27/closed-ticket-alert-for-all-department-members-in-osticket-v1-6-st-stable/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 11:23:46 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[closed ticket]]></category>
		<category><![CDATA[customer]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[notify]]></category>
		<category><![CDATA[reply]]></category>
		<category><![CDATA[staff]]></category>
		<category><![CDATA[ticket system]]></category>
		<category><![CDATA[v1.6 ST]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1123</guid>
		<description><![CDATA[It does make sense when a ticket is closed by your customer or client, then all department members will be automatically notified by your ticketing system via email. I made the modification to implement this requirement into osTicket v1.6 ST (Stable), including the related setting in order to enable or disable this feature, just in [...]]]></description>
			<content:encoded><![CDATA[<p>It does make sense when a ticket is closed by your customer or client, then all department members will be automatically notified by your ticketing system via email. I made the modification to implement this requirement into osTicket v1.6 ST (Stable), including the related setting in order to enable or disable this feature, just in case whether this feature is necessary to be implemented, and sometimes it is not. Besides that, you will be able to define the email template for the notification that sent to your customer via Admin Panel. This modification also will answer <a href="http://www.osticket.com/forums/showthread.php?t=3602" target="_blank">the related question in osTicket Discussion Forum</a>. <span id="more-1123"></span></p>
<ol>
<li>
First of all, you have to alter your <strong>ost_config</strong> table by adding four additional new fields into it, simply by executing this following SQL script into your osTicket database. Please note that in this example, I use <strong>ost_</strong> as the table prefix. Adjust it in case it differs with yours:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">ALTER TABLE ost_config 
ADD COLUMN `closed_alert_active` tinyint(1) default 0 NOT NULL,
ADD COLUMN `closed_alert_assigned` tinyint(1) default 0 NOT NULL,
ADD COLUMN `closed_alert_dept_manager` tinyint(1) default 0 NOT NULL,
ADD COLUMN `closed_alert_dept_members` tinyint(1) default 0 NOT NULL;</pre></div></div>

</li>
<li>
You also have to alter the <strong>ost_email_template</strong> by adding two new fields in order to create new email template for closing alert ticket. Simply run this following SQL script to your osTicket database as well as the first step above:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">ALTER TABLE ost_email_template 
ADD COLUMN `ticket_closed_subj` varchar(255) default '' NOT NULL,
ADD COLUMN `ticket_closed_body` text NOT NULL;</pre></div></div>

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

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>478
479
480
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;input type=&quot;checkbox&quot; name=&quot;overdue_alert_dept_members&quot; <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'overdue_alert_dept_members'</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">'checked'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&gt; Department Members (spammy)
            &lt;/td&gt;
        &lt;/tr&gt;</pre></td></tr></table></div>

<p>after that line, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>482
483
484
485
486
487
488
489
490
491
492
493
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010 ?&gt;</span>
        &lt;tr&gt;&lt;th valign=&quot;top&quot;&gt;Closed Ticket Alert:&lt;/th&gt;
            &lt;td&gt;
              &lt;input type=&quot;radio&quot; name=&quot;closed_alert_active&quot;  value=&quot;1&quot;   <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_active'</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">'checked'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #000000; font-weight: bold;">?&gt;</span> /&gt;Enable
              &lt;input type=&quot;radio&quot; name=&quot;closed_alert_active&quot;  value=&quot;0&quot;   <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #339933;">!</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_active'</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">'checked'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #000000; font-weight: bold;">?&gt;</span> /&gt;Disable
              &lt;br&gt;&lt;i&gt;Admin Email gets an alert by default. Select additional recipients below&lt;/i&gt;&amp;nbsp;&lt;font class=&quot;error&quot;&gt;&amp;nbsp;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_active'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/font&gt;&lt;br&gt;
              &lt;input type=&quot;checkbox&quot; name=&quot;closed_alert_assigned&quot; <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_assigned'</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">'checked'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&gt; Assigned Staff
              &lt;input type=&quot;checkbox&quot; name=&quot;closed_alert_dept_manager&quot; <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_dept_manager'</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">'checked'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&gt; Department Manager
              &lt;input type=&quot;checkbox&quot; name=&quot;closed_alert_dept_members&quot; <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_dept_members'</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">'checked'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&gt; Department Members (spammy)
            &lt;/td&gt;
        &lt;/tr&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010 ?&gt;</span></pre></td></tr></table></div>

</li>
<li>Open your <strong>/include/class.config.php</strong> file, and find this code:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>376
377
378
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">function</span> alertDeptMembersONOverdueTicket<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'overdue_alert_dept_members'</span><span style="color: #009900;">&#93;</span>?<span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>after the last line of that code, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span>
    <span style="color: #000000; font-weight: bold;">function</span> alertONClosedTicket<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_active'</span><span style="color: #009900;">&#93;</span>?<span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> alertAssignedONClosedTicket<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_assigned'</span><span style="color: #009900;">&#93;</span>?<span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> alertDeptManagerONClosedTicket<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_dept_manager'</span><span style="color: #009900;">&#93;</span>?<span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> alertDeptMembersONClosedTicket<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_dept_members'</span><span style="color: #009900;">&#93;</span>?<span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>511
512
513
514
515
516
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note_alert_active'</span><span style="color: #009900;">&#93;</span>
                <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note_alert_laststaff'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note_alert_assigned'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note_alert_dept_manager'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note_alert_active'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'No target recipient(s) selected'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>after the last line of that code, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>518
519
520
521
522
523
524
525
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_active'</span><span style="color: #009900;">&#93;</span>
                <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_assigned'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_dept_manager'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_dept_members'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_active'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'No target recipient(s) selected'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>599
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">            <span style="color: #0000ff;">',overdue_alert_dept_members='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'overdue_alert_dept_members'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span></pre></td></tr></table></div>

<p>replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>599
600
601
602
603
604
605
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">            <span style="color: #0000ff;">',overdue_alert_dept_members='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'overdue_alert_dept_members'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #cc66cc;">1</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: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010            </span>
            <span style="color: #0000ff;">',closed_alert_active='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_active'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>            
			<span style="color: #0000ff;">',closed_alert_assigned='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_assigned'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #cc66cc;">1</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;">',closed_alert_dept_manager='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_dept_manager'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #cc66cc;">1</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;">',closed_alert_dept_members='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_dept_members'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #cc66cc;">1</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: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span></pre></td></tr></table></div>

</li>
<li>Open <strong>/include/class.ticket.php</strong> file, and find this code:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>385
386
387
388
389
390
391
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #666666; font-style: italic;">//Close the ticket</span>
    <span style="color: #000000; font-weight: bold;">function</span> close<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000088;">$sql</span><span style="color: #339933;">=</span> <span style="color: #0000ff;">'UPDATE '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' SET status='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'closed'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">',staff_id=0,isoverdue=0,duedate=NULL,updated=NOW(),closed=NOW() '</span><span style="color: #339933;">.</span>
              <span style="color: #0000ff;">' WHERE ticket_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</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: #b1b100;">return</span> <span style="color: #009900;">&#40;</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;">&amp;&amp;</span> db_affected_rows<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>?<span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #666666; font-style: italic;">//Close the ticket</span>
    <span style="color: #000000; font-weight: bold;">function</span> close<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$cfg</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$sql</span><span style="color: #339933;">=</span> <span style="color: #0000ff;">'UPDATE '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' SET status='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'closed'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">',staff_id=0,isoverdue=0,duedate=NULL,updated=NOW(),closed=NOW() '</span><span style="color: #339933;">.</span>
              <span style="color: #0000ff;">' WHERE ticket_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</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: #666666; font-style: italic;">//return (db_query($sql) &amp;&amp; db_affected_rows())?true:false;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010 NOT FINISHED YET        </span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</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;">&amp;&amp;</span> db_affected_rows<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">//echo $sql;</span>
            <span style="color: #000088;">$dept</span><span style="color: #339933;">=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDept</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$dept</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tplId</span><span style="color: #339933;">=</span><span style="color: #000088;">$dept</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getTemplateId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                <span style="color: #000088;">$tplId</span><span style="color: #339933;">=</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDefaultTemplateId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">//if requested &amp;&amp; enabled fire nasty alerts.</span>
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">alertONClosedTicket</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$sql</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT ticket_closed_subj,ticket_closed_body FROM '</span><span style="color: #339933;">.</span>EMAIL_TEMPLATE_TABLE<span style="color: #339933;">.</span>
                     <span style="color: #0000ff;">' WHERE cfg_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</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: #0000ff;">' AND tpl_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$tplId</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resp</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: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resp</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$subj</span><span style="color: #339933;">,</span><span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">=</span>db_fetch_row<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resp</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
                    <span style="color: #000088;">$body</span><span style="color: #339933;">=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">replaceTemplateVars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #000088;">$subj</span><span style="color: #339933;">=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">replaceTemplateVars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$subj</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #339933;">=</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAlertEmail</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                        <span style="color: #000088;">$email</span><span style="color: #339933;">=</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDefaultEmail</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$email</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #666666; font-style: italic;">//Fire and email to admin. No questions asked.</span>
                        <span style="color: #000088;">$alert</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%s</span>taff&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Admin'</span><span style="color: #339933;">,</span><span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000088;">$email</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">send</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAdminEmail</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$subj</span><span style="color: #339933;">,</span><span style="color: #000088;">$alert</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                        <span style="color: #666666; font-style: italic;">/*** Build list of recipients and fire the alerts ***/</span>
                        <span style="color: #000088;">$recipients</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #666666; font-style: italic;">//Assigned staff... if any</span>
                        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isAssigned</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">alertAssignedONClosedTicket</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                            <span style="color: #000088;">$recipients</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getStaff</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">alertDeptMembersONClosedTicket</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//Alert assigned or dept members not both</span>
                            <span style="color: #666666; font-style: italic;">//All dept members.</span>
                            <span style="color: #000088;">$sql</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT staff_id FROM '</span><span style="color: #339933;">.</span>STAFF_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE dept_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dept</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</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: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$users</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: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$users</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                                <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">=</span>db_fetch_row<span style="color: #009900;">&#40;</span><span style="color: #000088;">$users</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                                    <span style="color: #000088;">$recipients</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Staff<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>     <span style="color: #666666; font-style: italic;">//possible mem issues with a large number of staff?</span>
                            <span style="color: #009900;">&#125;</span>
                        <span style="color: #009900;">&#125;</span>
                        <span style="color: #666666; font-style: italic;">//Always blame the manager</span>
                        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">alertDeptManagerONClosedTicket</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$dept</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                            <span style="color: #000088;">$recipients</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #000088;">$dept</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getManager</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
                        <span style="color: #666666; font-style: italic;">//Ok...we are ready to go....</span>
                        <span style="color: #000088;">$sentlist</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$recipients</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$k</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$staff</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: #339933;">!</span><span style="color: #000088;">$staff</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #990000;">is_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$staff</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #000088;">$staff</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isAvailable</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
                            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$staff</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getEmail</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$sentlist</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//avoid duplicate emails.</span>
                            <span style="color: #000088;">$alert</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%s</span>taff&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$staff</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFirstName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                            <span style="color: #000088;">$email</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">send</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$staff</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getEmail</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$subj</span><span style="color: #339933;">,</span><span style="color: #000088;">$alert</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                    Sys<span style="color: #339933;">::</span><span style="color: #990000;">log</span><span style="color: #009900;">&#40;</span>LOG_WARNING<span style="color: #339933;">,</span><span style="color: #0000ff;">'Template Fetch Error'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Unable to fetch 'closed' alert template #<span style="color: #006699; font-weight: bold;">$tplId</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010 NOT FINISHED YET</span>
&nbsp;
    <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</li>
<li>
Open your <strong>/include/staff/template.inc.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>173
174
175
176
177
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">            &lt;tr&gt;
                &lt;th&gt;Message Body:&lt;/th&gt;
                &lt;td&gt;&lt;textarea rows=&quot;7&quot; cols=&quot;75&quot; name=&quot;ticket_overdue_body&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$tpl</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_overdue_body'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/textarea&gt;
                    &amp;nbsp;&lt;font class=&quot;error&quot;&gt;&amp;nbsp;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_overdue_body'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/font&gt;&lt;/td&gt;
            &lt;/tr&gt;</pre></td></tr></table></div>

<p>after the last line of that code, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010 ?&gt;</span>
            &lt;tr class=&quot;header&quot;&gt;&lt;td colspan=2 &gt;Closed Ticket Alert/Notice&lt;/td&gt;&lt;/tr&gt;
            &lt;tr class=&quot;subheader&quot;&gt;&lt;td colspan=2 &gt;Alert sent to staff on closed tickets.&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;
                &lt;th&gt;Subject&lt;/th&gt;
                &lt;td&gt;
                    &lt;input type=&quot;text&quot; size=&quot;65&quot; name=&quot;ticket_closed_subj&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$tpl</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_subj'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
                            &amp;nbsp;&lt;font class=&quot;error&quot;&gt;&amp;nbsp;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_subj'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/font&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;th&gt;Message Body:&lt;/th&gt;
                &lt;td&gt;&lt;textarea rows=&quot;7&quot; cols=&quot;75&quot; name=&quot;ticket_closed_body&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$tpl</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_body'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/textarea&gt;
                    &amp;nbsp;&lt;font class=&quot;error&quot;&gt;&amp;nbsp;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_body'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/font&gt;&lt;/td&gt;
            &lt;/tr&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010 ?&gt;</span></pre></td></tr></table></div>

</li>
<li>
Open your <strong>/include/class.msgtpl.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>104
105
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #000088;">$fields</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_overdue_subj'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'string'</span><span style="color: #339933;">,</span>   <span style="color: #0000ff;">'required'</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'error'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Subject required'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$fields</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_overdue_body'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'string'</span><span style="color: #339933;">,</span>   <span style="color: #0000ff;">'required'</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'error'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Template message required'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>after the last line of that code, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>107
108
109
110
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010        </span>
        <span style="color: #000088;">$fields</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_subj'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'string'</span><span style="color: #339933;">,</span>   <span style="color: #0000ff;">'required'</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'error'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Subject required'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$fields</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_body'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'string'</span><span style="color: #339933;">,</span>   <span style="color: #0000ff;">'required'</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'error'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Template message required'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>143
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                 <span style="color: #0000ff;">',ticket_overdue_body='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">striptags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_overdue_body'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>143
144
145
146
147
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                 <span style="color: #0000ff;">',ticket_overdue_body='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">striptags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_overdue_body'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span>
                 <span style="color: #0000ff;">',ticket_closed_subj='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">striptags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_subj'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
                 <span style="color: #0000ff;">',ticket_closed_body='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">striptags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_body'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>213
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                 <span style="color: #0000ff;">',ticket_overdue_body='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">striptags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_overdue_body'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>213
214
215
216
217
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                 <span style="color: #0000ff;">',ticket_overdue_body='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">striptags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_overdue_body'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span>
                 <span style="color: #0000ff;">',ticket_closed_subj='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">striptags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_subj'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
                 <span style="color: #0000ff;">',ticket_closed_body='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">striptags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_body'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span></pre></td></tr></table></div>

</li>
</ol>
<p>That&#8217;s all for the modification! <img src='http://www.openscriptsolution.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>After you completed doing that modification, now you HAVE TO define the email template that will be sent to the staff when a ticket is closed. You can set it up via: <strong>Admin Panel -> Emails -> Templates</strong>, and then fill in the <strong>Closed Ticket Alert:</strong> directive.</p>
<p>For instance, in the <strong>Subject:</strong> directive, please fill ini with this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Closed Ticket Alert</pre></div></div>

<p>and in the <strong>Body:</strong> directive, fill in with this template:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">A ticket, #%ticket assigned to you or in your department has been closed.
&nbsp;
%url/scp/tickets.php?id=%id
&nbsp;
Thank you for your kindly cooperation so far.
&nbsp;
- Support Ticket System - powered by osTicket.</pre></div></div>

<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F02%2F27%2Fclosed-ticket-alert-for-all-department-members-in-osticket-v1-6-st-stable%2F&amp;linkname=Closed%20Ticket%20Alert%20for%20All%20Department%20Members%20in%20osTicket%20v1.6%20ST%20%28Stable%29"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/02/27/closed-ticket-alert-for-all-department-members-in-osticket-v1-6-st-stable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add Attachment on Internal Note in osTicket v1.6 ST (Stable)</title>
		<link>http://www.openscriptsolution.com/2010/02/26/add-attachment-on-internal-note-in-osticket-v1-6-st-stable/</link>
		<comments>http://www.openscriptsolution.com/2010/02/26/add-attachment-on-internal-note-in-osticket-v1-6-st-stable/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 14:03:56 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[attachment]]></category>
		<category><![CDATA[catatan internal]]></category>
		<category><![CDATA[Internal Note]]></category>
		<category><![CDATA[lampiran]]></category>
		<category><![CDATA[reply]]></category>
		<category><![CDATA[staff-side]]></category>
		<category><![CDATA[ticket system]]></category>
		<category><![CDATA[v1.6 ST]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1116</guid>
		<description><![CDATA[Since there are a little bit differences code in /scp/tickets.php file between osTicket v1.6 RC5 and osTicket v1.6 ST (Stable; the last version while I am writing this article), and also there is a new request to me from this post in osTicket Discussion Forums, then this following modification I made to be intended to [...]]]></description>
			<content:encoded><![CDATA[<p>Since there are a little bit differences code in <strong>/scp/tickets.php</strong> file between osTicket v1.6 RC5 and osTicket v1.6 ST (Stable; the last version while I am writing this article), and also there is a new request to me from <a href="http://www.osticket.com/forums/showthread.php?p=13513#post13513" target="_blank">this post in osTicket Discussion Forums</a>, then this following modification I made to be intended to those of you who want to implement the Attachment on Internal Note in osTicket v1.6 ST. <span id="more-1116"></span></p>
<ol>
<li>
First of all, alter the <strong>ticket_attachment</strong> table by adding a new enum value, that is: “<strong>N</strong>” into <strong>ref_type</strong> field, besides the existing value: <strong>M</strong> and <strong>R</strong>. The <strong>N</strong> value means: <strong>Note</strong> or <strong>Internal Note</strong> in this case. And make sure you don’t miss this step!
</li>
<li>
Open <strong>\include\staff\viewticket.inc.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>219
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">            &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;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note'</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;</pre></td></tr></table></div>

<p>after the last line of that code above, please add this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>220
221
222
223
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">            <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">// added by Masino Sinaga, Februari 26, 2010, attachment on Internal Notes osTicket v1.6 ST ?&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;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'N'</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;
            &lt;/tr&gt;</pre></td></tr></table></div>

</li>
<li>
Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>363
364
365
366
367
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                        &lt;div style=&quot;margin-top: 3px;&quot;&gt;
                            &lt;label for=&quot;note&quot; valign=&quot;top&quot;&gt;Enter note content.
                                &lt;font class=&quot;error&quot;&gt;*&amp;nbsp;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/font&gt;&lt;/label&gt;&lt;br/&gt;
                            &lt;textarea name=&quot;note&quot; id=&quot;note&quot; cols=&quot;80&quot; rows=&quot;7&quot; wrap=&quot;soft&quot; style=&quot;width:90%&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/textarea&gt;
                        &lt;/div&gt;</pre></td></tr></table></div>

<p>after the last line of the code above, please add this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>368
369
370
371
372
373
374
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                        <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;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">canUploadFiles</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//TODO: may be allow anyways and simply email out attachment?? ?&gt;</span>
                        &lt;div style=&quot;margin-top: 3px;&quot;&gt;
                            &lt;label for=&quot;attachment&quot; &gt;Attach File:&lt;/label&gt;
                            &lt;input type=&quot;file&quot; name=&quot;attachment&quot; id=&quot;attachment2&quot; size=30px value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attachment'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt; 
                                &lt;font class=&quot;error&quot;&gt;&amp;nbsp;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attachment'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/font&gt;
                        &lt;/div&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></pre></td></tr></table></div>

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

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'postnote'</span><span style="color: #339933;">:</span>
            <span style="color: #000088;">$fields</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$fields</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span>    <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'string'</span><span style="color: #339933;">,</span>   <span style="color: #0000ff;">'required'</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'error'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Title required'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$fields</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note'</span><span style="color: #009900;">&#93;</span>     <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'string'</span><span style="color: #339933;">,</span>   <span style="color: #0000ff;">'required'</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'error'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Note message required'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$params</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Validator<span style="color: #009900;">&#40;</span><span style="color: #000088;">$fields</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$params</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">validate</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                <span style="color: #000088;">$errors</span><span style="color: #339933;">=</span><span style="color: #990000;">array_merge</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$errors</span><span style="color: #339933;">,</span><span style="color: #000088;">$params</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">errors</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$errors</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">postNote</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$msg</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Internal note posted'</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_status'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_status'</span><span style="color: #009900;">&#93;</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;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setStatus</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_status'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">reload</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                        <span style="color: #000088;">$msg</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">' and status set to '</span><span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isClosed</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>?<span style="color: #0000ff;">'closed'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'open'</span><span style="color: #009900;">&#41;</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;">isClosed</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                            <span style="color: #000088;">$page</span><span style="color: #339933;">=</span><span style="color: #000088;">$ticket</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Going back to main listing.</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Error(s) occured. Unable to post the note.'</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'postnote'</span><span style="color: #339933;">:</span>
            <span style="color: #000088;">$fields</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$fields</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span>    <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'string'</span><span style="color: #339933;">,</span>   <span style="color: #0000ff;">'required'</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'error'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Title required'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$fields</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note'</span><span style="color: #009900;">&#93;</span>     <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'string'</span><span style="color: #339933;">,</span>   <span style="color: #0000ff;">'required'</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'error'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Note message required'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$params</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Validator<span style="color: #009900;">&#40;</span><span style="color: #000088;">$fields</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$params</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">validate</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                <span style="color: #000088;">$errors</span><span style="color: #339933;">=</span><span style="color: #990000;">array_merge</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$errors</span><span style="color: #339933;">,</span><span style="color: #000088;">$params</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">errors</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">// Added by Masino Sinaga, February 26, 2010 for attachment on Internal Notes</span>
            <span style="color: #666666; font-style: italic;">//Check attachments restrictions.  </span>
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attachment'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attachment'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'size'</span><span style="color: #009900;">&#93;</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: #339933;">!</span><span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attachment'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attachment'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'tmp_name'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attachment'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Invalid attachment'</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">canUploadFiles</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">//TODO: saved vs emailed attachments...admin config??</span>
                    <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attachment'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'upload dir invalid. Contact admin.'</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">canUploadFileType</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attachment'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attachment'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Invalid file type'</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">// Added by Masino Sinaga, February 26, 2010 attachment on Internal Notes</span>
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$errors</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$noteID</span><span style="color: #339933;">=</span><span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">postNote</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'alert_assigned'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
                <span style="color: #000088;">$msg</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Internal note posted'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_status'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_status'</span><span style="color: #009900;">&#93;</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;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setStatus</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_status'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">reload</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                        <span style="color: #000088;">$msg</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">' and status set to '</span><span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isClosed</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>?<span style="color: #0000ff;">'closed'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'open'</span><span style="color: #009900;">&#41;</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;">isClosed</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                            <span style="color: #000088;">$page</span><span style="color: #339933;">=</span><span style="color: #000088;">$ticket</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Going back to main listing.</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span> 
                <span style="color: #666666; font-style: italic;">// Added by Masino Sinaga, February 26, 2010, attachment on Internal Notes</span>
                <span style="color: #666666; font-style: italic;">//Finally upload attachment if any</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attachment'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attachment'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'size'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">uploadAttachment</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attachment'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #000088;">$noteID</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'N'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span>?<span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'Error(s) occured. Unable to post the note.'</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
</ol>
<p>That&#8217;s all. I have tested it, and everything seemed okay. Have a nice code!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F02%2F26%2Fadd-attachment-on-internal-note-in-osticket-v1-6-st-stable%2F&amp;linkname=Add%20Attachment%20on%20Internal%20Note%20in%20osTicket%20v1.6%20ST%20%28Stable%29"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/02/26/add-attachment-on-internal-note-in-osticket-v1-6-st-stable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Ticket Aging, Ticket Summary, and Ticket for Staff Report Feature into osTicket v1.6 RC5</title>
		<link>http://www.openscriptsolution.com/2010/01/31/adding-ticket-aging-ticket-summary-and-ticket-for-staff-report-feature-into-osticket-v1-6-rc5/</link>
		<comments>http://www.openscriptsolution.com/2010/01/31/adding-ticket-aging-ticket-summary-and-ticket-for-staff-report-feature-into-osticket-v1-6-rc5/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 01:44:08 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[laporan]]></category>
		<category><![CDATA[report]]></category>
		<category><![CDATA[ringkasan tiket]]></category>
		<category><![CDATA[ticket aging]]></category>
		<category><![CDATA[ticket for staff]]></category>
		<category><![CDATA[ticket summary]]></category>
		<category><![CDATA[tiket untuk staff]]></category>
		<category><![CDATA[usia tiket]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1105</guid>
		<description><![CDATA[I have successfully created a new report feature into osTicket v1.6 RC5 that contains three sub report. They are:
1) Ticket Aging ( 3 and  7 and  14 Days),
2) Ticket Summary (Staff in Charge:, Total Number of Active Tickets:, Total Number of Closed Tickets:, Total Number of Unassigned Tickets: ), and
3) Ticket for Staff [...]]]></description>
			<content:encoded><![CDATA[<p>I have successfully created a new report feature into osTicket v1.6 RC5 that contains three sub report. They are:<br />
<strong>1) Ticket Aging</strong> (<= 3 Days, > 3 and <= 7 Days, > 7 and <= 14 Days, and > 14 Days),<br />
<strong>2) Ticket Summary</strong> (Staff in Charge:, Total Number of Active Tickets:, Total Number of Closed Tickets:, Total Number of Unassigned Tickets: ), and<br />
<strong>3) Ticket for Staff</strong> (Staff in Charge with the tickets that assigned to them). </p>
<p>You will see that there are three sub tabs under <strong>Dashboard</strong> tab in Admin Panel of your osTicket. <span id="more-1105"></span></p>
<ol>
<li>
Open your <strong>/scp/admin.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>523
524
525
526
527
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">default</span><span style="color: #339933;">:</span>
        <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Uknown command!'</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">endswitch</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>523
524
525
526
527
528
529
530
531
532
533
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'ticketaging'</span><span style="color: #339933;">:</span>
&nbsp;
    <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'ticketsummary'</span><span style="color: #339933;">:</span>
&nbsp;
    <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">default</span><span style="color: #339933;">:</span>
        <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Uknown command!'</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">endswitch</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>556
557
558
559
560
561
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'dashboard'</span><span style="color: #339933;">:</span>
    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'syslog'</span><span style="color: #339933;">:</span>
        <span style="color: #000088;">$nav</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setTabActive</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$nav</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addSubMenu</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'desc'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'System Logs'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'href'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'admin.php?t=syslog'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'iconclass'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'syslogs'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$page</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'syslogs.inc.php'</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'dashboard'</span><span style="color: #339933;">:</span>
    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'syslog'</span><span style="color: #339933;">:</span>
    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'ticketaging'</span><span style="color: #339933;">:</span>
    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'ticketsummary'</span><span style="color: #339933;">:</span>
    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'ticketstaff'</span><span style="color: #339933;">:</span>
        <span style="color: #000088;">$nav</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setTabActive</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dashboard'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$nav</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addSubMenu</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'desc'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'System Logs'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'href'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'admin.php?t=syslog'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'iconclass'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'syslogs'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$nav</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addSubMenu</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'desc'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Ticket Aging'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'href'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'admin.php?t=ticketaging'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'iconclass'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'syslogs'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$nav</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addSubMenu</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'desc'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Ticket Summary'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'href'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'admin.php?t=ticketsummary'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'iconclass'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'syslogs'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$nav</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addSubMenu</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'desc'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Ticket for Staff'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'href'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'admin.php?t=ticketstaff'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'iconclass'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'syslogs'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$thistab</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>
        <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'dashboard'</span><span style="color: #339933;">:</span>
        <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'syslog'</span><span style="color: #339933;">:</span>
          <span style="color: #000088;">$page</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'syslogs.inc.php'</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'ticketaging'</span><span style="color: #339933;">:</span>
          <span style="color: #000088;">$page</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'ticketaging.inc.php'</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'ticketsummary'</span><span style="color: #339933;">:</span>
          <span style="color: #000088;">$page</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'ticketsummary.inc.php'</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'ticketstaff'</span><span style="color: #339933;">:</span>
          <span style="color: #000088;">$page</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'ticketstaff.inc.php'</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">endswitch</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
<li>
Create a new file named <strong>ticketaging.inc.php</strong> file, and copy paste this following code to that file, and put this file into your <strong>/include/staff/</strong> sub-directory of your osTicket:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><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: #339933;">!</span><span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'OSTSCPINC'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!@</span><span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isStaff</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Access Denied'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'staffid'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$staffid</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'staffid'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;msg&quot;&gt;Ticket Aging&lt;/div&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$numtotalstaff</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sqltotalstaff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT DISTINCT(t.staff_id), s.username, s.firstname, s.lastname '</span><span style="color: #339933;">.</span>
               <span style="color: #0000ff;">'FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' t, '</span><span style="color: #339933;">.</span>STAFF_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' s '</span><span style="color: #339933;">.</span>
               <span style="color: #0000ff;">'WHERE t.staff_id &lt;&gt; &quot;0&quot; AND t.staff_id=s.staff_id'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotalstaff</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqltotalstaff</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$numtotalstaff</span><span style="color: #339933;">=</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotalstaff</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$strtickettotalstaff</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$itotalstaff</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;form action=&quot;admin.php?t=ticketaging&quot; method=&quot;post&quot;&gt;
 &lt;input type=hidden name='a' value='staff'&gt;
 Staff Name:&amp;nbsp;&lt;select name=&quot;staffid&quot; &gt;
  &lt;option value=&quot;&quot; selected &gt;Select One&lt;/option&gt;
<span style="color: #000000; font-weight: bold;">&lt;?</span>
 <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$rowtotalstaff</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotalstaff</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000088;">$selected</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'staffid'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span><span style="color: #000088;">$rowtotalstaff</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'staff_id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #0000ff;">'selected'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
   &lt;option value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$rowtotalstaff</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'staff_id'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$selected</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$rowtotalstaff</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' ('</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotalstaff</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'firstname'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotalstaff</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'lastname'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">')'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/option&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;/select&gt;
 &lt;input class=&quot;button&quot; type=&quot;submit&quot; value=&quot;View&quot;&gt;
&lt;/form&gt;
<span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div style=&quot;margin-bottom:20px; padding-top:0px;&quot;&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=1 cellpadding=2&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;tr&gt;&lt;td&gt;
       &lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=0 cellpadding=2 class=&quot;logs&quot; align=&quot;center&quot;&gt;
       &lt;tr&gt;&lt;th&gt;&amp;nbsp;&amp;nbsp;Ticket Aging and Its Count&lt;/th&gt;&lt;/tr&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$numtotal</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$staffid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$sqltotal</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT * FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE staff_id = '</span><span style="color: #339933;">.</span><span style="color: #000088;">$staffid</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' AND status = &quot;open&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: #000088;">$sqltotal</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT * FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE staff_id &lt;&gt; &quot;0&quot; AND status = &quot;open&quot;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotal</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqltotal</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$numtotal</span><span style="color: #339933;">=</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotal</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$strtickettotal</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$itotal</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;">$rowtotal</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotal</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;">$itotal</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$numtotal</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strtickettotal</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotal</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotal</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;, '</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$itotal</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$numtotal</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strtickettotal</span> <span style="color: #339933;">.=</span>  <span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotal</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotal</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
   <span style="color: #000088;">$itotal</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>
&lt;tr class=&quot;row1&quot; id=&quot;1&quot;&gt;
&lt;td&gt;
&lt;a href=&quot;javascript:toggleMessage('1');&quot;&gt;
&lt;img border=&quot;0&quot; align=&quot;left&quot; id=&quot;img_1&quot; src=&quot;images/plus.gif&quot;&gt;
&lt;span style=&quot;color:000; float: left; width:350px;&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Total Number of Active Tickets: &quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
&amp;nbsp;&amp;nbsp;
 &lt;span class=&quot;Icon <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$icon</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; align=&quot;right&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;b&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$numtotal</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/b&gt;&lt;br /&gt;'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/a&gt;
   &lt;div id=&quot;msg_1&quot; class=&quot;hide&quot;&gt;
       &lt;hr&gt;
       &lt;span style=&quot;text-align:left;float:left;&quot;&gt;Ticket Item(s): &lt;i&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$strtickettotal</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$strtickettotal</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
   &lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #000088;">$numact3days</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$staffid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$sqlact3days</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT * FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">.</span>
               <span style="color: #0000ff;">'WHERE staff_id &lt;&gt; &quot;0&quot; AND 3 &gt;= TIMESTAMPDIFF(DAY,created,NOW()) '</span><span style="color: #339933;">.</span>
               <span style="color: #0000ff;">'AND status = &quot;open&quot; and staff_id = '</span><span style="color: #339933;">.</span><span style="color: #000088;">$staffid</span><span style="color: #339933;">.</span><span style="color: #0000ff;">''</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: #000088;">$sqlact3days</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT * FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">.</span>
               <span style="color: #0000ff;">'WHERE staff_id &lt;&gt; &quot;0&quot; AND 3 &gt;= TIMESTAMPDIFF(DAY,created,NOW()) '</span><span style="color: #339933;">.</span>
               <span style="color: #0000ff;">'AND status = &quot;open&quot;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resact3days</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqlact3days</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$numact3days</span><span style="color: #339933;">=</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resact3days</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$strticketact3days</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$iact3days</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;">$rowact3days</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resact3days</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;">$iact3days</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$numact3days</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strticketact3days</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowact3days</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowact3days</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;, '</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$iact3days</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$numact3days</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strticketact3days</span> <span style="color: #339933;">.=</span>  <span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowact3days</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowact3days</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
   <span style="color: #000088;">$iact3days</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>
&lt;tr class=&quot;row2&quot; id=&quot;2&quot;&gt;
&lt;td&gt;
&lt;a href=&quot;javascript:toggleMessage('2');&quot;&gt;
&lt;img border=&quot;0&quot; align=&quot;left&quot; id=&quot;img_2&quot; src=&quot;images/plus.gif&quot;&gt;
&lt;span style=&quot;color:000; float: left; width:350px;&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Total Number of Active Tickets (&lt;= 3 Days): &quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
&amp;nbsp;&amp;nbsp;
 &lt;span class=&quot;Icon <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$icon</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; align=&quot;right&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;b&gt;&lt;span align=&quot;right&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$numact3days</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/a&gt;
   &lt;div id=&quot;msg_2&quot; class=&quot;hide&quot;&gt;
       &lt;hr&gt;
       &lt;span style=&quot;text-align:left;float:left;&quot;&gt;Ticket Item(s): &lt;i&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$strticketact3days</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$strticketact3days</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
   &lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #000088;">$numact7days</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$staffid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$sqlact7days</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT * FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE staff_id = '</span><span style="color: #339933;">.</span><span style="color: #000088;">$staffid</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' AND (7 &gt;= TIMESTAMPDIFF(DAY,created,NOW()) AND 3 &lt; TIMESTAMPDIFF(DAY,created,NOW())) AND status = &quot;open&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: #000088;">$sqlact7days</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT * FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE staff_id &lt;&gt; &quot;0&quot; AND (7 &gt;= TIMESTAMPDIFF(DAY,created,NOW()) AND 3 &lt; TIMESTAMPDIFF(DAY,created,NOW())) AND status = &quot;open&quot;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resact7days</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqlact7days</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$numact7days</span><span style="color: #339933;">=</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resact7days</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$strticketact7days</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$iact7days</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;">$rowact7days</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resact7days</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;">$iact7days</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$numact7days</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strticketact7days</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowact7days</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowact7days</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;, '</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$iact7days</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$numact7days</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strticketact7days</span> <span style="color: #339933;">.=</span>  <span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowact7days</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowact7days</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
   <span style="color: #000088;">$iact7days</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>
&lt;tr class=&quot;row1&quot; id=&quot;3&quot;&gt;
&lt;td&gt;
&lt;a href=&quot;javascript:toggleMessage('3');&quot;&gt;
&lt;img border=&quot;0&quot; align=&quot;left&quot; id=&quot;img_3&quot; src=&quot;images/plus.gif&quot;&gt;
&lt;span style=&quot;color:000; float: left; width:350px;&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Total Number of Active Tickets (&gt; 3 Days and &lt;= 7 Days): &quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
&amp;nbsp;&amp;nbsp;
 &lt;span class=&quot;Icon <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$icon</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; align=&quot;right&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;b&gt;&lt;span align=&quot;right&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$numact7days</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/a&gt;
   &lt;div id=&quot;msg_3&quot; class=&quot;hide&quot;&gt;
       &lt;hr&gt;
       &lt;span style=&quot;text-align:left;float:left;&quot;&gt;Ticket Item(s): &lt;i&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$strticketact7days</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$strticketact7days</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
   &lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #000088;">$numact14days</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$staffid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$sqlact14days</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT * FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE staff_id = '</span><span style="color: #339933;">.</span><span style="color: #000088;">$staffid</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' AND (14 &gt;= TIMESTAMPDIFF(DAY,created,NOW()) AND 7 &lt; TIMESTAMPDIFF(DAY,created,NOW())) AND status = &quot;open&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: #000088;">$sqlact14days</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT * FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE staff_id &lt;&gt; &quot;0&quot; AND (14 &gt;= TIMESTAMPDIFF(DAY,created,NOW()) AND 7 &lt; TIMESTAMPDIFF(DAY,created,NOW())) AND status = &quot;open&quot;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resact14days</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqlact14days</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$numact14days</span><span style="color: #339933;">=</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resact14days</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$strticketact14days</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$iact14days</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;">$rowact14days</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resact14days</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;">$iact14days</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$numact14days</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strticketact14days</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowact14days</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowact14days</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;, '</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$iact14days</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$numact14days</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strticketact14days</span> <span style="color: #339933;">.=</span>  <span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowact14days</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowact14days</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
   <span style="color: #000088;">$iact14days</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>
&lt;tr class=&quot;row2&quot; id=&quot;4&quot;&gt;
&lt;td&gt;
&lt;a href=&quot;javascript:toggleMessage('4');&quot;&gt;
&lt;img border=&quot;0&quot; align=&quot;left&quot; id=&quot;img_4&quot; src=&quot;images/plus.gif&quot;&gt;
&lt;span style=&quot;color:000; float: left; width:350px;&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Total Number of Active Tickets (&gt; 7 Days and &lt;= 14 Days): &quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
&amp;nbsp;&amp;nbsp;
 &lt;span class=&quot;Icon <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$icon</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; align=&quot;right&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;b&gt;&lt;span align=&quot;right&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$numact14days</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/a&gt;
   &lt;div id=&quot;msg_4&quot; class=&quot;hide&quot;&gt;
       &lt;hr&gt;
       &lt;span style=&quot;text-align:left;float:left;&quot;&gt;Ticket Item(s): &lt;i&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$strticketact14days</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$strticketact14days</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
   &lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #000088;">$numactmore14days</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$staffid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$sqlactmore14days</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT * FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE staff_id = '</span><span style="color: #339933;">.</span><span style="color: #000088;">$staffid</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' AND 14 &lt; TIMESTAMPDIFF(DAY,created,NOW()) AND status = &quot;open&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: #000088;">$sqlactmore14days</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT * FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE staff_id &lt;&gt; &quot;0&quot; AND 14 &lt; TIMESTAMPDIFF(DAY,created,NOW()) AND status = &quot;open&quot;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resactmore14days</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqlactmore14days</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$numactmore14days</span><span style="color: #339933;">=</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resactmore14days</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$strticketactmore14days</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$iactmore14days</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;">$rowactmore14days</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resactmore14days</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;">$iactmore14days</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$numactmore14days</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strticketactmore14days</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowactmore14days</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowactmore14days</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;, '</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$iactmore14days</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$numactmore14days</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strticketactmore14days</span> <span style="color: #339933;">.=</span>  <span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowactmore14days</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowactmore14days</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
   <span style="color: #000088;">$iactmore14days</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>
&lt;tr class=&quot;row1&quot; id=&quot;5&quot;&gt;
&lt;td&gt;
&lt;a href=&quot;javascript:toggleMessage('5');&quot;&gt;
&lt;img border=&quot;0&quot; align=&quot;left&quot; id=&quot;img_5&quot; src=&quot;images/plus.gif&quot;&gt;
&lt;span style=&quot;color:000; float: left; width:350px;&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Total Number of Active Tickets (&gt; 14 Days): &quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
&amp;nbsp;&amp;nbsp;
 &lt;span class=&quot;Icon <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$icon</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; align=&quot;right&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;b&gt;&lt;span align=&quot;right&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$numactmore14days</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/a&gt;
   &lt;div id=&quot;msg_5&quot; class=&quot;hide&quot;&gt;
       &lt;hr&gt;
       &lt;span style=&quot;text-align:left;float:left;&quot;&gt;Ticket Item(s): &lt;i&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$strticketactmore14days</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$strticketactmore14days</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
   &lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</pre></div></div>

<p><img src="http://img85.imageshack.us/img85/5558/osticket16rc5ticketagin.jpg" alt="Ticket Aging Report" /><br />
<img src="http://img190.imageshack.us/img190/5558/osticket16rc5ticketagin.jpg" alt="Ticket Aging Report for The Certain Staff" /><br />
<img src="http://img687.imageshack.us/img687/5558/osticket16rc5ticketagin.jpg" alt="Ticket Aging for The Certain Staff with Detail Item Ticket" />
</li>
<li>
Create a new file named <strong>ticketsummary.inc.php</strong> file, and copy paste this following code to that file, and put this file into your <strong>/include/staff/</strong> sub-directory of your osTicket:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><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: #339933;">!</span><span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'OSTSCPINC'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!@</span><span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isStaff</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Access Denied'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'staffid'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$staffid</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'staffid'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;msg&quot;&gt;Ticket Summary&lt;/div&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$numtotalstaff</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sqltotalstaff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT DISTINCT(t.staff_id), s.username, s.firstname, s.lastname '</span><span style="color: #339933;">.</span>
               <span style="color: #0000ff;">'FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' t, '</span><span style="color: #339933;">.</span>STAFF_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' s '</span><span style="color: #339933;">.</span>
               <span style="color: #0000ff;">'WHERE t.staff_id &lt;&gt; &quot;0&quot; AND t.staff_id=s.staff_id'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotalstaff</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqltotalstaff</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$numtotalstaff</span><span style="color: #339933;">=</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotalstaff</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$strtickettotalstaff</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$itotalstaff</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;form action=&quot;admin.php?t=ticketsummary&quot; method=&quot;post&quot;&gt;
 &lt;input type=hidden name='a' value='staff'&gt;
 Staff Name:&amp;nbsp;&lt;select name=&quot;staffid&quot; &gt;
  &lt;option value=&quot;&quot; selected &gt;Select One&lt;/option&gt;
<span style="color: #000000; font-weight: bold;">&lt;?</span>
 <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$rowtotalstaff</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotalstaff</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000088;">$selected</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'staffid'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span><span style="color: #000088;">$rowtotalstaff</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'staff_id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #0000ff;">'selected'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
   &lt;option value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$rowtotalstaff</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'staff_id'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$selected</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$rowtotalstaff</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' ('</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotalstaff</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'firstname'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotalstaff</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'lastname'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">')'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/option&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;/select&gt;
 &lt;input class=&quot;button&quot; type=&quot;submit&quot; value=&quot;View&quot;&gt;
&lt;/form&gt;
<span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div style=&quot;margin-bottom:20px; padding-top:0px;&quot;&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=1 cellpadding=2&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;tr&gt;&lt;td&gt;
       &lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=0 cellpadding=2 class=&quot;logs&quot; align=&quot;center&quot;&gt;
       &lt;tr&gt;&lt;th&gt;&amp;nbsp;&amp;nbsp;Ticket Summary and Its Count&lt;/th&gt;&lt;/tr&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$numstaff</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$staffid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$sqlstaff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT DISTINCT(t.staff_id), s.username FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' t, '</span><span style="color: #339933;">.</span>STAFF_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' s '</span><span style="color: #339933;">.</span>
          <span style="color: #0000ff;">'WHERE t.staff_id = '</span><span style="color: #339933;">.</span><span style="color: #000088;">$staffid</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' AND t.staff_id=s.staff_id'</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: #000088;">$sqlstaff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT DISTINCT(t.staff_id), s.username FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' t, '</span><span style="color: #339933;">.</span>STAFF_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' s '</span><span style="color: #339933;">.</span>
          <span style="color: #0000ff;">'WHERE t.staff_id &lt;&gt; &quot;0&quot; AND t.staff_id=s.staff_id'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resstaff</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqlstaff</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$numstaff</span><span style="color: #339933;">=</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resstaff</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$strticketstaff</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$istaff</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;">$rowstaff</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resstaff</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;">$istaff</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$numstaff</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strticketstaff</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;a href=&quot;admin.php?t=staff&amp;id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowstaff</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'staff_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowstaff</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;, '</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$istaff</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$numstaff</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strticketstaff</span> <span style="color: #339933;">.=</span>  <span style="color: #0000ff;">'&lt;a href=&quot;admin.php?t=staff&amp;id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowstaff</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'staff_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowstaff</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
   <span style="color: #000088;">$istaff</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>
&nbsp;
&lt;tr class=&quot;row1&quot; id=&quot;1&quot;&gt;
&lt;td&gt;
&lt;a href=&quot;javascript:toggleMessage('1');&quot;&gt;
&lt;img border=&quot;0&quot; align=&quot;left&quot; id=&quot;img_1&quot; src=&quot;images/plus.gif&quot;&gt;
&lt;span style=&quot;color:000; float: left; width:250px;&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Staff in Charge: &quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
&amp;nbsp;&amp;nbsp;
 &lt;span class=&quot;Icon <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$icon</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; align=&quot;right&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;b&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$numstaff</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/b&gt;&lt;br /&gt;'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/a&gt;
   &lt;div id=&quot;msg_1&quot; class=&quot;hide&quot;&gt;
       &lt;hr&gt;
       &lt;span style=&quot;text-align:left;float:left;&quot;&gt;Staff in Charge Username: &lt;i&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$strticketstaff</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$strticketstaff</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
   &lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #000088;">$numtotal</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$staffid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$sqltotal</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT * FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE staff_id = '</span><span style="color: #339933;">.</span><span style="color: #000088;">$staffid</span><span style="color: #339933;">.</span><span style="color: #0000ff;">''</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: #000088;">$sqltotal</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT * FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE staff_id &lt;&gt; &quot;0&quot;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotal</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqltotal</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$numtotal</span><span style="color: #339933;">=</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotal</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$strtickettotal</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$itotal</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;">$rowtotal</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotal</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: #009900;">&#40;</span><span style="color: #000088;">$itotal</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$numtotal</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strtickettotal</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotal</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotal</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;, '</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$itotal</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$numtotal</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strtickettotal</span> <span style="color: #339933;">.=</span>  <span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotal</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotal</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
   <span style="color: #000088;">$itotal</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>
&lt;tr class=&quot;row2&quot; id=&quot;2&quot;&gt;
&lt;td&gt;
&lt;a href=&quot;javascript:toggleMessage('2');&quot;&gt;
&lt;img border=&quot;0&quot; align=&quot;left&quot; id=&quot;img_2&quot; src=&quot;images/plus.gif&quot;&gt;
&lt;span style=&quot;color:000; float: left; width:250px;&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Total Number of Active Tickets: &quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
&amp;nbsp;&amp;nbsp;
 &lt;span class=&quot;Icon <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$icon</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; align=&quot;right&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;b&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$numtotal</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/b&gt;&lt;br /&gt;'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/a&gt;
   &lt;div id=&quot;msg_2&quot; class=&quot;hide&quot;&gt;
       &lt;hr&gt;
       &lt;span style=&quot;text-align:left;float:left;&quot;&gt;Ticket Item(s): &lt;i&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$strtickettotal</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$strtickettotal</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
   &lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
<span style="color: #000000; font-weight: bold;">&lt;?</span>
&nbsp;
<span style="color: #000088;">$numtotalclosed</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$staffid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$sqltotalclosed</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT * FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE status = &quot;closed&quot; and staff_id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$staffid</span><span style="color: #339933;">.</span><span style="color: #0000ff;">''</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: #000088;">$sqltotalclosed</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT * FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE status = &quot;closed&quot;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotalclosed</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqltotalclosed</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$numtotalclosed</span><span style="color: #339933;">=</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotalclosed</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$strtickettotalclosed</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$itotalclosed</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;">$rowtotalclosed</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotalclosed</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;">$itotalclosed</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$numtotalclosed</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strtickettotalclosed</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotalclosed</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotalclosed</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;, '</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$itotalclosed</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$numtotalclosed</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strtickettotalclosed</span> <span style="color: #339933;">.=</span>  <span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotalclosed</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotalclosed</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
   <span style="color: #000088;">$itotalclosed</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>
&lt;tr class=&quot;row1&quot; id=&quot;3&quot;&gt;
&lt;td&gt;
&lt;a href=&quot;javascript:toggleMessage('3');&quot;&gt;
&lt;img border=&quot;0&quot; align=&quot;left&quot; id=&quot;img_3&quot; src=&quot;images/plus.gif&quot;&gt;
&lt;span style=&quot;color:000; float: left; width:250px;&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Total Number of Closed Tickets: &quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
&amp;nbsp;&amp;nbsp;
 &lt;span class=&quot;Icon <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$icon</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; align=&quot;right&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;b&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$numtotalclosed</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/b&gt;&lt;br /&gt;'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/a&gt;
   &lt;div id=&quot;msg_3&quot; class=&quot;hide&quot;&gt;
       &lt;hr&gt;
       &lt;span style=&quot;text-align:left;float:left;&quot;&gt;Ticket Item(s): &lt;i&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$strtickettotalclosed</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$strtickettotalclosed</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
   &lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
<span style="color: #000000; font-weight: bold;">&lt;?</span>
&nbsp;
<span style="color: #000088;">$numtotalunassigned</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$staffid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$sqltotalunassigned</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT * FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE staff_id = &quot;0&quot; and staff_id = '</span><span style="color: #339933;">.</span><span style="color: #000088;">$staffid</span><span style="color: #339933;">.</span><span style="color: #0000ff;">''</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: #000088;">$sqltotalunassigned</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT * FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE staff_id = &quot;0&quot;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotalunassigned</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqltotalunassigned</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$numtotalunassigned</span><span style="color: #339933;">=</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotalunassigned</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$strtickettotalunassigned</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$itotalunassigned</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;">$rowtotalunassigned</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$restotalunassigned</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;">$itotalunassigned</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$numtotalunassigned</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strtickettotalunassigned</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotalunassigned</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotalunassigned</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;, '</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$itotalunassigned</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$numtotalunassigned</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$strtickettotalunassigned</span> <span style="color: #339933;">.=</span>  <span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotalunassigned</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowtotalunassigned</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
   <span style="color: #000088;">$itotalunassigned</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>
&lt;tr class=&quot;row2&quot; id=&quot;4&quot;&gt;
&lt;td&gt;
&lt;a href=&quot;javascript:toggleMessage('4');&quot;&gt;
&lt;img border=&quot;0&quot; align=&quot;left&quot; id=&quot;img_4&quot; src=&quot;images/plus.gif&quot;&gt;
&lt;span style=&quot;color:000; float: left; width:250px;&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Total Number of Unassigned Tickets: &quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
&amp;nbsp;&amp;nbsp;
 &lt;span class=&quot;Icon <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$icon</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; align=&quot;right&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;b&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$numtotalunassigned</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/b&gt;&lt;br /&gt;'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/a&gt;
   &lt;div id=&quot;msg_4&quot; class=&quot;hide&quot;&gt;
       &lt;hr&gt;
       &lt;span style=&quot;text-align:left;float:left;&quot;&gt;Ticket Item(s): &lt;i&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$strtickettotalunassigned</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$strtickettotalunassigned</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
   &lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</pre></div></div>

<p><img src="http://img687.imageshack.us/img687/9462/osticket16rc5ticketsumm.jpg" alt="Ticket Summary" />
</li>
<li>
Create a new file named <strong>ticketstaff.inc.php</strong> file, and copy paste this following code to that file, and put this file into your <strong>/include/staff/</strong> sub-directory of your osTicket:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><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: #339933;">!</span><span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'OSTSCPINC'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!@</span><span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isStaff</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Access Denied'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$qselect</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT DISTINCT(t.staff_id), s.username, s.firstname, s.lastname '</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$qfrom</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' t, '</span><span style="color: #339933;">.</span>STAFF_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' s '</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$qwhere</span><span style="color: #339933;">=</span><span style="color: #0000ff;">' WHERE t.staff_id &lt;&gt; &quot;0&quot; AND t.staff_id=s.staff_id '</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//get log count based on the query so far..</span>
<span style="color: #000088;">$total</span><span style="color: #339933;">=</span>db_count<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT count(*) <span style="color: #006699; font-weight: bold;">$qfrom</span> <span style="color: #006699; font-weight: bold;">$qwhere</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pagelimit</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">30</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//pagenate</span>
<span style="color: #000088;">$pageNav</span><span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">new</span> Pagenate<span style="color: #009900;">&#40;</span><span style="color: #000088;">$total</span><span style="color: #339933;">,</span><span style="color: #000088;">$page</span><span style="color: #339933;">,</span><span style="color: #000088;">$pagelimit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pageNav</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setURL</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin.php'</span><span style="color: #339933;">,</span><span style="color: #000088;">$qstr</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$qselect</span> <span style="color: #006699; font-weight: bold;">$qfrom</span> <span style="color: #006699; font-weight: bold;">$qwhere</span> ORDER BY t.created DESC LIMIT &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$pageNav</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getStart</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$pageNav</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getLimit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//echo $query;</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$showing</span><span style="color: #339933;">=</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$pageNav</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">showing</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div class=&quot;msg&quot;&gt;Ticket for Staff&lt;/div&gt;
&lt;div style=&quot;margin-bottom:20px; padding-top:0px;&quot;&gt;
 &lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=1 cellpadding=2&gt;
    &lt;form action=&quot;tickets.php&quot; method=&quot;POST&quot; name='tickets' onSubmit=&quot;return checkbox_checker(this,1,0);&quot;&gt;
    &lt;input type=&quot;hidden&quot; name=&quot;a&quot; value=&quot;mass_process&quot; &gt;
    &lt;input type=&quot;hidden&quot; name=&quot;status&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$statusss</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; &gt;
    &lt;tr&gt;&lt;td&gt;
       &lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=0 cellpadding=2 class=&quot;logs&quot; align=&quot;center&quot;&gt;
        &lt;tr&gt;&lt;th&gt;&amp;nbsp;&amp;nbsp;Staff Name and Tickets Count&lt;/th&gt;&lt;/tr&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?</span>
        <span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;row1&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$total</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</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;">$result</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$num</span><span style="color: #339933;">=</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</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;">$row</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</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>
            &lt;tr class=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$class</span><span style="color: #000000; font-weight: bold;">?&gt;</span> &quot; id=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$i</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
                &lt;td&gt;
                  &lt;a href=&quot;javascript:toggleMessage('<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$i</span><span style="color: #000000; font-weight: bold;">?&gt;</span>');&quot;&gt;
                  &lt;img border=&quot;0&quot; align=&quot;left&quot; id=&quot;img_<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$i</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; src=&quot;images/plus.gif&quot;&gt;
                  &lt;span style=&quot;color:000; float: left; width:190px;&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span><span style="color: #b1b100;">echo</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; (&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'firstname'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'lastname'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;)&quot;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
&nbsp;
                <span style="color: #000000; font-weight: bold;">&lt;?</span>
                <span style="color: #000088;">$sqln</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT * FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE staff_id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;staff_id&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resn</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqln</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$numn</span><span style="color: #339933;">=</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resn</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                <span style="color: #009900;">&#125;</span>
                <span style="color: #000000; font-weight: bold;">?&gt;</span>
                  &amp;nbsp;&amp;nbsp;
                  &lt;span class=&quot;Icon <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$icon</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;&lt;b&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$numn</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;
                    &lt;div id=&quot;msg_<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$i</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;hide&quot;&gt;
                        &lt;hr&gt;
&nbsp;
                <span style="color: #000000; font-weight: bold;">&lt;?</span>
&nbsp;
                <span style="color: #000088;">$sqlt</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT ticketID, ticket_id FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE staff_id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;staff_id&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$rest</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqlt</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$numt</span><span style="color: #339933;">=</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$rest</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$strt</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
                    <span style="color: #000088;">$it</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;">$rowt</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$rest</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;">$it</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$numt</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #000088;">$strt</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowt</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowt</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;, '</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$it</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$numt</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #000088;">$strt</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">'&lt;a href=&quot;tickets.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowt</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$rowt</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticketID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
                    <span style="color: #000088;">$it</span><span style="color: #339933;">++;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
                <span style="color: #000000; font-weight: bold;">?&gt;</span>
                  &lt;span style=&quot;text-align:left;float:left;&quot;&gt;&lt;i&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$strt</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&amp;nbsp;&amp;nbsp;&lt;/i&gt;&lt;/span&gt;
                  &lt;/div&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
            <span style="color: #000000; font-weight: bold;">&lt;?</span>
            <span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$class</span> <span style="color: #339933;">==</span><span style="color: #0000ff;">'row2'</span><span style="color: #009900;">&#41;</span> ?<span style="color: #0000ff;">'row1'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'row2'</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: #666666; font-style: italic;">//end of while.</span>
        <span style="color: #b1b100;">else</span><span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">//not tickets found!! ?&gt;</span>
            &lt;tr class=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$class</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;&lt;td&gt;&lt;b&gt;Query returned 0 results.&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?</span>
        <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
       &lt;/table&gt;
    &lt;/td&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;">$num</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&gt;&lt;td style=&quot;padding-left:20px&quot;&gt;page:<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$pageNav</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPageLinks</span><span style="color: #009900;">&#40;</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;/form&gt;
 &lt;/table&gt;
&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?</span></pre></div></div>

<p><img src="http://img687.imageshack.us/img687/1876/osticket16rc5ticketfors.jpg" alt="Ticket for Staff" />
</li>
</ol>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F01%2F31%2Fadding-ticket-aging-ticket-summary-and-ticket-for-staff-report-feature-into-osticket-v1-6-rc5%2F&amp;linkname=Adding%20Ticket%20Aging%2C%20Ticket%20Summary%2C%20and%20Ticket%20for%20Staff%20Report%20Feature%20into%20osTicket%20v1.6%20RC5"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/01/31/adding-ticket-aging-ticket-summary-and-ticket-for-staff-report-feature-into-osticket-v1-6-rc5/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to Remove Unordered List Bullet in Output of Custom Field Template Plugin of WordPress</title>
		<link>http://www.openscriptsolution.com/2010/01/30/how-to-remove-unordered-list-bullet-in-output-of-custom-field-template-plugin-of-wordpress/</link>
		<comments>http://www.openscriptsolution.com/2010/01/30/how-to-remove-unordered-list-bullet-in-output-of-custom-field-template-plugin-of-wordpress/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 04:50:36 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[bullet]]></category>
		<category><![CDATA[Custom Field Template]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[unordered list]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1103</guid>
		<description><![CDATA[A few days ago, I used Custom Field Template plugin in my another website that I created by using WordPress. This plugin is useful if you want to define the custom field in your posts or pages, especially if you want to use the frequently templates which have the fixed data field entry. Unfortunately, when [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago, I used <a href="http://wordpress.org/extend/plugins/custom-field-template/" target="_blank">Custom Field Template plugin</a> in my another website that I created by using <a href="http://wordpress.org" target="_blank">WordPress</a>. This plugin is useful if you want to define the custom field in your posts or pages, especially if you want to use the frequently templates which have the fixed data field entry. Unfortunately, when the related template is being displayed, you will see the unordered list bullet in the leftside of each item inside the html table. So I made modification in order to remove this unordered list bullet. Also, this modification will add the ability for user to move to the next field while entering data in edit/add mode by using Tab from the keyboard. <span id="more-1103"></span></p>
<ol>
<li>Open your <strong>/wp-content/plugins/custom-field-template/custom-field-template.php</strong> file, and find this code:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2611
2612
2613
2614
2615
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;ul&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$metavalue</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$val</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
	<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;li&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$val</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/li&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">endforeach</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;/ul&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2611
2612
2613
2614
2615
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$metavalue</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$val</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
	<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">''</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$val</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">''</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">endforeach</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">''</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
<li>
Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2758
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$replace</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$rkey</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$rval</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2758
2759
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$x</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;">$replace</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$rkey</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$rval</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span></pre></td></tr></table></div>

</li>
<li>
Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2767
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;input type=&quot;text&quot; name=&quot;cftsearch['</span> <span style="color: #339933;">.</span> <span style="color: #990000;">rawurlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">']['</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$rkey</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'][]&quot; value=&quot;'</span> <span style="color: #339933;">.</span> attribute_escape<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cftsearch'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">rawurlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' /&gt;'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code (this code will have the ability to define the tabindex in each field in order to make you easier while inputing the data entry):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2767
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;input type=&quot;text&quot; name=&quot;cftsearch['</span> <span style="color: #339933;">.</span> <span style="color: #990000;">rawurlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">']['</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$rkey</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'][]&quot; value=&quot;'</span> <span style="color: #339933;">.</span> attribute_escape<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cftsearch'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">rawurlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' tabindex=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$x</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt;'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
<li>
Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2782
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;ul'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&gt;'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2783
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
<li>
Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;cftsearch['</span> <span style="color: #339933;">.</span> <span style="color: #990000;">rawurlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">']['</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$rkey</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'][]&quot; value=&quot;'</span> <span style="color: #339933;">.</span> attribute_escape<span style="color: #009900;">&#40;</span><span style="color: #000088;">$metavalue</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$checked</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'  /&gt; '</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$valueLabel</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$j</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">stripcslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$valueLabel</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$j</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">else</span> <span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">stripcslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$metavalue</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;/label&gt;&lt;/li&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$j</span><span style="color: #339933;">++;</span>
<span style="color: #b1b100;">endforeach</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;/ul&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cftsearch'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">rawurlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> attribute_escape<span style="color: #009900;">&#40;</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
<span style="color: #000088;">$checked</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">' checked=&quot;checked&quot;'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;cftsearch['</span> <span style="color: #339933;">.</span> <span style="color: #990000;">rawurlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">']['</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$rkey</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'][]&quot; value=&quot;'</span> <span style="color: #339933;">.</span> attribute_escape<span style="color: #009900;">&#40;</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$checked</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' /&gt; '</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;cftsearch['</span> <span style="color: #339933;">.</span> <span style="color: #990000;">rawurlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">']['</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$rkey</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'][]&quot; value=&quot;'</span> <span style="color: #339933;">.</span> attribute_escape<span style="color: #009900;">&#40;</span><span style="color: #000088;">$metavalue</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$checked</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' tabindex=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$x</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt; '</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$valueLabel</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$j</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">stripcslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$valueLabel</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$j</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">else</span> <span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">stripcslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$metavalue</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;/label&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$j</span><span style="color: #339933;">++;</span>
<span style="color: #b1b100;">endforeach</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cftsearch'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">rawurlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> attribute_escape<span style="color: #009900;">&#40;</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
<span style="color: #000088;">$checked</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">' checked=&quot;checked&quot;'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;cftsearch['</span> <span style="color: #339933;">.</span> <span style="color: #990000;">rawurlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">']['</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$rkey</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'][]&quot; value=&quot;'</span> <span style="color: #339933;">.</span> attribute_escape<span style="color: #009900;">&#40;</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$checked</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' tabindex=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$x</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt; '</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
<li>
Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2835
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;li&gt;&lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;cftsearch['</span> <span style="color: #339933;">.</span> <span style="color: #990000;">rawurlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">']['</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$rkey</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'][]&quot; value=&quot;'</span> <span style="color: #339933;">.</span> attribute_escape<span style="color: #009900;">&#40;</span><span style="color: #000088;">$metavalue</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$checked</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' /&gt; '</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2835
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;li&gt;&lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;cftsearch['</span> <span style="color: #339933;">.</span> <span style="color: #990000;">rawurlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">']['</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$rkey</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'][]&quot; value=&quot;'</span> <span style="color: #339933;">.</span> attribute_escape<span style="color: #009900;">&#40;</span><span style="color: #000088;">$metavalue</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$checked</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' tabindex=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$x</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt; '</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
<li>
Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2845
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;cftsearch['</span> <span style="color: #339933;">.</span> <span style="color: #990000;">rawurlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'][]&quot; value=&quot;'</span> <span style="color: #339933;">.</span> attribute_escape<span style="color: #009900;">&#40;</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$checked</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' /&gt; '</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2845
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;cftsearch['</span> <span style="color: #339933;">.</span> <span style="color: #990000;">rawurlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'][]&quot; value=&quot;'</span> <span style="color: #339933;">.</span> attribute_escape<span style="color: #009900;">&#40;</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$checked</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' tabindex=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$x</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt; '</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
<li>
Find again this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2861
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;select name=&quot;cftsearch['</span> <span style="color: #339933;">.</span> <span style="color: #990000;">rawurlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">']['</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$rkey</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'][]&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&gt;'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2861
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$replace_val</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$rkey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;select name=&quot;cftsearch['</span> <span style="color: #339933;">.</span> <span style="color: #990000;">rawurlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">']['</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$rkey</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'][]&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' tabindex=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$x</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
<li>
Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2881
2882
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #b1b100;">endswitch</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">endforeach</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2881
2882
2883
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #b1b100;">endswitch</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$x</span><span style="color: #339933;">++;</span>
<span style="color: #b1b100;">endforeach</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
</ol>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F01%2F30%2Fhow-to-remove-unordered-list-bullet-in-output-of-custom-field-template-plugin-of-wordpress%2F&amp;linkname=How%20to%20Remove%20Unordered%20List%20Bullet%20in%20Output%20of%20Custom%20Field%20Template%20Plugin%20of%20WordPress"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/01/30/how-to-remove-unordered-list-bullet-in-output-of-custom-field-template-plugin-of-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Fix and Repair Your Credit Effectively and Efficiently</title>
		<link>http://www.openscriptsolution.com/2010/01/18/how-to-fix-and-repair-your-credit-effectively-and-efficiently/</link>
		<comments>http://www.openscriptsolution.com/2010/01/18/how-to-fix-and-repair-your-credit-effectively-and-efficiently/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 12:19:31 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[Credits]]></category>
		<category><![CDATA[credit repair]]></category>
		<category><![CDATA[effectively]]></category>
		<category><![CDATA[efficiently]]></category>
		<category><![CDATA[fix credit]]></category>
		<category><![CDATA[professional]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1101</guid>
		<description><![CDATA[Many people (including myself) do not know how to fix their credits or repairing their credit effectively and efficiently, until I found a website from Google that provided the complete information regarding it. For those of you who have bad credit or your credit score decrease become low, and need to fix credit or credit [...]]]></description>
			<content:encoded><![CDATA[<p>Many people (including myself) do not know how to fix their credits or repairing their credit effectively and efficiently, until I found a website from Google that provided the complete information regarding it. For those of you who have bad credit or your credit score decrease become low, and need to fix credit or credit repair, then this following information is very useful for you. You won&#8217;t be sorry to use their services. I think your credit score can increase significantly by using the services they provided. <span id="more-1101"></span></p>
<p>First of all, the best practice to <a href="http://www.ovationcredit.com" target="_blank">fix credit</a> or <a href="http://www.ovationcredit.com" target="_blank">credit repair</a> for yourself is try to help by yourself. Try to identify what is the problem happened. Of course, if you still have no idea about how to identify the problem of your credit, or how to increase your credit score, why don&#8217;t you entrust it to the professional services? Afterwards, you can do your another activities without having worry about your credit problem, since you have entrust your problem to the professional. </p>
<p>I found <a href="http://www.ovationcredit.com" target="_blank">this website</a> from Google, and it looked like they provided the services regarding <a href="http://www.ovationcredit.com" target="_blank">credit repair</a> seriously. After reading their profile and the processes they provided, they are professional, indeed. Perhaps it can helps you to <a href="http://www.ovationcredit.com" target="_blank">fix credit</a> of yours. </p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F01%2F18%2Fhow-to-fix-and-repair-your-credit-effectively-and-efficiently%2F&amp;linkname=How%20to%20Fix%20and%20Repair%20Your%20Credit%20Effectively%20and%20Efficiently"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/01/18/how-to-fix-and-repair-your-credit-effectively-and-efficiently/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Navigate Posts Only in The Current Category using Smarter Navigation Plugin and Atahualpa Theme of WordPress</title>
		<link>http://www.openscriptsolution.com/2010/01/16/how-to-navigate-posts-only-in-the-current-category-using-smarter-navigation-plugin-and-atahualpa-theme-of-wordpress/</link>
		<comments>http://www.openscriptsolution.com/2010/01/16/how-to-navigate-posts-only-in-the-current-category-using-smarter-navigation-plugin-and-atahualpa-theme-of-wordpress/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 09:14:58 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Atahualpa]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[next]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[previous]]></category>
		<category><![CDATA[smart]]></category>
		<category><![CDATA[Smarter Navigation]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1095</guid>
		<description><![CDATA[If you want to change the existing navigation in Atahualpa Theme of your WordPress website that navigate all post based on the order of the general Post ID no matter which category you choose, become the smarter technique which will navigate based on the current category that selected by user, then this following modification is [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to change the existing navigation in Atahualpa Theme of your WordPress website that navigate all post based on the order of the general Post ID no matter which category you choose, become the smarter technique which will navigate based on the current category that selected by user, then this following modification is for you! As we know, Atahualpa theme has provided the previous/next link when we display the certain post in the top of the post page. Unfortunately, by default, when we choose the certain category, then we navigate through that navigation post link, it will avoid the selected category. Now, after you implement this following modification, you will be able to navigate only through the posts that located in the certain category that you have choosen. Isn&#8217;t smarter, huh? <span id="more-1095"></span></p>
<ol>
<li>
Download the <a href="http://wordpress.org/extend/plugins/smarter-navigation/">Smarter Navigation</a> plugin.
</li>
<li>
Upload this plugin to your <strong>/wp-content/plugins/</strong> and then extract it.
</li>
<li>
Activate this plugin from your wp-admin.
</li>
<li>
Open your <strong>/wp-content/themes/{youratahualpaname}/functions/bfa_next_previous_links.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>137
138
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">		previous_post_link<span style="color: #009900;">&#40;</span><span style="color: #000088;">$bfa_ata</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'single_next_prev_older'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> 
		next_post_link<span style="color: #009900;">&#40;</span><span style="color: #000088;">$bfa_ata</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'single_next_prev_newer'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>137
138
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">		previous_post_smart<span style="color: #009900;">&#40;</span><span style="color: #000088;">$bfa_ata</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'single_next_prev_older'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">// previous_post_link replaced by previous_post_smart in order to navigate only in the current category using Smarter Navigation plugin, modified by Masino Sinaga, Januari 16, 2010</span>
		next_post_smart<span style="color: #009900;">&#40;</span><span style="color: #000088;">$bfa_ata</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'single_next_prev_newer'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// next_post_link replaced by next_post_smart in order to navigate only in the current category using Smarter Navigation plugin, modified by Masino Sinaga, Januari 16, 2010</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>147
148
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">		next_post_link<span style="color: #009900;">&#40;</span><span style="color: #000088;">$bfa_ata</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'single_next_prev_newer'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> 
		previous_post_link<span style="color: #009900;">&#40;</span><span style="color: #000088;">$bfa_ata</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'single_next_prev_older'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>147
148
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">		next_post_smart<span style="color: #009900;">&#40;</span><span style="color: #000088;">$bfa_ata</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'single_next_prev_newer'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">// next_post_link replaced by next_post_smart in order to navigate only in the current category using Smarter Navigation plugin, modified by Masino Sinaga, Januari 16, 2010</span>
		previous_post_smart<span style="color: #009900;">&#40;</span><span style="color: #000088;">$bfa_ata</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'single_next_prev_older'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// previous_post_link replaced by previous_post_smart in order to navigate only in the current category using Smarter Navigation plugin, modified by Masino Sinaga, Januari 16, 2010</span></pre></td></tr></table></div>

</li>
</ol>
<p>The conclusion: All you need to do is simply replace the <strong>link</strong> with <strong>smart</strong> in the <strong>previous_post_link</strong> and <strong>next_post_link</strong> function call in <strong>bfa_next_previous_links.php</strong> file belongs to <strong>Atahualpa</strong> theme. Afterwards, you can navigate through the posts only that located in the certain category you chose.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F01%2F16%2Fhow-to-navigate-posts-only-in-the-current-category-using-smarter-navigation-plugin-and-atahualpa-theme-of-wordpress%2F&amp;linkname=How%20to%20Navigate%20Posts%20Only%20in%20The%20Current%20Category%20using%20Smarter%20Navigation%20Plugin%20and%20Atahualpa%20Theme%20of%20WordPress"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/01/16/how-to-navigate-posts-only-in-the-current-category-using-smarter-navigation-plugin-and-atahualpa-theme-of-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Add user_registered Column in Authors &amp; Users Page on wp-admin of WordPress</title>
		<link>http://www.openscriptsolution.com/2010/01/13/how-to-add-user_registered-column-in-authors-users-page-on-wp-admin-of-wordpress/</link>
		<comments>http://www.openscriptsolution.com/2010/01/13/how-to-add-user_registered-column-in-authors-users-page-on-wp-admin-of-wordpress/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 02:28:52 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[add]]></category>
		<category><![CDATA[column]]></category>
		<category><![CDATA[field]]></category>
		<category><![CDATA[kolom]]></category>
		<category><![CDATA[pendaftaran]]></category>
		<category><![CDATA[registered date]]></category>
		<category><![CDATA[tanggal]]></category>
		<category><![CDATA[Users & Authors]]></category>
		<category><![CDATA[user_registered]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1092</guid>
		<description><![CDATA[Once upon a time, I needed to monitor when did my users registered their account in one of my WordPress website. It meant that I needed to get the value from user_registered field in the users table, and then displaying it in Authors &#038; Users page on wp-admin of WordPress. I have searched for the [...]]]></description>
			<content:encoded><![CDATA[<p>Once upon a time, I needed to monitor when did my users registered their account in one of my WordPress website. It meant that I needed to get the value from <strong>user_registered</strong> field in the users table, and then displaying it in <strong>Authors &#038; Users</strong> page on wp-admin of WordPress. I have searched for the plugin regarding this, but I found nothing. Actually, I wanted to create the plugin to implement it. Unfortunately, I still have no idea how to do this, since I am not expert to create the plugin (probably someday I can do it). So I decided to edit the core file of WordPress. First of all, I opened the <strong>users.php</strong> file that located in <strong>wp-admin</strong> sub directory. After investigating this file for a few minutes, then I found the code regarding how to display the users list in <strong>template.php</strong> based on the code or function call <strong>user_row</strong> and <strong>get_column_headers</strong>. This template.php file located in <strong>/wp-admin/includes/</strong> sub directory. So, here is the modification I made. <span id="more-1092"></span></p>
<p>Open your <strong>/wp-admin/includes/template.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>899
900
901
902
903
904
905
906
907
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">		<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'users'</span><span style="color: #339933;">:</span>
			<span style="color: #000088;">$_wp_column_headers</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$page</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
				<span style="color: #0000ff;">'cb'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;input type=&quot;checkbox&quot; /&gt;'</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'username'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Username'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'email'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'E-mail'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'role'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Role'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'posts'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Posts'</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>899
900
901
902
903
904
905
906
907
908
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">		<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'users'</span><span style="color: #339933;">:</span>
			<span style="color: #000088;">$_wp_column_headers</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$page</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
				<span style="color: #0000ff;">'cb'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;input type=&quot;checkbox&quot; /&gt;'</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'username'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Username'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'email'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'E-mail'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'role'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Role'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'posts'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Posts'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'user_registered'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Registered Date'</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// added by Masino Sinaga, January 13, 2010</span>
			<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1985
1986
1987
1988
1989
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">			<span style="color: #b1b100;">default</span><span style="color: #339933;">:</span>
				<span style="color: #000088;">$r</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;td <span style="color: #006699; font-weight: bold;">$attributes</span>&gt;&quot;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$r</span> <span style="color: #339933;">.=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'manage_users_custom_column'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$column_name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user_object</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$r</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;/td&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>before the first line of that code, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1984
1985
1986
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">			<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'user_registered'</span><span style="color: #339933;">:</span>  <span style="color: #666666; font-style: italic;">// added by Masino Sinaga, January 13, 2010</span>
				<span style="color: #000088;">$r</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;td <span style="color: #006699; font-weight: bold;">$attributes</span>&gt;<span style="color: #006699; font-weight: bold;">$user_object-&gt;user_registered</span>&lt;/td&gt;&quot;</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>That&#8217;s all. Now, go to your wp-admin of your WordPress website, then see the <strong>Authors &#038; Users</strong> page under the <strong>Users</strong> menu. You should see now the new column at the right most of the list named <strong>Registered Date</strong>. I had tested and it worked like a charm.</p>
<p>Please do not hesitate to leave your comment if you have a new idea how to implement this using the plugin in WordPress.</p>
<p>Hopefully this will help someone else out there.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F01%2F13%2Fhow-to-add-user_registered-column-in-authors-users-page-on-wp-admin-of-wordpress%2F&amp;linkname=How%20to%20Add%20user_registered%20Column%20in%20Authors%20%26%23038%3B%20Users%20Page%20on%20wp-admin%20of%20WordPress"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/01/13/how-to-add-user_registered-column-in-authors-users-page-on-wp-admin-of-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Get Current Language Code by Using WPML Plugin of WordPress</title>
		<link>http://www.openscriptsolution.com/2010/01/11/how-to-get-current-language-code-by-using-wpml-plugin-of-wordpress/</link>
		<comments>http://www.openscriptsolution.com/2010/01/11/how-to-get-current-language-code-by-using-wpml-plugin-of-wordpress/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 03:39:09 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[current]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[multi-language]]></category>
		<category><![CDATA[multi-lingual]]></category>
		<category><![CDATA[multilanguage]]></category>
		<category><![CDATA[multilingual]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WPML]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1088</guid>
		<description><![CDATA[I have been using WPML Plugin for one of my multi language websites. Once upon a time, I needed to check the current language code in order to execute my own code that I wrote in the sidebar related to the current language. The question is: How did I get that current language code? After [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using <a href="http://wpml.org" target="_blank">WPML Plugin</a> for one of my multi language websites. Once upon a time, I needed to check the current language code in order to execute my own code that I wrote in the sidebar related to the current language. The question is: How did I get that current language code? After do some searching through the author&#8217;s website, then I found the answer from this following post: <a href="http://wpml.org/documentation/support/wpml-coding-api/">WPML coding API</a>. WPML has provided the constants in order to get: 1) The current language code, 2) The name of current language in the original (current) language, and 3) The name of the current language name in English. Thanks to WPML for providing this constants! <span id="more-1088"></span></p>
<p>If you wan to get the value of those three constants, then you can put this code to your <strong>index.php</strong> file of your current theme.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;Language Code: &quot;</span><span style="color: #339933;">.</span>ICL_LANGUAGE_CODE<span style="color: #339933;">;</span> 
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;Original Language Name: &quot;</span><span style="color: #339933;">.</span>ICL_LANGUAGE_NAME<span style="color: #339933;">;</span> 
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;Language Name in English: &quot;</span><span style="color: #339933;">.</span>ICL_LANGUAGE_NAME_EN<span style="color: #339933;">;</span> 
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Suppose you are using English (en) and Indonesian (id) language, and you want to check the current language code only, so you can execute the certain code related to the current language code, then you can use this following code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>ICL_LANGUAGE_CODE <span style="color: #339933;">==</span> <span style="color: #0000ff;">'en'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// put your code here if the current language code is 'en' (English)</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span>ICL_LANGUAGE_CODE <span style="color: #339933;">==</span> <span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// put your code here if the current language code is 'id' (Indonesian)</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Hopefully this will be helpful.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F01%2F11%2Fhow-to-get-current-language-code-by-using-wpml-plugin-of-wordpress%2F&amp;linkname=How%20to%20Get%20Current%20Language%20Code%20by%20Using%20WPML%20Plugin%20of%20WordPress"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/01/11/how-to-get-current-language-code-by-using-wpml-plugin-of-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
