putypuruty

Topic: Job statistics in the admin panel

Hi, guys!

I'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
http://www.fileqube.com/hl/xgDZji1337706/admin_statistics.PNG

Please tell me what could be enhanced and I'll try to implement your requests.

Once I get some feedback, I'll put here a tutorial on how to integrate the changes in your site. smile

Last edited by putypuruty (2009-01-26 19:20:25)

Tokyoj

Re: Job statistics in the admin panel

Looks excellent. These would be nice to have...
- 'Viewed x Times' in its own column
- 'No. of Applicants' in its own column
- All columns sortable (A->B, B->A) using the column heading

---------------
Tokyoj
"You can't build a reputation on what you're going to do." (Henry Ford)
"Insanity is doing the same thing over and over, expecting different results." (Albert Einstein)

putypuruty

Re: Job statistics in the admin panel

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.

elgreco

Re: Job statistics in the admin panel

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!

putypuruty wrote:

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.

Tokyoj

Re: Job statistics in the admin panel

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'm just used to using column headings)

---------------
Tokyoj
"You can't build a reputation on what you're going to do." (Henry Ford)
"Insanity is doing the same thing over and over, expecting different results." (Albert Einstein)

markk

Re: Job statistics in the admin panel

Hi, I am new to this forum, and I hope you don't think I'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

People who search for IT Jobs typically find Jobs in IT

putypuruty

Re: Job statistics in the admin panel

Hi, guys!

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

I'm describing here the steps needed to add this feature to an existing 1.6 jobberbase installation.

Important: make a backup of the affected files before proceeding

1. Open _includes/class.Job.php and:

- add

Code:
'views_count' => $this->mViewsCount,

before

Code:
'is_spotlight' => $this->mIsSpotlight);

(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 = 'SELECT job_id, count(id) numberOfApplications,  DATE_FORMAT(max(created_on), \'%d-%m-%Y %H:%i\') lastApplicationOn 
                FROM job_applications j 
                WHERE job_id in (' . $this->buildCommaSeparatedIDsString($jobIDs) . ') GROUP BY job_id'; 
        $result = $db->query($sql);
        
        while ($row = $result->fetch_assoc())
            $statisticalData[$row['job_id']] = $row;
            
        return $statisticalData;
    }
    
    private function buildCommaSeparatedIDsString($numbersArray)
    {
        $string = '';
        
        for ($i = 0; $i < count($numbersArray); $i++)
        {
            $string .= $numbersArray[$i];

            if ($i < count($numbersArray) - 1)
                $string .= ',';
        }
        
        return $string;
    }

2. replace /admin/page_category with http://jobberbase.googlecode.com/svn-hi … tegory.php
3. replace /admin/_templates/posts-loop.tpl with http://jobberbase.googlecode.com/svn-hi … s-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 wink