77 lines
2.0 KiB
PHP
Executable File
77 lines
2.0 KiB
PHP
Executable File
<?php
|
|
|
|
include_once('../init.php');
|
|
include_once('../config.php');
|
|
include_once(DOC_ROOT.'/libraries.php');
|
|
|
|
switch($_POST['type'])
|
|
{
|
|
case 'editRfc':
|
|
|
|
$rfc->setRfcId($_POST['id']);
|
|
$result = $rfc->Info();
|
|
$myRfc = $util->DecodeUrlRow($result);
|
|
|
|
$smarty->assign('post', $myRfc);
|
|
$smarty->assign('DOC_ROOT', DOC_ROOT);
|
|
$smarty->display(DOC_ROOT.'/templates/boxes/editar-rfc-popup.tpl');
|
|
|
|
break;
|
|
|
|
case 'saveEditRfc':
|
|
|
|
$rfc->setRfcId($_POST['rfcId']);
|
|
$rfc->setRfc($_POST['rfc']);
|
|
$rfc->setRazonSocial($_POST['razonSocial']);
|
|
$rfc->setCalle($_POST['calle']);
|
|
$rfc->setNoExt($_POST['noExt']);
|
|
$rfc->setNoInt($_POST['noInt']);
|
|
$rfc->setReferencia($_POST['referencia']);
|
|
$rfc->setColonia($_POST['colonia']);
|
|
$rfc->setLocalidad($_POST['localidad']);
|
|
$rfc->setMunicipio($_POST['municipio']);
|
|
$rfc->setCiudad($_POST['ciudad']);
|
|
$rfc->setEstado($_POST['estado']);
|
|
$rfc->setPais($_POST['pais']);
|
|
$rfc->setCodigoPostal($_POST['cp']);
|
|
$rfc->setRegimenFiscal($_POST['regimenFiscal']);
|
|
|
|
$rfc->setDiasDevolucion($_POST['diasDevolucion']);
|
|
$rfc->setBonificacion($_POST['bonificacion']);
|
|
$rfc->setDevolucion($_POST['devolucion']);
|
|
|
|
if(!$rfc->Update())
|
|
{
|
|
echo 'fail[#]';
|
|
$smarty->display(DOC_ROOT.'/templates/boxes/status_on_popup.tpl');
|
|
}
|
|
else
|
|
{
|
|
echo 'ok[#]';
|
|
$smarty->display(DOC_ROOT.'/templates/boxes/status_on_popup.tpl');
|
|
echo '[#]';
|
|
$result = $rfc->GetRfcsByEmpresa();
|
|
$empresaRfcs = $util->DecodeUrlResult($result);
|
|
|
|
$smarty->assign('DOC_ROOT', DOC_ROOT);
|
|
$smarty->assign('empresaRfcs', $empresaRfcs);
|
|
$smarty->display(DOC_ROOT.'/templates/lists/datos-generales.tpl');
|
|
}
|
|
|
|
break;
|
|
|
|
case 'viewRfc':
|
|
|
|
$rfc->setRfcId($_POST['id']);
|
|
$result = $rfc->Info();
|
|
$myRfc = $util->DecodeUrlRow($result);
|
|
|
|
$smarty->assign('post', $myRfc);
|
|
$smarty->assign('DOC_ROOT', DOC_ROOT);
|
|
$smarty->display(DOC_ROOT.'/templates/boxes/detalles-rfc-popup.tpl');
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
?>
|