Exemplo n.º 1
0
 /**
  * This is construct base of the class.
  *
  * A public constructor; initializes the variable $instanceDataBase.
  *
  */
 public function __construct($instanceDataBase)
 {
     parent::__construct($instanceDataBase);
     TypeDirection::setDataOperationBusiness($instanceDataBase);
     TypeDirection::getBusiness();
     TypeDirection::getDescriptionBusiness();
 }
        break;
    case 'EDIT':
        $transaction = new Transaction($registry[$nameDataBase]);
        TypeDirection::setDataOperationBusiness($registry[$nameDataBase]);
        $idTransaction = $transaction->insertTransaction(array(TypeDirection::$business, TypeDirection::$update, TypeDirection::$descriptionBusiness));
        $data = array($_POST['NAME'], $_POST['EDIT']);
        $statusTransactionDB = $catalog->updateTypeDirection($data, $idTransaction);
        if ($statusTransactionDB > 0) {
            Forms::setMessage('SUCCESS', $v_label["SHORT_MESSAGE_OK_EDIT"], $v_label["DETAIL_MESSAGE_OK_EDIT"]);
        } else {
            Forms::setMessage('ERROR', $v_label["SHORT_MESSAGE_NOOK_EDIT"], $v_label["DETAIL_MESSAGE_NOOK_EDIT"]);
        }
        break;
    case 'DELETE':
        $transaction = new Transaction($registry[$nameDataBase]);
        TypeDirection::setDataOperationBusiness($registry[$nameDataBase]);
        $idTransaction = $transaction->insertTransaction(array(TypeDirection::$business, TypeDirection::$update, TypeDirection::$descriptionBusiness));
        $data = array($_GET['DELETE']);
        $statusTransactionDB = $catalog->deleteTypeDirection($data, $idTransaction);
        if ($statusTransactionDB > 0) {
            Forms::setMessage('SUCCESS', $v_label["SHORT_MESSAGE_OK_DELETE"], $v_label["DETAIL_MESSAGE_OK_DELETE"]);
        } else {
            Forms::setMessage('ERROR', $v_label["SHORT_MESSAGE_NOOK_DELETE"], $v_label["DETAIL_MESSAGE_NOOK_DELETE"]);
        }
        break;
    default:
        break;
}
// Obtener lista
$list = $catalog->getListTypeDirection();
?>