Ir para conteúdo
Fórum Script Brasil
  • 0

opcao para altera


alinefs

Pergunta

Fiz um site que quero colocar na parte da DATA DE EXECUÇÃO uma opção para pode alterar a data que já esta no banco com a data que o usuario digitar se puderem me ajduar. agardeço.

<?php

session_start();

error_reporting(E_ALL ^ E_NOTICE);

if (!isset($_SESSION['USER'])){

echo '<script>opener.history.go(0);window.close()</script>';

//exit;

}

include('include/config.php');

include('include/functions.php');

//$string = ($_GET[$_SESSION['CODE_VAR']]);

//echo $string;

//parse_str($string);

$mode = $_GET['mode'];

$id = $_GET['id'];

$query = 'select do.id as orcamento_id,

do.site,

do.os,

do.login_abertura,

do.data_abertura,

do.login_ultimo_aprovador,

s.name as status,

do.regional,

do.data_execucao,

do.classificacao,

(select cat.name from categorization_tier1 cat where do.classificacao=cat.id) as categorization_tier_1,

do.justificativa,

(SELECT max(user_id) FROM `audit_log` WHERE orcamento_id=do.id group by orcamento_id) as login_ultimo_aprovador,

(SELECT max(data_entrada) FROM `audit_log` WHERE orcamento_id=do.id group by orcamento_id) as data_ultimo_aprovador,

(SELECT tl.name from tipo_lpu tl where do.tipo_lpu_id = tl.id) as tipo_lpu,

do.tipo_lpu_id,

do.tipo_emergencial,

do.empresa,

u.nome as login_abertura_nome

from dados_orcamento do,

status s,

users u

where do.status=s.id

and u.login=do.login_abertura';

$query .= ' and do.id=.orcamento_id($id);

//echo $query;

if ($mode=='edit') {

$res = mysql_query($query) or die(mysql_error());

$line = mysql_fetch_assoc($res) or die(mysql_error());

$edit_mode='true';

//var_dump($line);

}

if ($mode=='view') {

$res = mysql_query($query) or die(mysql_error());

$line = mysql_fetch_assoc($res) or die(mysql_error());

$edit_mode='false';

}

if ($mode=='new') {

$res = mysql_query($query) or die(mysql_error());

$line = mysql_fetch_assoc($res) or die(mysql_error()); //caso houver campos preencidos no ato da criacao

$line['orcamento_id] = $_SESSION['ORC_ID'];

$line['status'] = 'Aberto';

$line['data_abertura'] = $_SESSION['DATE_CREATE'];

$line['login_abertura'] = $_SESSION['USER'];

$edit_mode=true';

}

$line['orcamento_id_str] = orcamento_id($line['orcamento_id'],1);

?>

<!--

<?php echo APPL_NAME ?>

Desenvolvido por Roberta Brandão

r.brandao@claro.com.br

(21) 9101-2500

-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns=http://www.w3.org/1999/xhtml">

<head>

<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

<META HTTP-EQUIV="Expires" CONTENT="-1">

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Or&ccedil;amento - <?php echo APPL_NAME ?></title>

<!--ENCs-->

<script src="js/encode.js"></script>

<!--End ENCs-->

<!-- DHX CALENDAR-->

<link rel="STYLESHEET" type="text/css" href="js/calendar/skins/dhtmlxcalendar_yahoolike.css">

<script src="js/calendar/dhtmlxcalendar.js"></script>

<!-- DHX CALENDAR-->

<!-- DHX GRID-->

<script language="javascript" type="text/javascript">

window.dhx_globalImgPath="js/calendar/imgs/";

window.name = 'orcamento';

var id_orcamento_value = <?php echo (isset($id)?orcamento_id($id):'"none"'); ?>;

var edit_mode = <?php echo $edit_mode; ?>;

var APPL_NAME='<?php echo APPL_NAME ?>';

</script>

<link rel="STYLESHEET" type="text/css" href="js/grid/dhtmlxgrid.css">

<link rel="STYLESHEET" type="text/css" href="js/grid/dhtmlxcombo.css">

<script src="js/grid/dhtmlxcommon.js"></script>

<script src="js/grid/dhtmlxgrid.js"></script>

<script src="js/grid/dhtmlxcombo.js"></script>

<script src="js/grid/dhtmlxgridcell.js"></script>

<!--script src="js/grid/ext/dhtmlxgrid_srnd.js"></script-->

<!--script src="js/grid/ext/dhtmlxgrid_group.js">//group</script-->

<!--script src="js/grid/ext/dhtmlxgrid_splt.js"></script-->

<!--script src="js/grid/ext/dhtmlxgrid_nxml.js"></script-->

<!--script src="js/grid/dhtmlxgrid_export.js"> //export excell</script-->

<!--script src="js/grid/ext/dhtmlxgrid_pgn.js"> //paginacao </script-->

<script src="js/grid/ext/dhtmlxgrid_filter.js"></script>

<script src="js/grid/excells/dhtmlxgrid_excell_sub_row.js"></script>

<!-- End DHX -->

<!-- DHX Menu -->

<link rel="stylesheet" type="text/css" href="js/menu/skins/dhtmlxmenu_dhx_web.css">

<script src="js/menu/dhtmlxmenu.js"></script>

<script src="js/menu/ext/dhtmlxmenu_ext.js"></script>

<!-- End DHX Menu -->

<!-- DHX Window -->

<link rel="stylesheet" type="text/css" href="js/window/dhtmlxwindows.css">

<link rel="stylesheet" type="text/css" href="js/window/skins/dhtmlxwindows_dhx_black.css">

<script src="js/window/dhtmlxwindows.js"></script>

<script src="js/window/dhtmlxcontainer.js"></script>

<!-- End DHX Window -->

<style type="text/css">

<!--

body {

background-color: #FFF;

background-image: url(img/bg.gif);

background-repeat: repeat-x;

margin-left: 0px;

margin-top: 0px;

margin-right: 0px;

margin-bottom: 0px;

}

.about {

font-size: 10px;

color: #000;

font-family: Verdana, Geneva, sans-serif;

text-align:center;

}

.text_10px {

font-size: 10px;

font-family: Verdana, Geneva, sans-serif;

}

#conteudo_SGI {

position: relative;

left:auto;

top:auto;

height:550px;

z-index:1;

width: 95%;

overflow: auto;

}

#loading {

/* position:absolute;

left:752px;

top:243px;

width:32px;

height:32px;*/

z-index:1;

visibility: hidden;

}

