Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/12/2015, 09:53
esoto
 
Fecha de Ingreso: abril-2015
Mensajes: 96
Antigüedad: 9 años, 9 meses
Puntos: 1
Busqueda actualizar un campo

estimados nuevamente yo, una consulta.
les cuento lo que necesito hacer.


tengo una vista donde muestro datos en una tabla, uno de los campos de la tabla se llama "ESTADO", el cual por defecto esta en "SIN GESTION". y tengo un campo Accion. el cual me envia un formulario que esta en otra vista.


entonces lo que necesito hacer es que al momento de guardar el formulario, el campo Estado se actualice y se cambie a " GESTIONADO".

como podria hacer esto?

con ajax?.

les dejare las vistas, para ver si me pueden ayudar.


vista 1

Código PHP:
Ver original
  1. <?php error_reporting(E_ALL ^ E_NOTICE);?>
  2.   <h1 class="titulo">Agenda</h1>
  3.  
  4.    <div>  
  5.    <fieldset class="filest">
  6.     <div class="Busqueda">
  7.  
  8.   <form action="<?= base_url() . 'callcenter/Agenda' ?>" method="post" accept-charset="utf-8" class="form-horizontal" name="form" id="form">
  9.       <p>
  10.    
  11.    
  12.   <form action="<?= base_url().'callcenter/Agendaexcel'?>">
  13.  
  14.   <div class="muestra_poblaciones">
  15. <div class="table">
  16. <div class="table-responsive">
  17.  
  18.  <table class="table table-condensed">
  19.   <?php //si hay resultados los mostramos
  20.  
  21.   if(is_array($resultados) && !is_null($resultados))
  22.   {
  23.   ?>
  24.     <thead>
  25.         <tr>
  26.  
  27.             <th>ACCION</th>
  28.             <th>TIPO DE GESTION</th>
  29.             <th>MOROSIDAD</th>
  30.             <th>SUPERVISOR</TH>
  31.             <th>NOMBRE</th>
  32.             <th>RUT</th>
  33.             <th>DV</th>                      
  34.             <th>SUCURSAL</th>
  35.             <th>CELULAR</th>
  36.             <th>PRODUCTO</th>
  37.             <th>TIPO DE PRODUCTO</th>                                  
  38.             <th>DIAS MORA</th>                                    
  39.             <th>ESTADO</th>
  40.  
  41.     <?php
  42.     foreach($resultados as $fila){
  43.     ?>
  44.         </tr>
  45.     </thead>
  46.     <tbody>
  47.  
  48.         <tr class="success">
  49.           <td class="info"><img src="<?=base_url()?>public/images/call2.ico" width="20"  /><a  href="<?php echo base_url() ?>callcenter/guardar/<?php echo $fila->iColocacion ?>"> GESTION TELEFONICA </a></td>
  50.  
  51.  
  52.  
  53.  
  54.  
  55.        
  56.  
  57.           <td><?php print $fila->TipoGestion?></td>
  58.           <td><?php print $fila->moroso?></td>
  59.           <TD><?php print $fila->Supervisor?></TD>
  60.           <td><?php print $fila->Nombre ?></td>  
  61.           <td><?php print $fila->Rut ?></td>  
  62.           <td><?php print $fila->cDv ?></td>                                
  63.           <td><?php print $fila->Sucursal ?></td>
  64.           <td><?php print $fila->Celular ?></td>
  65.           <td><?php print $fila->Producto ?></td>
  66.           <td><?php print $fila->Tipo_producto ?></td>                    
  67.           <td><?php print $fila->qDiasMora ?></td>          
  68.           <TD class="danger">   <?php
  69.  
  70.      if (isset($_POST['form1'])) {
  71.           ?>
  72.          <td>REALIZADO</td>
  73.  
  74.  
  75.          <?php
  76.        }
  77.        ?></TD>
  78.          
  79.         </tr>
  80.        
  81.     </tbody>
  82.        <?php
  83.     }
  84.     ?>
  85.       <?php
  86.   }
  87.   ?>  
  88. </table>
  89.        
  90.            
  91.  </div>
  92.   <input type="submit" class="btn btn-primary" value="exportar">  
  93.  </div>
  94.  </div>
  95. </form>


VISTA 2

