changed git call from https to git readonly
[atutor.git] / mods / job_board / admin / view_post.php
1 <?php
2 /***********************************************************************/
3 /* ATutor                                                                                                                          */
4 /***********************************************************************/
5 /* Copyright (c) 2002-2009                                                                                         */
6 /* Adaptive Technology Resource Centre / Inclusive Design Institute        */
7 /* http://atutor.ca                                                                                                        */
8 /*                                                                                                                                         */
9 /* This program is free software. You can redistribute it and/or           */
10 /* modify it under the terms of the GNU General Public License             */
11 /* as published by the Free Software Foundation.                                           */
12 /***********************************************************************/
13 // $Id$
14
15 define(AT_INCLUDE_PATH, '../../../include/');
16 include(AT_INCLUDE_PATH.'vitals.inc.php');
17 include(AT_JB_INCLUDE.'classes/Job.class.php');
18 $_custom_css = $_base_path . AT_JB_BASENAME . 'module.css'; // use a custom stylesheet
19
20 admin_authenticate(AT_ADMIN_PRIV_JOB_BOARD);
21
22 /* 
23  * Add the submenu on this page so that user can go back to the listing.
24  * Reason why this is not included in module.php is because we don't want the 
25  * 'view_post' submenu to show on job_board/index.php
26  */
27 $_pages[AT_JB_BASENAME.'index_admin.php']['children'] = array(AT_JB_BASENAME.'admin/view_post.php');
28
29 $jid = intval($_REQUEST['jid']);
30 $job = new Job();
31 $job_post = $job->getJob($jid);
32
33 if($_GET['action']=='delete'){
34         $hidden_vars['jid'] = $jid;
35         $job_post = $job->getJob($jid);
36         $msg->addConfirm(array('DELETE', $job_post['title']), $hidden_vars);
37 }
38 //handle delete 
39 if (isset($_POST['submit_no'])) {
40         $msg->addFeedback('CANCELLED');
41         header('Location: ../index_admin.php');
42         exit;
43 } else if (isset($_POST['submit_yes'])) {
44         $job->removeJob($jid);
45         $msg->addFeedback('JB_POST_DELETED');
46         header('Location: ../index_admin.php');
47         exit;
48 }
49
50 include(AT_INCLUDE_PATH.'header.inc.php');
51 $msg->printConfirm();
52 $savant->assign('job_obj', $job);
53 $savant->assign('job_post', $job_post);
54 $savant->display('jb_view_post.tmpl.php');
55 include(AT_INCLUDE_PATH.'footer.inc.php'); 
56 ?>