Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1488

Přidáno uživatelem David Raška před více než 12 roky(ů)

Upravy:
- Pridan export prihlasek clenu ve formatu HTML
- Pokus o zrychleni nacteni statistik provozu...asi zbytecny

Zobrazit rozdíly:

freenetis/branches/network/application/models/iface.php
* Link with given mediums which may conect interface with type given as key.
*
* @author Ondřej Fibich
* @var array
* @todo Michal must check this!!!
* @var array
*/
private static $type_has_link_with_medium = array
(
freenetis/branches/network/application/models/members_traffic.php
switch ($type)
{
case 'daily':
$group_by = 'GROUP BY day';
$group_by = 'GROUP BY TO_DAYS(day)';
break;
case 'weekly':
$group_by = 'GROUP BY WEEK(day)';
......
switch ($type)
{
case 'daily':
$group_by = 'GROUP BY member_id, day';
$group_by = 'GROUP BY member_id, TO_DAYS(day)';
break;
case 'weekly':
$group_by = 'GROUP BY member_id, WEEK(day), YEAR(day)';
......
switch ($type)
{
case 'daily':
$group_by = 'GROUP BY day';
$group_by = 'GROUP BY TO_DAYS(day)';
break;
case 'weekly':
$group_by = 'GROUP BY WEEK(day)';
......
switch ($type)
{
case 'daily':
$group_by = 'GROUP BY day';
$group_by = 'GROUP BY TO_DAYS(day)';
break;
case 'weekly':
$group_by = 'GROUP BY WEEK(day)';
......
$group_by = 'GROUP BY YEAR(day)';
break;
default:
$group_by = 'GROUP BY day';
$group_by = 'GROUP BY TO_DAYS(day)';
break;
}
......
switch ($type)
{
case 'daily':
$group_by = 'GROUP BY member_id, day';
$group_by = 'GROUP BY member_id, TO_DAYS(day)';
break;
case 'weekly':
$group_by = 'GROUP BY member_id, WEEK(day), YEAR(day)';
......
switch ($type)
{
case 'daily':
$group_by = 'GROUP BY day';
$group_by = 'GROUP BY TO_DAYS(day)';
break;
case 'weekly':
$group_by = 'GROUP BY WEEK(day)';
......
switch ($type)
{
case 'daily':
$group_by = 'GROUP BY day';
$group_by = 'GROUP BY TO_DAYS(day)';
break;
case 'weekly':
$group_by = 'GROUP BY WEEK(day)';
......
$group_by = 'GROUP BY YEAR(day)';
break;
default:
$group_by = 'GROUP BY day';
$group_by = 'GROUP BY TO_DAYS(day)';
break;
}
......
switch ($type)
{
case 'daily':
$group_by = 'GROUP BY day';
$group_by = 'GROUP BY TO_DAYS(day)';
break;
case 'weekly':
$group_by = 'GROUP BY WEEK(day)';
......
$group_by = 'GROUP BY YEAR(day)';
break;
default:
$group_by = 'GROUP BY day';
$group_by = 'GROUP BY TO_DAYS(day)';
break;
}
freenetis/branches/network/application/models/account.php
/**
* Recalculates all account balances.
*
* @todo EXPLAIN CREATING NEW DATABASE
* @author Jiri Svitak
* @return array[integer]
*/
freenetis/branches/network/application/models/account_attribute.php
const BANK_INTERESTS = '644000'; // created in installation
const MEMBER_FEES = '684000'; // created in installation
const TIME_DEPOSITS_INTERESTS = '655000';
const TIME_DEPOSITS = '259000';
/**
* The constructor is used for filling the double accounts numbers from the database.
* @todo: the public static constants listed above should be filled from the
* "config" database table, using the name of the constant.
* If a constant is not found in the table, its predefined value would be kept.
*/
//public function __construct() {}
const TIME_DEPOSITS = '259000';
/**
* Accounting system requires special query.
freenetis/branches/network/application/controllers/transfers.php
* Function edits double-entry transfers. They should not be edited.
* Wrong transfer should be solved by new transfer.
*
* @todo unused delete?
* @author Jiri Svitak
* @param integer $transfer_id
*/
freenetis/branches/network/application/controllers/members.php
->rules('required')
->options(array
(
'pdf' => 'PDF '.__('document')
'pdf' => 'PDF '.__('document'),
'html' => 'HTML'
));
$form->submit('Export');
......
*/
private function registration_html_export($member_id)
{
// no parameter
if (!isset($member_id))
Controller::warning(PARAMETER);
$member = new Member_Model($member_id);
// record doesn't exist
if ($member->id == 0)
Controller::error(RECORD);
// access control
if (!$this->acl_check_view(get_class($this), 'members', $member_id))
Controller::error(ACCESS);
// html head
$page = "<html>";
$page .= "<head>";
$page .= "<title>".__('export of registration').' - '.$member->name."</title>";
$page .= "</head>";
$page .= '<body style="font-size:14px">';
// -------------------- LOGO -------------------------------
$logo = Settings::get('registration_logo');
$page .= '<div style="width:18cm">';
if (file_exists($logo))
{
$page .= '<div style="float:left"><img src="'.substr($logo, strlen($_SERVER['DOCUMENT_ROOT'])).'" width=274 height=101></div>';
}
else //if logo doesn't exist, insert only blank div
{
$page .= '<div style="float:left" width=274 height=101>';
}
// --------------- INFO ABOUT ASSOCIATION -----------------
$page .= '<div style="float:right">';
$a_member = new Member_Model(1);
$bank_account_model = new Bank_account_Model();
$a_bank_account = $bank_account_model->get_assoc_bank_accounts()->current();
$page .= $a_member->name ."</br>";
$page .= __('organization identifier').
': '.$a_member->organization_identifier. "</br>";
$page .= __('account number').': '
.$a_bank_account->account_number. "</br>";
$page .= $a_member->address_point->street->street.' '.
$a_member->address_point->street_number. "</br>";
$page .= $a_member->address_point->town->zip_code .' '.
$a_member->address_point->town->town. "</br>";
$page .= '</div><div style="clear:both;text-align:center;font-weight:bold;margin:0px;">';
// --------------------- MAIN TITLE -------------------------
$page .= '<p style="font-size:1.5em">'.__('Request for membership'). ' – '
. __('registration in association')."</p>";
// --------------------- INFO -------------------------
$page .= '<span>'.$this->settings->get('registration_info').'</span>';
// ----------- TABLE WITH INFORMATION ABOUT MEMBER --------
$member_name = $member->name;
$street = $member->address_point->street->street.' '
.$member->address_point->street_number;
$town = $member->address_point->town->town;
if ($member->address_point->town->quarter != '')
$town .= '-'.$member->address_point->town->quarter;
$zip_code = $member->address_point->town->zip_code;
$variable_symbol_model = new Variable_Symbol_Model();
$account_model = new Account_Model();
$account_id = $account_model->where('member_id',$member_id)->find()->id;
$variable_symbols = array();
$var_syms = $variable_symbol_model->find_account_variable_symbols($account_id);
foreach ($var_syms as $var_sym)
{
$variable_symbols[] = $var_sym->variable_symbol;
}
$entrance_date = date::pretty($member->entrance_date);
$user_model = new User_Model();
$user = $user_model->where('member_id',$member_id)
->where('type',User_Model::MAIN_USER)
->find();
$emails = $user->get_user_emails($user->id);
$email = '';
if ($emails && $emails->current())
{
$email = $emails->current()->email;
}
$birthday = date::pretty($user->birthday);
$enum_type_model = new Enum_type_Model();
$types = $enum_type_model->get_values(Enum_type_Model::CONTACT_TYPE_ID);
$contact_model = new Contact_Model();
$contacts = $contact_model->find_all_users_contacts($user->id);
$phone_id = $enum_type_model->get_type_id('Phone');
$icq_id = $enum_type_model->get_type_id('ICQ');
$msn_id = $enum_type_model->get_type_id('MSN');
$jabber_id = $enum_type_model->get_type_id('Jabber');
$skype_id = $enum_type_model->get_type_id('Skype');
$phones = array();
$arr_contacts = array();
foreach ($contacts as $contact)
{
if ($contact->type == $phone_id)
{
$phones[] = $contact->value;
}
else if($contact->type == $icq_id OR
$contact->type == $msn_id OR
$contact->type == $jabber_id OR
$contact->type == $skype_id)
{
$arr_contacts[] = $types[$contact->type].': '.$contact->value;
}
}
$contact_info = implode('<br />', $arr_contacts);
$device_engineer_model = new Device_engineer_Model();
$device_engineers = $device_engineer_model->get_engineers_of_user($user->id);
$arr_engineers = array();
foreach ($device_engineers as $device_engineer)
{
$arr_engineers[] = $device_engineer->surname;
}
$engineers = (count($arr_engineers)) ? implode(', ',$arr_engineers) : $member->user->surname;
$subnet = new Subnet_Model();
$subnet = $subnet->get_subnet_of_user($user->id);
$subnet_name = isset($subnet->name) ? $subnet->name : '';
$tbl = '<table border="1" cellpadding="5" cellspacing="0" width="100%" style="font-size:14px;">';
$tbl .= "<tr>";
$tbl .= " <td><b>". __('name',NULL,1) .", ";
$tbl .= __('surname',NULL,1) .",<br /> ";
$tbl .= __('title',NULL,1) ."</b></td>";
$tbl .= " <td align=\"center\">$member_name</td>";
$tbl .= " <td><b>". __('email address') ."</b></td>";
$tbl .= " <td align=\"center\">$email</td>";
$tbl .= "</tr>";
$tbl .= "<tr>";
$tbl .= " <td><b>". __('address of connecting place',NULL,1);
$tbl .= "</b> (". strtolower(__('street',NULL,1)) .", ";
$tbl .= __('street_number',NULL,1) .", ";
$tbl .= __('zip code') .", ". __('town',NULL,1) .")</td>";
$tbl .= " <td align=\"center\">$street<br />$town<br />$zip_code</td>";
$tbl .= " <td><b>". __('id of member') ."</b><br /> (";
$tbl .= __('according to freenetis') .")</td>";
$tbl .= " <td align=\"center\">$member_id</td>";
$tbl .= "</tr>";
$tbl .= "<tr>";
$tbl .= " <td><b>". __('birthday',NULL,1) ."</b></td>";
$tbl .= " <td align=\"center\">$birthday</td>";
$tbl .= " <td><b>ICQ, Jabber, Skype, ". __('etc') ."…</b></td>";
$tbl .= " <td align=\"center\">$contact_info</td>";
$tbl .= "</tr>";
$tbl .= "<tr>";
$tbl .= " <td><b>".__('variable symbols',NULL,1) ."</b></td>";
$tbl .= " <td align=\"center\">".implode("<br />", $variable_symbols)."</td>";
$tbl .= " <td><b>". __('phones',NULL,1) ."<b/></td>";
$tbl .= " <td align=\"center\">".implode("<br />", $phones)."</td>";
$tbl .= "</tr>";
$tbl .= "<tr>";
$tbl .= " <td><b>".__('Subnet',NULL,1)."</b></td>";
$tbl .= " <td align=\"center\">$subnet_name</td>";
$tbl .= " <td></td>";
$tbl .= " <td align=\"center\"></td>";
$tbl .= "</tr>";
$tbl .= "<tr>";
$tbl .= " <td><b>". __('entrance date',NULL,1) ."</b></td>";
$tbl .= " <td align=\"center\">$entrance_date</td>";
$tbl .= " <td><b>". __('engineers',NULL,1) .":</b></td>";
$tbl .= " <td align=\"center\">$engineers</td>";
$tbl .= "</tr>";
$tbl .= "</table>";
$page .= $tbl;
$page .= '<div style="text-align:left">';
$page .= $this->settings->get('registration_license');
$page .= "</div>";
$page .= '<br><p style="text-align:right;font-size:1.1em">'.__('signature of applicant member').' : ........................................</p>';
$page .= '<p style="font-size:1.2em">'.__('decision Counsil about adoption of member').'</p>';
$page .= '<p style="text-align:left">'.__('Member adopted on').
': .........................................</p>';
$page .= '<p style="text-align:left">'.__('signature and stamp').
': .........................................</p>';
$page .= "</div></div>";
$page .= "</body>";
$page .= "</html>";
die($page);
}
/**

Také k dispozici: Unified diff