Overview

Packages

  • JAMA
  • None
  • PHP
  • PHPExcel
    • CachedObjectStorage
    • Calculation
    • Cell
    • Chart
      • Renderer
    • Reader
      • Excel2007
      • Excel5
    • RichText
    • Settings
    • Shared
      • Escher
      • OLE
      • Trend
      • ZipArchive
    • Style
    • Worksheet
      • Drawing
    • Writer
      • 2007
      • CSV
      • Excel2007
      • Excel5
      • HTML
      • PDF

Classes

  • CholeskyDecomposition
  • Dao
  • DateTime
  • DateTimeZone
  • DOMNode
  • EigenvalueDecomposition
  • Elemento
  • Historial
  • Irradiacion
  • Latitud
  • MotorPhp
  • Panel
  • PclZip
  • Periodo
  • PHPExcel
  • PHPExcel_Autoloader
  • PHPExcel_Best_Fit
  • PHPExcel_CachedObjectStorage_APC
  • PHPExcel_CachedObjectStorage_CacheBase
  • PHPExcel_CachedObjectStorage_DiscISAM
  • PHPExcel_CachedObjectStorage_Igbinary
  • PHPExcel_CachedObjectStorage_Memcache
  • PHPExcel_CachedObjectStorage_Memory
  • PHPExcel_CachedObjectStorage_MemoryGZip
  • PHPExcel_CachedObjectStorage_MemorySerialized
  • PHPExcel_CachedObjectStorage_PHPTemp
  • PHPExcel_CachedObjectStorage_SQLite
  • PHPExcel_CachedObjectStorage_SQLite3
  • PHPExcel_CachedObjectStorage_Wincache
  • PHPExcel_CachedObjectStorageFactory
  • PHPExcel_CalcEngine_CyclicReferenceStack
  • PHPExcel_CalcEngine_Logger
  • PHPExcel_Calculation
  • PHPExcel_Calculation_Database
  • PHPExcel_Calculation_DateTime
  • PHPExcel_Calculation_Engineering
  • PHPExcel_Calculation_ExceptionHandler
  • PHPExcel_Calculation_Financial
  • PHPExcel_Calculation_FormulaParser
  • PHPExcel_Calculation_FormulaToken
  • PHPExcel_Calculation_Function
  • PHPExcel_Calculation_Functions
  • PHPExcel_Calculation_Logical
  • PHPExcel_Calculation_LookupRef
  • PHPExcel_Calculation_MathTrig
  • PHPExcel_Calculation_Statistical
  • PHPExcel_Calculation_TextData
  • PHPExcel_Calculation_Token_Stack
  • PHPExcel_Cell
  • PHPExcel_Cell_AdvancedValueBinder
  • PHPExcel_Cell_DataType
  • PHPExcel_Cell_DataValidation
  • PHPExcel_Cell_DefaultValueBinder
  • PHPExcel_Cell_Hyperlink
  • PHPExcel_Chart
  • PHPExcel_Chart_DataSeries
  • PHPExcel_Chart_DataSeriesValues
  • PHPExcel_Chart_Layout
  • PHPExcel_Chart_Legend
  • PHPExcel_Chart_PlotArea
  • PHPExcel_Chart_Renderer_jpgraph
  • PHPExcel_Chart_Title
  • PHPExcel_Comment
  • PHPExcel_DocumentProperties
  • PHPExcel_DocumentSecurity
  • PHPExcel_Exponential_Best_Fit
  • PHPExcel_HashTable
  • PHPExcel_IOFactory
  • PHPExcel_Linear_Best_Fit
  • PHPExcel_Logarithmic_Best_Fit
  • PHPExcel_NamedRange
  • PHPExcel_Polynomial_Best_Fit
  • PHPExcel_Power_Best_Fit
  • PHPExcel_Reader_Abstract
  • PHPExcel_Reader_CSV
  • PHPExcel_Reader_DefaultReadFilter
  • PHPExcel_Reader_Excel2003XML
  • PHPExcel_Reader_Excel2007
  • PHPExcel_Reader_Excel2007_Chart
  • PHPExcel_Reader_Excel2007_Theme
  • PHPExcel_Reader_Excel5
  • PHPExcel_Reader_Excel5_Escher
  • PHPExcel_Reader_Excel5_MD5
  • PHPExcel_Reader_Excel5_RC4
  • PHPExcel_Reader_Gnumeric
  • PHPExcel_Reader_HTML
  • PHPExcel_Reader_OOCalc
  • PHPExcel_Reader_SYLK
  • PHPExcel_ReferenceHelper
  • PHPExcel_RichText
  • PHPExcel_RichText_Run
  • PHPExcel_RichText_TextElement
  • PHPExcel_Settings
  • PHPExcel_Shared_CodePage
  • PHPExcel_Shared_Date
  • PHPExcel_Shared_Drawing
  • PHPExcel_Shared_Escher
  • PHPExcel_Shared_Escher_DgContainer
  • PHPExcel_Shared_Escher_DgContainer_SpgrContainer
  • PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
  • PHPExcel_Shared_Escher_DggContainer
  • PHPExcel_Shared_Escher_DggContainer_BstoreContainer
  • PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
  • PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
  • PHPExcel_Shared_Excel5
  • PHPExcel_Shared_File
  • PHPExcel_Shared_Font
  • PHPExcel_Shared_JAMA_LUDecomposition
  • PHPExcel_Shared_JAMA_Matrix
  • PHPExcel_Shared_JAMA_QRDecomposition
  • PHPExcel_Shared_OLE
  • PHPExcel_Shared_OLE_ChainedBlockStream
  • PHPExcel_Shared_OLE_PPS
  • PHPExcel_Shared_OLE_PPS_File
  • PHPExcel_Shared_OLE_PPS_Root
  • PHPExcel_Shared_OLERead
  • PHPExcel_Shared_PasswordHasher
  • PHPExcel_Shared_String
  • PHPExcel_Shared_TimeZone
  • PHPExcel_Shared_XMLWriter
  • PHPExcel_Shared_ZipArchive
  • PHPExcel_Shared_ZipStreamWrapper
  • PHPExcel_Style
  • PHPExcel_Style_Alignment
  • PHPExcel_Style_Border
  • PHPExcel_Style_Borders
  • PHPExcel_Style_Color
  • PHPExcel_Style_Conditional
  • PHPExcel_Style_Fill
  • PHPExcel_Style_Font
  • PHPExcel_Style_NumberFormat
  • PHPExcel_Style_Protection
  • PHPExcel_Style_Supervisor
  • PHPExcel_Worksheet
  • PHPExcel_Worksheet_AutoFilter
  • PHPExcel_Worksheet_AutoFilter_Column
  • PHPExcel_Worksheet_AutoFilter_Column_Rule
  • PHPExcel_Worksheet_BaseDrawing
  • PHPExcel_Worksheet_CellIterator
  • PHPExcel_Worksheet_ColumnDimension
  • PHPExcel_Worksheet_Drawing
  • PHPExcel_Worksheet_Drawing_Shadow
  • PHPExcel_Worksheet_HeaderFooter
  • PHPExcel_Worksheet_HeaderFooterDrawing
  • PHPExcel_Worksheet_MemoryDrawing
  • PHPExcel_Worksheet_PageMargins
  • PHPExcel_Worksheet_PageSetup
  • PHPExcel_Worksheet_Protection
  • PHPExcel_Worksheet_Row
  • PHPExcel_Worksheet_RowDimension
  • PHPExcel_Worksheet_RowIterator
  • PHPExcel_Worksheet_SheetView
  • PHPExcel_WorksheetIterator
  • PHPExcel_Writer_Abstract
  • PHPExcel_Writer_CSV
  • PHPExcel_Writer_Excel2007
  • PHPExcel_Writer_Excel2007_Chart
  • PHPExcel_Writer_Excel2007_Comments
  • PHPExcel_Writer_Excel2007_ContentTypes
  • PHPExcel_Writer_Excel2007_DocProps
  • PHPExcel_Writer_Excel2007_Drawing
  • PHPExcel_Writer_Excel2007_Rels
  • PHPExcel_Writer_Excel2007_RelsRibbon
  • PHPExcel_Writer_Excel2007_RelsVBA
  • PHPExcel_Writer_Excel2007_StringTable
  • PHPExcel_Writer_Excel2007_Style
  • PHPExcel_Writer_Excel2007_Theme
  • PHPExcel_Writer_Excel2007_Workbook
  • PHPExcel_Writer_Excel2007_Worksheet
  • PHPExcel_Writer_Excel2007_WriterPart
  • PHPExcel_Writer_Excel5
  • PHPExcel_Writer_Excel5_BIFFwriter
  • PHPExcel_Writer_Excel5_Escher
  • PHPExcel_Writer_Excel5_Font
  • PHPExcel_Writer_Excel5_Parser
  • PHPExcel_Writer_Excel5_Workbook
  • PHPExcel_Writer_Excel5_Worksheet
  • PHPExcel_Writer_Excel5_Xf
  • PHPExcel_Writer_HTML
  • PHPExcel_Writer_PDF
  • PHPExcel_Writer_PDF_Core
  • PHPExcel_Writer_PDF_DomPDF
  • PHPExcel_Writer_PDF_mPDF
  • PHPExcel_Writer_PDF_tcPDF
  • Provincia
  • Radiacion
  • SingularValueDecomposition
  • Sistema
  • trendClass
  • xajax
  • xajaxArgumentManager
  • xajaxCallableObject
  • xajaxCallableObjectPlugin
  • xajaxControl
  • xajaxControlContainer
  • xajaxCustomRequest
  • xajaxCustomResponse
  • xajaxEvent
  • xajaxEventPlugin
  • xajaxFunctionPlugin
  • xajaxIncludeClientScriptPlugin
  • xajaxLanguageManager
  • xajaxPlugin
  • xajaxPluginManager
  • xajaxRequest
  • xajaxRequestPlugin
  • xajaxResponse
  • xajaxResponseManager
  • xajaxResponsePlugin
  • xajaxScriptPlugin
  • xajaxUserFunction
  • XMLWriter

Interfaces

  • DateTimeInterface
  • Iterator
  • PHPExcel_CachedObjectStorage_ICache
  • PHPExcel_Cell_IValueBinder
  • PHPExcel_IComparable
  • PHPExcel_Reader_IReader
  • PHPExcel_Reader_IReadFilter
  • PHPExcel_RichText_ITextElement
  • PHPExcel_Writer_IWriter
  • Throwable
  • Traversable

Exceptions

  • Exception
  • PHPExcel_Calculation_Exception
  • PHPExcel_Chart_Exception
  • PHPExcel_Exception
  • PHPExcel_Reader_Exception
  • PHPExcel_Writer_Exception

Functions

  • acosh
  • agregar_elemento
  • asinh
  • atanh
  • borrar_elementos
  • borrar_gdm_ab
  • borrar_irradiacion
  • borrar_latitud
  • borrar_panel
  • borrar_periodo
  • borrar_pmp_min_pmp_max
  • borrar_radiacion
  • borrar_resumen
  • borrar_sistema
  • borrar_sombra
  • gdm_ab
  • grabar_resumen
  • historial
  • hypo
  • irradiacion
  • JAMAError
  • latitud
  • limpiar_historial
  • login
  • mb_str_replace
  • mostrar_energia_total_ch
  • mostrar_panel_md_th
  • mostrar_panel_th
  • mostrar_radiacion_md_th
  • mostrar_radiacion_th
  • mostrar_resumen_th
  • panel
  • PclZipUtilCopyBlock
  • PclZipUtilOptionText
  • PclZipUtilPathInclusion
  • PclZipUtilPathReduction
  • PclZipUtilRename
  • PclZipUtilTranslateWinPath
  • periodo
  • pmp_min_pmp_max
  • preparar_panel
  • preparar_radiacion
  • preparar_radiacion_media
  • radiacion
  • resumen
  • sistema
  • sombra
  • xajaxCompressFile
  • xajaxErrorHandler
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download
  1: <?php
  2: 
  3: /**
  4:  * Copyright 2015 AutEne.com.
  5:  *
  6:  * This work is licensed under the 
  7:  * Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
  8:  * To view a copy of this license, visit 
  9:  *
 10:  *      http://creativecommons.org/licenses/by-nc-nd/3.0/
 11:  *
 12:  * or send a letter to Creative Commons, 444 Castro Street, Suite 900, 
 13:  * Mountain View, California, 94041, USA.
 14:  * Unless required by applicable law or agreed to in writing, software
 15:  * distributed under the License is distributed on an "AS IS" BASIS,
 16:  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 17:  * See the License for the specific language governing permissions and
 18:  * limitations under the License.
 19:  */
 20: 
 21: /**
 22:  * Incluimos las lilbrerías necesarias. Xajax y clases.
 23:  */
 24: require_once('Provincia.php');
 25: require_once('Latitud.php');
 26: require_once('Periodo.php');
 27: require_once('Radiacion.php');
 28: require_once('Sistema.php');
 29: require_once('Panel.php');
 30: require_once('Historial.php');
 31: 
 32: /**
 33:  * Description of Dao
 34:  * 
 35:  * La clase Dao.php gestiona las conexiones a la base de datos y los métodos
 36:  * que implementan las consultas SQL necesarias para la obtención de los datos
 37:  * y la persistencia de los mismos.
 38:  *
 39:  * @author antonio horrillo horrillo
 40:  */
 41: class Dao {  
 42:     
 43:     /**
 44:      * protected static function ejecutaConsulta($sql)
 45:      * 
 46:      * Realiza la conexión a la base de datos mediante PDO, especificando el
 47:      * servidor, nombre de la base de datos, usuario y contraseña de la misma.
 48:      * Devuelve el resultado de la consulta que tiene como parámetro de entrada.
 49:      * 
 50:      * @param type $sql
 51:      * @return type
 52:      */
 53:     protected static function ejecutaConsulta($sql) {
 54:         $opc = array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8");
 55:         $dsn = "mysql:host=db604256230.db.1and1.com;dbname=db604256230";
 56:         $usuario = 'dbo604256230';
 57:         $contrasena = 'sqlinefex2011';        
 58:         $autene = new PDO($dsn, $usuario, $contrasena, $opc);
 59:         $resultado = null;
 60:         if (isset($autene)) {
 61:             $resultado = $autene->query($sql);
 62:         }
 63:         return $resultado;
 64:     }
 65:     
 66:     /**
 67:      * public static function obtieneLatitud()
 68:      * 
 69:      * Obtenemos los valores de latitud de las provincias. 
 70:      * 
 71:      * Definimos la consulta sql y la enviamos como parametro al método propio 
 72:      * de la clase Dao:
 73:      * self::ejecutaConsulta ($sql);
 74:      * Si tiene datos, mediante fetch obtenemos las filas devueltas en la consulta
 75:      * y creamos un objeto Latitud por cada fila. Finalmente almacenamos todos
 76:      * los objetos en el array $latitud y lo retornamos.
 77:      * 
 78:      * @return \Latitud
 79:      */
 80:     public static function obtieneLatitud() {
 81:         $sql = "SELECT * FROM aut_ciu_lat;";
 82:         $resultado = self::ejecutaConsulta ($sql);
 83:         $latitud = array();
 84:     if($resultado) {
 85:             $row = $resultado->fetch();
 86:             while ($row != null) {
 87:                 $latitud[] = new Latitud($row);
 88:                 $row = $resultado->fetch();
 89:             }
 90:     }
 91:         return $latitud;
 92:     }
 93:     
 94:     /**
 95:      * public static function obtienePeriodo()
 96:      * 
 97:      * Obtenemos los valores del Periodo de Cálculo. 
 98:      * 
 99:      * Definimos la consulta sql y la enviamos como parametro al método propio 
100:      * de la clase Dao:
101:      * self::ejecutaConsulta ($sql);
102:      * Si tiene datos, mediante fetch obtenemos las filas devueltas en la consulta
103:      * y creamos un objeto Periodo por cada fila. Finalmente almacenamos todos
104:      * los objetos en el array $periodo y lo retornamos.
105:      * 
106:      * @return \Periodo
107:      */
108:     public static function obtienePeriodo() {
109:         $sql = "SELECT * FROM aut_per_cal;";
110:         $resultado = self::ejecutaConsulta ($sql);
111:         $periodo = array();
112:     if($resultado) {
113:             $row = $resultado->fetch();
114:             while ($row != null) {
115:                 $periodo[] = new Periodo($row);
116:                 $row = $resultado->fetch();
117:             }
118:     }
119:         return $periodo;
120:     }
121:     
122:     /**
123:      * public static function obtieneRadiacion()
124:      * 
125:      * Obtenemos los valores de Radiación Horizontal Mensual por provincia.
126:      *  
127:      * Definimos la consulta sql y la enviamos como parametro al método propio 
128:      * de la clase Dao:
129:      * self::ejecutaConsulta ($sql);
130:      * Si tiene datos, mediante fetch obtenemos las filas devueltas en la consulta
131:      * y creamos un objeto Radiación por cada fila. Finalmente almacenamos todos
132:      * los objetos en el array $radiación y lo retornamos.
133:      * 
134:      * @return \Radiacion
135:      */
136:     public static function obtieneRadiacion() {
137:         $sql = "SELECT * FROM aut_rad_hor;";
138:         $resultado = self::ejecutaConsulta ($sql);
139:         $radiacion = array();
140:     if($resultado) {
141:             $row = $resultado->fetch();
142:             while ($row != null) {
143:                 $radiacion[] = new Radiacion($row);
144:                 $row = $resultado->fetch();
145:             }
146:     }
147:         return $radiacion;
148:     }   
149:  
150:     /**
151:      * public static function obtieneSistema()
152:      * 
153:      * Obtenemos los Tipos de Sistemas y sus Factores Pr.
154:      * 
155:      * Definimos la consulta sql y la enviamos como parametro al método propio 
156:      * de la clase Dao:
157:      * self::ejecutaConsulta ($sql);
158:      * Si tiene datos, mediante fetch obtenemos las filas devueltas en la consulta
159:      * y creamos un objeto Sistema por cada fila. Finalmente almacenamos todos
160:      * los objetos en el array $sistema y lo retornamos.
161:      * 
162:      * @return \Sistema
163:      */
164:     public static function obtieneSistema() {
165:         $sql = "SELECT * FROM aut_efi_sis;";
166:         $resultado = self::ejecutaConsulta ($sql);
167:         $sistema = array();
168:     if($resultado) {
169:             $row = $resultado->fetch();
170:             while ($row != null) {
171:                 $sistema[] = new Sistema($row);
172:                 $row = $resultado->fetch();
173:             }
174:     }
175:         return $sistema;
176:     }
177:     
178:     /**
179:      * public static function obtienePanel()
180:      * 
181:      * Obtenemos la información de los Módulos Solares disponibles en la base de datos.
182:      * 
183:      * Definimos la consulta sql y la enviamos como parametro al método propio 
184:      * de la clase Dao:
185:      * self::ejecutaConsulta ($sql);
186:      * Si tiene datos, mediante fetch obtenemos las filas devueltas en la consulta
187:      * y creamos un objeto Panel por cada fila. Finalmente almacenamos todos
188:      * los objetos en el array $panel y lo retornamos.
189:      * 
190:      * @return \Panel
191:      */
192:     public static function obtienePanel() {
193:         $sql = "SELECT * FROM aut_dat_pan;";
194:         $resultado = self::ejecutaConsulta ($sql);
195:         $panel = array();
196:     if($resultado) {
197:             $row = $resultado->fetch();
198:             while ($row != null) {
199:                 $panel[] = new Panel($row);
200:                 $row = $resultado->fetch();
201:             }
202:     }
203:         return $panel;
204:     }
205:     
206:     /**
207:      * public static function verificaNombre($nombre)
208:      * 
209:      * Verificamos el nombre de usuario en la base de datos para iniciar sesión.
210:      * 
211:      * Definimos la consulta sql y la enviamos como parametro al método propio 
212:      * de la clase Dao:
213:      * self::ejecutaConsulta ($sql);
214:      * Definimos la variable $verificado y le asignamos el valor false. Si tiene 
215:      * datos la consulta, mediante fetch obtenemos la fila devuelta en la consulta,
216:      * existe un registro que cumpla la condición, tenemos usuario registrado, 
217:      * por lo que asignamos el valor de $verificado a true y la retornamos. Si
218:      * no tenemos datos, retornamos el valor inicial de $verificado, el valor false
219:      * lo que indica que no existe un registro con ese usuario.
220:      * 
221:      * @param type $nombre
222:      * @return boolean
223:      */
224:     public static function verificaNombre($nombre) {
225:         $sql = "SELECT usuario FROM aut_use_log ";
226:         $sql .= "WHERE usuario='".$nombre."';";
227:         $resultado = self::ejecutaConsulta ($sql);
228:         $verificado = false;
229:         if(isset($resultado)) {
230:             $fila = $resultado->fetch();
231:             if($fila !== false) {
232:                 $verificado=true;
233:             }
234:         }
235:         return $verificado;
236:     }
237:     
238:     /**
239:      * public static function obtieneClave($nombre)
240:      * 
241:      * Retornamos la clave del usuario especificado para iniciar sesión.
242:      * 
243:      * Definimos la consulta sql y la enviamos como parametro al método propio 
244:      * de la clase Dao:
245:      * self::ejecutaConsulta ($sql);
246:      * Si tiene datos, mediante fetch obtenemos la fila devuelta en la consulta
247:      * y asignamos a $clave el valor del la celda $row['clave'], que contene la
248:      * contraseña del usuario. Finalmente retornamos $clave.
249:      * 
250:      * @param type $nombre
251:      * @return type
252:      */
253:     public static function obtieneClave($nombre) {
254:         $sql = "SELECT clave FROM aut_use_log ";
255:         $sql .= "WHERE usuario='".$nombre."';";
256:         $resultado = self::ejecutaConsulta ($sql);
257:         $clave = array();
258:         if(isset($resultado)) {
259:             $row = $resultado->fetch();
260:             $clave = $row['clave'];
261:         }
262:         return $clave;
263:     }   
264: 
265:     /**
266:      * public static function grabarDatos($usu,$ed,$prov,$pmp_min,$pmp_max,$panel,$paneles)
267:      * 
268:      * Grabamos los datos del Resumen del Cálculo en la base de datos.
269:      * 
270:      * Si las variables $usu, $ed, $prov, $pmp_min, $pmp_max, $panel, $paneles
271:      * estan definidas y no son null, definimos la consulta sql y la enviamos 
272:      * como parametro al método propio de la clase Dao:
273:      * self::ejecutaConsulta ($sql);
274:      * Este método realiza la inserción de la fila en la base de datos. Si alguna
275:      * de las variables no estuviera definida correctamente, no se realiza la 
276:      * inserción de la fila en la tabla.
277:      * 
278:      * @param type $usu
279:      * @param type $ed
280:      * @param type $prov
281:      * @param type $pmp_min
282:      * @param type $pmp_max
283:      * @param type $panel
284:      * @param type $paneles
285:      */
286:     public static function grabarDatos($usu,$ed,$prov,$pmp_min,$pmp_max,$panel,$paneles) {
287:         if (isset($usu) && isset($ed) && isset($prov) && isset($pmp_min) && isset($pmp_max) && isset($panel) && isset($paneles)) {                            
288:             $sql = "INSERT INTO `aut_use_cal` (`Usuario`, `Ed`, `Provincia`,";
289:             $sql.="`Pmpmin`, `Pmpmax`, `Panel`, `Modulos`) VALUES ('".$usu."', '".$ed."',";
290:             $sql.="'".$prov."', '".$pmp_min."', '".$pmp_max."', '".$panel."', '".$paneles."')";           
291:             self::ejecutaConsulta ($sql);
292:         }           
293:     }
294:     
295:     /**
296:      * public static function verificaResumen($usu,$ed,$prov,$pmp_min,$pmp_max,$panel,$paneles)
297:      * 
298:      * Verificamos si el registro se encuentra en la base de datos o no.
299:      * 
300:      * Definimos la consulta sql y la enviamos como parametro al método propio 
301:      * de la clase Dao:
302:      * self::ejecutaConsulta ($sql);
303:      * Definimos la variable $verificado y le asignamos el valor false. Si tiene 
304:      * datos la consulta, mediante fetch obtenemos la fila devuelta en la consulta,
305:      * existe un registro que cumpla la condición, lo que significa que ya tenemos
306:      * el calculo del panel registrado en la base de datos, por lo que asignamos
307:      * el valor de $verificado a true y la retornamos. Si no tenemos datos, 
308:      * retornamos el valor inicial de $verificado, el valor false lo que indica 
309:      * que no existe un registro con el calculo del panel registrado.
310:      * 
311:      * @param type $usu
312:      * @param type $ed
313:      * @param type $prov
314:      * @param type $pmp_min
315:      * @param type $pmp_max
316:      * @param type $panel
317:      * @param type $paneles
318:      * @return boolean
319:      */
320:     public static function verificaResumen($usu,$ed,$prov,$pmp_min,$pmp_max,$panel,$paneles) {       
321:         $sql = "SELECT usuario FROM `aut_use_cal` WHERE `Usuario`='".$usu."' AND ";
322:         $sql.= " `Ed`='".$ed."' AND `Provincia`='".$prov."' AND `Pmpmin`='".$pmp_min."' AND ";     
323:         $sql.=" `Pmpmax`='".$pmp_max."' AND `Panel`='".$panel."' AND `Modulos`='".$paneles."'";
324:         $resultado = self::ejecutaConsulta ($sql);
325:         $verificado = false;
326:         if(isset($resultado)) {
327:             $fila = $resultado->fetch();
328:             if($fila !== false) {
329:                 $verificado=true;
330:             }
331:         }
332:         return $verificado;
333:     }
334:     
335:     /**
336:      * public static function obtieneHistorial()
337:      * 
338:      * Obtenemos el Historial de Cálculos de los Módulos Solares.
339:      * 
340:      * Definimos la consulta sql y la enviamos como parametro al método propio 
341:      * de la clase Dao:
342:      * self::ejecutaConsulta ($sql);
343:      * Si tiene datos, mediante fetch obtenemos las filas devueltas en la consulta
344:      * y creamos un objeto Historial por cada fila. Finalmente almacenamos todos
345:      * los objetos en el array $historial y lo retornamos.
346:      * 
347:      * @return \Historial
348:      */
349:     public static function obtieneHistorial() {
350:         $sql = "SELECT * FROM aut_use_cal;";
351:         $resultado = self::ejecutaConsulta ($sql);
352:         $historial = array();
353:     if($resultado) {
354:             $row = $resultado->fetch();
355:             while ($row != null) {
356:                 $historial[] = new Historial($row);
357:                 $row = $resultado->fetch();
358:             }
359:     }
360:         return $historial;
361:     }
362: }
363: 
364: ?>
Autene API documentation generated by ApiGen