本文整理汇总了PHP中type_to_str函数的典型用法代码示例。如果您正苦于以下问题:PHP type_to_str函数的具体用法?PHP type_to_str怎么用?PHP type_to_str使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了type_to_str函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: loadResults
/**
* Метод загрузки данных
*
* @param Sppc_Dashboard_DateRange $range
*/
protected function loadResults(Sppc_Dashboard_DateRange $range, $sortField = '', $sortDirection = '')
{
// Подключаем объект фидов
$this->CI->load->model('feeds');
/* @var $feeds Feeds */
$feeds = $this->CI->feeds;
if (empty($sortField)) {
$sortField = $this->getSortField();
}
if (empty($sortDirection)) {
$sortDirection = $this->getSortDirection();
}
// Формируем колонки
$this->addColumn('name', 'Feed Name');
$this->addColumn('impressions', 'Impressions', 'numeric', 'desc');
$this->addColumn('clicks', 'Clicks', 'numeric', 'desc');
$this->addColumn('ctr', '% CTR', 'numeric', 'desc');
$this->addColumn('revenue', 'Earnings', 'numeric', 'desc');
// Получаем данные по фидам
$rowsData = $feeds->top($sortField, $sortDirection, array('from' => $range->getUnixStartDate(), 'to' => $range->getUnixEndDate()));
foreach ($rowsData as $data) {
$rowData = array(type_to_str($data['title'], 'encode'), type_to_str($data['impressions'], 'integer'), type_to_str($data['clicks'], 'integer'), type_to_str($data['ctr'], 'procent'), type_to_str($data['revenue'], 'money'));
$this->addRow($rowData);
}
// Устанавливаем title
$this->title = sprintf(__('Top Feeds (%d)'), count($rowsData));
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:32,代码来源:AdminTopFeeds.php
示例2: index
/**
* функция по умолчанию
*
* @return ничего не возвращает
*/
public function index()
{
$this->load->model('groups', '', TRUE);
$this->groups->end_fl_status();
if (is_null($this->id_campaign)) {
if (is_null($this->id_group)) {
$usercode = type_to_str($this->user_id, 'textcode');
$node = 'user' . $usercode;
$startitem = "show_campaigns('{$usercode}');";
} else {
$node = 'group' . $this->id_group;
$id_campaign_type = $this->groups->group_type(type_cast($this->id_group, 'textcode'));
$startitem = "show_ads('{$this->id_group}', '', '{$id_campaign_type}');";
}
} else {
$node = 'camp' . $this->id_campaign;
$id_campaign = type_cast($this->id_campaign, 'textcode');
$id_campaign_type = $this->groups->campaign_type($id_campaign);
$startitem = "show_groups('{$this->id_campaign}', '{$id_campaign_type}');";
}
$vars = array('TREE' => $this->groups->get_html_tree($this->user_id, $this->user_name), 'TABLE' => 'table', 'STARTITEM' => $startitem, 'NODE' => $node, 'TAB' => $this->tab, 'NUMBERFORMAT' => get_number_format());
$vars['PLUGIN_COLOR_HINT'] = implode($this->plugins->run('get_colors_hint_html', $this));
$vars['PLUGIN_JS_FUNCTIONS'] = implode($this->plugins->run('get_js_functions_html', $this));
$plugin_controller = '';
foreach ($this->plugins->run('get_controller', $this) as $controllers) {
foreach ($controllers as $id_campaign_type => $return_value) {
$plugin_controller .= " case '{$id_campaign_type}': return {$return_value}; ";
}
}
$vars['PLUGIN_CONTROLLER'] = $plugin_controller;
$this->_set_content($this->parser->parse('advertiser/manage_ads/template.html', $vars, TRUE));
$this->_display();
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:38,代码来源:manage_ads.php
示例3: get_list
/**
* возвращает список выплат
*
* @param array параметры списка выплат
* int id_entity идентификатор сущности, которой выплачивались деньги, - опционально
* array flow_program фильтр по типам денежных потоков, - опционально
* array fields поля БД для запроса списка - опционально
* array order ('by' => 'field', 'direction' => 'asc') параметры сортировки списка - опционально
* array date_range ('from' => unixtimestamp, 'to' => unixtimestamp) фильтр по дате выплаты - опционально
* int id_gateway фильтр по платежным шлюзам - опционально (0 - все шлюзы)
* @return array
*/
public function get_list($params)
{
$result = array();
if (isset($params['id_entity'])) {
$this->db->where('id_entity_receipt', $params['id_entity']);
}
if (isset($params['id_gateway'])) {
if ($params['id_gateway']) {
$this->db->where('payment_gateways.id_entity', $params['id_gateway']);
}
}
if (isset($params['flow_program'])) {
$this->db->where_in('flow_program', $params['flow_program']);
}
if (isset($params['fields'])) {
$this->db->select($params['fields']);
}
if (isset($params['order'])) {
$this->db->order_by($params['order']['by'], $params['order']['direction']);
}
if (isset($params['date_range'])) {
$this->db->where(array('flow_date >=' => type_to_str($params['date_range']['from'], 'databasedatetime'), 'flow_date <=' => type_to_str($params['date_range']['to'], 'databasedatetime')));
}
$this->db->join('money_flows', self::TABLE . '.id_flow = money_flows.id_flow')->join('payment_gateways', 'money_flows.id_entity_expense = payment_gateways.id_entity')->join('entities', 'payment_gateways.id_entity = entities.id_entity')->join('entities pe', 'money_flows.id_entity_receipt = pe.id_entity')->join('payment_requests', 'money_flows.id_flow = payment_requests.id_flow', 'left');
$query = $this->db->get(self::TABLE);
//echo $this->db->last_query();
foreach ($query->result() as $row) {
//$ids[] = $row->id_entity_receipt;
$result[] = $row;
}
return $result;
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:44,代码来源:gateway_payments.php
示例4: getContent
/**
* @see Sppc_Dashboard_Block_Interface::getContent
*
* @param Sppc_Dashboard_DateRange $range
* @return string
*/
public function getContent(Sppc_Dashboard_DateRange $range)
{
// Получаем заработок за период
$this->CI->load->model('entity');
$stat = $this->CI->entity->publisher_range_stat(array('from' => mktime(0, 0, 0), 'to' => time()));
// Выводим
$data = array('REVENUE' => type_to_str($stat['revenue'], 'money'));
return $this->CI->parser->parse('common/dashboard/today_earnings.html', $data, true);
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:15,代码来源:TodayEarnings.php
示例5: index
public function index()
{
$this->load->model('ads', '', TRUE);
$this->load->model('groups', '', TRUE);
$id_ad = $this->input->post('id');
if ($id_ad) {
$id_ad_decoded = type_cast($id_ad, 'textcode');
$this->load->model('ads', '', TRUE);
$id_group_decoded = $this->ads->group($id_ad_decoded);
$group_code = type_to_str($id_group_decoded, 'textcode');
$this->id_group = $group_code;
} else {
$this->load->model('new_campaign');
$this->new_campaign->free_storage($this->id_xml);
$this->session->unset_userdata('id_xml');
}
$id_group = $this->input->post('id_group');
if (isset($id_ad_decoded)) {
$this->img_src = $this->ads->image($id_ad_decoded, TRUE);
$this->img_dim = $this->ads->get_ad_dimensions($id_ad_decoded);
}
if ($id_group) {
$id_group_decoded = type_cast($id_group, 'textcode');
$group_code = type_to_str($id_group_decoded, 'textcode');
$this->id_group = $id_group;
}
$campaign_name = type_to_str($this->groups->parent_campaign($id_group_decoded), 'encode');
$id_campaign = type_to_str($this->groups->id_parent_campaign($id_group_decoded), 'textcode');
$group_name = type_to_str($this->groups->name($id_group_decoded), 'encode');
$this->cancel_creation_controller = "advertiser/manage_ads/group/{$group_code}/ads";
if ($id_ad) {
$this->next_step = 'advertiser/create_ad/success/' . $group_code . '/true';
} else {
$this->next_step = 'advertiser/create_ad/success/' . $group_code . '/false';
}
$this->upload_controller = "advertiser/create_ad/upload_image/{$group_code}";
$this->form_title = '<a href="<%SITEURL%><%INDEXPAGE%>advertiser/manage_ads">{@Manage Ads@}</a> → ' . '<a href="advertiser/manage_ads/campaign/' . $id_campaign . '">{@Campaign@}:</a> <span class="green i">„' . $campaign_name . '“</span> → ' . '<a href="<%SITEURL%><%INDEXPAGE%>advertiser/manage_ads/group/' . $group_code . '/ads">{@Group@}:</a> <span class="green i">„' . $group_name . '“</span> → ';
if ($id_ad) {
$ad_info = $this->ads->get($id_ad_decoded);
if ($ad_info['ad_type'] == 'richmedia') {
$ad_info['title'] = __('Rich Media Ad');
}
$this->ad_id = $id_ad;
$this->form_title .= __('Edit Ad') . ': <span class="green i">„' . type_to_str($ad_info['title'], 'encode') . '“</span>';
$this->image_dir = $this->config->item('path_to_images');
} else {
$this->form_title .= __('Create Ad');
}
parent::index('create_ad');
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:50,代码来源:create_ad.php
示例6: Account_settings
/**
* конструктор класса,
* вносит изменения в структуру базового класса
*
* @return ничего не возвращает
*/
public function Account_settings()
{
parent::Parent_entity();
$this->form_data["id"] = $this->user_id;
$this->form_data["kill"] = array("terms_and_conditions", "confirm_password", "cancel_button");
$this->form_data["redirect"] = "advertiser/account_settings/success";
unset($this->form_data["fields"]["confirm"]);
$this->button_name = "{@Update Account@}";
$this->content['SROLE'] = $this->role;
$this->content['CODE'] = type_to_str($this->user_id, 'textcode');
$this->content["CANCEL"] = $this->site_url . $this->index_page . "advertiser/account_settings";
$this->content["INFO"] = $this->load->view("advertiser/account_settings/info.html", "", TRUE);
$this->_set_title(implode(self::TITLE_SEP, array(__("Advertiser"), __("Account Settings"))));
$this->_set_help_index("advertiser_account_settings");
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:21,代码来源:account_settings.php
示例7: index
public function index($group_code = FALSE, $program_type = null)
{
$this->set_campaign_type('edit_channels');
$this->setCurrentStep('/advertiser/edit_channels');
$this->load->model('groups', '', TRUE);
$code = $this->input->post('group');
if (FALSE === $code) {
$code = $group_code;
} else {
//Если код группы есть в POST, то на страницу пришли из раздела Manage Ads (производим очистку XML)
$this->new_campaign->free_storage($this->id_xml);
$this->id_xml = uniqid();
$this->session->set_userdata('id_xml', $this->id_xml);
}
if (2 == $this->new_campaign->init_storage($this->id_xml)) {
//на первом шаге создаем xml-файл и наполняем его данными выбранной группы
$id_group = type_cast($code, 'textcode');
//$this->new_campaign->free_storage($this->id_xml);
//$this->new_campaign->init_storage($this->id_xml);
$this->new_campaign->set_group_name($code);
/*$channels = $this->groups->get_channels($id_group);
foreach ($channels as $channel) {
$this->new_campaign->add_channel($channel);
}*/
$this->new_campaign->set_program_type($program_type);
$site_channels = $this->groups->get_site_channels($id_group, false);
foreach ($site_channels as $site_channel) {
$this->new_campaign->add_site_channel($site_channel);
}
$this->new_campaign->apply_sites_channels();
$frequency_coup = $this->groups->get_frequency_coup($id_group);
$this->new_campaign->set_daily_impressions($frequency_coup > 0 ? $frequency_coup : '');
$this->new_campaign->save_data();
} else {
//на остальных шагах работаем с xml-файлом
//$this->new_campaign->init_storage($this->id_xml);
$code = $this->new_campaign->get_group_name();
$id_group = type_cast($code, 'textcode');
}
$this->cancel_creation_controller = 'advertiser/manage_ads/group/' . $code . '/channels';
$this->load->model('campaigns', '', TRUE);
$campaign_name = type_to_str($this->groups->parent_campaign($id_group), 'encode');
$id_campaign = type_to_str($this->groups->id_parent_campaign($id_group), 'textcode');
$group_name = type_to_str($this->groups->name($id_group), 'encode');
$group_code = type_to_str($id_group, 'textcode');
$this->form_title = '<h1><a href="<%SITEURL%><%INDEXPAGE%>advertiser/manage_ads">{@Manage Ads@}</a> → ' . '<a href="<%SITEURL%><%INDEXPAGE%>advertiser/manage_ads/campaign/' . $id_campaign . '">{@Campaign@}:</a> <span class="green i">„' . $campaign_name . '“</span> → ' . '<a href="<%SITEURL%><%INDEXPAGE%>advertiser/manage_ads/group/' . $group_code . '/channels">{@Group@}:</a> <span class="green i">„' . $group_name . '“</span></h1>';
parent::index('edit_channels');
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:48,代码来源:edit_channels.php
示例8: index
public function index()
{
$this->load->model('groups', '', TRUE);
$this->new_campaign->init_storage($this->id_xml);
$code = $this->new_campaign->get_group_name();
$this->id_group = type_cast($code, 'textcode');
$this->cancel_creation_controller = 'advertiser/manage_ads/group/' . $code . '/channels';
$this->load->model('campaigns', '', TRUE);
$campaign_name = type_to_str($this->groups->parent_campaign($this->id_group), 'encode');
$id_campaign = type_to_str($this->groups->id_parent_campaign($this->id_group), 'textcode');
$group_name = type_to_str($this->groups->name($this->id_group), 'encode');
$group_code = type_to_str($this->id_group, 'textcode');
$this->form_title = '<h1><a href="<%SITEURL%><%INDEXPAGE%>advertiser/manage_ads">{@Manage Ads@}</a> → ' . '<a href="<%SITEURL%><%INDEXPAGE%>advertiser/manage_ads/campaign/' . $id_campaign . '">{@Campaign@}:</a> <span class="green i">„' . $campaign_name . '“</span> → ' . '<a href="<%SITEURL%><%INDEXPAGE%>advertiser/manage_ads/group/' . $group_code . '/channels">{@Group@}:</a> <span class="green i">„' . $group_name . '“</span></h1>';
$this->next_step = 'advertiser/edit_set_pricing/success/' . $code;
parent::index('edit_channels');
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:16,代码来源:edit_set_pricing.php
示例9: _create
/**
* отправляет письмо
*
* @param array $fields массив со значениями полей формы
* @return string при успехе - пустая строка, иначе текст ошибки
*/
public function _create($fields)
{
$title = $this->global_variables->get('SiteName');
$CI =& get_instance();
$CI->load->library('email');
$config['charset'] = 'utf-8';
$config['wordwrap'] = FALSE;
$CI->email->initialize($config);
$CI->email->from($fields['e_mail'], type_to_str($fields['name'], 'mime'));
$CI->email->to($this->global_variables->get("SystemEMail"));
$subject = $title . ' ' . __('Contact Us Message');
$CI->email->subject(type_to_str($subject, 'mime'));
$CI->email->message($fields['message']);
$CI->email->send();
$this->global_variables->set('MsgID_' . $this->messageid, 'true', 0);
return "";
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:23,代码来源:contact_us.php
示例10: loadResults
/**
* Метод загрузки данных
*
* @param Sppc_Dashboard_DateRange $range
*/
protected function loadResults(Sppc_Dashboard_DateRange $range)
{
// Получаем данные за период
$this->CI->load->model('entity');
$stat = $this->CI->entity->publisher_range_stat(array('from' => $range->getUnixStartDate(), 'to' => $range->getUnixEndDate()));
// Формируем строки для отображения
$this->addRow(__('Total Earnings'), type_to_str($stat['revenue'], 'money'));
$this->addRow(__('Total Impressions'), type_to_str($stat['impressions'], 'integer'));
$this->addRow(__('Total Clicks'), type_to_str($stat['clicks'], 'integer'));
$this->addRow(__('CTR'), type_to_str($stat['ctr'], 'procent'));
// add additional summary performance fields from plugins
foreach ($this->_hooks as $hookObj) {
$fields = $hookObj->addSummaryPerformanceFields($stat);
foreach ($fields as $field) {
$this->addRow($field['title'], $field['value']);
}
}
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:23,代码来源:Publisher.php
示例11: _load
public function _load($id)
{
$fields = array();
$id_campaign = type_cast($id, 'textcode');
$this->load->model('campaigns', '', TRUE);
$info = $this->campaigns->info($id_campaign);
$fields['campaign_name'] = $info['name'];
$fields['targeting_type'] = $info['targeting_type'];
$fields['id_targeting_group'] = type_to_str($info['id_targeting_group'], 'textcode');
$this->load->model('targeting_groups');
$id_targeting_group_temp = $this->targeting_groups->copy($info['id_targeting_group']);
//echo $info['id_targeting_group'];
$fields['id_targeting_group_temp'] = type_to_str($id_targeting_group_temp, 'textcode');
$targeting_info = new Campaign_Targeting();
$targeting_group_countries = $this->targeting_groups->get_group_list($info['id_targeting_group'], 'countries');
foreach ($targeting_group_countries as $country) {
$targeting_info->countries[] = $country['value'];
}
if (0 == count($targeting_info->countries)) {
foreach ($this->targeting_all_list->countries as $iso => $country) {
$targeting_info->countries[] = $iso;
}
}
$targeting_group_languages = $this->targeting_groups->get_group_list($info['id_targeting_group'], 'languages');
foreach ($targeting_group_languages as $language) {
$targeting_info->languages[] = $language['value'];
}
if (0 == count($targeting_info->languages)) {
foreach ($this->targeting_all_list->languages as $iso => $language) {
$targeting_info->languages[] = $iso;
}
}
$fields['targeting'] = json_encode($targeting_info);
$id_schedule = $this->campaigns->schedule($id_campaign);
$schedule = new Campaign_Schedule();
$schedule->schedule_is_set = !is_null($id_schedule);
if (!is_null($id_schedule)) {
$schedule->schedule = $this->schedule->get($id_schedule);
}
$fields['schedule'] = json_encode($schedule);
return $fields;
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:42,代码来源:edit_campaign.php
示例12: loadResults
/**
* Метод загрузки данных
*
* @param Sppc_Dashboard_DateRange $range
*/
protected function loadResults(Sppc_Dashboard_DateRange $range)
{
// Получаем новости
$this->CI->load->model('admin_news');
$need_update = time() - $this->CI->global_variables->get('orbitscripts_news_time') > 60 * 60 * 12;
if ($need_update) {
$xml_file = $this->CI->global_variables->get('orbitscripts_news_xml');
$this->CI->load->model('orbit_news', '', TRUE);
$rez = $this->CI->orbit_news->parse_xml($xml_file);
if (is_null($rez)) {
$this->CI->global_variables->set('orbitscripts_news_time', time());
}
}
$news = $this->CI->admin_news->get_admin_news();
// Добавляем новости для вывода
foreach ($news as $row) {
$rowData = array('date' => type_to_str($row['date'], 'mysqldate'), 'title' => type_to_str($row['title'], 'encode'), 'description' => nl2br($row['content']), 'link' => $row['link']);
$this->addRow($rowData);
}
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:25,代码来源:Orbitscripts.php
示例13: index
/**
* показывает форму для изменения настроек или результат изменения настроек
*
* @return ничего не возвращает
*/
public function index()
{
$this->load->model('ourdatabaseevo');
$this->load->library('Plugins', array('path' => array('admin', 'system_settings'), 'interface' => 'Sppc_Admin_SystemSettings_Interface'));
/**
* Добавляет Display 'Your Ad Here' link:
*
* @return ничего не возвращает
*/
$your_ad_here_file = APPPATH . 'views/admin/system_settings/your_ad_here.html';
if (file_exists($your_ad_here_file)) {
$your_ad_here = $this->load->view('admin/system_settings/your_ad_here.html', '', TRUE);
} else {
$your_ad_here = '';
}
$afile = APPPATH . 'views/admin/system_settings/approve_advertisers.html';
if (file_exists($afile)) {
$advsignup = $this->load->view('admin/system_settings/approve_advertisers.html', '', TRUE);
} else {
$advsignup = '';
}
$pfile = APPPATH . 'views/admin/system_settings/approve_publishers.html';
if (file_exists($pfile)) {
$pubsignup = $this->load->view('admin/system_settings/approve_publishers.html', '', TRUE);
} else {
$pubsignup = '';
}
$mfile = APPPATH . 'views/admin/system_settings/approve_members.html';
if (file_exists($mfile)) {
$memsignup = $this->load->view('admin/system_settings/approve_members.html', '', TRUE);
} else {
$memsignup = '';
}
$form = array("id" => $this->user_id, "name" => "system_settings", "view" => "admin/system_settings/form.html", 'redirect' => 'admin/system_settings/success', 'vars' => array('USERIDCODE' => type_to_str($this->user_id, 'textcode'), 'YOUR_AD_HERE' => $your_ad_here, 'PUBSIGNUP' => $pubsignup, 'ADVSIGNUP' => $advsignup, 'MEMSIGNUP' => $memsignup, 'ADDITIONAL_SETTINGS' => ''), "fields" => array("mail" => array("display_name" => "Administrator E-mail", "id_field_type" => "string", "form_field_type" => "text", "validation_rules" => "required|valid_email"), "reserve" => array("id_field_type" => "bool", "form_field_type" => "checkbox"), "campaigns" => array("id_field_type" => "bool", "form_field_type" => "checkbox"), "signup" => array("id_field_type" => "bool", "form_field_type" => "checkbox"), "pubsignup" => array("id_field_type" => "bool", "form_field_type" => "checkbox"), "memsignup" => array("id_field_type" => "bool", "form_field_type" => "checkbox"), "title" => array("display_name" => "System Title", "id_field_type" => "string", "form_field_type" => "text", "validation_rules" => "required"), "show_your_ad_here_link" => array("display_name" => "Show 'Your Ad Here' link", "id_field_type" => "bool", "form_field_type" => "checkbox"), "your_ad_here_link_text" => array("display_name" => "'Your Ad Here' link text", "id_field_type" => "string", "form_field_type" => "text", "max" => 15)));
$this->plugins->run('registerFieldsForAdditionalSettings', $form);
$additionalSettings = $this->plugins->run('getAdditionalSettingsHTML', null);
$form['vars']['ADDITIONAL_SETTINGS'] = implode(' ', $additionalSettings);
$this->load->library("form");
$this->_set_content($this->form->get_form_content("modify", $form, $this->input, $this));
$this->_display();
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:46,代码来源:system_settings.php
示例14: loadResults
/**
* Метод загрузки данных
*
* @param Sppc_Dashboard_DateRange $range
*/
protected function loadResults(Sppc_Dashboard_DateRange $range, $sortField = '', $sortDirection = '')
{
// Подключаем нужный объект
$this->CI->load->model('entity');
/* @var $entities Entity */
$entities = $this->CI->entity;
if (empty($sortField)) {
$sortField = $this->getSortField();
}
if (empty($sortDirection)) {
$sortDirection = $this->getSortDirection();
}
// Формируем колонки
$this->addColumn('name', 'Advertiser');
$this->addColumn('impressions', 'Impressions', 'numeric', 'desc');
$this->addColumn('clicks', 'Clicks', 'numeric', 'desc');
$this->addColumn('ctr', '% CTR', 'numeric', 'desc');
$this->addColumn('revenue', 'Earnings', 'numeric', 'desc');
// add additional columns from plugins
foreach ($this->_hooks as $hookObj) {
$columns = $hookObj->addColumns($this);
foreach ($columns as $column) {
$this->addColumn($column['name'], $column['title'], $column['type'], $column['order']);
}
}
// Получаем данные по фидам
$rowsData = $entities->top_advertisers($sortField, $sortDirection, array('from' => $range->getUnixStartDate(), 'to' => $range->getUnixEndDate()));
foreach ($rowsData as $idEntity => $data) {
$code = type_to_str($idEntity, 'textcode');
$rowData = array(type_to_str($data['name'], 'encode') . " ({$data['email']})", type_to_str($data['impressions'], 'integer'), type_to_str($data['clicks'], 'integer'), type_to_str($data['ctr'], 'procent'), type_to_str($data['revenue'], 'money'));
// add data for addtional columns from plugins
foreach ($this->_hooks as $hookObj) {
$rowData = $hookObj->addColumnsData($data, $rowData);
}
$this->addRow($rowData);
}
// Устанавливаем title
$this->title = sprintf(__('Top Advertisers (%d)'), count($rowsData));
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:44,代码来源:AdminTopAdvertisers.php
示例15: index
/**
* Отображение формы изменения баланса сущности
*
*/
public function index()
{
$error_message = '';
$code = $this->input->post('balance_code');
if (!$code) {
$error_message = 'Advertiser is not specified!';
$data = array('MESSAGE' => __($error_message), 'REDIRECT' => $this->site_url . $this->index_page . $this->role . '/manage_advertisers');
$content = $this->parser->parse('common/errorbox.html', $data, FALSE);
$this->_set_content($content);
$this->_display();
return NULL;
}
$id_entity = type_cast($code, 'textcode');
$entity_info = $this->entity->get_name_and_mail($id_entity);
$entity_info = $entity_info->name . ' (' . $entity_info->e_mail . ')';
$balance = $this->entity->ballance($id_entity);
$balance = type_to_str($balance, 'money');
$this->load->model('campaigns', '', TRUE);
$form = array('id' => $code, 'name' => 'balance_form', 'redirect' => "admin/change_" . $this->subject_role . "_balance/success", 'view' => "admin/change_balance/form.html", 'vars' => array('ENTITY' => $entity_info, 'CUR' => $balance, 'CANCEL_URL' => $this->cancel_url, 'PREV_TITLE' => $this->prev_title), 'fields' => array('amount' => array('display_name' => __('Amount'), 'id_field_type' => 'money', 'form_field_type' => 'text', 'validation_rules' => 'required|callback_valuetrim|float|positive'), 'balance_code' => array('id_field_type' => 'string', 'form_field_type' => 'hidden', 'default' => $code), 'balance_mode' => array('id_field_type' => 'string', 'form_field_type' => 'select', 'options' => array('add' => __('Add'), 'sub' => __('Subtract')), 'default' => 'add')));
$this->_set_content($this->form->get_form_content('modify', $form, $this->input, $this));
$this->_display();
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:26,代码来源:change_balance.php
示例16: loadResults
/**
* Метод загрузки данных
*
* @param Sppc_Dashboard_DateRange $range
*/
protected function loadResults(Sppc_Dashboard_DateRange $range, $sortField = '', $sortDirection = '')
{
// Подключаем нужный объект
$this->CI->load->model('site');
/* @var $sites Site */
$sites = $this->CI->site;
if (empty($sortField)) {
$sortField = $this->getSortField();
}
if (empty($sortDirection)) {
$sortDirection = $this->getSortDirection();
}
// Формируем колонки
$this->addColumn('name', 'Site Name');
$this->addColumn('impressions', 'Impressions', 'numeric', 'desc');
$this->addColumn('clicks', 'Clicks', 'numeric', 'desc');
$this->addColumn('ctr', '% CTR', 'numeric', 'desc');
$this->addColumn('revenue', 'Earnings', 'numeric', 'desc');
// add additional columns from plugins
foreach ($this->_hooks as $hookObj) {
$columns = $hookObj->addColumns($this);
foreach ($columns as $column) {
$this->addColumn($column['name'], $column['title'], $column['type'], $column['order']);
}
}
// Получаем данные по фидам
$rowsData = $sites->top(null, $sortField, $sortDirection, array('from' => $range->getUnixStartDate(), 'to' => $range->getUnixEndDate()));
foreach ($rowsData as $data) {
$code = type_to_str($data['id_publisher'], 'textcode');
$rowData = array(limit_str_and_hint($data['name'], 20) . " (<a target='_blank' href='http://{$data['url']}'>{$data['url']}</a>)", type_to_str($data['impressions'], 'integer'), type_to_str($data['clicks'], 'integer'), type_to_str($data['ctr'], 'procent'), type_to_str($data['revenue'], 'money'));
// add data for addtional columns from plugins
foreach ($this->_hooks as $hookObj) {
$rowData = $hookObj->addColumnsData($data, $rowData);
}
$this->addRow($rowData);
}
// Устанавливаем title
$this->title = sprintf(__('Top Sites (%d)'), count($rowsData));
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:44,代码来源:AdminTopSites.php
示例17: total
/**
* возвращает количество рекламодателей, попадающих под указанный фильтр
*
* @param string $filt фильтр по статусу
* @param array $range массив с двумя датами - начала и конце периода ('from', 'to')
* @param string $quickSearch Параметр для поиска рекламодателя по id, fullname, email и join date
* @return integer количество
*/
public function total($filt, $range, $quickSearch = '')
{
$total = array('cnt' => 0, 'balance' => 0, 'impressions' => 0, 'clicks' => 0, 'spent' => 0, 'bonus' => 0);
// All pages total
$sql = "\n \tSELECT \n \t\tSUM(sa.impressions) AS impressions,\n \t\tSUM(sa.clicks) AS clicks,\n \t\tSUM(sa.spent) AS spent,\n \t\tSUM(e.bonus) AS bonus\n \tFROM advertisers a\n \t\tJOIN entities e ON a.id_entity_advertiser = e.id_entity\n \t\tJOIN entity_roles er ON (er.id_entity = e.id_entity AND er.id_role = " . self::ID_ROLE . ")\n \t\tLEFT JOIN stat_advertisers sa ON (a.id_entity_advertiser = sa.id_entity_advertiser\n \t\t\tAND sa.stat_date BETWEEN '" . type_to_str($range['from'], 'databasedate') . "' AND '" . type_to_str($range['to'], 'databasedate') . "')\n \tWHERE 1 = 1 \n \t";
if ($filt != 'all') {
$sql .= ' AND er.status = ' . $this->db->escape($filt);
}
if (!empty($quickSearch)) {
$escapedQuickSearch = $this->db->escape_str($quickSearch);
$sql .= " AND ((e.id_entity LIKE '%" . $escapedQuickSearch . "%')\n \t \t\t\t\tOR (e.name LIKE '%" . $escapedQuickSearch . "%')\n \t \t\t\t\tOR (e.e_mail LIKE '%" . $escapedQuickSearch . "%')\n \t \t\t\t\tOR (e.creation_date LIKE '%" . $escapedQuickSearch . "%'))\n \t \t\t ";
}
$query = $this->db->query($sql);
if (0 < $query->num_rows()) {
$row = $query->row();
$total['impressions'] = $row->impressions;
$total['clicks'] = $row->clicks;
$total['spent'] = $row->spent;
$total['bonus'] = $row->bonus;
}
// All count
$sql = "\n \tSELECT \n \t\tSUM(e.ballance) AS ballance,\n \t\tCOUNT(*) AS cnt\n \tFROM advertisers a\n \t\tJOIN entities e ON a.id_entity_advertiser = e.id_entity\n \t\tJOIN entity_roles er ON er.id_entity = e.id_entity AND er.id_role = " . self::ID_ROLE . "\n \tWHERE 1 = 1\n ";
if ($filt != 'all') {
$sql .= ' AND er.status = ' . $this->db->escape($filt);
}
if (!empty($quickSearch)) {
$escapedQuickSearch = $this->db->escape_str($quickSearch);
$sql .= " AND ((e.id_entity LIKE '%" . $escapedQuickSearch . "%')\n \t \t\t\t\tOR (e.name LIKE '%" . $escapedQuickSearch . "%')\n \t \t\t\t\tOR (e.e_mail LIKE '%" . $escapedQuickSearch . "%')\n \t \t\t\t\tOR (e.creation_date LIKE '%" . $escapedQuickSearch . "%'))\n \t \t\t ";
}
$query = $this->db->query($sql);
if (0 < $query->num_rows()) {
$row = $query->row();
$total['balance'] = $row->ballance;
$total['cnt'] = $row->cnt;
}
return $total;
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:45,代码来源:advertisers.php
示例18: select_group
public function select_group($site_code, $channel_code)
{
//Стираем данные о ID XML файла (именно здесь - чтобы убить эти данные и в куке)
$this->session->unset_userdata('id_xml');
$program_type = $this->input->post("program_type");
switch ($program_type) {
case 'cpm_flatrate':
$campaigns_filter = 'cpm_flatrate';
break;
default:
$this->error_message('Wrong program type specified!');
return;
}
$id_site = type_cast($site_code, 'textcode');
$id_channel = type_cast($channel_code, 'textcode');
$site_info = $this->site->get_info($id_site);
$channel_info = $this->channel->get_info($id_channel);
if (is_null($site_info) || is_null($channel_info)) {
$this->error_message('Site or channel is not found.');
return;
}
$this->load->model('groups');
$campaigns_tree = $this->groups->get_html_tree($this->user_id, $this->user_name, 0, $campaigns_filter);
$content = $this->parser->parse('advertiser/site_directory/select_group.html', array('SITE_CODE' => $site_code, 'CHANNEL_CODE' => $channel_code, 'SITE_NAME' => type_to_str($site_info->name, 'encode'), 'SITE_URL' => $site_info->url, 'CHANNEL_NAME' => type_to_str($channel_info->name, 'encode'), 'PROGRAM_TYPE' => $program_type, 'CAMPAIGNS_TREEVIEW' => $campaigns_tree, 'CHANNEL_TYPE' => $channel_info->ad_type, 'USER_CODE' => type_to_str($this->user_id, 'textcode'), 'EMPTYTREE' => $this->groups->EmptyTree ? 'true' : 'false'));
$this->_set_content($content);
$this->_display();
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:27,代码来源:buy_site_channel.php
示例19: post_old
/**
* Скорее всего этот хак можно удалить будет.
*
* @access public
* @param string
* @param bool
* @return string
*/
function post_old($index = '', $xss_clean = FALSE)
{
/**
* Dirty hack для datepicker.
* Суть проблемы: у каждой локали есть свой формат даты.
* Этот формат никак не совпадает с форматом даты в яваскрипте.
* И ко всему прочему сокращённое название месяца для разных языков разное.
* Поэтому для дэйтпикер
|
请发表评论