#multi_calendar{

background-color: #FFF;

position:absolute;

top:196px;

display: none;

z-index:50;

border: 1px solid #666;

width: 438px;

height: 215px;

left: 566px;

}

#calendar0{

position:absolute;

left:20px;

top:20px;

display: block;

z-index:100;

}

#calendar1{

position:absolute;

left:230px;

top:20px;

display: block;

z-index:100;

}

.Txt_Common {

font-family: Arial, Helvetica, sans-serif;

font-size: 12px;

}

.Txt_Footer {

font-family: Arial, Helvetica, sans-serif;

font-size: 12px;

background-color: #FFF;

background-image: url(img/bg.gif);

background-repeat: repeat-x;

}

.read_only_inputs {

font-family: Verdana, Geneva, sans-serif;

font-size: 10px;

background-color:#CCC;

border: 1px solid #666;

}

.Txt_Common b {

color: #F00;

}

.mini_inputs {

font-family: Verdana, Geneva, sans-serif;

font-size: 10px;

border: 1px inset;

}td img {display: block;}td img {display: block;}

-->

</style>

</head>

<body>

<table width="100%" height="534" border="0" align="center" cellpadding="1" cellspacing="1" class="text_10px">

<tr>

<td height="17" colspan="4"><div style="height: 25px;"><div id="menu_orcamento"></div></td>

</tr>

<tr>

<td width="27%" height="77" valign="bottom" bgcolor="#DFDFDF"><table width="333" border="0" cellspacing="0" cellpadding="0" class="text_10px">

<tr>

<td>Or&ccedil;amento Id:</td>

<td colspan="2"><input name="orcamento_id" type="text" class="mini_inputs" id="orcamento_id" accesskey="0" readonly="readonly" value="<?php echo $line['orcamento_id_str]; ?>"/></td>

</tr>

<tr>

<td width="116">OS Remedy:</td>

<td colspan="2" class="text_10px"><input name="os" type="text" class="mini_inputs" id="os" accesskey="0" value="<?php echo $line['os']; ?>"/>

<label class=text_10px"><input name="type_os" type="radio" onchange="convert_remedy(1)" onclick="convert_remedy(1)" id="radio_inc"/>INC</label><label class="text_10px"><input name="type_os" type="radio" onchange="convert_remedy(2)" onclick="convert_remedy(2)" id="radio_crq"/>CRQ</label>

</td>

</tr>

<tr>

<td>Site:</td>

