1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-26 07:44:02 +01:00
openstamanager/modules/contratti/buttons.php
2018-06-26 14:30:26 +02:00

24 lines
905 B
PHP

<?php
include_once __DIR__.'/../../core.php';
$rs_documento = $dbo->fetchArray('SELECT * FROM co_righe_documenti WHERE idcontratto='.prepare($id_record));
if (sizeof($rs_documento) > 0) {
echo '
<button type="button" class="btn btn-info" disabled>
<i class="fa fa-magic"></i> '.tr('Crea fattura').'...
</button>';
} else {
echo "
<button type=\"button\" class=\"btn btn-info\" onclick=\"if( confirm('Creare una fattura per questo contratto?') ){fattura_da_contratto();}\">
<i class=\"fa fa-magic\"></i> ".tr('Crea fattura').'...
</button>';
}
if ($records[0]['rinnovabile']) {
echo "
<button type=\"button\" class=\"btn btn-warning\" onclick=\"if( confirm('Rinnovare questo contratto?') ){ location.href='".$rootdir.'/editor.php?op=renew&id_module='.$id_module.'&id_record='.$id_record."'; }\">
<i class=\"fa fa-refresh\"></i> ".tr('Rinnova').'...
</button>';
}