Commit 9f4f2745 authored by Игорь's avatar Игорь
Browse files

init

parent a765cdc4
<table width="100%" cellspacing="0" cellpadding="3" border="0" class="lui__list_table lui__list_table_donor lui__list_table__sourse" id="lui__list_table_donor">
<?php if (!$pager->getNbResults()): ?>
<thead><tr></tr></thead>
<?php else: ?>
<?php
$parser = new sfYamlParser();
$generators = array();
?>
<thead>
<tr>
<th id="sf_admin_list_batch_actions" class="sf_admin_batch_checkbox__td"><input id="sf_admin_list_batch_checkbox" type="checkbox" onclick="$('.sf_admin_batch_checkbox').prop('checked', $(this).is(':checked'));" /></th>
<?php include_partial('user_log/list_th_tabular', array('sort' => $sort)) ?>
<th id="sf_admin_list_th_actions">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php foreach ($pager->getResults() as $i => $user_log): $odd = fmod(++$i, 2) ? 'odd' : 'even' ?>
<?php
if(!isset($generators[$user_log->getModule()]) && file_exists(sfConfig::get('sf_app_module_dir') . '/' . $user_log->getModule() . '/config/generator.yml'))
{
$generators[$user_log->getModule()] = $parser->parse(file_get_contents(sfConfig::get('sf_app_module_dir') . '/' . $user_log->getModule() . '/config/generator.yml'));
}
?>
<tr class="sf_admin_tr_stop tr_log_type_<?php echo $user_log->getLogType();?> sf_admin_row <?php echo $odd ?>" valign="top" data-href="<?php echo url_for('user_log/edit?id=' . $user_log->getPrimaryKey());?>">
<?php include_partial('user_log/list_td_batch_actions', array('user_log' => $user_log, 'helper' => $helper)) ?>
<?php include_partial('user_log/list_td_tabular', array('user_log' => $user_log, 'generators' => $generators)) ?>
<?php
//include_partial('user_log/list_td_actions', array('user_log' => $user_log, 'helper' => $helper))
?>
</tr>
<?php endforeach; ?>
</tbody>
<?php endif; ?>
</table>
<?php include_partial('user_log/list_footer', array('user_log' => $user_log, 'helper' => $helper)) ?>
<?php
$generators = $generators->getRawValue();
$log_types = UserLog::$log_types;
?>
<td class="sf_admin_text sf_admin_list_td_user">
<?php
$user = $user_log->getUser();
/*
if($user->getIname())
{
echo $user->getIname() . ' ';
}
if($user->getFname())
{
echo $user->getIname() . ', ';
}
*/
echo $user->getUsername();
?>
</td>
<td class="sf_admin_text sf_admin_list_td_log_type">
<?php echo isset($log_types[$user_log->getLogType()]) ? $log_types[$user_log->getLogType()] : $user_log->getLogType(); ?>
</td>
<td class="sf_admin_text sf_admin_list_td_model">
<?php
if (isset($generators[$user_log->getModule()])) {
$generator = $generators[$user_log->getModule()];
echo $generator['generator']['param']['config']['list']['title'];
} else {
echo $user_log->getModel();
}
?>
</td>
<td class="sf_admin_text sf_admin_list_td_log">
<?php
$object = @unserialize($user_log->getLog(ESC_RAW));
if (is_object($object)) {
if ($user_log->getLogType() == 'update') {
$fields = false;
if (isset($generators[$user_log->getModule()])) {
$generator = $generators[$user_log->getModule()];
$fields = $generator['generator']['param']['config']['fields'];
}
$old = $object->getModified(true, true);
$new = $object->getModified(false, true);
foreach ($old as $fk => $fv) {
if ($fk != 'updated_at' && $fk != 'created_at') {
if ($fields !== false) {
echo '<b>' . $fields[$fk]['label'] . '</b>';
echo '<i class="br3"></i>';
}
if ($fk == 'password') {
} else {
echo ($fv == '' ? '<i>нет значения</i>' : $fv) . '&nbsp;→&nbsp;' . ($new[$fk] == '' ? '<i>нет значения</i>' : $new[$fk]) . '<i class="br5"></i>';
}
}
}
} else {
echo '<b>' . $object . '</b>';
}
}
?>
</td>
<td class="sf_admin_date sf_admin_list_td_created_at">
<?php echo false !== strtotime($user_log->getCreatedAt()) ? format_date($user_log->getCreatedAt(), "g") : '&nbsp;' ?>
</td>
<td class="sf_admin_text sf_admin_list_td_action">
<?php
if ($sf_user->getUsername() == 'root' && $user_log->getLogType() == 'delete') {
echo '<ul class="sf_admin_td_actions">';
echo '<li class="sf_admin_action_return"><a href="' . url_for('user_log/return?id=' . $user_log->getId()) . '">Восстановить</a></li>';
echo '</ul>';
}
?>
</td>
<?php
?>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><?php include_slot('title', sfConfig::get('app_arm_title')); ?></title>
<link rel="shortcut icon" href="/favicon.ico">
<?php
$path_prefix = isset($_SERVER['PATH_PREFIX']) ? $_SERVER['PATH_PREFIX'] : '';
?>
<script type="text/javascript">
var sf_app = '<?php echo sfConfig::get('sf_app');?>';
var sf_prefix = '<?php echo $path_prefix;?>';
var sf_user = <?php echo $sf_user->isAuthenticated() ? $sf_user->getUserId() : 'false';?>;
var sf_user_root = <?php echo($sf_user->isAuthenticated() ? ($sf_user->getUsername() == 'root' ? 'true' : 'false') : 'false');?>;
var sf_ws_pub = '<?php echo sfConfig::get('app_ws_pub');?>';
</script>
<?php
if ($sf_user->isAuthenticated()) {
if (file_exists(sfConfig::get('sf_web_js_dir_name', 'js') . $path_prefix . '/' . $this->getModuleName() . '.js')) {
use_javascript(mb_substr($path_prefix, 1) . '/' . $this->getModuleName() . '.js');
}
if (file_exists(sfConfig::get('sf_web_css_dir_name', 'css') . $path_prefix . '/' . $this->getModuleName() . '.css')) {
use_stylesheet(mb_substr($path_prefix, 1) . '/' . $this->getModuleName() . '.css');
}
}
include_http_metas();
include_stylesheets();
include_javascripts();
?>
</head>
<body>
<div class="jcrop_curtain">
<table width="100%" height="100%" cellcpacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle">
<div class="jcrop_curtain__long_item"></div>
</td>
</tr>
</table>
</div>
<div class="lui__root">
<div class="ftm_wrap ftm" onclick="$(this).hide();">
<div class="ftm__actions">
<div class="ftm__close"></div>
<div class="ftm__rotate" title="Повернуть по часовой стрелке"
onclick="ftm.rotate(this);event.stopPropagation();return false;"></div>
</div>
<table width="100%" height="100%" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle" align="center">
<div class="fotorama " data-auto="false" onclick="event.stopPropagation();"></div>
</td>
</tr>
</table>
</div>
<?php
if (!$sf_user->isAuthenticated()) {
echo $sf_content;
} else {
?>
<table class="lui__desktop" border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="lui__desktop_left invert" style="padding-top:20px;">
<?php
if ($sf_user->getUsername() === 'root') {
echo '<a href="' . url_for('@version') . '" class="version_top">v&nbsp;' . ProjectUtils::getVersion() . '</a>';
}
?>
<div class="lui__desktop_left_hider" title="<?php echo __('Свернуть'); ?>"></div>
<div class="lui__desktop_left__wrapper">
<div class="logo_wrap">
<a target="_blank" href="/" class="logo"></a>
</div>
<i class="br20" style="border-bottom:1px solid #D8D8D866"></i>
<b class="br20"></b>
<div class="lui__nav__wrapper" style="position:relative;height: 0;">
<ul class="lui__nav">
<?php
function menu_cmp($a, $b)
{
if ($a['order'] == $b['order']) {
return 0;
}
return ($a['order'] < $b['order']) ? -1 : 1;
}
$parser = new sfYamlParser();
$modules = glob(sfConfig::get('sf_app_module_dir') . '/*');
$links = array();
$group_counts = array();
foreach ($modules as $k => $v) {
if (file_exists($v . '/config/generator.yml')) {
$p = $parser->parse(file_get_contents($v . '/config/generator.yml'));
$module = basename($v);
if ((!$sf_user->hasCredential($module . '_index') && $module !== 'help_dialog') || $p['generator']['param']['skip'] || $p['generator']['param']['config']['list']['title'] == '') {
continue;
}
$model = str_replace(' ', '', ucwords(str_replace('_', ' ', $module)));
$count = '';
$count_number = 0;
if (class_exists($model) && method_exists($model, 'getMenuCount')) {
$count = $model::getMenuCount();
$count_number = $count;
$count = '<span class="lui__nav_menu__count">' . ($count > 0 ? $count : '') . '</span>';
}
$group_class = isset($p['generator']['param']['group']) ? Page::translit($p['generator']['param']['group']) : false;
if($group_class !== false){
if(!isset($group_counts[$group_class])){
$group_counts[$group_class] = 0;
}
$group_counts[$group_class] += $count_number;
}
$links[] = array(
'm' => $module,
'title' => $p['generator']['param']['config']['list']['title'],
'order' => isset($p['generator']['param']['order']) ? $p['generator']['param']['order'] : 0,
'group' => isset($p['generator']['param']['group']) ? $p['generator']['param']['group'] : false,
'group_class' => $group_class,
'tab_group' => isset($p['generator']['param']['tab_group']) ? $p['generator']['param']['tab_group'] : false,
'add' => isset($p['generator']['param']['add']) ? $p['generator']['param']['add'] : true,
'hr' => isset($p['generator']['param']['hr']),
'count' => $count
);
}
}
usort($links, 'menu_cmp');
$open_groups = array('zakazchik', 'kurer');
$tab_groups = array();
foreach ($links as $link){
if($link['tab_group']){
if(!isset($tab_groups[$link['tab_group']])){
$tab_groups[$link['tab_group']] = array();
}
$tab_groups[$link['tab_group']][] = $link['m'];
}
if($link['group'] && $this->getModuleName() == $link['m']){
$open_group = $link['group_class'];
}
}
foreach ($links as $k => $v) {
if($v['tab_group']){
$tab_group_link_count_sum = 0;
foreach ($links as $tab_group_link){
if($v['tab_group'] === $tab_group_link['tab_group'] && isset($tab_group_link['count_num'])){
$tab_group_link_count_sum += $tab_group_link['count_num'];
}
}
$v['count_num'] = $tab_group_link_count_sum;
$tab_groups_on = in_array($this->getModuleName(), $tab_groups[$v['tab_group']]);
if(($tab_groups_on && $this->getModuleName() != $v['m']) || (!$tab_groups_on && $tab_groups[$v['tab_group']][0] != $v['m'])){
continue;
}
}
if ($v['group'] && (!isset($links[$k - 1]) || $links[$k - 1]['group'] != $v['group'])) {
echo '<li class="lui__nav_li_group_btn' . (in_array($v['group_class'], $open_groups) ? ' lui__nav_li_group_btn_open' : '') . '" data-group="' . $v['group_class'] . '">';
echo '<div class="lui__nav_li_group_btn__cont">' . $v['group'] . '</div>';
if(isset($group_counts[$v['group_class']]) && $group_counts[$v['group_class']] > 0){
echo '<span class="lui__nav_menu__count">' . $group_counts[$v['group_class']] . '</span>';
}
echo '</li>';
}
echo '<li class="' . ($this->getModuleName() == $v['m'] ? 'current' : '') . ($v['group'] ? ' lui__nav_li_group lui__nav_li_group_' . $v['group_class'] : '') . '" ' . ($v['group'] && !in_array($v['group_class'], $open_groups) ? 'style="display:none;"' : '') . '>';
$link = $v['m'];
echo '<a class="lui__nav_a lui__nav_a_' . $v['m'] . '" href="' . url_for('@' . $v['m']) . '">' . $v['title'] . '</a>' . $v['count'];
echo '</li>';
if ($v['hr'] && $k != count($links) - 1) {
echo '<i class="hr20" style="margin:10px 0;background:#D8D8D866;"></i>';
}
}
echo '</ul>';
echo '</div>';
echo '<div class="fixed_user_menu">';
echo '<div style="position:relative;">';
// echo link_to('Профиль', '@profile', array('class' => 'sprite_link sprite_link_user'));
echo '</div>';
echo '<i class="br10"></i>';
if ($sf_user->getUsername() === 'root') {
echo '<a href="' . url_for('@cs_setting') . '" class="sprite_link sprite_link_setting">Настройки</a>';
echo '<i class="br10"></i>';
}
echo '<a href="' . url_for('@signout') . '" class="sprite_link sprite_link_logout">Выйти</a>';
echo '</div>';
?>
</div>
</td>
<td width="100%" class="lui__desktop_right" height="100%">
<div class="lui__desktop_right__wrapper <?php echo sfConfig::get('sf_app') . '_' . $this->getModuleName(); ?>">
<?php
echo $sf_content;
?>
</div>
</td>
</tr>
</table>
<?php
}
?>
</div>
<?php
if($sf_user->isAuthenticated()){
?>
<script type="text/javascript">
$(document).ready(function () {
var calc_lui__nav__wrapper = function () {
$('.lui__nav__wrapper').height($(window).height() - $('.lui__nav__wrapper').offset().top - $('.fixed_user_menu').outerHeight());
$('.lui__nav__wrapper').perfectScrollbar('update');
};
$('.lui__nav__wrapper').perfectScrollbar();
$('.lui__nav__wrapper').scroll(function () {
var top = $(this).scrollTop();
var bottom = $('.lui__nav').outerHeight() - $(this).outerHeight();
$(this).removeClass('lui__nav__wrapper__sh_top');
$(this).removeClass('lui__nav__wrapper__sh_bottom');
$(this).removeClass('lui__nav__wrapper__sh_bottom_top');
if (bottom < 0) {
return false;
}
if (top == 0) {
$(this).addClass('lui__nav__wrapper__sh_bottom');
} else if (top == bottom) {
$(this).addClass('lui__nav__wrapper__sh_top');
} else {
$(this).addClass('lui__nav__wrapper__sh_bottom_top');
}
}).scroll();
$(window).resize(function () {
calc_lui__nav__wrapper();
$('.lui__nav__wrapper').scroll();
}).resize();
$('.lui__nav_li_group_btn').click(function(){
var btn = $(this);
if(btn.data('group')){
var groupLi = $('.lui__nav_li_group_' + btn.data('group'));
if(btn.hasClass('lui__nav_li_group_btn_open')){
btn.removeClass('lui__nav_li_group_btn_open');
groupLi.hide();
}else{
btn.addClass('lui__nav_li_group_btn_open');
groupLi.show();
}
$('.lui__nav__wrapper').scroll();
}
});
});
</script>
<?php
}
?>
</body>
</html>
\ No newline at end of file
default:
enabled: false
with_layout: false
lifetime: 2592000
prod:
logger:
class: sfNoLogger
param:
level: err
loggers: ~
all:
user:
class: myUser
param:
timeout: 7776000
logging: %SF_LOGGING_ENABLED%
use_flash: true
default_culture: %SF_DEFAULT_CULTURE%
storage:
class: sfPDOSessionStorage
param:
session_name: app
database: doctrine
db_table: session
db_id_col: id
db_data_col: session_data
db_time_col: session_time
# mailer:
# param:
# delivery_strategy: realtime
# transport:
# class: Swift_SmtpTransport
# param:
# host: 127.0.0.1
# port: 25
# encryption: ~
# username: ~
# password: ~
mailer:
param:
delivery_strategy: realtime
transport:
class: Swift_SmtpTransport
param:
host: mail.atmadev.ru
port: 25
encryption: ~
username: root@atmadev.ru
password: freelord
routing:
class: sfPatternRouting
param:
generate_shortest_url: true
extra_parameters_as_query_string: true
view_cache:
class: sfFileCache
param:
automatic_cleaning_factor: 0
view_cache_manager:
class: sfViewCacheManager
param:
cache_key_use_vary_headers: true
cache_key_use_host_name: true
userBlocked:
class: userBlockedFilter
param:
type: rendering
rendering: ~
security: ~
#remember_me:
# class: doAuthRememberMeFilter
cache: ~
execution: ~
\ No newline at end of file
h1:
url: /test/
param: { module: main, action: help }
homepage:
url: /
param: { module: main, action: index }
main_index:
url: /main/
param: { module: main, action: index }
main_add_bid:
url: /user/add-bid/
param: { module: user, action: addBid }
main_remove_bid:
url: /user/remove-bid/
param: { module: user, action: removeBid }
main_edit_profile:
url: /user/edit-profile/
param: { module: user, action: editProfile }
recovery_form:
url: /user/recovery-form/
param: { module: user, action: recoveryForm }
change_psw_form:
url: /user/change-psw-form/
param: { module: user, action: changePswForm }
out:
url: /out/
param: { module: main, action: out }
signin:
url: /user/signin/
param: { module: user, action: signin }
signup:
url: /user/signup/
param: { module: user, action: signup }
signout:
url: /user/signout/
param: { module: user, action: signout }
default:
is_secure: false
prod:
.settings:
logging_enabled: false
cache: false
min_view: false
dev:
.settings:
error_reporting: <?php echo ((E_ALL) ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING)."\n" ?>
web_debug: false
cache: false
etag: false
logging_enabled: false
all:
.settings:
csrf_secret: 2450ecb2853511b9f9137ee54890608d0b8c62dd
escaping_strategy: true
escaping_method: ESC_SPECIALCHARS
use_database: true
no_script_name: true
enabled_modules: [default, sfCaptchaGD, csSetting]
default_culture: ru_RU
standard_helpers: [Partial, Cache, I18N]
i18n: true
default_timezone: Europe/Moscow
.actions:
error_404_module: main
error_404_action: error404
login_module: user
login_action: signin
secure_module: user
secure_action: secure
\ No newline at end of file
default:
http_metas:
content-type: text/html
metas:
robots: 'index, follow'
viewport: 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0'
stylesheets:
- 'fonts.css?deploy=1613032033'
- 'cash/g.css?deploy=1613032033'
- 'cash/p.css?deploy=1613032033'
javascripts:
- jquery-2.1.4.min.js
- 'cash/init.d.js?deploy=1327645525'
has_layout: true
layout: layout
<?php
class wwwConfiguration extends sfApplicationConfiguration
{
public function configure()
{
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xliff PUBLIC "-//XLIFF//DTD XLIFF//EN" "http://www.oasis-open.org/committees/xliff/documents/xliff.dtd">
<xliff version="1.0">
<file source-language="EN" target-language="en" datatype="plaintext" original="messages" date="2019-04-23T15:47:31Z" product-name="messages">
<header/>
<body>
<trans-unit id="1">
<source>Страница</source>
<target>Page</target>
</trans-unit>
<trans-unit id="2">
<source>Требуется авторизация</source>
<target>Authorization required</target>
</trans-unit>
<trans-unit id="3">
<source>Неверный формат телефона</source>
<target>Incorrect phone format</target>
</trans-unit>
<trans-unit id="4">
<source>Пользователь не существует</source>
<target>User does not exist</target>
</trans-unit>
<trans-unit id="5">
<source>Неверный код</source>
<target>Invalid code</target>
</trans-unit>
<trans-unit id="6">
<source>Имя</source>
<target>Name</target>
</trans-unit>
<trans-unit id="7">
<source>Фамилия</source>
<target>Surname</target>
</trans-unit>
<trans-unit id="8">
<source>Телефон</source>
<target>Phone</target>
</trans-unit>
<trans-unit id="9">
<source>Обязательное поле</source>
<target>Required field</target>
</trans-unit>
<trans-unit id="10">
<source>Неверный формат</source>
<target>Incorrect format</target>
</trans-unit>
<trans-unit id="11">
<source>Уже используется</source>
<target>Already use</target>
</trans-unit>
<trans-unit id="12">
<source>Не определено текущее местоположение</source>
<target>Current location not determined</target>
</trans-unit>
<trans-unit id="13">
<source>Сообщение</source>
<target>Message</target>
</trans-unit>
<trans-unit id="14">
<source>Событие</source>
<target>Event</target>
</trans-unit>
<trans-unit id="15">
<source>Неправильный формат</source>
<target>Wrong format</target>
</trans-unit>
<trans-unit id="16">
<source>Событие не найдено</source>
<target>Event not found</target>
</trans-unit>
<trans-unit id="17">
<source>Пользователь не найден</source>
<target>The user is not found</target>
</trans-unit>
<trans-unit id="18">
<source>Пользователь</source>
<target>User</target>
</trans-unit>
<trans-unit id="19">
<source>Пин-код не установлен</source>
<target>Pin not set</target>
</trans-unit>
<trans-unit id="20">
<source>Фотография</source>
<target>Photo</target>
</trans-unit>
<trans-unit id="21">
<source>Пин-код</source>
<target>Pin code</target>
</trans-unit>
<trans-unit id="22">
<source>Уведомления «Помогите всем»</source>
<target>Notice «Help»</target>
</trans-unit>
<trans-unit id="23">
<source>Уведомления «Все события»</source>
<target>Notice «Event»</target>
</trans-unit>
<trans-unit id="24">
<source>Уведомления «Помогите другу»</source>
<target>Notice «Help» only friend</target>
</trans-unit>
<trans-unit id="25">
<source>Уведомления «Событие у друга»</source>
<target>Notice «Event» only friend</target>
</trans-unit>
<trans-unit id="26">
<source>Координаты места по умолчанию</source>
<target>Default location coordinates</target>
</trans-unit>
<trans-unit id="27">
<source>Место по умолчанию</source>
<target>The default location</target>
</trans-unit>
<trans-unit id="28">
<source>Некорректные данные</source>
<target>Incorrect data</target>
</trans-unit>
<trans-unit id="29">
<source>Пользователь заблокирован</source>
<target>The user is blocked</target>
</trans-unit>
<trans-unit id="30">
<source>Язык</source>
<target>Language</target>
</trans-unit>
<trans-unit id="31">
<source>Слишком большое значение</source>
<target>Too much importance</target>
</trans-unit>
<trans-unit id="32">
<source>Изображение</source>
<target>image</target>
</trans-unit>
<trans-unit id="33">
<source>Место</source>
<target>Location name</target>
</trans-unit>
<trans-unit id="34">
<source>Слишком маленькое значение</source>
<target>Too small a value</target>
</trans-unit>
<trans-unit id="35">
<source>Название места</source>
<target>Place name</target>
</trans-unit>
<trans-unit id="36">
<source>Широта</source>
<target>Latitude</target>
</trans-unit>
<trans-unit id="37">
<source>Долгота</source>
<target>Longitude</target>
</trans-unit>
<trans-unit id="38">
<source>Актуально</source>
<target>Available time</target>
</trans-unit>
<trans-unit id="39">
<source>На расстоянии</source>
<target>Available distance</target>
</trans-unit>
<trans-unit id="40">
<source>Теги</source>
<target>Tags</target>
</trans-unit>
<trans-unit id="41">
<source>Тип</source>
<target>Type</target>
</trans-unit>
<trans-unit id="42">
<source>Участники</source>
<target>Participants</target>
</trans-unit>
<trans-unit id="43">
<source>Нужно указать место или участников</source>
<target>You need to specify the place or participants</target>
</trans-unit>
<trans-unit id="44">
<source>Нужно заполнить все поля места расположения</source>
<target>You need to specify all fields of the location</target>
</trans-unit>
<trans-unit id="45">
<source>Название</source>
<target>Name</target>
</trans-unit>
<trans-unit id="46">
<source>Пользователи</source>
<target>Users</target>
</trans-unit>
<trans-unit id="47">
<source>Название уже используется</source>
<target>The name is already in use</target>
</trans-unit>
<trans-unit id="48">
<source>Группы участников</source>
<target>Group of participants</target>
</trans-unit>
<trans-unit id="49">
<source>Группа не найдена</source>
<target>The group was not found</target>
</trans-unit>
<trans-unit id="50">
<source>Контакты</source>
<target>Contacts</target>
</trans-unit>
<trans-unit id="51">
<source>Группа не может быть пустой</source>
<target>The group may not be empty</target>
</trans-unit>
<trans-unit id="52">
<source>Пользователи в приложении</source>
<target>Users in the app</target>
</trans-unit>
<trans-unit id="53">
<source>Неверный пин-код</source>
<target>Invalid pin-code</target>
</trans-unit>
<trans-unit id="54">
<source>Здесь пока ничего нет</source>
<target>There's nothing here yet</target>
</trans-unit>
</body>
</file>
</xliff>
<?php
class myUser extends doAuthSecurityUser
{
public function isFirstRequest($boolean = null)
{
if (is_null($boolean)) {
return $this->getAttribute('first_request', true);
}
$this->setAttribute('first_request', $boolean);
}
}
\ No newline at end of file
<?php
class mainActions extends sfActions
{
private function isOutAvailable($account)
{
return $account['courier_money_available'] >= Yavinesu::getCourierOutMin();
}
public function executeIndex(sfWebRequest $request)
{
$balance = 0;
$exports = array();
if($this->getUser()->isAuthenticated()){
$account = $this->getUser()->getAccount();
$exports = Doctrine_Query::create()
->select("e.id, e.weight, e.logic_type, e.sum, c.title AS cat_title, c.id AS cat_id, c.price AS cat_price, c.min_weight AS cat_min_weight")
->from("Export e")
->leftJoin("e.Cat c")
//->where("e.logic_type = 'wait'")
->andWhere("e.user_id = ?", $account->getId())
->orderBy("e.logic_type DESC, e.created_at DESC")
->fetchArray();
$export_q = Doctrine_Query::create()
->select("e1.sum")
->from("Export e1")
//->where("e1.logic_type != 'wait'")
->andWhere("e1.user_id = ?", $account->getId())
->fetchArray();
if(count($export_q) > 0){
foreach ($export_q as $item){
$balance = $balance + $item['sum'];
}
}
}
$cat_q = Doctrine_Query::create()
->select("c.id, c.title, c.min_weight, c.price")
->from("Cat c")
->orderBy("c.order_id")
->fetchArray();
$this->balance = $balance;
$this->cats = $cat_q;
$this->exports = $exports;
}
public function executeOut(sfWebRequest $request)
{
$this->form = new cashOutForm();
if($request->isMethod('post')){
if(csSettings::get('mass_payment_on')){
$this->form->bind($request->getParameter($this->form->getName()));
if($this->form->isValid()){
$account = $this->getUser()->getAccount();
if($this->isOutAvailable($account)){
/*добавить проверку на подсчет всех денег по таблице courierMoney*/
$money_out = new CourierMoneyOut();
$money_out['courier_id'] = $account->getId();
$money_out['status'] = 'wait';
$money_out['created'] = date('Y-m-d H:i:s');
$money_out['total'] = $account['courier_money_available'];
$money_out->save();
if($money_out){
$result = $money_out->massPaymentCreate($this->form->getValue('card'));
if($result['state'] === 'success'){
$this->completed = true;
}else{
$this->form->getErrorSchema()->addError(new sfValidatorError(new sfValidatorSchema(), $result['message']));
}
}else{
$this->form->getErrorSchema()->addError(new sfValidatorError(new sfValidatorSchema(), 'Техническая ошибка. Попробуйте позднее'));
}
}else{
$this->form->getErrorSchema()->addError(new sfValidatorError(new sfValidatorSchema(), 'Нельзя вывести меньше минимальной суммы вывода'));
}
}
}else{
$this->completed = true;
}
}
}
public function executeError404(sfWebRequest $request)
{
}
}
<?php
class mainComponents extends sfComponents
{
public function executeMainMenu(sfWebRequest $request)
{
$main_menu_q = Doctrine_Query::create()
->select("mm.id, mm.title, mm.link")
->from("MainMenu mm")
->where("mm.is_activated = '1'")
->orderBy("mm.order_id")
->fetchArray();
$this->main_menu = $main_menu_q;
}
}
<?php if(count($main_menu) > 0){?>
<div class="main_menu">
<ul>
<?php foreach($main_menu as $item){
echo '<li><a href="' . $item['link'] . '">' . $item['title'] . '</a></li>';
}?>
</ul>
</div>
<?php }?>
<?php slot('title', '404');?>
<h2>404</h2>
Нет такой страницы
\ No newline at end of file
<div class="max_width">
<?php if($sf_user->isAuthenticated()){ ?>
<div class="top_menu">
<ul class="top_menu__ul">
<li class="top_menu__li <?php echo ($sf_user->isAuthenticated() ? 'active' : '');?>" data-tab="0">Личный кабинет</li>
<li class="top_menu__li <?php echo (!$sf_user->isAuthenticated() ? 'active' : '');?>" data-tab="1">Новая заявка</li>
</ul>
</div>
<?php } ?>
<div class="tabs_container">
<div class="tabs_container__item <?php echo ($sf_user->isAuthenticated() ? 'active' : '');?> bid_export" data-tab="0">
<?php if($sf_user->isAuthenticated()){
$account = $sf_user->getAccount();
?>
<div class="personal_data">
<div class="personal_data__wrap">
<div class="personal_data__name personal_data__item">
<span><?php echo $account->getName();?></span>
</div>
<div class="personal_data__balance personal_data__item">
<div class="balance_title">Ваш счет</div>
<div class="balance_total balance_content_main">
<span>Всего заработано:</span><span class="balance_content_r"><?php echo $balance;?></span>
</div>
<!-- <div class="balance_remains balance_content_main">-->
<!-- <span>Невыведено:</span><span class="balance_content_r">1000</span>-->
<!-- </div>-->
<!-- <div class="balance_take">Вывести</div>-->
</div>
<div class="personal_data__text personal_data__item">
<?php echo csSettings::get('text_personal');?>
</div>
<div class="personal_data__profile personal_data__item">
<div class="personal_data__profile_phone"><?php echo Page::maskPhone($account->getPhone());?></div>
<div class="personal_data__profile_mail"><?php echo $account->getEmail();?></div>
<div class="personal_data__profile_address"><?php echo $account->getAddress();?></div>
<span>
<button class="btn btn_signup white_btn" onclick="popup.open('open_profile');">Изменить данные</button>
</span>
</div>
</div>
</div>
<?php } ?>
<div class="personal_bids">
<div class="personal_bids__title">Мое вторсырье</div>
<?php if(count($exports) > 0) {
$key_wait = '';
$key_bid = '';
$c = 1;
foreach ($exports as $key_e => $export){
if($export['logic_type'] == 'wait'){
$key_wait = $c;
}
if($export['logic_type'] != 'wait'){
$key_bid = $c;
}
$c++;
}
?>
<table class="statistic_content__table" width="100%" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th width="31%">Категория</th>
<th width="13%">Собрано (кг)</th>
<th width="13%">Дособрать (кг)</th>
<th width="13%">Сумма ₽</th>
<th width="29%"></th>
<th width="1%"></th>
</tr>
</thead>
<tbody>
<?php
$k = 1;
foreach ($exports as $key_ex => $export){
$remains = $export['cat_min_weight'] - $export['weight'];
?>
<tr id="export_<?php echo $export['id']; ?>" data-id="<?php echo $export['id']; ?>" data-cat_id="<?php echo $export['cat_id']; ?>" data-price="<?php echo $export['cat_price']; ?>" data-min_weight="<?php echo $export['cat_min_weight']; ?>">
<td width="31%"><?php echo $export['cat_title']; ?></td>
<td width="13%"><input class="tb_weight_inp numeric_td" autocomplete="off" name="tb_weight_<?php echo $export['id']; ?>" id="tb_weight_<?php echo $export['id']; ?>" value="<?php echo Yavinesu::weightFormat($export['weight']); ?>"></td>
<td class="numeric_td remains_td" width="13%"><?php echo ($remains > 0 ? Yavinesu::weightFormat($remains) : 0); ?></td>
<td class="numeric_td price_td" width="13%"><?php echo Yavinesu::priceFormat($export['sum']); ?></td>
<td class="btn_td" width="29%">
<?php if($export['logic_type'] == 'wait'){ ?>
<button class="btn btn_signup btn_weight_collect <?php echo $remains > 0 ? 'disabled' : '';?>" <?php echo $remains > 0 ? 'disabled="disabled"' : '';?> >Собрано</button>
<?php } else {
echo 'Заявка отправлена';
} ?>
</td>
<td class="remove_bid_td"width="1%"><?php echo ($export['logic_type'] == 'wait' ? '<span class="remove_bid" title="Удалить"></span>' : '');?></td>
</tr>
<?php
$text_less_weight = trim(csSettings::get('text_less_weight'));
if($key_wait != '' && $key_wait == $k) {
echo '<tr>';
echo '<td class="info_text_td" colspan="6">';
echo csSettings::get('text_less_weight');
echo '</td>';
echo '</tr>';
}
$text_more_weight = trim(csSettings::get('text_more_weight'));
if($key_bid != '' && $key_bid == $k){
echo '<tr>';
echo '<td class="info_text_td" colspan="6">';
echo csSettings::get('text_more_weight');
echo '</td>';
echo '</tr>';
}
$k++;
} ?>
</tbody>
</table>
<?php }
if(trim(csSettings::get('text_info_bottom')) != ''){
?>
<div class="info_text_body"><?php echo csSettings::get('text_info_bottom');?></div>
<?php }?>
</div>
</div>
<div class="tabs_container__item <?php echo (!$sf_user->isAuthenticated() ? 'active' : '');?> new_bid_export" data-tab="1">
<div class="new_bid_export__cats">
<div class="new_bid_export__title">Сколько у вас сырья?</div>
<?php if(count($cats)){ ?>
<select class="cats_sel cats_item" name="cats" id="cats">
<?php foreach($cats as $key => $cat){
echo '<option value="' . $cat['id'] . '" ' . ($key == 0 ? 'selected="selected"' : '') . ' data-min_weight="' . $cat['min_weight'] . '" data-price="' . $cat['price'] . '">' . $cat['title'] . '</option>';
} ?>
</select>
<div class="cats_item cats_item__weight">
<input class="weight_inp" autocomplete="off" name="weight" id="weight" placeholder="Укажите вес">
<span class="weight_sp">кг</span>
</div>
<!-- <div class="cats_item cats_item__remains">-->
<!-- <span class="cats_item__remains_title">Осталось собрать</span><span class="cats_item__remains_value">0</span> кг-->
<!-- </div>-->
<!-- <div class="cats_item cats_item__sum">-->
<!-- <span class="cats_item__sum_title">Сумма</span><span class="cats_item__sum_value">0</span> ₽-->
<!-- </div>-->
<div class="cats_item cats_item__wait_weight ">
<div class="wait_weight_msg" data-temp="<?php echo csSettings::get('text_will_wait');?>"></div>
<?php if(!$sf_user->isAuthenticated()) {?>
<!-- <a href="--><?php //echo url_for('@signup');?><!--" class="btn btn_signup">Буду копить</a>-->
<span class="btn btn_signup" onclick="popup.open('signup_form');return false;">Буду копить</span>
<?php } else { ?>
<span class="btn btn_signup btn_add_bid">Добавить заявку</span>
<?php } ?>
<span class="btn btn_signup white_btn btn_cancel">Отменить</span>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment