function deleteDepartments() { global $toC_Json, $osC_Language; $error = false; $batch = explode(',', $_REQUEST['batch']); foreach ($batch as $id) { if (!toC_Departments::delete($id)) { $error = true; break; } } if ($error === false) { $response = array('success' => true, 'feedback' => $osC_Language->get('ms_success_action_performed')); } else { $response = array('success' => false, 'feedback' => $osC_Language->get('ms_error_action_not_performed')); } echo $toC_Json->encode($response); }
* TomatoCart Open Source Shopping Cart Solution * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License v3 (2007) * as published by the Free Software Foundation. * * @package TomatoCart * @author TomatoCart Dev Team * @copyright Copyright (c) 2009 - 2012, TomatoCart. All rights reserved. * @license http://www.gnu.org/licenses/gpl.html * @link http://tomatocart.com * @since Version 1.1.8 * @filesource */ $departments = array(); $Qlisting = toC_Departments::getListing(); while ($Qlisting->next()) { $departments[] = array('id' => $Qlisting->value('departments_email_address'), 'text' => $Qlisting->value('departments_title')); $departments_description[$Qlisting->value('departments_email_address')] = $Qlisting->value('departments_description'); } ?> <?php if ($messageStack->size('contact') > 0) { echo $messageStack->output('contact'); } ?> <h1><?php echo $osC_Template->getPageTitle(); ?>