3
The code below for entering data via checkbox
, but I need to get the checkbox
recorded in the bank for any update?
<?php include("includes/config.php"); ?>
<!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="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<div class="header"><img src="imagens/logo.png"style="width:300px;height:150px;"></div>
<div class="nav"><?php include("menu.php") ?></div>
<body>
<div class="corpo">
<form name="editar" enctype="multipart/form-data" method="post">
<?php
$id = $_GET['id'];
$seleciona = mysql_query("
SELECT orcamento.*, clientes.*, veiculos.* FROM orcamento
INNER JOIN clientes ON clientes.id = orcamento.cliente_id
INNER JOIN veiculos ON veiculos.id = orcamento.cliente_id
WHERE orcamento.id = '$id'" ) or die (mysql_error());
if($seleciona == ''){
echo 'Erro';
}else{
while($res_id = $row = mysql_fetch_assoc($seleciona)){
?>
<br /><br />
<fieldset><legend>Dados do Cliente</legend>
<br />
Número do Orçamento (ID): <input type="text" name="id" value="<?php echo $id?>" size="6" />
Data: <input type="text" name="nome" disabled="disabled" value="<?php echo $res_id = $row['data'];?>" /><br /><br />
Nome do Cliente: <input type="text" name="nome" disabled="disabled" value="<?php echo $res_id = $row['nome'];?>" size="75" />
<br /><br />
Veiculo: <input type="text" name="marca" disabled="disabled" value="<?php echo $res_id = $row['marca'];?>" />
Modelo: <input type="text" name="modelo" disabled="disabled" value="<?php echo $res_id = $row['modelo'];?>" />
Placa: <input type="text" name="placa" disabled="disabled" value="<?php echo $res_id = $row['placa'];?>" />
<br />
</fieldset>
<br />
<fieldset><legend>Condições</legend>
<br />
Condição de Pagamento: <input type="text" name="cond_pagamento" value="<?php echo $res_id = $row['cond_pagamento'];?>" size="10" />
Data Inicio: <input type="text" name="datainicio" value="<?php echo $res_id = $row['datainicio'];?>" />
Data Témino: <input type="text" name="datatermino" value="<?php echo $res_id = $row['datatermino'];?>" /><br /><br />
Validade: <input type="text" name="validade" value="<?php echo $res_id = $row['validadeorcamento'];?>" />
Status: <input type="text" name="status" value="<?php echo $res_id = $row['status'];?>" />
<br /><br />
</fieldset>
<br />
<?php
}}
?>
<fieldset><legend>Serviços</legend>
<br /><br />
<?php
$id = $_GET['id'];
$seleciona2 = mysql_query("
SELECT orcamento.*, orcamento.data, DATE_FORMAT(data, '%d/%m/%Y') AS data_orc, detalhe_orcamento.*, mao_obra.* FROM orcamento
INNER JOIN detalhe_orcamento ON detalhe_orcamento.orcamento_id = orcamento.id
INNER JOIN mao_obra ON mao_obra.id = detalhe_orcamento.mao_obra_id
WHERE orcamento.id = '$id'" ) or die (mysql_error());
if($seleciona2 == ''){
echo 'Erro';
}else{
echo'aqui que tenho que colocar o form com os checkbox, e aqueles que estão gravados no banco vir como checked';
}
?>
</fieldset>
</form>
<br /><br />
</div>
</body>
</html>
If you are going to rescue all the right workmanship! and how you will rescue the orcamento_id since in your form there is no value?
– user6026
in fact Harry this code is a part of the form the part that resgato orcamento_id already managed to rescue as other data, although orcamento_id and other data as customer data, vehicle data will only be for visualization, this data is edited in other Forms...
– Rogerio
I’ll put an example like another answer who knows you understand, because on this screen you can not do ok!?
– user6026