version: '3'
services:
laravel:
image: lorisleiva/laravel-docker:latest
volumes:
- ./:/var/www
- composer:/root/.composer/cache
command: php -d memory_limit=256M
service-nginx:
build:
context: ./docker/nginx
depends_on:
- service-php
- laravel
- postgres
volumes:
- ./:/var/www
ports:
- "8080:80"
service-php:
build:
context: ./docker/php
volumes:
- ./:/var/www
hostname: php
service-php-cli:
build:
context: ./docker/php-cli
volumes:
- ./:/var/www
- composer:/root/.composer/cache
command: php -d memory_limit=256M
postgres:
build:
context: ./docker/postgres
ports:
- "65432:5432"
restart: always
environment:
PGDATA: "/var/lib/postgresql/data"
POSTGRES_PASSWORD: qwerty
POSTGRES_USER: root
POSTGRES_DB: database
volumes:
- pgdata:/var/lib/postgresql/data
adminer:
image: adminer
depends_on:
- postgres
restart: always
ports:
- 3000:8080
redis:
image: redis:4.0.5-alpine
command: ["redis-server", "--appendonly", "yes"]
volumes:
composer:
pgdata:
driver: local
let checkRating = false;
let checkName = false;
function checkRating(id) {
var rating=document.getElementById(id);
if(!rating.value){
rating.className="error";
checkRating = false;
}
else if(!/^\d+$/.test(rating.value)) {
rating.className = "error";
checkRating = false;
}
else{
rating.className="true";
if (checkName === true) {
showDiv();
}
checkRating = true;
}
}
function checkName(id) {
var name=document.getElementById(id);
if(!name.value){
name.className="error";
checkName = false;
}
else if(!/\D/.test(name.value)) {
name.className = "error";
checkName = false;
}
else{
name.className="true";
if (checkRating === true) {
showDiv();
}
checkName = true;
}
}
function showDiv() {
// Показ div
}
<td data-date='' data-age=''></td>
$project_id = empty($_SESSION['selected_menu_item_id']) ? '' :
"tasks.project_id = ".$_SESSION['selected_menu_item_id']." AND";
$current_tasks_list_query = "SELECT
tasks.id AS ID,
tasks.name AS TASK_NAME,
tasks.deadline_datetime AS TASK_DEADLINE,
tasks.status AS TASK_STATUS,
projects.name AS PROJECT_NAME
FROM tasks
JOIN projects
ON tasks.project_id = projects.id
WHERE
$project_id
tasks.author_id = '".$USER['id']."'";
const NotAccess = (props) => {
return (
<div>
Доступ закрыт
</div>
)
}
export default class RouteAdmin extends React.Component {
constructor (props) {
super(props)
this.state = {
component: null
}
}
componentDidMount () {
axios.post('/admin').then(data => data.data).then(data => {
if (data.auth === true) {
const Admin = React.lazy(() => import('./moduleAdmin/Index'))
this.setState({component: Admin})
} else {
this.setState({component: NotAccess})
}
})
}
render () {
const Component = this.state.component
return (
<Route path="/admin" {...this.props} render={this.state.component}/>
)
}
}
<Route path='/admin' render={props => <RouteAdmin {...path} />} />