Commit bd4316fa authored by notebook's avatar notebook
Browse files

Merge origin/master into skuska

Conflicts:
	composer.lock
	config/packages/security.yaml
	src/Controller/Admin/DashboardController.php
	symfony.lock
parent 9bc3c94b
Pipeline #27791 failed with stages
in 0 seconds
......@@ -35,7 +35,7 @@ public function usersAction()
->getRepository("App:User")
->findAll();
return $this->render('admin/users.html.twig', array(
return $this->render('user/index.html.twig', array(
'users' => $users
));
}
......
......@@ -48,7 +48,7 @@ public function viewOrderDetailAction(Request $request , $id)
$ordersitems = $em->getRepository('App:OrderItem')->findOrderItemsbyId($id);
return $this->render('orders/order_detail.html.twig', array(
'orders' => $orders->getQuery()->execute() , 'ordersitem' => $ordersitems
'orders' => $orders->getQuery()->execute() , 'ordersitems' => $ordersitems->getQuery()->execute()
));
}
/**
......@@ -183,7 +183,7 @@ public function addOrderItemAction(Request $request, $id)
$orderitem->setSumTotal($unit_price);
$orderitem->setOrders( $orders );
$em->persist($orderitem);
$em->flush();
......
......@@ -10,6 +10,7 @@ use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
......@@ -23,16 +24,33 @@ class AddOrderItemFormType extends AbstractType
),
'label' => 'Názov tovaru',
'mapped' => false ))
->add('qty',TextType::class, array( 'attr' => array(
->add('qty',IntegerType::class, array( 'attr' => array(
'class' => 'form-control',
),
'label' => 'Názov tovaru',
'label' => 'qty',
'mapped' => false ))
->add('mu',TextType::class, array( 'attr' => array(
'class' => 'form-control',
),
'label' => 'Merná jednotka',
'mapped' => false ))
->add('mu')
->add('unit_price')
->add('sum_total')
->add('unit_price',IntegerType::class, array( 'attr' => array(
'class' => 'form-control',
),
'label' => 'Cena za mernú jednotku',
'mapped' => false ))
->add('sum_total',IntegerType::class, array( 'attr' => array(
'class' => 'form-control',
),
'label' => 'Suma celkom',
'mapped' => false ))
;
->add('save', SubmitType::class, array(
'attr' => array(
'class' => 'btn btn-success float-right mt-3',
),
'label' => 'Zapísať položku objednávky',
));
}
public function configureOptions(OptionsResolver $resolver)
......
......@@ -44,7 +44,7 @@ class OrderFormType extends AbstractType
'attr' => array(
'class' => 'btn btn-success float-right mt-3',
),
'label' => 'Save invoice',
'label' => 'Zapísať objednávku',
));
......
......@@ -52,8 +52,7 @@ class OrderItemRepository extends ServiceEntityRepository
{
return $this->createQueryBuilder('b')
->where('b.orders = :u')
->setParameters(['u' => $id ])
->setMaxResults(1);
->setParameters(['u' => $id ]) ;
}
......
......@@ -36,7 +36,7 @@
</li>
{% if is_granted('ROLE_ADMIN') %}
<li><a class="nav-link" href=""><span class="fas fa-user-edit"></span> Správa uživateľov</a></li>
<li><a class="nav-link" href="{{ path("users") }}"><span class="fas fa-user-edit"></span> Správa uživateľov</a></li>
{% endif %}
</ul>
{# RIGHT ALIGN NAVBAR #}
......
......@@ -39,15 +39,17 @@
<th><span class="text-center"></span>AKCIA </th>
</tr>
</thead>
{% if ordersitem is not empty %}
{% for orderitem in ordersitem %}
{% if ordersitems is not empty %}
{% for orderitem in ordersitems %}
<tr>
<td class="text-center"></td>
<td class="text-center"></td>
<td style="white-space:pre-wrap; word-wrap:break-word; max-width: 15%"></td>
<td style="white-space:pre-wrap; word-wrap:break-word; max-width: 15%"></td>
<td style="white-space:pre-wrap; word-wrap:break-word; max-width: 15%"></td>
<td class="text-center">{{ orderitem.name | upper }}</td>
<td class="text-center">{{ orderitem.qty }}</td>
<td style="white-space:pre-wrap; word-wrap:break-word; max-width: 15%">{{ orderitem.mu }}</td>
<td style="white-space:pre-wrap; word-wrap:break-word; max-width: 15%">{{ orderitem.unitprice }}</td>
<td style="white-space:pre-wrap; word-wrap:break-word; max-width: 15%">{{ orderitem.sumtotal }}</td>
<td class="text-center"><a href="" class="btn btn-sm btn-danger"><span class="fas"></span>Zobraziť detail</a></td>
</tr>
{% endfor %}
......
{% extends 'base.html.twig' %}
{% extends "base.html.twig" %}
{% block title %}Hello UserController!{% endblock %}
{% block title %}Zoznam uživateľov{% endblock %}
{% block body %}
<style>
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
</style>
<div class="panel panel-info col-sm-12">
<div class="panel-heading">
<h3>Zoznam uživateľov</h3>
</div>
<div class="example-wrapper">
<h1>Hello {{ controller_name }}! ✅</h1>
This friendly message is coming from:
<ul>
<li>Your controller at <code><a href="{{ 'C:/xampp/htdocs/orders/src/Controller/UserController.php'|file_link(0) }}">src/Controller/UserController.php</a></code></li>
<li>Your template at <code><a href="{{ 'C:/xampp/htdocs/orders/templates/user/index.html.twig'|file_link(0) }}">templates/user/index.html.twig</a></code></li>
</ul>
</div>
{% endblock %}
{% if users is not empty %}
<table class="table table-striped table-hover table-light">
<thead>
<tr>
<th class="text-center">#</th>
<th><span class="fas fa-sticky-note"></span> NAME</th>
<th><span class="fas fa-calendar-alt"></span> LASTNAME</th>
<th><span class="fas fa-comment-alt"></span> E-MAIL</th>
<th class="text-center">AKCIA</th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td class="text-center">{{ user.id }}</td>
<td class="text-center">{{ user.name }}</td>
<td style="white-space:pre-wrap; word-wrap:break-word; max-width: 15%">{{ user.lastname }}</td>
<td style="white-space:pre-wrap; word-wrap:break-word; max-width: 15%">{{ user.email }}</td>
<td class="text-center"><a href="{{ path('users', {'id': user.id }) }}" class="btn btn-sm btn-danger"><span class="fas"></span>Zmeniť užívateľa</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
{% endblock %}
\ No newline at end of file
Supports Markdown
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