No he vuelto a tocar este tema pues he estado ocupado con otras cosistas, pero si me urge saber como podria hacerlo,
Les Agradeceria mucho su colaboracion!
Les Agradeceria mucho su colaboracion!
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú
beforeSend: mostrarLoader,
function mostrarLoader(){
// $('#loader_gif').fadeIn("slow"); //muestro el loader de ajax
$("#ajax_loader").append("Se envio Correctamente ");
};
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<?php
$db_username = "";
$db_password = "";
$db = "oci:dbname=";
//$conn = new PDO($db,$db_username,$db_password);
try{
$conn = new PDO($db,$db_username,$db_password);
echo "conectado correctamente";
}catch(PDOException $e){
echo ($e->getMessage());
echo "<br>Error Conection";
}
$st=$conn->prepare("SELECT PD_ID, PD_CANTIDAD, PRODUCTOS_PRO_ID, DEVOLUCION_MM_DMM_ID FROM PRODUCTO_DEVOLUCION ORDER BY PD_ID ASC");
$st->execute( );
$Result=$st->fetchAll($Result);
foreach ($Result as $Result1) :
$a=$Result1['PD_ID'];
endforeach;
$Num_Rows=$Result;
$Num_Rows=count($Num_Rows);
$Per_Page = 2; // Per Page
$Page = $_GET["Page"];
if(!$_GET["Page"])
{
$Page=1;
}
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($Num_Rows<=$Per_Page)
{
$Num_Pages =1;
}
else if(($Num_Rows % $Per_Page)==0)
{
$Num_Pages =($Num_Rows/$Per_Page) ;
}
else
{
$Num_Pages =($Num_Rows/$Per_Page)+1;
$Num_Pages = (int)$Num_Pages;
}
$Page_End = $Per_Page * $Page;
if ($Page_End > $Num_Rows)
{
$Page_End = $Num_Rows;
}
?>
<table width="600" border="1">
<tr>
<th width="91"> <div align="center">CustomerID </div></th>
<th width="98"> <div align="center">Name </div></th>
<th width="198"> <div align="center">Email </div></th>
<th width="97"> <div align="center">CountryCode </div></th>
</tr>
<?php
for($i=$Page_Start;$i<$Page_End;$i++)
{
?>
<tr>
<td><div align="center"><?php echo $Result["PD_ID"][$i];?></div></td>
<td><?php echo $Result["PD_CANTIDAD"][$i];?></td>
<td><?php echo $Result["PRODUCTOS_PRO_ID"][$i];?></td>
<td><div align="center"><?php echo $Result["DEVOLUCION_MM_DMM_ID"][$i];?></div></td>
</tr>
<?php
}
?>
</table>
<br>
Total <?php $Num_Rows;?> Record : <?php $Num_Pages;?> Page :
<?php
if($Prev_Page)
{
echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a> ";
}
for($i=1; $i<=$Num_Pages; $i++){
if($i != $Page)
{
echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]";
}
else
{
echo "<b> $i </b>";
}
}
if($Page!=$Num_Pages)
{
echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Next>></a> ";
}
//oci_close($objConnect);
?>
</body>
</html>
error_reporting(0);
$dbhost = "localhost:1521/xe";
// static public $mvc_bd_nombre = "prueba_ccl";
$dbuser = "HR";
$dbpass = "1234";
$objConnect = oci_connect($dbuser,$dbpass,$dbhost);
$strSQL = "SELECT PD_ID, PD_CANTIDAD, PRODUCTOS_PRO_ID, DEVOLUCION_MM_DMM_ID FROM PRODUCTO_DEVOLUCION ORDER BY PD_ID ASC";
$objParse = oci_parse ($objConnect, $strSQL);
oci_execute ($objParse,OCI_DEFAULT);
$Num_Rows = oci_fetch_all($objParse, $Result);
<html>
<head>
<script language="javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script language="javascript">
$(document).ready(function() {
$().ajaxStart(function() {
$('#loading').show();
$('#result').hide();
}).ajaxStop(function() {
$('#loading').hide();
$('#result').fadeIn('slow');
});
$('#form, #fat, #mc-embedded-subscribe-form').submit(function() {
$.ajax({
type: 'POST',
url: $(this).attr('action'),
data: $(this).serialize(),
success: function(data) {
$('#result').html(data);
}
})
return false;
});
})
</script>
<link href="//cdn-images.mailchimp.com/embedcode/classic-081711.css" rel="stylesheet" type="text/css">
<style type="text/css">
.form-control {
width: 34%;
height: 30px;
padding: 10px 15px;
font-size: 15px;
line-height: 1.42857143;
color: #2c3e50;
background-color: #ffffff;
background-image: none;
border: 1px solid #dce4ec;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
</style>
</head>
<body>
<div id="mc_embed_signup">
<form action="//ribot-barcelona.us5.list-manage.com/subscribe/post?u=d2c4a68aadfd8d6061877b0b2&id=809315d24f" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" >
<table align=center cellpadding=1 cellspacing=2 background="newsletter web_Ribot.jpg" height="415" width="754">
<tr>
<td><br> </td>
</tr>
<tr>
<td><br> </td>
</tr>
<tr>
<td></td>
<td align="right">
<font color="white"><b>E-Mail</b></font> <input type="text" value="" name="EMAIL" id="mce-EMAIL" required class="form-control" > <br><br>
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button" >
<div id="result" ></div>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
<?php foreach ($paramsPD['productoD'] as $paramsPD1) :?>
<?php
//$bus;
//$nameb="bus";
//$sum=0;
//$sum++;
//$sumando=$sum+1;
//$bus=$nameb.$sum;
//echo $bus;
static $bus = 0;
static $sum = 0;
?>
<tr>
<td><?php echo $paramsPD1['PD_ID'] ?></td>
<td>
<!--Buscar <input type="text" id="bus" name="bus" onkeyup="loadXMLDoc()" required />-->
Buscar <input type="text" id="<?php echo $bus ?>" name="<?php echo $bus ?>" onkeyup="loadXMLDoc(<?php echo $sum ?>)" required />
</td>
<td><div id="myDiv<?php echo $sum ?>"> </div></td>
function loadXMLDoc(id)
{
var xmlhttp;
//var n=document.getElementById('bus1').value;
var n=document.getElementById('bus' + id).value;
if(n==''){
document.getElementById("myDiv" + id).innerHTML="";
//document.getElementById("myDiv").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv" + id).innerHTML=xmlhttp.responseText;
}else{ document.getElementById("myDiv" + id).innerHTML='<img src="load.gif" width="50" height="50" />'; }
// document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
//}else{ document.getElementById("myDiv").innerHTML='<img src="load.gif" width="50" height="50" />'; }
}
xmlhttp.open("POST","index.php?ctl=buscarajax",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("q="+n);
}
<?php foreach ($paramsPD['productoD'] as $paramsPD1) :?>
<?php
$bus=0;
$nameb="bus";
$sum=0;
$sum++;
//$sumando=$sum+1;
//$bus=$nameb.$sum;
//echo $bus;
?>
<tr>
<td><?php echo $paramsPD1['PD_ID'] ?></td>
<td>
<!--Buscar <input type="text" id="bus" name="bus" onkeyup="loadXMLDoc()" required />-->
Buscar <input type="text" id="bus" name="<?php echo $bus ?>" onkeyup="loadXMLDoc(<?php echo $sum ?>)" required /></td>
</td>
<td>
<div id="myDiv<?php echo $sum ?>"> </div></td>
<td><input type="number" name="cantidad" min="1" required placeholder="Cantidad de Productos" class="form-control" id="" size="" value="<?php echo $paramsPD1['PD_CANTIDAD']?>"/></td>
<td><button class="btn btn-success " data-toggle="modal" data-target="#myModal2">
Add <span class="glyphicon glyphicon-plus"></span> </button></td>
<td><input type="text" name="" size="7" /></td>
<td><input type="number" name="cantidad" min="1" required placeholder="Cantidad de Productos" class="form-control" id="" size="" value="<?php ?>"/></td>
<td><input type="text" name="" size="7" /></td>
</tr>
<?php endforeach; ?>
function loadXMLDoc(id)
{
var xmlhttp;
//var n=document.getElementById('bus1').value;
var n=document.getElementById('bus' + id).value;
if(n==''){
document.getElementById("myDiv" + id).innerHTML="";
//document.getElementById("myDiv").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv" + id).innerHTML=xmlhttp.responseText;
}else{ document.getElementById("myDiv" + id).innerHTML='<img src="load.gif" width="50" height="50" />'; }
// document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
//}else{ document.getElementById("myDiv").innerHTML='<img src="load.gif" width="50" height="50" />'; }
}
xmlhttp.open("POST","index.php?ctl=buscarajax",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("q="+n);
}
name="<?php echo $bus ?>" onkeyup="loadXMLDoc(<?php echo $sum ?>)" required /></td>
Buscar <input type="text" id="bus"
name="bus" onkeyup="loadXMLDoc()" required /></td>
public function listarProductosAjax()
{
$aux = $_POST['q'];
// $aux1 = $_GET['id'];
$m = new Model(Config::$mvc_bd_usuario,
Config::$mvc_bd_clave, Config::$mvc_bd_hostname);
$productoajax = $m->verProductoAjax($aux);
$paramsVerAjax = $productoajax;
return $paramsVerAjax;
}
public function verProductoAjax($id)
{
$id = htmlspecialchars($id);
$id1=1;
$sql="select PRO_NOMBRE from PRODUCTOS where PRO_ID LIKE '".$id."%'";
$result = oci_parse($this->conexion,$sql);
oci_execute($result, OCI_DEFAULT);
//$devolucion = array();
$row = oci_fetch_array($result);
echo $row['PRO_NOMBRE'];
// $row = $result;
// return $row;
}
<div class="table-responsive">
<table align="center" class="table table-condensed table-hover">
<tr>
<th>#</th>
<th>Producto</th>
<th>...</th>
<th>Cantidad</th>
<th>Reserva</th>
<th>Producto</th>
<th>Cantidad</th>
<th>Tipo Reserva</th>
</tr>
<?php
?>
<?php foreach ($paramsPD['productoD'] as $paramsPD1) :?>
<?php
$nameb="bus";
$sum++;
//$sumando=$sum+1;
$bus=$nameb.$sum;
echo $bus;
?>
<tr>
<td><?php echo $paramsPD1['PD_ID'] ?></td>
<td>
[B] Buscar <input type="text" id="<?php echo $bus ?>"
name="<?php echo $bus ?>" onkeyup="loadXMLDoc()" required /></td>
<td><div id="myDiv"> </div></td>
[/B]
<td><input type="number" name="cantidad" min="1" required placeholder="Cantidad de Productos" class="form-control" id="" size="" value="<?php echo $paramsPD1['PD_CANTIDAD']?>"/></td>
.....
</tr>
<?php endforeach; ?>
function loadXMLDoc()
{
var xmlhttp;
var n=document.getElementById('bus1').value;
if(n==''){
document.getElementById("myDiv").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}else{ document.getElementById("myDiv").innerHTML='<img src="load.gif" width="50" height="50" />'; }
}
xmlhttp.open("POST","index.php?ctl=buscarajax",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("q="+n);
}