コード例 #1
0
include_once "../../DataAccessObjects/IndirectCostDAO.php";
include_once "../../DataTransferObjects/IndirectCostDTO.php";
if (!isset($_REQUEST["acao"])) {
    echo "Erro no processamento da requisição.";
    exit;
}
$acao = $_REQUEST["acao"];
// Abre a conexao com o banco de dados
$dataConnector = new DataConnector('mySql');
$dataConnector->OpenConnection();
if ($dataConnector->mysqlConnection == null) {
    echo 'Não foi possível se connectar ao bando de dados!';
    exit;
}
// Cria o objeto de mapeamento objeto-relacional
$indirectCostDAO = new IndirectCostDAO($dataConnector->mysqlConnection);
$indirectCostDAO->showErrors = 1;
if ($acao == "store") {
    $serviceCallId = $_REQUEST["serviceCallId"];
    $indirectCostId = $_REQUEST["indirectCostId"];
    $result = $indirectCostDAO->AddDistributedExpense($serviceCallId, $indirectCostId);
    if (!$result) {
        echo "Não foi possivel efetuar a operação...";
        exit;
    }
    echo "Operação efetuada com sucesso!";
}
if ($acao == "remove") {
    $serviceCallId = $_REQUEST["serviceCallId"];
    $indirectCostId = $_REQUEST["indirectCostId"];
    $result = $indirectCostDAO->RemoveDistributedExpense($serviceCallId, $indirectCostId);
コード例 #2
0
$serviceCallArray = $serviceCallDAO->RetrieveRecordArray("cartaoEquipamento IN (" . $equipmentEnumeration . ") AND " . $pediodFilter);
$callEnumeration = "";
foreach ($serviceCallArray as $serviceCall) {
    if (!empty($callEnumeration)) {
        $callEnumeration = $callEnumeration . ", ";
    }
    $callEnumeration = $callEnumeration . $serviceCall->id;
}
if (empty($callEnumeration)) {
    $callEnumeration = "0";
}
$expenseDAO = new ExpenseDAO($dataConnector->mysqlConnection);
$expenseDAO->showErrors = 1;
$expenseArray = $expenseDAO->RetrieveRecordArray("codigoChamado IN (" . $callEnumeration . ")");
// localiza todos os custos indiretos no período
$indirectCostDAO = new IndirectCostDAO($dataConnector->mysqlConnection);
$indirectCostDAO->showErrors = 1;
$indirectCostIdArray = $indirectCostDAO->GetIds("chamadoServico_id IN (" . $callEnumeration . ") GROUP BY custoIndireto_id");
$idEnumeration = "";
foreach ($indirectCostIdArray as $indirectCostId) {
    if (!empty($idEnumeration)) {
        $idEnumeration .= ", ";
    }
    $idEnumeration = $idEnumeration . $indirectCostId;
}
if (empty($idEnumeration)) {
    $idEnumeration = "0";
}
$indirectCostArray = $indirectCostDAO->RetrieveRecordArray("id IN (" . $idEnumeration . ")");
// localiza todos os gastos com consumíveis no período
$supplyRequestDAO = new SupplyRequestDAO($dataConnector->mysqlConnection);
コード例 #3
0
include_once "../DataAccessObjects/IndirectCostDAO.php";
include_once "../DataTransferObjects/IndirectCostDTO.php";
include_once "../DataAccessObjects/ServiceCallDAO.php";
include_once "../DataTransferObjects/ServiceCallDTO.php";
include_once "../DataAccessObjects/EquipmentDAO.php";
include_once "../DataTransferObjects/EquipmentDTO.php";
$indirectCostId = $_GET['indirectCostId'];
// Abre a conexao com o banco de dados
$dataConnector = new DataConnector('both');
$dataConnector->OpenConnection();
if ($dataConnector->mysqlConnection == null || $dataConnector->sqlserverConnection == null) {
    echo 'Não foi possível se connectar ao bando de dados!';
    exit;
}
// Cria os objetos de mapeamento objeto-relacional
$indirectCostDAO = new IndirectCostDAO($dataConnector->mysqlConnection);
$indirectCostDAO->showErrors = 1;
$serviceCallDAO = new ServiceCallDAO($dataConnector->mysqlConnection);
$serviceCallDAO->showErrors = 1;
// Busca os chamados relacionados ao custo indireto
$serviceCallArray = $indirectCostDAO->GetDistributedExpenses($indirectCostId);
if (sizeof($serviceCallArray) == 0) {
    echo "<tr>";
    echo "    <td colspan='5' align='center' >Nenhum registro encontrado!</td>";
    echo "</tr>";
    exit;
}
foreach ($serviceCallArray as $serviceCallId) {
    $serviceCall = $serviceCallDAO->RetrieveRecord($serviceCallId);
    $subject = new Text($serviceCall->defeito);
    $serialNumber = EquipmentDAO::GetSerialNumber($dataConnector->sqlserverConnection, $serviceCall->codigoCartaoEquipamento);
コード例 #4
0
ファイル: acao.php プロジェクト: renatosans/contratos
include_once "../../DataAccessObjects/IndirectCostDAO.php";
include_once "../../DataTransferObjects/IndirectCostDTO.php";
if (!isset($_REQUEST["acao"])) {
    echo "Erro no processamento da requisição.";
    exit;
}
$acao = $_REQUEST["acao"];
// Abre a conexao com o banco de dados
$dataConnector = new DataConnector('mySql');
$dataConnector->OpenConnection();
if ($dataConnector->mysqlConnection == null) {
    echo 'Não foi possível se connectar ao bando de dados!';
    exit;
}
// Cria o objeto de mapeamento objeto-relacional
$indirectCostDAO = new IndirectCostDAO($dataConnector->mysqlConnection);
$indirectCostDAO->showErrors = 1;
if ($acao == "store") {
    $id = 0;
    $indirectCost = new IndirectCostDTO();
    if (isset($_REQUEST["id"]) && $_REQUEST["id"] != 0) {
        $id = $_REQUEST["id"];
        $indirectCost = $indirectCostDAO->RetrieveRecord($id);
    }
    $indirectCost->data = $_REQUEST["data"];
    $indirectCost->hora = $_REQUEST["hora"];
    $indirectCost->solicitante = $_REQUEST["solicitante"];
    $indirectCost->infoSolicitante = $_REQUEST["infoSolicitante"];
    $indirectCost->codigoInsumo = $_REQUEST["codigoInsumo"];
    $indirectCost->medicaoInicial = $_REQUEST["medicaoInicial"];
    $indirectCost->medicaoFinal = $_REQUEST["medicaoFinal"];
コード例 #5
0
ファイル: editar.php プロジェクト: renatosans/contratos
include_once "../../ClassLibrary/DataConnector.php";
include_once "../../DataAccessObjects/IndirectCostDAO.php";
include_once "../../DataTransferObjects/IndirectCostDTO.php";
include_once "../../DataAccessObjects/ProductionInputDAO.php";
include_once "../../DataTransferObjects/ProductionInputDTO.php";
include_once "../../DataAccessObjects/EmployeeDAO.php";
include_once "../../DataTransferObjects/EmployeeDTO.php";
// Abre a conexao com o banco de dados
$dataConnector = new DataConnector('both');
$dataConnector->OpenConnection();
if ($dataConnector->mysqlConnection == null || $dataConnector->sqlserverConnection == null) {
    echo 'Não foi possível se connectar ao bando de dados!';
    exit;
}
// Cria o objeto de mapeamento objeto-relacional
$indirectCostDAO = new IndirectCostDAO($dataConnector->mysqlConnection);
$indirectCostDAO->showErrors = 1;
$productionInputDAO = new ProductionInputDAO($dataConnector->mysqlConnection);
$productionInputDAO->showErrors = 1;
$id = 0;
$indirectCost = new IndirectCostDTO();
if (isset($_REQUEST["id"]) && $_REQUEST["id"] != 0) {
    $id = $_REQUEST["id"];
    $indirectCost = $indirectCostDAO->RetrieveRecord($id);
}
?>

    <h1>Administração - Custo Indireto</h1>
    <h1><?php 
echo str_pad('_', 60, '_', STR_PAD_LEFT);
?>
コード例 #6
0
ファイル: listar.php プロジェクト: renatosans/contratos
include_once "../../check.php";
include_once "../../defines.php";
include_once "../../ClassLibrary/DataConnector.php";
include_once "../../DataAccessObjects/IndirectCostDAO.php";
include_once "../../DataTransferObjects/IndirectCostDTO.php";
include_once "../../DataAccessObjects/ProductionInputDAO.php";
include_once "../../DataTransferObjects/ProductionInputDTO.php";
// Abre a conexao com o banco de dados
$dataConnector = new DataConnector('mySql');
$dataConnector->OpenConnection();
if ($dataConnector->mysqlConnection == null) {
    echo 'Não foi possível se connectar ao bando de dados!';
    exit;
}
// Cria os objetos de mapeamento objeto-relacional
$indirectCostDAO = new IndirectCostDAO($dataConnector->mysqlConnection);
$indirectCostDAO->showErrors = 1;
$productionInputDAO = new ProductionInputDAO($dataConnector->mysqlConnection);
$productionInputDAO->showErrors = 1;
// Traz os custos indiretos cadastrados
$indirectCostArray = $indirectCostDAO->RetrieveRecordArray();
?>
    <h1>Administração - Custos Indiretos</h1>
    <h1><?php 
echo str_pad('_', 60, '_', STR_PAD_LEFT);
?>
</h1>
    <div style="clear:both;">
        <br/><br/>
    </div>