Compare commits
2 Commits
ac571273f5
...
319cd5e44e
Author | SHA1 | Date | |
---|---|---|---|
319cd5e44e | |||
cf18949409 |
25
common/Controller/Web/Documentos.php
Normal file
25
common/Controller/Web/Documentos.php
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
namespace ProVM\NotariaRaby\Common\Controller\Web;
|
||||||
|
|
||||||
|
use Psr\Container\ContainerInterface as Container;
|
||||||
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
|
use Psr\Http\Message\ResponseInterface as Response;
|
||||||
|
|
||||||
|
class Documentos {
|
||||||
|
public function existe(Request $request, Response $response, Container $container, $documento) {
|
||||||
|
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||||
|
$container->get('folders.upload'),
|
||||||
|
$documento . '.pdf'
|
||||||
|
]);
|
||||||
|
$existe = file_exists($filename);
|
||||||
|
$output = [
|
||||||
|
'informacion' => $documento,
|
||||||
|
'archivo' => $filename,
|
||||||
|
'existe' => $existe
|
||||||
|
];
|
||||||
|
$response->getBody()->write(json_encode($output));
|
||||||
|
return $response
|
||||||
|
->withHeader('Content-Type', 'application/json')
|
||||||
|
->withStatus(201);
|
||||||
|
}
|
||||||
|
}
|
@ -129,7 +129,7 @@
|
|||||||
#indice .img,
|
#indice .img,
|
||||||
#indice .img img {
|
#indice .img img {
|
||||||
max-height: 20rem !important;
|
max-height: 20rem !important;
|
||||||
min-height: 10rem !important;
|
min-height: 20rem !important;
|
||||||
}
|
}
|
||||||
#indice .contenido {
|
#indice .contenido {
|
||||||
padding-top: 5rem !important;
|
padding-top: 5rem !important;
|
||||||
|
6
resources/routes/web/documentos.php
Normal file
6
resources/routes/web/documentos.php
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
use ProVM\NotariaRaby\Common\Controller\Web\Documentos;
|
||||||
|
|
||||||
|
$app->group('/documentos', function($app) {
|
||||||
|
$app->get('/existe/{documento}', [Documentos::class, 'existe']);
|
||||||
|
});
|
@ -36,6 +36,7 @@
|
|||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
var file_url = ''
|
||||||
$('#indices_calendar').calendar({
|
$('#indices_calendar').calendar({
|
||||||
type: 'month',
|
type: 'month',
|
||||||
text: {
|
text: {
|
||||||
@ -51,12 +52,23 @@
|
|||||||
'{!!implode("', '", $months->full)!!}'
|
'{!!implode("', '", $months->full)!!}'
|
||||||
]
|
]
|
||||||
var date = arguments[0]
|
var date = arguments[0]
|
||||||
var url = '{{$urls->uploads}}/indices_' + date.getFullYear() + '_' + months[date.getMonth()] + '.pdf'
|
var test = 'indices_' + date.getFullYear() + '_' + months[date.getMonth()]
|
||||||
$('#indices_descarga').attr('href', url)
|
$.getJSON('{{$urls->base}}/documentos/existe/' + test, function(data) {
|
||||||
|
if (data.existe) {
|
||||||
|
var url = '{{$urls->uploads}}/indices_' + date.getFullYear() + '_' + months[date.getMonth()] + '.pdf'
|
||||||
|
$('#indices_descarga').attr('href', url).show()
|
||||||
|
file_url = url
|
||||||
|
return
|
||||||
|
}
|
||||||
|
$('#indices_descarga').attr('href', '').hide()
|
||||||
|
file_url = ''
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
$('#indices_descarga').hide()
|
||||||
$('#form_indices').submit(function(e) {
|
$('#form_indices').submit(function(e) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
window.open(file_url, '_blank')
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<a href="#" target="_window" id="balances_descarga">
|
<a href="#" target="_blank" id="balances_descarga">
|
||||||
<button class="ui mini gray button">DESCARGA</button>
|
<button class="ui mini gray button">DESCARGA</button>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -60,7 +60,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<a href="#" target="_window" id="patrimonio_descarga">
|
<a href="#" target="_blank" id="patrimonio_descarga">
|
||||||
<button class="ui mini gray button">DESCARGA</button>
|
<button class="ui mini gray button">DESCARGA</button>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -76,12 +76,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<a href="#" target="_window" id="fiscalia_descarga">
|
<a href="#" target="_blank" id="fiscalia_descarga">
|
||||||
<button class="ui mini gray button">DESCARGA</button>
|
<button class="ui mini gray button">DESCARGA</button>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<a target="_window" href="{{$urls->uploads}}/valores.pdf">
|
<a target="_blank" href="{{$urls->uploads}}/valores.pdf">
|
||||||
<i class="dropdown icon"></i>
|
<i class="dropdown icon"></i>
|
||||||
Valores
|
Valores
|
||||||
</a>
|
</a>
|
||||||
@ -97,6 +97,11 @@
|
|||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
var urls = {
|
||||||
|
balances: '',
|
||||||
|
patrimonio: '',
|
||||||
|
fiscalia: ''
|
||||||
|
}
|
||||||
$('.accordion').accordion()
|
$('.accordion').accordion()
|
||||||
$('#balances_calendar').calendar({
|
$('#balances_calendar').calendar({
|
||||||
type: 'month',
|
type: 'month',
|
||||||
@ -113,8 +118,17 @@
|
|||||||
'{!!implode("', '", $months->full)!!}'
|
'{!!implode("', '", $months->full)!!}'
|
||||||
]
|
]
|
||||||
var date = arguments[0]
|
var date = arguments[0]
|
||||||
var url = '{{$urls->uploads}}/balances_anuales_' + date.getFullYear() + '_' + months[date.getMonth()] + '.pdf'
|
var test = 'balances_anuales_' + date.getFullYear() + '_' + months[date.getMonth()]
|
||||||
$('#balances_descarga').attr('href', url)
|
$.getJSON('{{$urls->base}}/documentos/existe/' + test, function(data) {
|
||||||
|
if (data.existe) {
|
||||||
|
var url = '{{$urls->uploads}}/balances_anuales_' + date.getFullYear() + '_' + months[date.getMonth()] + '.pdf'
|
||||||
|
$('#balances_descarga').attr('href', url).show()
|
||||||
|
urls.balances = url
|
||||||
|
return
|
||||||
|
}
|
||||||
|
$('#balances_descarga').attr('href', '').hide()
|
||||||
|
urls.balances = ''
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
$('#patrimonio_calendar').calendar({
|
$('#patrimonio_calendar').calendar({
|
||||||
@ -132,8 +146,17 @@
|
|||||||
'{!!implode("', '", $months->full)!!}'
|
'{!!implode("', '", $months->full)!!}'
|
||||||
]
|
]
|
||||||
var date = arguments[0]
|
var date = arguments[0]
|
||||||
var url = '{{$urls->uploads}}/intereses_y_patrimonio_' + date.getFullYear() + '_' + months[date.getMonth()] + '.pdf'
|
var test = 'intereses_y_patrimonio_' + date.getFullYear() + '_' + months[date.getMonth()]
|
||||||
$('#patrimonio_descarga').attr('href', url)
|
$.getJSON('{{$urls->base}}/documentos/existe/' + test, function(data) {
|
||||||
|
if (data.existe) {
|
||||||
|
var url = '{{$urls->uploads}}/intereses_y_patrimonio_' + date.getFullYear() + '_' + months[date.getMonth()] + '.pdf'
|
||||||
|
$('#patrimonio_descarga').attr('href', url).show()
|
||||||
|
urls.patrimonio = url
|
||||||
|
return
|
||||||
|
}
|
||||||
|
$('#patrimonio_descarga').attr('href', '').hide()
|
||||||
|
urls.patrimonio = ''
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
$('#fiscalia_calendar').calendar({
|
$('#fiscalia_calendar').calendar({
|
||||||
@ -151,10 +174,20 @@
|
|||||||
'{!!implode("', '", $months->full)!!}'
|
'{!!implode("', '", $months->full)!!}'
|
||||||
]
|
]
|
||||||
var date = arguments[0]
|
var date = arguments[0]
|
||||||
var url = '{{$urls->uploads}}/informes_fiscalia_' + date.getFullYear() + '_' + months[date.getMonth()] + '.pdf'
|
var test = 'informes_fiscalia_' + date.getFullYear() + '_' + months[date.getMonth()]
|
||||||
$('#fiscalia_descarga').attr('href', url)
|
$.getJSON('{{$urls->base}}/documentos/existe/' + test, function(data) {
|
||||||
|
if (data.existe) {
|
||||||
|
var url = '{{$urls->uploads}}/informes_fiscalia_' + date.getFullYear() + '_' + months[date.getMonth()] + '.pdf'
|
||||||
|
$('#fiscalia_descarga').attr('href', url).show()
|
||||||
|
urls.fiscalia = url
|
||||||
|
return
|
||||||
|
}
|
||||||
|
$('#fiscalia_descarga').attr('href', '').hide()
|
||||||
|
urls.fiscalia = ''
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
$("[id$='_descarga']").hide()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
Reference in New Issue
Block a user