<td width="194" ><input name="site" type="text" onkeypress="<?php echo ($line['login_abertura]==$_SESSION['USER']?'onEnterkey(event,\'findsite();\')':'') ?>" class=mini_inputs" id="site" accesskey="0" value="<?php echo $line['site]; ?>"/>

<input name="search_site" type="submit" class="mini_inputs" id="search_site" value="Validar" onclick="<?php echo ($line['login_abertura']==$_SESSION['USER']?'findsite()':'') ?>"/></td>

<td width=23"><span id="mini_loading" style="visibility:hidden"><img src="img/mini_loading.gif" border="0" /></span></td>

</tr>

<tr>

<td>Regional:</td>

<td colspan="2"><span id="span_regional"><input name="regional" type="text" class="read_only_inputs" id="regional" accesskey="0" readonly="readonly" value="<?php echo $line['regional]; ?>" /></span></td>

</tr>

<tr>

<td>Dono:</td>

<td colspan="2"><input name="owner" type="hidden" id="owner" value="<?php echo $line['login_abertura']; ?>" />

<input name=owner" type="text" class="read_only_inputs" id="owner_name" accesskey="0" readonly="readonly" value="<?php echo $line['login_abertura_nome].'('.$line['login_abertura'].')'; ?>" /></td>

</tr>

<tr>

<td>Aprovador:</td>

<td colspan=2"><input name="approver" type="text" class="read_only_inputs" id="approver" accesskey="0" readonly="readonly" value="<?php echo $line['login_ultimo_aprovador]; ?>"/></td>

</tr>

</table> <span id="div_CountX" class="about"></span></td>

<td width="26%" valign="bottom" bgcolor="#DFDFDF">

<table width="322" border="0" cellspacing="0" cellpadding="2" class="text_10px">

<tr>

<td width="116">Status:</td>

<td width="206"><input name="status" type="text" class="read_only_inputs" id="status" accesskey="0" readonly="readonly" value="<?php echo $line['status']; ?>"/></td>

</tr>

<tr>

<td>Tipo de LPU:</td>

<td><span id=span_tipo_lpu"><select name="tipo_lpu" class="mini_inputs" id="tipo_lpu">

<?php echo (isset($line['tipo_lpu])?'<option selected="selected" value="'.$line['tipo_lpu_id'].'">'.$line['tipo_lpu'].'</option>':'<option value=">Selecione um Item</option>'); ?>

</select></span></td>

</tr>

<tr>

<td>Empresa:</td>

<td><span id="span_empresa"><input name="empresa" type="text" class="mini_inputs" id="empresa" accesskey="0" disabled="disabled" value="<?php echo $line['empresa]; ?>"/></span></td>

</tr>

<tr>

<td>Data da Cria&ccedil;&atilde;o:</td>

<td><input name="owner_date" type="text" class="read_only_inputs" id="owner_date" accesskey="0" readonly="readonly" value="<?php echo mysql_data($line['data_abertura']); ?>"/></td>

</tr>

<tr>

<td>Data da Aprova&ccedil;&atilde;o:</td>

<td><input name=approver_date" type="text" class="read_only_inputs" id="approver_date" accesskey="0" readonly="readonly" value="<?php echo mysql_data($line['data_ultimo_aprovador]); ?>" /></td>

</tr>

</table></td>

<td width="43%" valign="bottom" bgcolor="#DFDFDF"><table width="428" border="0" cellspacing="0" cellpadding="0" class="text_10px">

<tr>

<td width="162">Classifica&ccedil;&atilde;o Tipo 1:<div id="span_data_execucao_text">Data de Execu&ccedil;&atilde;o:</div></td>

<td width="266"><div id="span_prod_cat_tier1"><select id="categorization_tier1" class="mini_inputs" name="categorization_tier1">

<?php echo (isset($line['classificacao'])?'<option selected=selected" value="'.$line['classificacao].'">'.$line['categorization_tier_1'].'</option>':'<option value=">Selecione um Item</option>'); ?>

</select></div><div id="span_data_execucao"><input type="text" id="data_execucao" name="data_execucao" class="mini_inputs" disable="disable" onkeypress="format_mask(this,\"##/##/#### ##:##\')" value="<?php echo $line ['data_execucao];?>">

</div>

</td>

</tr>

<tr>

<td>Emergencial:</td>

<td><span id="span_tipo_emergencial"><input name="tipo_emergencial" type="text" class="mini_inputs" id="tipo_emergencial" accesskey="0" disabled="disabled" value="<?php echo $line['tipo_emergencial']; ?>"/></span>

</td>

</tr>

<tr>

<td height=54">Justificativa do Orcamento:</td>

<td><textarea name="justify_0" cols="40" rows="3" class="mini_inputs" id="justify_0" accesskey="0"><?php echo $line['justificativa]; ?></textarea></td>

</tr>

</table></td>

<td width="4%"><span id="loading"><img src="img/lightbox-ico-loading.gif" alt="Loading" width="20" height="20" border="0" align="absbottom" /></span></td>

</tr>

<tr>

<td height="402" colspan="4" align="center" valign="top"><div id="gridbox" style="width:99%;height:520px;background-color:white;"></div></td>

</tr>

<tr>

<td height="10" align="left" valign="center" colspan="2"><div id="soma_orc" class="Txt_Footer"></div></td>

<!--td height="10" align="rigth" valign="center"><div id="soma_status" class="Txt_Common"></div></td-->

<td height="10" align="right" valign="center" colspan="2"><div id="soma_total" class="Txt_Footer" align="right"></div></td>

</tr>

</table>

<!--input type="text" id="txt" / -->

<iframe name="post_iframe_ie" style="visibility:hidden;display:none;" height="0" width="0"></iframe>

<script type="text/javascript" src="js/orcamento_functions.js"></script>

<div id="debug" class="Txt_Common"></div>

</body>

</html>

<!--

<?php echo APPL_NAME ?>

Desenvolvido por Roberta Brandão

r.brandao@claro.com.br

(21) 9101-2500

-->

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,3k
    • Posts
      652,5k
×
×
  • Criar Novo...