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. Llamamos a la clase Dao.php donde esta
 23:  * definida la conexión a la base de datos.
 24:  */
 25: require_once('./modelo/Dao.php');
 26: 
 27: /**
 28:  * Description of MotorPhp.
 29:  * 
 30:  * La clase MotorPhp.php gestiona las variables de sesión y las funciones 
 31:  * que se ejecutan en la vista que no requieren el uso de Xajax para procesar 
 32:  * información entre el cliente y el servidor.
 33:  *
 34:  * @author antonio horrillo horrillo
 35:  */
 36: class MotorPhp {
 37: 
 38:     /**
 39:      * Función verificarUsuario()
 40:      * 
 41:      * Comprobamos que el usuario se haya autentificado. Si no esta identificado
 42:      * mostramos en la barra de navegación el mensaje Iniciar Sesión, el cual 
 43:      * tiene un enlace a un componente modal que abre la ventana de login. Si el
 44:      * usuario esta identificado, cambiamos el mensaje anterior por un menú 
 45:      * desplegable dropdown cuyas opciones estan definidas en la vista, y muestra
 46:      * el correo como usuario. Ambas opciones se relacionan a la variable $usu, la 
 47:      * cual retornamos al invocar el método. Retornamos la variable String $usu.
 48:      * 
 49:      * @return string
 50:      */
 51:     public static function verificarUsuario() {
 52:         if (!isset($_SESSION['usuario'])) {
 53:             $usu = "<li class='active'><a class='modal-trigger' href='#login'>Iniciar Sesión</a></li>";
 54:         } else {
 55:             $usu = "<li><a class='dropdown-button' href='#!' data-activates='menu'>" . $_SESSION['usuario'] . "</a></li>";
 56:         }
 57:         return $usu;
 58:     }
 59: 
 60:     /**
 61:      * Función verificarUsuarioMovil()
 62:      * 
 63:      * Comprobamos que el usuario se haya autentificado. Si no esta identificado
 64:      * mostramos en la barra de navegación el mensaje Iniciar Sesión, el cual 
 65:      * tiene un enlace a un componente modal que abre la ventana de login. Si el
 66:      * usuario esta identificado, cambiamos el mensaje anterior por un menú 
 67:      * desplegable dropdown cuyas opciones estan definidas en la vista, y muestra
 68:      * el correo como usuario. Ambas opciones se relacionan a la variable $usu, la 
 69:      * cual retornamos al invocar el método. Retornamos la variable String $usu.
 70:      * 
 71:      * @return string
 72:      */
 73:     public static function verificarUsuarioMovil() {
 74:         if (!isset($_SESSION['usuario'])) {
 75:             $usu_mov = "<li class='active'><a class='modal-trigger' href='#login'>Iniciar Sesión</a></li>";
 76:         } else {
 77:             $usu_mov = "<li><a class='dropdown-button' href='#!' data-activates='menuMovil'>" . $_SESSION['usuario'] . "</a></li>";
 78:         }
 79:         return $usu_mov;
 80:     }
 81:     
 82:     /**
 83:      * Función botonLogin()
 84:      * 
 85:      * Comprobamos que el usuario se haya autentificado. Si no esta identificado
 86:      * mostramos el botón de Iniciar Sesión, el cual tiene un enlace a un 
 87:      * componente modal que abre la ventana de login. Si el usuario esta 
 88:      * identificado, eliminamos el botón. La variable $usu_login la retornamos 
 89:      * al invocar el método. Retornamos la variable String $usu_login.
 90:      * 
 91:      * @return string
 92:      */
 93:     public static function botonLogin() {
 94:         if (!isset($_SESSION['usuario'])) {
 95:             $usu_login = "<a class='btn-large waves-effect waves-light red lighten-1 btn modal-trigger' href='#login'>Iniciar Sesión</a>";
 96:         } else {
 97:             $usu_login = "";
 98:         }
 99:         return $usu_login;
100:     }
101:     
102:     /**
103:      * Función arrayAlmacen()
104:      * 
105:      * Comprobamos que la variable de sesión almacen está definida y no es NULL.
106:      * En caso de no estarlo, creamos un nuevo array. Guardaremos los objetos
107:      * de Elementos que el usuario introduzca en la aplicación.
108:      */
109:     public static function arrayAlmacen() {
110:         if (!isset($_SESSION['almacen'])) {
111:             $_SESSION['almacen'] = array();
112:         }
113:     }
114: 
115:     /**
116:      * Función arrayLatitud()
117:      * 
118:      * Comprobamos que la variable de sesión lat está definida y no es NULL.
119:      * En caso de no estarlo, creamos un nuevo array con objetos obtenidos
120:      * de la conexión a la base de datos de Latitud. aut_ciu_lat Guardamos las 
121:      * provincias y sus latitudes. 
122:      */
123:     public static function arrayLatitud() {
124:         if (!isset($_SESSION['lat'])) {
125:             $_SESSION['lat'] = Dao::obtieneLatitud();
126:         }
127:     }
128: 
129:     /**
130:      * Función consulta_provincias()
131:      * 
132:      * Listamos las provincias en un menú desplegable select id="provincia" de
133:      * forma que el contenido, cada option value es la columna provincia de la fila
134:      * contenida en la tabla aut_ciu_lat.
135:      */
136:     public static function consulta_provincias() {
137:         foreach ($_SESSION['lat'] as $l) {
138:             echo "<option value='" . $l->getProvincia() . "'>" . $l->getProvincia() . "</option>";
139:         }
140:     }
141: 
142:     /**
143:      * Función arrayPeriodo()
144:      * 
145:      * Comprobamos que la variable de sesión per está definida y no es NULL.
146:      * En caso de no estarlo, creamos un nuevo array con objetos obtenidos
147:      * de la conexión a la base de datos de Periodo aut_per_cal. Guardamos el
148:      * Periodo de cálculo, el Factor K y el Factor F.
149:      */
150:     public static function arrayPeriodo() {
151:         if (!isset($_SESSION['per'])) {
152:             $_SESSION['per'] = Dao::obtienePeriodo();
153:         }
154:     }
155: 
156:     /**
157:      * Función consulta_periodos()
158:      * 
159:      * Listamos el Periodo de Cálculo en un menú desplegable id="periodo_calculo"
160:      * de forma que el contenido, cada option value es la columna Periodo de la fila
161:      * contenida en la tabla aut_per_cal.
162:      */
163:     public static function consulta_periodos() {
164:         foreach ($_SESSION['per'] as $p) {
165:             echo "<option value='" . $p->getPeriodo() . "'>" . $p->getPeriodo() . "</option>";
166:         }
167:     }
168: 
169:     /**
170:      * Función arraySombra()
171:      * 
172:      * Comprobamos que la variable de sesión fs está definida y no es NULL.
173:      * En caso de no estarlo, la inicializamos igualandola a cero.
174:      */
175:     public static function arraySombra() {
176:         if (!isset($_SESSION['fs'])) {
177:             $_SESSION['fs'] = 0;
178:         }
179:     }
180: 
181:     /**
182:      * Función arrayRadiacion()
183:      * 
184:      * Comprobamos que la variable de sesión rad está definida y no es NULL.
185:      * En caso de no estarlo, creamos un nuevo array con objetos obtenidos
186:      * de la conexión a la base de datos de Radiación aut_rad_hor. Guardamos la
187:      * Provincia y la radiación horizontal en todos los meses del año.
188:      */
189:     public static function arrayRadiacion() {
190:         if (!isset($_SESSION['rad'])) {
191:             $_SESSION['rad'] = Dao::obtieneRadiacion();
192:         }
193:     }
194: 
195:     /**
196:      * Función arraySistema()
197:      * 
198:      * Comprobamos que la variable de sesión sis está definida y no es NULL.
199:      * En caso de no estarlo, creamos un nuevo array con objetos obtenidos
200:      * de la conexión a la base de datos de Sistemas aut_efi_sis. Guardamos el
201:      * tipo de Sistema y la eficiencia del mismo en condiciones de trabajo.
202:      */
203:     public static function arraySistema() {
204:         if (!isset($_SESSION['sis'])) {
205:             $_SESSION['sis'] = Dao::obtieneSistema();
206:         }
207:     }
208: 
209:     /**
210:      * Función consulta_sistema()
211:      * 
212:      * Listamos el Tipo de Sistema en un menú desplegable id="sistema_eficiencia"
213:      * de forma que el contenido, cada option value es la columna Sistema de la fila
214:      * contenida en la tabla aut_efi_sis.
215:      */
216:     public static function consulta_sistema() {
217:         foreach ($_SESSION['sis'] as $s) {
218:             echo "<option value='" . $s->getSistema() . "'>" . $s->getSistema() . "</option>";
219:         }
220:     }
221: 
222:     /**
223:      * Función arrayPanel()
224:      * 
225:      * Comprobamos que la variable de sesión pan está definida y no es NULL.
226:      * En caso de no estarlo, creamos un nuevo array con objetos obtenidos
227:      * de la conexión a la base de datos de Paneles aut_dat_pan. Guardamos los
228:      * datos del módulo solar.
229:      */
230:     public static function arrayPanel() {
231:         if (!isset($_SESSION['pan'])) {
232:             $_SESSION['pan'] = Dao::obtienePanel();
233:         }
234:     }
235: 
236:     /**
237:      * Función consulta_panel()
238:      * 
239:      * Listamos los módulos solares en un menú desplegable select id="panel"
240:      * de forma que el contenido, cada option value es la columna Modelo de la fila
241:      * contenida en la tabla aut_dat_pan.
242:      */
243:     public static function consulta_panel() {
244:         foreach ($_SESSION['pan'] as $p) {
245:             echo "<option value='" . $p->getModelo() . "'>" . $p->getModelo() . "</option>";
246:         }
247:     }
248: }
249: 
250: ?>
Autene API documentation generated by ApiGen