本文整理汇总了PHP中GroupManager::getEntryData方法的典型用法代码示例。如果您正苦于以下问题:PHP GroupManager::getEntryData方法的具体用法?PHP GroupManager::getEntryData怎么用?PHP GroupManager::getEntryData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GroupManager
的用法示例。
在下文中一共展示了GroupManager::getEntryData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowPriceclasses
/**
* Shows the Priceclasses
*/
function ShowPriceclasses()
{
require_once PATH_ACCESS . '/GroupManager.php';
try {
$groupManager = new GroupManager('groups');
} catch (Exception $e) {
$this->pcInterface->dieError($this->msg['err_fetch_groups'] . $e->getMessage());
}
try {
$priceclasses = $this->pcManager->getTableData();
} catch (Exception $e) {
$this->pcInterface->dieError($this->msg['err_fetch_priceclass'] . $e->getMessage());
}
foreach ($priceclasses as &$priceclass) {
try {
$group = $groupManager->getEntryData($priceclass['GID'], 'name');
} catch (MySQLVoidDataException $e) {
$priceclass['group_name'] = $this->msg['err'];
} catch (Exception $e) {
$this->pcInterface->dieError($this->msg['err_fetch_groups'] . $e->getMessage());
}
if (!$group) {
$priceclass['group_name'] = $this->msg['err'];
} else {
$priceclass['group_name'] = $group['name'];
}
}
$this->pcInterface->ShowPriceclasses($priceclasses);
}
示例2: ShowOrders
/**
*shows the orders in a table
*/
function ShowOrders()
{
require_once PATH_ACCESS . '/OrderManager.php';
require_once PATH_ACCESS . '/MealManager.php';
require_once PATH_ACCESS . '/UserManager.php';
require_once PATH_ACCESS . '/GroupManager.php';
require_once PATH_ACCESS . '/GlobalSettingsManager.php';
if (!isset($_POST['ordering_day']) or !isset($_POST['ordering_month']) or !isset($_POST['ordering_year'])) {
//Select the date of the orders that should be displayed
$today = array('day' => date('d'), 'month' => date('m'), 'year' => date('Y'));
$this->mealInterface->ShowOrdersSelectDate($today);
} else {
//Show the Orders
$user_manager = new UserManager();
$groupManager = new GroupManager();
$mysql_orders = array();
$order = array();
if ($_POST['ordering_day'] > 31 or $_POST['ordering_month'] > 12 or $_POST['ordering_year'] < 2000 or $_POST['ordering_year'] > 3000) {
$this->mealInterface->dieError($this->msg['err_inp_date']);
}
$date = $_POST['ordering_year'] . '-' . $_POST['ordering_month'] . '-' . $_POST['ordering_day'];
try {
$orders = $this->orderManager->getAllOrdersAt($date);
} catch (MySQLVoidDataException $e) {
$this->mealInterface->dieError($this->msg['err_no_orders']);
} catch (MySQLConnectionException $e) {
$this->mealInterface->dieError($e->getMessage());
}
if (!count($orders)) {
$this->mealInterface->dieError($this->msg['err_no_orders']);
}
foreach ($orders as &$order) {
if (!count($meal_data = $this->mealManager->getEntryData($order['MID'], 'name')) or !count($user_data = $user_manager->getEntryData($order['UID'], 'name', 'forename', 'GID'))) {
$this->mealInterface->dieError($this->msg['err_order_database']);
} else {
$order['meal_name'] = $meal_data['name'];
$order['user_name'] = $user_data['forename'] . ' ' . $user_data['name'];
if (!$order['fetched']) {
$order['is_fetched'] = $this->msg['order_not_fetched'];
} else {
$order['is_fetched'] = $this->msg['order_fetched'];
}
}
}
//--------------------
//Count all Orders
$num_orders = array();
$mealIdArray = $this->mealManager->GetMealIdsAtDate($date);
$counter = 0;
foreach ($mealIdArray as $mealIdEntry) {
$groups = array();
//to show how many from different groups ordered something
$sp_orders = $this->orderManager->getAllOrdersOfMealAtDate($mealIdEntry['MID'], $date);
$num_orders[$counter]['MID'] = $mealIdEntry['MID'];
$num_orders[$counter]['name'] = $this->mealManager->GetMealName($mealIdEntry['MID']);
$num_orders[$counter]['number'] = count($sp_orders);
//--------------------
//Get specific Usergroups for Interface
foreach ($sp_orders as $sp_order) {
$user = $user_manager->getEntryData($sp_order['UID'], 'GID');
$sql_group = $groupManager->getEntryData($user['GID'], 'name');
$group_name = $sql_group['name'];
if (count($groups)) {
$is_new_group = true;
foreach ($groups as &$group) {
if (isset($group['name']) && $group['name'] == $group_name) {
$group['counter'] += 1;
$is_new_group = false;
continue;
}
}
if ($is_new_group) {
$group_arr = array('name' => $group_name, 'counter' => 1);
$groups[] = $group_arr;
}
} else {
//no group defined yet
$group_arr = array('name' => $group_name, 'counter' => 1);
$groups[] = $group_arr;
}
}
//--------------------
$num_orders[$counter]['user_groups'] = $groups;
$counter++;
}
/**
* Sort the Orders
*/
foreach ($orders as &$order) {
$meals[$order['meal_name']][] = $order;
}
//sorting by usernames
foreach ($meals as $meal) {
foreach ($meal as $order) {
$temp[] = $order['user_name'];
}
sort($temp);
//.........这里部分代码省略.........