Skip to content

Commit

Permalink
botao de mostrar valores de consultas
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardovilarinho committed Aug 7, 2017
1 parent 2e469f2 commit 293ea79
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/banco.sql
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ CREATE TABLE `carga_horarias` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


DROP TABLE IF EXISTS `consultas`;
CREATE TABLE `consultas` (
CREATE TABLE IF NOT EXISTS `consultas` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`horario` datetime NOT NULL,
`obs` text COLLATE utf8mb4_unicode_ci,
`status` enum('Primeira','Retorno','Nova') COLLATE utf8mb4_unicode_ci NOT NULL,
`medico_id` int(10) unsigned NOT NULL,
`valor` decimal(8,2) DEFAULT NULL,
`paciente_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
Expand Down
28 changes: 25 additions & 3 deletions src/resources/views/medicos/dia.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

@section('conteudo')


<p style="text-align:center">
@if(session('msg'))
<span class="texto-verde">
Expand Down Expand Up @@ -43,6 +44,8 @@
</section>
{{ Form::close() }}

<button onclick="mostrarPrecos()" class="btn verde">Mostrar/ocultar preços das consultas</button>

<section id="imprimir">
<p>
Olá <span class="texto-verde">{{ auth()->user()->nome }}</span>, aqui estão suas consultas entre <span class="texto-verde">{{ $inicio->format('d/m/Y á\s H:i') }}</span> e <span class="texto-verde">{{ $fim->format('d/m/Y á\s H:i') }}</span:
Expand All @@ -57,7 +60,8 @@
<span>
{{ date('d/m/Y á\s H:i', strtotime($consulta->horario)) }} -
{{ $consulta->paciente->nome }} |
{{ Saudacoes::idade($consulta->paciente->nascimento) }} ano(s)
{{ Saudacoes::idade($consulta->paciente->nascimento) }} ano(s) |
<span class="oculto">R${{ $consulta->valor }}</span>
</span>

<div class="direita">
Expand All @@ -77,7 +81,8 @@
<span>
{{ date('d/m/Y á\s H:i', strtotime($consulta->horario)) }} -
{{ $consulta->paciente->nome }} |
{{ Saudacoes::idade($consulta->paciente->nascimento) }} ano(s)
{{ Saudacoes::idade($consulta->paciente->nascimento) }} ano(s) |
<span class="oculto">R${{ $consulta->valor }}</span>
</span>

<div class="direita">
Expand All @@ -89,7 +94,24 @@
@endif
</section>

<button class="btn vermelho" disabled>Total de {{ $preco }} reais!</button>
<button class="btn vermelho oculto" disabled>Total de {{ $preco }} reais!</button>

<button onclick="printDiv('imprimir')" class="btn verde oculta-tel">Imprimir</button>

<script>
var ocultos = document.querySelectorAll('.oculto');
for (var i = 0; i < ocultos.length; i++) {
ocultos[i].style.display = 'none';
}
function mostrarPrecos() {
var ocultos = document.querySelectorAll('.oculto');
for (var i = 0; i < ocultos.length; i++) {
if(ocultos[i].style.display == 'none')
ocultos[i].style.display = '';
else
ocultos[i].style.display = 'none';
}
}
</script>
@endsection

0 comments on commit 293ea79

Please sign in to comment.