Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript" src="../js/jquery-1.4.4.min.js"></script>
- <script>
- var input = 0;
- function mais(campo) {
- var nova = document.getElementById("aqui");
- var novadiv = document.createElement("div");
- var nomediv = "div";
- novadiv.innerHTML = "<td class='nomecampos'>Origem:</td><td width='738' ><input type='text' name='origem[]' class='input' id='origem[]' value=''/></td><br/><br/>";
- novadiv.innerHTML += "<td class='nomecampos'>Destino:</td><td ><input type='text' name='destino[]' id='destino[]' class='input' value=''/></td><br/><br/>";
- novadiv.innerHTML += "<td class='nomecampos'>Motivo:</td><td><label><textarea name='motivo[]' id='motivo[]' class='input'></textarea></label></td><br/><br/>";
- novadiv.innerHTML += "<td class='nomecampos'>Paciente:</td><td ><label><input type='text' name='paciente[]' id='paciente[]' class='input' value=''/></label></td></tr><hr/>";
- nova.appendChild(novadiv);
- input++;
- }
- </script>
- </script>
- <?php require("../include_ob/boletim/crud.php");
- require("../include_ob/acv/crud.php");
- require("../include_ob/motorista/crud.php");
- require("../include_ob/veiculos/crud.php");
- require("../include_ob/unid_saude/crud.php");
- /*require("../include_ob/cidade/crud.php");
- require("../include_ob/bairro/crud.php");*/
- require("../include_ob/funcao_data.php");
- require("../include_ob/clinica/crud.php");
- $cod_bol = $_POST["cod_bol"];
- $id_bol = $_POST["id_bol"];
- $ubs = $_POST["ubs"];
- $motorista = $_POST["motorista"];
- $plantonista = $_POST["plantonista"];
- $veiculo = $_POST["veiculo"];
- $paciente = $_POST["paciente"];
- $endereco = $_POST["endereco"];
- $hr_saida = $_POST["hr_saida"];
- $km_saida = $_POST["km_saida"];
- $hr_chegada = $_POST["hr_chegada"];
- $km_chegada = $_POST["km_chegada"];
- $destino = $_POST["destino"];
- $km_rodados = $_POST["km_rodados"];
- $dt_atend = $_POST["dt_atend"];
- $dt_atend = databr($dt_atend,1);
- $origem = $_POST["origem"];
- $motivo = $_POST["motivo"];
- if($_POST['acao'] == '1' ){
- if($_POST['action'] == 'inserir'){
- $obj = new boletim();
- $obj->inserir($ubs,$motorista,$plantonista,$veiculo,$paciente,$endereco,$hr_saida,$km_saida,$hr_chegada,$km_chegada,$km_rodados,$dt_atend,$origem,$destino,$motivo,$id_bol);
- }
- if($_POST['action'] == 'alterar'){
- $obj = new boletim();
- $obj->atualizar($ubs,$motorista,$plantonista,$veiculo,$paciente,$endereco,$hr_saida,$km_saida,$hr_chegada,$km_chegada,$destino,$km_rodados,$dt_atend,$cod_bol);
- $objAcv = new acv();
- $objAcv = atualizar($origem,$destino,$motivo,$cod_bol,$cod_acv);
- }
- }
- if($_GET['action'] != '' ){
- $obj = new boletim();
- $obj->selCodigo();
- $row=mysql_fetch_object($obj->rs);
- $objAcv = new acv();
- $objAcv->selCodigo();
- $rowAcv=mysql_fetch_object($objAcv->rs);
- }
- if($_GET['action'] == '' && $_GET['page'] == 'boletim' ){
- $obj = new boletim();
- $obj->increment();
- $row=mysql_fetch_object($obj->rs);
- $id = $row->Auto_increment;
- }
- ?>
- <fieldset> <legend>Movimento de Autorização de Circulação de Veículos
- </legend><table width="97%" height="442" align="center" class="tabela">
- <tr><td>
- </td> </tr>
- <tr> <td align="center" valign="top">
- <?php echo $mensagem; ?>
- <? include('../load/load.php'); ?>
- <form action="" method="post" enctype="multipart/form-data">
- <input type="hidden" name="campo" value="">
- <table width="100%" border="0" cellspacing="4" cellpadding="0">
- <tr>
- <td colspan="2" class="nomecampos"><fieldset>
- <legend>Informações da ACV</legend>
- <table width="100%" border="0">
- <tr>
- <td width="388" class="nomecampos">Número da ACV:</td>
- <td width="738" ><label>
- <input type="text" name="cod_bol" id="cod_bol" class="inputcodigo" readonly="readonly" value="<?php if($id != ''){ echo $id; }else{ echo $row->cod_bol; } ?>"/>
- <input type="hidden" name="id_bol" id="id_bol" class="inputcodigo" readonly="readonly" value="<?php if($id != ''){ echo $id; }else{ echo $row->cod_bol; } ?>"/>
- </label></td>
- </tr>
- <tr>
- <td class="nomecampos">Data:</td>
- <td ><input type="text" name="dt_atend" id="dt_atend" class="inputmenor" value="<?php echo date("d/m/Y"); ?>" readonly="readonly"/></td>
- </tr>
- <tr>
- <td class="nomecampos">Motorista:</td>
- <td ><label>
- <select name="motorista" id="motorista" class="inputmenor" >
- <option value="0">SELECIONE UM MOTORISTA</option>
- <?php
- $obj = new motorista();
- $obj->selecionarbusca($busca);
- while($rowMot=mysql_fetch_object($obj->rs)){?>
- <option value="<?php echo $rowMot->NOME_MOT; ?>" <?php if($rowMot->COD_MOT == $row->motorista){ ?> selected="selected" <?php } ?>><?php echo $rowMot->NOME_MOT; ?></option>
- <?php } ?>
- </select>
- </label></td>
- </tr>
- <tr>
- <td class="nomecampos">Veículo:</td>
- <td ><label>
- <select name="veiculo" id="veiculo" class="inputmenor" >
- <option value="0">SELECIONE UM VEÍCULO</option>
- <?php
- $obj = new veiculos();
- $obj->selecionarbusca($busca);
- while($rowVei=mysql_fetch_object($obj->rs)){?>
- <option value="<?php echo $rowVei->MODELO_VEI.' '.$rowVei->PLACA_VEI; ?>" <?php if($rowVei->COD == $row->veiculo){ ?> selected="selected" <?php } ?>><?php echo $rowVei->MODELO_VEI.' '.$rowVei->PLACA_VEI; ?></option>
- <?php } ?>
- </select>
- </label></td>
- </tr>
- <tr>
- <td class="nomecampos">Unidade de Saúde:</td>
- <td ><label>
- <select name="ubs" id="ubs" class="inputmenor" >
- <option value="0">SELECIONE UMA UBS</option>
- <?php
- $obj = new unid_saude();
- $obj->selecionarbusca($busca);
- while($rowUbs=mysql_fetch_object($obj->rs)){?>
- <option value="<?php echo $rowUbs->CODIGO_UNID; ?>" <?php if($rowUbs->CODIGO_UNID == $rowUbs->ubs){ ?> selected="selected" <?php } ?>><?php echo $rowUbs->UNIDADE; ?></option>
- <?php } ?>
- </select>
- </label></td>
- </tr>
- <tr>
- <td class="nomecampos">Responsável pela liberação:</td>
- <td><label>
- </label>
- <label>
- <select name="plantonista" id="plantonista" class="inputmenor" >
- <option value="0">SELECIONE UM MOTORISTA</option>
- <?php
- $obj = new motorista();
- $obj->selecionarbusca($busca);
- while($rowMot=mysql_fetch_object($obj->rs)){?>
- <option value="<?php echo $rowMot->NOME_MOT; ?>" <?php if($rowMot->COD_MOT == $row->motorista){ ?> selected="selected" <?php } ?>><?php echo $rowMot->NOME_MOT; ?></option>
- <?php } ?>
- </select>
- </label></td>
- </tr>
- <tr>
- <td class="nomecampos">Hora da Saída:</td>
- <td><label>
- <input type="text" name="hr_saida" id="hr_saida" class="inputmenor" value="<?php echo $row->hr_saida; ?>"/>
- </label></td>
- </tr>
- <tr>
- <td class="nomecampos">Km da Saída:</td>
- <td><label>
- <input type="text" name="km_saida" id="km_saida" class="input" value="<?php echo $row->km_saida; ?>"/>
- </label></td>
- </tr>
- </table>
- </fieldset></td>
- </tr>
- <tr>
- <td height="24" colspan="2" class="nomecampos"> </td>
- </tr>
- <tr>
- <td colspan="2" class="nomecampos"><fieldset>
- <legend>Dados do Percurso
- </legend><table width="100%" border="0">
- <tr>
- <td width="388" class="nomecampos">Origem:</td>
- <td width="738" >
- <select name="origem[]" id="origem[]" class="inputmenor" >
- <option value="0">SELECIONE UMA ORIGEM</option>
- <?php
- $obj = new clinica();
- $obj->selecionarbusca($busca);
- while($rowLoc=mysql_fetch_object($obj->rs)){?>
- <option value="<?php echo $rowLoc->CLINICA; ?>" <?php if($rowLoc->CODIGO == $rowLoc->origem){ ?> selected="selected" <?php } ?>><?php echo $rowLoc->CLINICA; ?></option>
- <?php } ?>
- </select>
- </td>
- </tr>
- <tr>
- <td class="nomecampos">Destino:</td>
- <td >
- <select name="destino[]" id="destino[]" class="inputmenor" >
- <option value="0">SELECIONE UM DESTINO</option>
- <?php
- $obj = new clinica();
- $obj->selecionarbusca($busca);
- while($rowLoc=mysql_fetch_object($obj->rs)){?>
- <option value="<?php echo $rowLoc->CLINICA; ?>" <?php if($rowLoc->CODIGO == $rowLoc->origem){ ?> selected="selected" <?php } ?>><?php echo $rowLoc->CLINICA; ?></option>
- <?php } ?>
- </select></td>
- </tr>
- <tr>
- <td class="nomecampos">Motivo:</td>
- <td><label>
- <textarea name="motivo[]" id="motivo[]" class="input"><?php echo $rowAcv->motivo; ?></textarea>
- </label></td>
- </tr>
- <tr>
- <td class="nomecampos">Paciente:</td>
- <td ><label>
- <input type="text" name="paciente[]" id="paciente[]" class="input" value="<?php echo $row->paciente; ?>"/>
- </label></td>
- </tr>
- <tr>
- <td align="left" class="titulo"></td>
- <td align="left" class="titulo"><br><input type="button" value="Adicionar Percurso" onClick="mais(campo.value);">
- <span class="titinterno2">Clique aqui para adicionar</span> <div id="aqui"></div></td>
- </tr>
- <div id="campos"> </div>
- </table>
- </fieldset></td>
- </tr>
- <tr>
- <td colspan="2" class="nomecampos"> </td>
- </tr>
- <tr>
- <td colspan="2" class="nomecampos"><fieldset>
- <legend>Dados do Fechamento da ACV</legend>
- <table width="100%" border="0">
- <tr>
- <td width="245" class="nomecampos">Hora da Chegada:</td>
- <td width="888"><label>
- <input type="text" name="hr_saida" id="hr_saida" class="inputmenor" value="<?php echo $row->hr_saida; ?>"/>
- </label></td>
- </tr>
- <tr>
- <td class="nomecampos">Km da Chegada:</td>
- <td><label>
- <input type="text" name="km_saida" id="km_saida" class="input" value="<?php echo $row->km_saida; ?>"/>
- </label></td>
- </tr>
- <tr>
- <td class="nomecampos"> </td>
- <td > </td>
- </tr>
- </table>
- </fieldset></td>
- </tr>
- <tr>
- <td width="27%" align="left"> </td>
- <td width="73%" align="left"><input type="hidden" name="acao" value= "1" />
- <input type="hidden" name="cod_diaria" value= "<?php echo $row->cod_bol; ?>" />
- <input type="hidden" name="cod_acv" value= "<?php echo $row->cod_acv; ?>" />
- <input type="hidden" name="action" value = "<?php if ($_GET['action'] !="") {echo $_GET['action'];} else { echo "inserir";} ?>" />
- <input type="submit" name="button" id="button" value="<?php if ($_GET['action'] !="") {echo 'Alterar';} else { echo "Inserir";} ?>" />
- <input name="Limpar" type="reset" value="Limpar"/></td>
- </tr>
- <tr>
- <td align="left"> </td>
- <td align="right"><span style="padding-right:0px"><a href="../?page=pesqbol">pesquisar </a> - <a href="javascript:history.back(1);"> voltar</a></span></td>
- </tr>
- </table>
- </form>
- </td></tr>
- </table>
- </fieldset>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement