<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title>jobberBase Community - Job statistics in the admin panel</title>
		<link>http://www.jobberbase.com/forum/topic1059-job-statistics-in-the-admin-panel.html</link>
		<description>The most recent posts in Job statistics in the admin panel.</description>
		<lastBuildDate>Mon, 23 Mar 2009 19:21:19 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title>Re: Job statistics in the admin panel</title>
			<link>http://www.jobberbase.com/forum/post4700.html#p4700</link>
			<description>Hi, guys!

I didn&#039;t have a lot of time on my hands and so I&#039;ve implemented the basic enhancements as described in the first post - I&#039;ll implement the full deal when I&#039;ll have the time ;)

I&#039;m describing here the steps needed to add this feature to an existing [b]1.6[/b] jobberbase installation. 

[b]Important[/b]: make a backup of the affected files before proceeding

1. Open [b]_includes/class.Job.php[/b] and:

- add
[code]&#039;views_count&#039; =&gt; $this-&gt;mViewsCount,[/code]
before
[code]&#039;is_spotlight&#039; =&gt; $this-&gt;mIsSpotlight);[/code](around line 174-175)

- in the same file, scroll to the end and add the following lines before the last } character
[code]
	
	/**
	 * Returns an associative array containing the
	 * @param $jobIDs an array of job IDs
	 * @return
	 */
	public function GetApplicationsStatistics($jobIDs)
	{
		global $db;
		
		$statisticalData = array();
		
		$sql = &#039;SELECT job_id, count(id) numberOfApplications,  DATE_FORMAT(max(created_on), \&#039;%d-%m-%Y %H:%i\&#039;) lastApplicationOn 
				FROM job_applications j 
				WHERE job_id in (&#039; . $this-&gt;buildCommaSeparatedIDsString($jobIDs) . &#039;) GROUP BY job_id&#039;; 
		$result = $db-&gt;query($sql);
		
		while ($row = $result-&gt;fetch_assoc())
			$statisticalData[$row[&#039;job_id&#039;]] = $row;
			
		return $statisticalData;
	}
	
	private function buildCommaSeparatedIDsString($numbersArray)
	{
		$string = &#039;&#039;;
		
		for ($i = 0; $i &lt; count($numbersArray); $i++)
		{
			$string .= $numbersArray[$i];

			if ($i &lt; count($numbersArray) - 1)
				$string .= &#039;,&#039;;
		}
		
		return $string;
	}
[/code]

2. replace [b]/admin/page_category[/b] with http://jobberbase.googlecode.com/svn-history/r128/trunk/app/admin/page_category.php
3. replace [b]/admin/_templates/posts-loop.tpl[/b] with http://jobberbase.googlecode.com/svn-history/r128/trunk/app/admin/_templates/posts-loop.tpl

As always, please report here the bugs (if any) and I will try to fix them as soon as possible.

Any feedback is appreciated ;)</description>
			<author>dummy@example.com (putypuruty)</author>
			<pubDate>Mon, 23 Mar 2009 19:21:19 +0000</pubDate>
			<guid>http://www.jobberbase.com/forum/post4700.html#p4700</guid>
		</item>
		<item>
			<title>Re: Job statistics in the admin panel</title>
			<link>http://www.jobberbase.com/forum/post3872.html#p3872</link>
			<description>Hi, I am new to this forum, and I hope you don&#039;t think I&#039;m butting in by adding my own comments, but a lot of the forums that I have been on in the past do have sortable columns, and it does help.

Thanks</description>
			<author>dummy@example.com (markk)</author>
			<pubDate>Tue, 03 Feb 2009 13:51:24 +0000</pubDate>
			<guid>http://www.jobberbase.com/forum/post3872.html#p3872</guid>
		</item>
		<item>
			<title>Re: Job statistics in the admin panel</title>
			<link>http://www.jobberbase.com/forum/post3741.html#p3741</link>
			<description>Yes.....just adding the columns and headings in the middle.

For now with only 8~10 jobs is easy to manage but consider having 1,200 jobs, and Admin users having different preferences as to how they want to order the list (date, co. name, #of views, etc...) 

Solutions should be flexible and scalable and a combo sort box would just as well. (personally I&#039;m just used to using column headings)</description>
			<author>dummy@example.com (Tokyoj)</author>
			<pubDate>Wed, 28 Jan 2009 23:26:17 +0000</pubDate>
			<guid>http://www.jobberbase.com/forum/post3741.html#p3741</guid>
		</item>
		<item>
			<title>Re: Job statistics in the admin panel</title>
			<link>http://www.jobberbase.com/forum/post3739.html#p3739</link>
			<description>As it is is really cool, i dont believe you need  columns and the only thing could be
a sort by (combo) on the top page

Keep the good work pal!



[quote=putypuruty]Thanks for the feedback!

Would you find sortable columns useful? The jobs could also be sorted by creation time.

Where could we put the columns? Were you thinking about something like this:

job description | number of views | number of applicants | posted on | the icons for edit/delete/activate etc

What I wanted to point out with this example is that these 2 columns that you suggested would be placed between the job title and creation time.[/quote]</description>
			<author>dummy@example.com (elgreco)</author>
			<pubDate>Wed, 28 Jan 2009 19:56:25 +0000</pubDate>
			<guid>http://www.jobberbase.com/forum/post3739.html#p3739</guid>
		</item>
		<item>
			<title>Re: Job statistics in the admin panel</title>
			<link>http://www.jobberbase.com/forum/post3736.html#p3736</link>
			<description>Thanks for the feedback!

Would you find sortable columns useful? The jobs could also be sorted by creation time.

Where could we put the columns? Were you thinking about something like this:

job description | number of views | number of applicants | posted on | the icons for edit/delete/activate etc

What I wanted to point out with this example is that these 2 columns that you suggested would be placed between the job title and creation time.</description>
			<author>dummy@example.com (putypuruty)</author>
			<pubDate>Wed, 28 Jan 2009 16:37:54 +0000</pubDate>
			<guid>http://www.jobberbase.com/forum/post3736.html#p3736</guid>
		</item>
		<item>
			<title>Re: Job statistics in the admin panel</title>
			<link>http://www.jobberbase.com/forum/post3716.html#p3716</link>
			<description>Looks excellent. These would be nice to have...
- &#039;Viewed x Times&#039; in its own column
- &#039;No. of Applicants&#039; in its own column
- All columns sortable (A-&gt;B, B-&gt;A) using the column heading</description>
			<author>dummy@example.com (Tokyoj)</author>
			<pubDate>Tue, 27 Jan 2009 00:01:40 +0000</pubDate>
			<guid>http://www.jobberbase.com/forum/post3716.html#p3716</guid>
		</item>
		<item>
			<title>Job statistics in the admin panel</title>
			<link>http://www.jobberbase.com/forum/post3707.html#p3707</link>
			<description>Hi, guys!

I&#039;ve enhanced the administration section to show some job related statistics: number of views, number of applications, date of last application.

You have below a screenshot
[img]http://www.fileqube.com/hl/xgDZji1337706/admin_statistics.PNG[/img]

Please tell me what could be enhanced and I&#039;ll try to implement your requests.

Once I get some feedback, I&#039;ll put here a tutorial on how to integrate the changes in your site. :)</description>
			<author>dummy@example.com (putypuruty)</author>
			<pubDate>Mon, 26 Jan 2009 19:17:59 +0000</pubDate>
			<guid>http://www.jobberbase.com/forum/post3707.html#p3707</guid>
		</item>
	</channel>
</rss>