Código PHP:
Ver original
  1. <form action="<?= base_url() . 'callcenter/guardar_post' ?>" method="post" accept-charset="utf-8" class="form-horizontal" onsubmit="return checkSubmit();" name="form1" id="form1">
  2.  
  3.  
  4.     <fieldset class="call">
  5.      <?php
  6.      $validation_error = validation_errors('<li>', '</li>');
  7.      if ($validation_error != "")
  8.      {
  9.         echo '<div class="bg-danger"><button type="button" class="close" data-dismiss="alert">&times;</button>' . $validation_error . '</div>';
  10.      }
  11.     ?>      
  12.  
  13.  
  14.    <fieldset>
  15.    <h2>GESTION REALIZADA</h2>
  16.    <fieldset class="filform">
  17.    <div class="divform">
  18.  
  19.  
  20.     <input type="Text" name="txtestado1" value="GESTIONADO" >  
  21.    
  22.  
  23.     <h2>DATOS DEL SOCIO</h2>
  24.     <fieldset class="filform">
  25.     <div class="divform">
  26.     <div class="group">
  27.       <label>Nombre Socio(a):</label>
  28.       <input type="text" class="success" name="txtnombre" style="width: 33em;" value="<?php echo $Nombre ?>" readonly   />
  29.     </div>
  30.     <br>
  31.     <div class="group">
  32.       <label>Rut:</label>
  33.       <input type="text" class="success" name="txtrut" style="width: 12em;" value="<?php echo $Rut ?>"  readonly /> -
  34.       <input type="text" class="success" name="txtcDv" style="width: 2em;" value="<?php echo $cDv ?>"  readonly />
  35.     </div>
  36.      <br>
  37.     <div class="group">
  38.     <p>
  39.       <label class="desc">Sucursal:</label>
  40.       <input type="text" class="success" name="txtsucursal" style="width: 12em;" value="<?php echo $sucursal ?>">
  41.     </p>
  42.     <p>
  43.       <label>Fono principal :</label>
  44.       <input type="text" class="success" name="txtfono" style="width: 12em;" value="<?php echo set_value("txtfono") ?>" readonly />
  45.     </p>
  46.     <p>
  47.       <label>Fono celular :</label>
  48.       <input type="text" class="success" name="txtcelular" style="width: 12em;" value="<?php echo $celular ?>" readonly  />
  49.     </p>
  50.     <p>
  51.       <label>Fono particular :</label>
  52.        <input type="text" class="success" name="txtparticular" style="width: 12em;" value="" readonly />
  53.     </p>
  54.     <p>
  55.       <label>Fono comercial :</label>
  56.       <input type="text" class="success" name="txtcomercial" style="width: 12em;" value="<?php echo set_value("txtcomercial") ?>"  readonly />
  57.  
  58.     </p>
  59.    
  60.     </div>
  61.     </div>
  62.     </fieldset>
  63.     <h2>DATOS COMERCIALES DEL SOCIO</h2>
  64.     <fieldset class="filform">
  65.       <div class="clasiposicion">
  66.                  <div class="clasificacion">
  67.                     <label><b>Clasificacion:</b></label>
  68.                     <input class="letra" size="1px;" style="background:#A9D0F5; width: 3em;" value="<?php echo $Clasificacion_Cartera ?>" readonly>
  69.                 <p>
  70.                     <label><b>Factor:</b></label>
  71.                     <input class="letra"  size="1px;"type="text" style="background:#A9D0F5;width: 3em;" value="<?php echo $Factor_Provision ?>" readonly>
  72.                 </p>
  73.                 </div>    
  74.             </div>    
  75.     <div class="divform">
  76.     <p>
  77.       <label>Colocacion:</label>
  78.       <input type="text" class="success" name="txtcolocacion" style="width: 12em;" value="<?php echo $iColocacion ?>" readonly   />
  79.     </p>
  80.     <p>
  81.       <label>Pagare:</label>
  82.       <input type="text" class="success" name="txtpagare" style="width: 12em;" value="<?php echo $Pagare ?>" readonly   />
  83.     </p>
  84.     <p>
  85.       <label>Producto :</label>
  86.       <input type="text" class="success" name="txtproducto" style="width: 33em;"value="<?php echo $producto ?>" readonly />
  87.     </p>
  88.     <p>
  89.       <label>Tipo de credito :</label>
  90.       <input type="text" class="success" name="txttipo" style="width: 33em;" value="<?php echo $Tipo_producto ?>" readonly  />
  91.     </p>
  92.     <p>
  93.       <label>Cantidad Renegociaciones :</label>
  94.       <input type="text" class="success" name="txtcantrenegociado" style="width: 12em;"  value="<?php echo $qrenegociados ?>" readonly  />                        
  95.     </p>
  96.     <br>
  97.      <p>
  98.       <label>Plazo Credito</label>
  99.       <input type="text" class="success" style="width: 12em;" name="txtPlazocredito" value="<?php echo $Plazo_Cred ?>" readonly>
  100.     </p>
  101.    
  102.     <p>
  103.       <label>Valor cuota :</label>
  104.       <input type="text" class="success" style="width: 12em;" name="txtvalor"  value="<?php echo $ValorCuota ?>" readonly />
  105.     </p>
  106.     <p>
  107.       <label>Interes por Mora:</label>
  108.       <input type="text" class="success" style="width: 12em;" name="" size="20px"  readonly   />
  109.     </p>
  110.     <p>
  111.       <label>Gastos de Cobranza:</label>
  112.       <input type="text" class="success" style="width: 12em;"  name="" size="20px"  readonly   />
  113.     </p>
  114.     <p>
  115.       <label>Capital Social:</label>
  116.       <input type="text" class="success" style="width: 12em;" name="" size="20px"  readonly   />
  117.     </p>
  118.     <p>
  119.       <label>Valor Cuota Total:</label>
  120.       <input type="text" class="success" style="width: 12em;" name="" size="20px"  readonly   />
  121.     </p>
  122.     <p>
  123.       <label>Dias morosos :</label>
  124.       <input type="text" class="success" style="width: 12em;" name="txtmorosos" value="<?php echo $qDiasMora ?>"  readonly />
  125.     </p>
  126.     <p>
  127.       <label>Fecha de vencimiento Cuota :</label>
  128.       <input type="text" class="success" style="width: 12em;" name="txtvencimiento" value="<?php echo $fVencimiento_Cuota ?>" readonly  />
  129.     </p>
  130.     <br>
  131.     <p>
  132.       <label>Cuotas Morosas :</label>
  133.       <input type="text" class="success" style="width: 12em;" name="txtcuotas" value="<?php echo $cancuo_morosas ?>" readonly  />
  134.     </p>
  135.     <p>
  136.       <label>Saldo Adeudado Total :</label>
  137.       <input type="text" class="success" style="width: 12em;" name=""  readonly  />
  138.     </p>
  139.  
  140.   </fieldset>  
  141.   </fieldset>    
  142.   </fieldset>
  143.    <div class="a">
  144.   <input type="submit" class="btn btn-primary" id="btsubmit" onClick="return  guardar()" value="GUARDAR" />
  145.   </form>  
  146.   </div>
  147.   <div class="b">