示例#1
0
            foreach ($ids as $id) {
                $blf->getByIdAndCompanyId($id, $current_company->getId());
                foreach ($blf as $branch) {
                    $branch->setDeleted($delete);
                    $branch->Save();
                }
            }
        }
        Redirect::Page(URLBuilder::getURL(NULL, 'BranchList.php'));
        break;
    default:
        $sort_array = NULL;
        if ($sort_column != '') {
            $sort_array = array(Misc::trimSortPrefix($sort_column) => $sort_order);
        }
        $blf = new BranchListFactory();
        $blf->GetByCompanyId($current_company->getId(), $current_user_prefs->getItemsPerPage(), $page, NULL, $sort_array);
        $pager = new Pager($blf);
        $branches = array();
        if ($blf->getRecordCount() > 0) {
            foreach ($blf as $branch) {
                $branches[] = array('id' => $branch->GetId(), 'status_id' => $branch->getStatus(), 'manual_id' => $branch->getManualID(), 'name' => $branch->getName(), 'city' => $branch->getCity(), 'province' => $branch->getProvince(), 'deleted' => $branch->getDeleted());
            }
        }
        $smarty->assign_by_ref('branches', $branches);
        $smarty->assign_by_ref('sort_column', $sort_column);
        $smarty->assign_by_ref('sort_order', $sort_order);
        $smarty->assign_by_ref('paging_data', $pager->getPageVariables());
        break;
}
$smarty->display('branch/BranchList.tpl');