<?php
 
session_start();
//include("DSA1000.php");
include("DMMYSQLG.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>
<title>---TECLADO---</title>
<script>
//autor: karlankas -Actualizado por panino5001-
texto="";
var Tletras=new Array ("Q","W","E","R","T","Y","U","I","O","P","A","S","D","F","G","H","J","K","L","Ñ","Z","X","C","V","B","N","M",",",".");
var z=0;
var mayus=true
function anadir(letra){

texto=document.f.barra.value;
if(letra=="\b"){
numeroLetras=texto.length-texto.length
texto=texto.substring(0,numeroLetras);
}
else{
if(!mayus){letra=letra.toLowerCase()}
texto=texto+letra;
}
document.f.barra.value=texto;
}
function mostrar(){
if (z==0){z=1;document.getElementById('botones').style.visibility="visible";pregunta.innerHTML="Ocultar teclado";}
else {z=0;document.getElementById('botones').style.visibility="hidden";pregunta.innerHTML="Mostrar teclado";}
 }
 function cambiomayus(aqui){
 if(aqui.checked){mayus=true}
 else{mayus=false}
 }
 </script>
   
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><style type="text/css">
<!--
body {
	background-image: url(img_punt/fonpunt/part5.png);
	background-repeat: repeat;
}
-->
</style></head>

<body style="font:normal 10px/15px verdana" onLoad = "self.focus (); document.f.barra.focus ()">
<!--onBlur="self.focus()"-->
<div align="center">
<form name="f" id="f" method="post" action="">

<div align="center">
<input type="Text" name="barra"  id="barra" style="width:300px;border:solid 1px black" >

<div align="center" id="botones" style="font:normal 15px/4px verdana;visibility:visible;"></div>
<script>
var letras="";
var p=0;
for (a=0;a<Tletras.length;a++){
letras=letras+"<input style='width:25px;' type='Button' value="+Tletras[a]+" onclick=anadir('"+Tletras[a]+"')>&nbsp;";
p=p+1;
if(p==10){p=0;letras=letras+"<br><br>";}
}
document.getElementById('botones').innerHTML=letras+"<input style='width:40px;' alt='Borrar' type='Button' value=&laquo; onClick=anadir('\b')><br><br><input style='width:205px;height:22px;' type='Button' value='espacio' onclick=anadir('&#160')><br><input type=hidden name=mayusculas onclick='cambiomayus(this)' checked>";

</script>

<label><input name="actec" type="Submit"  value="Aceptar"/>
</label>
<?PHP 
  $_SESSION['folio']=(isset($_GET['nop']))?$_GET['nop']:"";
  $_SESSION['prod']=(isset($_GET['prod']))?$_GET['prod']:"";
 $_SESSION['fcom']=(isset($_GET['fcom']))?$_GET['fcom']:"";
  $vpb=(isset($_POST['barra']))?$_POST['barra']:"";
 echo $_SESSION['folio']; '</br>';
  //echo $_SESSION['prod']; '</br>';
  echo $_SESSION['fcom']; '</br>';
  echo $_POST['barra'];
 $sq_pememd=mysqli_query($con ,"select * from dgpememd where  fol_ven1='".  $_SESSION['prod']."'");
//echo "select * from dgpememd where cons_ven ='".$_SESSION['folio']."' AND nparte1 ='".$_SESSION['prod']."' and fcomd='".$_SESSION['fcom']."'";
 echo mysqli_error($con);
$dt_pememd=mysqli_fetch_array($sq_pememd);
		echo mysqli_error($con);		
				if($dt_pememd['can_ref']>1) {
					$esCargado=true;
					 $dt_pememd['fol_ven1'];
				}else {
					$esCargado=false;
					$dt_pememd['fol_ven1'];
				} 
		
		
	$comen=$vpb;
if ($vpb!=""){
	@$com_invt=mysqli_query($con ,"update dgpememd set comenta='".$vpb."' where cons_ven='".$_SESSION['folio']."' and fol_ven1='".$dt_pememd['fol_ven1']."'");
       // echo "update dgpememd set comenta='".$vpb."' where cons_ven='".$_SESSION['folio']."' and fol_ven1='".$dt_pememd['fol_ven1']."'";
	echo  mysqli_error($con);
	echo "<script type='text/javascript'> window.close(); </script> ";
}
?>

</div>
</form>
</div>
</body>
</html>