Ver Mensaje Individual
  #3 (permalink)  
Antiguo 14/10/2011, 22:54
Avatar de danj
danj
 
Fecha de Ingreso: octubre-2011
Ubicación: Calarcho
Mensajes: 53
Antigüedad: 12 años, 6 meses
Puntos: 1
Respuesta: Error de String en Aplicacion

Sii claro espero me puedan ayudar!

PrincipalForm.php

Código PHP:
Ver original
  1. <?php
  2. class Form_PrincipalForm extends Zend_Form
  3. {
  4.     public function __construct($option = null){
  5.         parent::__construct($option);
  6.        
  7.         $this->setName('opciones');
  8.        
  9.         $usuario = new Zend_Form_Element_Hidden('idusuarios');
  10.    
  11.        $nombre = new Zend_Form_Element_Text('usuarios');  
  12.          $nombre->setLabel('USUARIOS')  
  13.          ->setRequired(true)  
  14.          ->addFilter('StripTags')  
  15.          ->addFilter('StringTrim')  
  16.          ->addValidator('NotEmpty');
  17.            
  18.          $submit = new Zend_Form_Element_Submit('submit');  
  19.          $submit->setAttrib('idusuarios','submitbutton');  
  20.         // $this->addElements(array($usuario,$nombre,$submit));
  21.          
  22.        
  23.         $opciones = new Zend_Form_Element_Select('opcion');
  24.         $opciones->setLabel('Roles')
  25.                  ->setAttrib('onchange','prueba()');
  26.                
  27.         $opciones->addMultiOption('','SELECIONE UN ROL');        
  28.         $tabla = new CuentasUsuariosModel();       
  29.         $mysesion = new Zend_Session_Namespace('mysesion');
  30.         $usuario=$mysesion->usuario;
  31.         $password=$mysesion->password;
  32.        
  33.         foreach ($tabla->consultarCuentas($usuario, $password)as $rows){
  34.             $opciones->addMultiOption($rows->idroles, $rows->nombre);
  35.         }
  36.                
  37.         $this->addElements(array($opciones,$usuario,$nombre,$submit));
  38.  
  39.     ?>
  40.    
  41. <table>
  42. <tr>
  43.         <th>Estado</th>
  44.         <th>Solicitud Herramientas</th>
  45.         <th>Nombres</th>
  46.         <th>Fecha</th>
  47.         <th>Fecha Estimada Devolucion</th>
  48.         <th>&nbsp;</th>
  49. </tr>
  50. <?php
  51.         $tabla2 = new CuentasUsuariosModel();      
  52.         foreach ($tabla2->consultarFechas($usuario)as $rows1){ 
  53.    
  54.         /*$fechaUno = new Zend_Date();
  55.         Zend_Date::setOptions(array('format_type' => 'php'));
  56.         $date=new Zend_Date($fechaUno);
  57.         print $date->toString('Y-m-d');*/
  58.            
  59.             ?>
  60. <tr>
  61. <td><?php      
  62.                
  63.         /*$fechaUno = new Zend_Date(strtotime('11/10/2011 00:00:00'));         
  64.         $fechaUno->toString("YYYY.MM.dd HH:mm:ss");
  65.         echo $fechaUno;*/
  66.        
  67.        
  68.         $fechaDevolucion = $rows1->fechaEstimadaDevolucion;
  69.            
  70.         //echo $fechaDos->get('yyyy-mm-dd');
  71.         if(date("Y-m-d") > $fechaDevolucion) {
  72.          echo '<img src="/img/rojo.png">';
  73.         }
  74.         if(date("Y-m-d") <= $fechaDevolucion) {
  75.          echo '<img src="/img/verde.png">';
  76.         } else {
  77.          echo '<!--<img src="/img/gris.png">-->';
  78.         }   ?></td>
  79. <td><?php echo $rows1->idsolicitudHerramientas; ?></td>
  80. <td><?php echo $rows1->nombres; ?></td>
  81. <td><?php echo $rows1->fecha; ?></td>
  82. <td><?php echo $rows1->fechaEstimadaDevolucion; }?></td>
  83. </tr>  
  84.    
  85. </table>
  86.  
  87. <div id="div_3" class="contenido" style="display: none;">
  88. <p align="center"><h2>Prestamos De Todos Los Usuarios</h2></p>
  89. <br>
  90.             <table>
  91. <tr>       
  92.         <th>Estado</th>
  93.         <th>Solicitud Herramientas</th>
  94.         <th>Nombres</th>
  95.         <th>Fecha</th>
  96.         <th>Fecha Estimada Devolucion</th>
  97.         <th>&nbsp;</th>
  98. </tr>
  99. <?php
  100.         $tabla3 = new CuentasUsuariosModel();      
  101.         foreach ($tabla3->consultarFechasTotal()as $rows2){
  102.    
  103.         /*$fechaUno = new Zend_Date();
  104.         Zend_Date::setOptions(array('format_type' => 'php'));
  105.         $date=new Zend_Date($fechaUno);
  106.         print $date->toString('Y-m-d');*/
  107.            
  108.             ?>
  109. <tr>
  110. <td><?php      
  111.                
  112.         /*$fechaUno = new Zend_Date(strtotime('11/10/2011 00:00:00'));         
  113.         $fechaUno->toString("YYYY.MM.dd HH:mm:ss");
  114.         echo $fechaUno;*/
  115.        
  116.        
  117.         $fechaDevolucion = $rows2->fechaEstimadaDevolucion;
  118.            
  119.         //echo $fechaDos->get('yyyy-mm-dd');
  120.         if(date("Y-m-d") > $fechaDevolucion) {
  121.          echo '<img src="/img/rojo.png">';
  122.         }
  123.         if(date("Y-m-d") <= $fechaDevolucion) {
  124.          echo '<img src="/img/verde.png">';
  125.         } else {
  126.          echo '<!--<img src="/img/gris.png">-->';
  127.         }   ?></td>
  128. <td><?php echo $rows2->idsolicitudHerramientas; ?></td>
  129. <td><?php echo $rows2->nombres; ?></td>
  130. <td><?php echo $rows2->fecha; ?></td>
  131. <td><?php echo $rows2->fechaEstimadaDevolucion; }?></td>
  132. </tr>  
  133.    
  134. </table>
  135.         </div>
  136.        
  137.         <?php
  138. $tabla = new solcitudesmaterialModel();
  139.                                
  140.                                
  141.                                
  142.                                foreach ( $tabla->actualizar()as $c)
  143.                                {
  144.                                 echo "<table border=\"1\" align=\"center\">";
  145.                                 echo "<tr><th>fecha</th>";
  146.                                                echo "<th>estado solicitud</th>";
  147.                                                 echo "<tr><td>";
  148.                                     echo $c -> fecha;
  149.                                     echo "</td><td>";
  150.                                     echo $c -> estado;
  151.                                     echo "</td></tr>";
  152.                                     echo "</table>";
  153.                                }
  154.     }}                                 
  155. ?>

Saludos.