version: '3'
services:
app_php:
container_name: myata_php
build:
context: .
dockerfile: ./docker/Dockerfile
environment:
XDEBUG_CONFIG: remote_host=host.docker.internal
PHP_IDE_CONFIG: serverName=localhost
volumes:
- ./:/var/www
links:
- db
depends_on:
- db
nginx:
container_name: myata_nginx
image: nginx
volumes:
- ./docker/conf/nginx:/etc/nginx/conf.d/
- ./:/var/www
ports:
- 80:80
depends_on:
- app_php
adminer:
container_name: myata_adminer
image: adminer
restart: always
depends_on:
- db
ports:
- 8080:8080
db:
container_name: myata_mysql
image: percona:latest
command: --default-authentication-plugin=mysql_native_password
restart: on-failure
ports:
- 3306:3306
expose:
- 3306
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: myata
MYSQL_USER: ruslan
MYSQL_PASSWORD: kazan1811
FROM php:7.3-fpm
RUN apt-get update && apt-get install -y \
git \
curl \
wget \
libzip-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev zlib1g-dev libicu-dev g++ libmagickwand-dev --no-install-recommends libxml2-dev \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl \
&& docker-php-ext-install mbstring zip xml gd pdo_mysql \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& pecl install xdebug-2.7.1 \
&& docker-php-ext-enable xdebug
RUN wget https://getcomposer.org/installer -O - -q \
| php -- --install-dir=/bin --filename=composer --quiet
WORKDIR /var/www
CMD ["php-fpm"]
server {
# listen 443 ssl http2;
listen 80;
server_name app-test.local;
proxy_connect_timeout 3000;
proxy_send_timeout 3000;
proxy_read_timeout 3000;
client_max_body_size 20m;
send_timeout 300;
set $path "/var/www/frontend/web";
root $path;
access_log /var/www/frontend/runtime/logs/app-test-access.log;
error_log /var/www/frontend/runtime/logs/app-test-error.log;
charset utf-8;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_min_length 1024;
gzip_buffers 12 32k;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain application/xhtml+xml text/xml application/xml application/xml+rss text/css application/javascript;
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
expires 1d;
add_header Cache-Control "max-age=86400, public";
}
location / {
root $path;
index index.php index.html;
try_files $uri $uri/ /index.php?$args;
}
location ~* \.php$ {
fastcgi_param SERVER_NAME $host;
root $path;
fastcgi_pass app_php:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $path$fastcgi_script_name;
include fastcgi_params;
fastcgi_send_timeout 3000;
fastcgi_read_timeout 3000;
}
}
server {
if ($host = app-test.local) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name myata.local;
return 404; # managed by Certbot
}
$('#modal').modal('show')
.change($('#modalContent').html('<div style="display:flex;justify-content: center;margin: 60px 0;"><img src="/images/loader/35.gif"></div>'))
.find('#modalContent')
.load($(this).attr('href'))
$('#modal').on('show.bs.modal', function(e) {
$('#modalContent').html('<div style="display:flex;justify-content: center;margin: 60px 0;"><img src="/images/loader/35.gif"></div>');
})
class FileUpload {
public input: any = document.getElementById('upload-input');
....
handleFileSelect(event) {
const files = event.target.files;
for(let i = 0; i < files.length; i++) {
const file = files[i];
let type = file.type;
Store.files.push(file);
const fileType: FileType = FileUpload.determineFileType(type);
let count: number = Store.files.length - 1;
if(fileType.type === 'image') {
const reader = new FileReader();
reader.onload = (e: any) => {
let div: any = document.createElement('div');
div.setAttribute('class', 'preview-file');
div.innerHTML = [`<i class="material-icons remove-file" id="${count}">close</i>
<img class="preview" title="${file.name}" src="${e.target.result}" width="100px" height="100px"/>
<div>${file.name}</div>`].join('');
document.getElementById('preview-content').insertBefore(div, null);
FileUpload.removeFile(count);
};
reader.readAsDataURL(files[i]);
} else {
let div = document.createElement('div');
div.setAttribute('class', 'preview-file');
div.innerHTML = [`<i class="material-icons remove-file" id="${count}">close</i>
<img class="preview" title="${file.name}" src="${fileType.icon}" width="100px"/>
<div>${file.name}</div>`].join('');
document.getElementById('preview-content').insertBefore(div, null);
FileUpload.removeFile(count);
}
}
}
static removeFile(count): void {
const removeButton: any = document.getElementById(`${count}`);
removeButton.onclick = () => {
console.log("hello");
}
}
}
new FileUpload();
$dropdown.css({
position: 'absolute',
// top: -999999
});
$file = CFile::MakeFileArray(
$_SERVER['DOCUMENT_ROOT'].'/upload/payment/'.$_GET['ORDER_ID'].'.pdf',
false,
false,
''
);
$fileSave = CFile::SaveFile(
$file,
'/payment',
false,
false
);
CEvent::Send(
'SEND_PAY_PDF',
's1',
array('EMAIL_TO' => $USER->getEmail()),
'N',
'',
array($fileSave),
'ru'
);
$(#id).modal('show').find('$idModal').load('#href')
;$('#button').click(functuion(){
$(this).attr(href);// Или примерно так если укажешь data-href $(this).data("href")
})