Ver Mensaje Individual
  #11 (permalink)  
Antiguo 26/04/2020, 12:32
Avatar de petit89
petit89
 
Fecha de Ingreso: marzo-2011
Mensajes: 1.135
Antigüedad: 13 años, 1 mes
Puntos: 170
Respuesta: Deshabilitar este boton

Ocupando el primer codigo que pusiste he adaptado el ejemplo que te di:

Código PHP:
Ver original
  1. <?php
  2. include('../config/conexion.php');
  3. $estado = [2 => '<font color="#6A0888"><b>Publicado</b>', 3 => '<font color="green"><b>Pausado</b></font>', 1 => '<font color="green"><b>Pendiente</b></font>'];
  4. $query = "select * from table_public_article where article_id=".$_GET['article_id']." and user_id=".$_SESSION['user_id']."";     // Esta linea hace la consulta
  5. $result = mysql_query($query);
  6.  
  7. while ($registro = mysql_fetch_array($result)){
  8.  
  9. echo "<form action='reg_edit_estatus.php' method='post' enctype='multipart/form-data'>
  10.                    <div class='form-group'>
  11.                      <label for='exampleFormControlSelect1'>Condicion del Articulo</label>
  12.                      <select class='form-control' name='estado' id='exampleFormControlSelect1' required>
  13.                        <option value='".$registro['estado']."'>" . $estado[$registro['estado']] . "</option>
  14.                        <option value='2'>Publicar</option>
  15.                        <option value='3'>Pausar</option>
  16.                        
  17.                      </select>
  18.                    </div>
  19.                      
  20.                    <input type='hidden' name='article_id' value='".$registro['article_id']."'>
  21.                      
  22.                    <div class='form-group'>";
  23.                     $activado = "";
  24.                     if($registro['estado'] == 1) {
  25.                         $activado = "disabled";
  26.                         }
  27.                         echo "<div class='form-group'>
  28.                        <button type='submit' id='estado' class='btn btn-primary btn-block' ".$activado.">GUARDAR CAMBIOS</button>
  29.                        </div>";
  30.                     }
  31.                 }
  32.                 ?>
  33.             </form>

espero que te sirva.
__________________
█ WebHosting / Reseller a bajo costo | Uptime Garantizado | Soporte en Español e Ingles
¿Te sirvió la respuesta? Deja un +1 (Triangulo negro al lado derecho)