Exemplo n.º 1
0
// (at your option) any later version.
// Help Center Live is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Help Center Live; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
// Contributors: Michael Bird
// File Comments:
// This file allows administration of the assigning of operators to departments
include_once '../class/include.php';
$inc = new Includer();
$inc->auth();
$inc->template();
$inc->assign();
// Check to see if the person is not logged in
$GLOBALS['auth']->check_logout();
// Define the three sets of links in the template
if ($GLOBALS['auth']->admin()) {
    $GLOBALS['template']->links('conf', 'conf');
} else {
    header('Location: ' . $GLOBALS['conf']['url'] . '/admin/index.php');
}
$GLOBALS['template']->assign('links_main', array(array('title' => $GLOBALS['lang']['view_all'], 'url' => $GLOBALS['conf']['url'] . '/admin/assigns.php'), array('title' => $GLOBALS['lang']['operators'], 'url' => $GLOBALS['conf']['url'] . '/admin/operators.php'), array('title' => $GLOBALS['lang']['departments'], 'url' => $GLOBALS['conf']['url'] . '/admin/departments.php')));
if (isset($_POST['edit'])) {
    $GLOBALS['template']->assign('text', $GLOBALS['lang']['assigns_updated']);
    $GLOBALS['assign']->delete_department(addslashes($_POST['id']));
    // Loop through all the posted variables. Ones that have their name and values as numbers
    // are departments being assigned
    foreach ($_POST as $key => $val) {