UNIVERSITY OF THE PHILIPPINES MANILA College of Arts and Sciences Department of Physical Sciences and Mathematics

Epidemic Information and Simulation System: An Online System for Epidemiologic Simulation of Anthroponotic Diseases Using Stochastic Differential Equations

A Special problem in partial fulfillment Of the Requirements for the Degree of Bachelor of Science in Computer Science

James Matthew B. Miraflor October 20, 2009

ACCEPTANCE SHEET

The Special Problem entitled “Epidemic Information and Simulation System: An Online for Epidemiologic Simulation of Anthroponotic Diseases Using Stochastic Differential Equations” prepared and submitted by James Matthew B. Miraflor in partial fulfillment of the requirements for the degree of Bachelor of Science in Computer Science has been examined and is recommended for acceptance.

__________________________________ Vincent Peter C. Magboo, M.D., M.S. Adviser

EXAMINERS: Approved 1. Gregorio B. Baes, Ph.D. (candidate) 2. Avegail D. Carpio, M.S. 3. Richard Bryann L. Chua, M.S. 4. Aldrich Colin K. Co, M.S. (candidate) 5. Geoffrey A. Solano, M.S. 6. Bernie B. Terrado, M.S. (candidate) __________ __________ __________ __________ __________ __________ Disapproved __________ __________ __________ __________ __________ __________

Accepted and approved as partial fulfillment of the requirements for the degree of Bachelor of Science in Computer Science.

__________________________________ Geoffrey A. Solano, M.S. Unit Head Mathematical and Computing Sciences Unit Department of Physical Sciences and Mathematics

__________________________________ Marcelina B. Lirazan, Ph.D. Chair Department of Physical Sciences and Mathematics

__________________________________ Reynaldo H. Imperial, Ph.D. Dean College of Arts and Sciences

ABSTRACT

With the need for epidemiologic surveillance increasing with rapid urbanization, changing climate, and rising security risks, the Epidemic Information and Simulation System (EISS), a webbased system for epidemiologic simulation of anthroponotic (human-transferrable) diseases, was developed. The objective was to create a system – easily accessible by pathologists, geographers, and epidemiologists – that effectively simulates the spreading of a particular disease in a certain geographic area and visually display the result through customizable animation, pivot tables, and charts. This will facilitate the intuitive design of interventions, particularly quarantine and vaccination strategies, that respond to epidemic outbreaks. The effects of these interventions can also be simulated by the system.

The EISS uses algorithms using Stochastic Differential Equations (SDE) that describe a variant of a compartmental model in epidemiology known as Susceptible-Latent/ExposedInfectious-Removed (SLIR/SEIR) model. The particular SLIR model used was the one that incorporates spatiality, since the system simulates the “movement” of the disease over regions in the geographic area. Numerical approximation using Euler-Maruyama method was used to estimate the SDE solutions.

The system allows four users: System Administrator, Geographer, and Pathologist to manage accounts, geographic information, and disease information respectively, and Epidemiologist who has access to the simulation features. The interface of the system is based on the concept of a one-stop-shop i.e. all features for management of data are, as much as possible, compressed in a single page in an ergonomic manner. Tables have controls that sorts, filters, and paginates the entries without reloading the page.

Keywords: epidemic simulation, SLIR, SEIR, epidemics, epidemic compartmental models, epidemic information system, epidemic surveillance, containment

TABLE OF CONTENTS

I. INTRODUCTION A. BACKGROUND OF THE STUDY B. STATEMENT OF THE PROBLEM C. PROJECT OBJECTIVES D. SIGNIFICANCE OF THE STUDY E. ASSUMPTIONS F. SCOPE AND LIMITATIONS II. REVIEW OF RELATED LITERATURE III. THEORETICAL/CONCEPTUAL FRAMEWORK A. EPIDEMIOLOGIC SIMULATION Epidemiologic Simulation and Popular Models Susceptible-Exposed-Infectious-Removed Model Global SEIR Model B. MATHEMATICAL MODELLING OF EPIDEMICS Epidemiologic Models and Differential Equations Stochastic Differential Equations The Stochastic Langevin Form Gaussian White Noise Factors and the Box-Muller Algorithm Approximating Stochastic Differential Equations: The Euler-Maruyama Scheme C. THE DARGATZ ET AL. GLOBAL SEIR SDE MODEL The Global SEIR model Introducing Gaussian White Noise Generating the Gaussian White Noise Computing for Mean Transmission Rate Algorithm IV. DESIGN AND IMPLEMENTATION A. ENTITY RELATIONSHIP DIAGRAM B. CONTEXT DIAGRAM C. DATAFLOW DIAGRAM D. DATA DICTIONARY E. TECHNICAL ARCHITECTURE V. RESULTS BASIC PARTS USER FUNCTIONS

Page  1  1  3  4  7  7  8  10  13  13  13  15  16  18  18  20  22  22  24  25  25  27  28  28  29  34  34  36  37  45  48  49  49  56 

Logging-in The Control Panel SYSTEM ADMINISTRATOR Account Management (for System Administrator) PATHOLOGIST Diseases Management GEOGRAPHER Management of Geographic Units, Regions, and Maps EPIDEMIOLOGIST Manage your Regions Simulation Data View Function Map View Function Graph View Function Simulation Controls Other Maps VI. DISCUSSION Regions, Subregions, Geographic Units, and Maps The Traffic Matrix Simulation Interventions: Quarantine and Vaccinate VII. CONCLUSION VIII. RECOMMENDATIONS IX. BIBLIOGRAPHY X. APPENDIX XI. ACKNOWLEDGEMENT

56  57  58  58  62  62  65  65  71  72  75  80  83  96  99  107  110  112  113  114  115  117  119  121  207 

I. INTRODUCTION

A. BACKGROUND OF THE STUDY

Epidemiologic surveillance, currently, is one of the dynamic endeavors by the scientific community in the biological and medical professions. The changing climate, rapid urbanization (and thus rising levels of biochemical pollution), and the evolving immunity of targeted viral and bacterial infections have given pressure for practitioners to improve the science and the technology of epidemiology. Even the economics and financial side also has to be considered, especially since government health interventions are often costly – and in a time of soaring budget deficits at the wake of the financial crisis, there is even more pressure to limit costs.

Recent studies on epidemiologic surveillance had gradually gravitated towards the discussion on the proliferation of anthroponotic or human transferable diseases. The reason for this is apparently the current emergence of such diseases as Severe Acute Respiratory Syndrome (SARS) and the constant threat of bio-terrorism in many countries. As such, many mathematical models had already been devised to describe the behavior of such outbreaks. This is important especially since the only way a government of a specific country can respond to an epidemic is to know first how it spreads and act according to it.

Earlier models resort to interpolating and predicting data through common statistical methods. However, relying on statistical methods alone for epidemiologic surveillance and simulation is found to be inadequate. Dunham and Berlin characterized statistical methods as oversimplified and does not take into account “super-spreader” events, just like the recent SARS. This prompted epidemiologists and bio-statisticians to use other mathematical tools – particularly the SEIR differential equations (DE).

This is done by dividing the population into four clusters – that of Susceptible, Exposed, Infected, and Removed population (SEIR) [1]. One requirement of using SEIR DE is to assume that a particular region at study is fully mixed (i.e. random, with each individual able to contact the rest of the community). However, reality tells us that each individual is in contact only with a fraction of the population, and that the number of contacts and the frequency of interaction vary from individual to individual. Thus, the differential equation approach, which determines the spread of the disease by assuming that each person is with contact with each other, is inadequate [2].

Some systems responded to such a problem. With the aim of tracing the spread of the disease, they model epidemic processes as graphs. Contact network epidemiology allows epidemiologists to study the vulnerability of the population to a particular disease by using networks that links individuals with each other and the transmissibility rate of the disease. Such kind of methodology analyzes on the individual level [3].

An alternative solution would have been to incorporate spatial effects in the SEIR DE. Lloyd et al. [4] discussed this through the introduction of the force of infection. He merely divided the region at study into sub-regions and used to same SEIR model in each of the sub-region – with the modification that the rate by which susceptible individuals became infected now depends on the number of infected in the adjacent sub-regions.

A clearer and much more convincing spatial SEIR DE model is used by Dargatz et al. [5] in modeling the spread of influenza in Germany. Using the method of Hufnagel (cited by Dargatz et al. in their paper), he used the Global SIR model wherein instead of operating on the force of infection, he instead used the concept of contact rate and modeled the entry and exit of people from one sub-region to another (for an in-depth discussion, please proceed to the theoretical/conceptual framework).

2

While the new model now incorporates special effect, the method is primarily deterministic – i.e. no probabilistic factor is incorporated in the model. This does not adequately represent the status quo which, even if governed by certain rules, more often than not shows a random behavior. To solve this problem, Schwartz et al. [6] introduced the concept of noise in stochastic prediction and control of epidemics. Schwartz introduced the function h(t) which causes perturbation in the vaccination rate.

Dargatz et al. [5] proposed a better solution by writing the Global SIR models into Langevin stochastic differential equations (SDE). It introduces Gaussian white noise forces on each of the term of the earlier SIR DE to make the system of equations stochastic and probabilistic. The paper then proposed a numerical algorithm in simulating the epidemic.

B. STATEMENT OF THE PROBLEM

The main problem involves on the representation of the disease spreading. Earlier systems either dealt with the population as individuals connected in a network, or assume that the population is fully mixed such that it can be modeled by differential equations.

Problems arise with such kind of dichotomy. In the first case, wherein models tackle the problem at the individual level, the cost of computation will likely become very large if the population at study is also very large. It is thus applicable only at populations that are small in number. The second approach, however, tends to rely on chance encounters for the spreading of the disease, and assumes that there is an equal chance for any given individual to make contact with any individual in the population. As such, we cannot use the second approach to spatially predict the spreading of the disease.

The solution to this had been provided by the literature on SIR spatially heterogeneous SDE (stochastic differential equations) which are used to model and represent the spread of the

3

diseases. This uses differential equations to calculate the SIR percentages in the population as time progresses and at the same time determine the spatial movement of the disease. To model fluctuations in the real world, the model is a stochastic and probabilistic one.

There are, however, quite few if there are any systems incorporating such methodology. What we need therefore is a system that uses SDE to model epidemics and thus provide for the following needs of epidemiologists:

• •

need to aggregate and collate large amounts of data necessary for simulation. need to perform complex calculations (using the large amounts of data that had been collated) that are involved in using spatially heterogeneous SDE in predicting the behavior of an epidemic.

need to be able to manipulate parameters of the simulation at any time instance. This is important in answering “what if” questions during the course of scenario planning for epidemic control.

C. PROJECT OBJECTIVES

To address the needs earlier specified, the Epidemiologic Information and Simulation System (EISS) will be allowing the following users to perform the stated functions:

1) Allow registered users categorized as Epidemiologist to perform the simulation process through the following functionalities:

a) Input the simulation parameters i) ii) Number (tmax) of time frames (t Є [0,..,tmax]) to generate Time step unit (e.g. days, hours, weeks, etc.)

4

iii) Number of times the simulation is to be performed iv) The region at study (R) v) The disease to be used vi) The infected sub-regions, and the following information: (1) The number of exposed people (less than total population) (2) The number of infectious people (less than the number of exposed people) (3) The number of vaccinated/immune people (less than the difference of total and exposed population)

b) Update the simulation interventions registry through adding, editing and deleting interventions so as to allow the user to create a sound containment strategy for the epidemic. A particular intervention will contain the following arguments: i) ii) Time step the command will take effect (t Є [0,..,tmax]) The sub-region the command will take effect (Si)

iii) Intervention type and its required parameters. The available interventions are: (1) Quarantine – sets all the entries in the traffic/dispersal array to zero (2) Vaccinate – provides a vaccination rate of a particular sub-region (zero by default). This intervention requires vaccination rate vi as an argument.

c) Run the simulation using the simulation parameters and simulation interventions. d) View simulation results for each population category (Susceptible, Latent/Exposed, Infectious, Removed/Immunized) containing the following: i) Animation of the spread of the disease (time-frames/second are adjustable) using the SLIR data ii) Data of the following for each population category at time tmax: (1) Final population for each sub-region for each population category (printable) (2) Total final population for each population category (printable)

5

(3) Graph of total average final population versus sub-regions for each population category iii) Downloadable table of average population for each population category versus against time for every Sub-region in .csv format (simulation data dump)

2) Allow registered users categorized as Pathologist to do the following a) Insert an entry to the list of characterized diseases available for use in the system. Each disease entry would contain following information: • • • • Disease Name Disease Description Mean latent period (ε-1) Mean infectious period (β-1)

b) Edit disease information c) Delete disease information

3) Allow registered users categorized as Geographer to do the following: a) Create a new region, which contains the following information • • • • Region name Description Sub-regions it contains (S1, S2, S3, …, Sn) – taken from the geographic units Traffic/Dispersal matrix, which describes the movement of people from one subregion to another (an n by n connectivity matrix γ = [γi,j ], where γi,j is the movement rate from sub-region Si to sub-region Sj) b) Edit region information c) Edit information of pre-defined geographic units, which contains the following information • • • Geographic unit name Descriptions The current population of the geographic unit (Ni)

6

The current population density of the geographic unit (di)

4) Allow registered users categorized as System Administrator to create, edit, deactivate and activate an account categorized either as Pathologist, Geographer, Epidemiologist, or System Administrator

D. SIGNIFICANCE OF THE STUDY

The significance of the study, in a the period of emergence of new pathologic-epidemic strains like SARS and bio-terrorism agents like Anthrax, is thus very much apparent. The need to respond to a crisis brought by a sudden epidemiologic attack through sound containment and control strategies is an imperative if we are to save hundreds or possibly thousands of lives not to mention thousand to million pesos worth of properties.

This is especially true when there are no conceivable or if there is, feasible methods of prevention. This has caused a great concern among mathematical scientists and epidemiologists, since epidemics might have been caused by a deliberate introduction of diseases by bio-terrorists themselves [2]. Thus, such cases are unpredictable outside the realm of epidemiology.

In the case of the Philippines, such a system would prove to be indispensable. The fact that we have limited number of health workers just proves that to for epidemiologic containment and control to be effective, we must be able to maximize our resources by employing the best possible strategy to contain the disease.

E. ASSUMPTIONS

The simulation parameters inputted are assumed to be true and correct.

7

Sub-regions are assumed to be fully mixed i.e. all individuals in a sub-region have equal chances of meeting each other.

The region at study is assumed to be closed (that is, migration from and to the outside of the region is discounted). This does not mean, however, that the population does not change – in fact, the birth and the death rate of each of the sub-regions directly affects the total population.

A particular simulation intervention inputted is assumed to be feasible and can be done in real life situation. For example, when the Epidemiology Management Expert tests the effect of quarantining a particular sub-region at a particular time, resources are indeed enough to effectively quarantine that area at that time.

The effects of quarantine and vaccination are assumed to be perfectly effective, i.e. for quarantine, there is absolutely zero traffic from and to the sub-region; for vaccination, all people vaccinated are considered immune and will never be infected.

F. SCOPE AND LIMITATIONS

Scope

The system will be using the numerical method Euler-Maruyama approximation scheme in computing for Stochastic Differential Equations (SDE) defined in the Global SEIR model to be used.

The system only simulates the spread of diseases with human vectors (anthroponotic/human-transferable diseases). Animate vectors other than human beings are (e.g. insects, animals, plants) are also not included in the study and system development. Other environmental factors are also ignored, except when it affects the traffic/dispersal matrix.

8

The system does not distinguish between symptomatic infectious and asymptomatic infectious populations.

Since the system will treat the population as homogenous, it will only be tackling diseases which affect everyone from all age and gender groups.

Limitations

The system envisioned will not concern itself with the obtaining of information listed in the whether by simulation, by experimentation or by direct observation. The system is only concerned on what happens after we are able to characterize the disease and to determine the population description of the region at study.

The system will not be able to determine the veracity or correctness of the data inputted – except perhaps the type of data (e.g. the system can check when a user inputted an alphanumeric character when it should be inputting only a number).

9

II. REVIEW OF RELATED LITERATURE

Linda Allen and Clyde Martin’s The Black Death, AIDS and Mathematics: What's the Connection? explains the development of the SEIR (Susceptible-Exposed-Infectious-Removed) method in simulating epidemics. The text provides the simple theoretical explanations for the derivation of the SEIR differential equations, including how it stemmed out from the simpler SIR (Susceptible-Infected-Removed) model and SI (Susceptible-Immune) model. Recognizing the importance of vaccination in the process of transferring people from the Susceptible population to the Removed population, the text introduces the concept of a vaccination rate.

In the study by Joseph N. S.Eisenberg, , M. Alan Brookhart, Glenn Rice, Mary Brown, and John M. Colford, Jr. entitled Disease Transmission Models for Public Health Decision Making: Analysis of Epidemic and Endemic Conditions Caused by Waterborne Pathogens, the SEIR model was extended by dividing the Infectious population into two groups – the Symptomatic Infectious and the Asymptomatic Infectious. While this represents a step from the SEIR model, the concept had not been used in our modeling, since it had been assumed that most infectious people are symptomatic already, or that there is an effective method of detecting infectiousness without relying on detectable symptoms. The concept is useful, however, in instances when we need to contain possibly infectious individuals which do not show any symptoms. The Eisenberg et al. model are used to describe such scenarios.

In the study Scale-Free Network Models in Epidemiology: Preliminary Findings by Jill Bigley Dunham and F. Brett Berlin, the inadequacies of present models of epidemic simulation, which particularly involves statistical procedures and differential equations alone, are discussed. Consequently, it tackled on the need to use network models, particularly scale-free ones, in predicting epidemiologic processes.

10

Modeling Control Strategies of Respiratory Pathogens by Babak Pourbohloul, Lauren Ancel Meyers, Danuta M. Skowronski, Mel Krajden, David M. Patrick, and Robert C. Brunham also discusses graph structure to trace and predict the spread of epidemics, although at the individual level. The paper discusses the importance of assessing the epidemics in terms of how the persons within the population contact each other.

The study Modelling SARS Transmission Dynamics: A Small-Word Network Approach by Dr. Michael Small and Prof. C. K. Michael Tse presented a simple simulation of a contact-network epidemiologic system. They used simple grid network with dots representing people to demonstrate how people infect those who are in contact with them most (represented by adjacent dots). It is a presentation of a system similar to Pourbohloul’s.

The text Spatial Heterogeneity in Epidemic Models by Alun L. Lloyd and Robert M. May had been able to present a mathematical model which uses SEIR differential equations but modified it for the purpose of allowing heterogeneous subpopulations. In this way, spatial effects of the epidemics could be analyzed, considering the spatial heterogeneity of populations.

According to the study Stochastic Modelling of the Spatial Spread of Influenza in Germany by Christiane Dargatz, Vera Georgescu, and Leonhard Held, it is not enough that we have SEIR equations that are global or spatially-heterogeneous in nature. The probabilistic nature of real-life epidemic process has to be accounted also. The study then contains the Global SEIR mathematical models transformed into stochastic Langevin equations to incorporate Gaussian White Noise forces. The text also outlined the numerical algorithm used by to solve these equations using the Euler Maruyama approximation scheme for solving differential equations.

Ira B. Schwartz, Lora Billings, Erik M. Bollt’s Dynamical epidemic suppression using stochastic prediction and control deals with the new concepts behind stochastic prediction of epidemics, particularly the concept of noise. Its use of stochastic models to generate solutions to

11

problems posed by epidemics, while outside the scope of current study, is rather useful for advanced discourse in the field of using stochastic dynamics to predict disease behavior.

The textbook Differential Equations: Computing and Modelling by Henry C. Edwards and David E. Penney describes, in detail, the concepts behind Ordinary Differential Equations (ODE) and mathematical modeling. It contains techniques of symbolic computation and algorithms for numerical computation and approximation of solutions of ODE. The text also outlines possible real world applications of ODE.

Intended as a compilation of notes for students of UC Berkeley, Lawrence Evans’ An Introduction to Stochastic Differential Equations Version 1.2 explains Stochastic Differential Equations (SDE) and its foundations. The text clarifies the meaning of “noise” when used in the context of differential equations. It also introduces some concepts in basic probability.

12

III. THEORETICAL/CONCEPTUAL FRAMEWORK

A. EPIDEMIOLOGIC SIMULATION

Epidemiologic Simulation and Popular Models

Epidemiologists, in order to keep track of spread of diseases, usually divide the population at study into various population groups. An example of such groupings is the model wherein the population is divided into two groups, those susceptible to the disease and those who are not susceptible or the immune. A person moves from the susceptible group to the immune group only through vaccination or when his body recovers and develops immunity to the disease. It is generally believed that there is no movement in the other direction. That is, when you are vaccinated or you are immune from the disease, that immunity is life-long. While there are evidences on the waning of immunity, there is yet to be a convincing study of the matter [1]. In figure, we have:

Fig.1. Susceptible-Immune Model

A more useful population grouping is called the SIR Model, or the Susceptible-InfectiousRemoved model. In SIR model, the population is grouped into (a) Susceptible, those who had not contracted to the disease but is vulnerable to be infected; (b) Infectious, those who have contracted the disease and can transfer it to others i.e. the Susceptible population; and finally (c) Removed, those who are either immune from the disease (naturally or through vaccination) or dead. As we can see, the sum of these population groups is equal to the total population. Visually, we can think of the model as:

13

Fig.2. Susceptible-Infectious-Removed Model

One can then predict how fast a disease spread in a certain population by plotting the Susceptible and Infectious population in graph with respect to time. Furthermore, one can also know how fast people in the Infectious population transfer into the Removed population (through host i.e. the person affected, developing immunity or the host dying).

Fig.3. Susceptible-Infectious-Removed Model – Typical Behavior over Time

When one, for example, had already obtained an empirical value for how fast people are infected and on how fast and how many people die (mortality rate) or get immune, then future values can actually be predicted by using the same parameters. Furthermore, when these disease-related parameters are obtained, one can actually use it for any location or population infected by the disease.

14

This is how simulation of epidemics is being done in the present. We first obtain a model involving the population groups we want to observe. When a model had adequately been presented or devised, the necessary step is to represent the model into mathematical equations. But the model, first and foremost, should be accurate in presenting reality.

Susceptible-Exposed-Infectious-Removed Model

A more inclusive model is the SEIR model, or the Susceptible-Exposed-InfectiousRemoved Model. This now tackles four different groups: (a) Susceptible, those who are vulnerable to the disease: (2) Exposed, also called as Latent – those who have contracted the disease but are not yet infectious. (3) Infectious – those who can infect others with the disease. Infectious people are, most of the times, already symptomatic. (4) Finally, we have Removed – those who already immune from the disease or dead. Usually, immunity is obtained through vaccination. Allen and Martin represented the model visually as:

Fig.4. Susceptible-Exposed-Infectious-Removed Model with Vaccination Group

Let us analyze the transfer of population from one grouping to another. The rate by which people transfer from one group to another can be obtained empirically and be used to predict future values. Dargatz’s [5] and Allen & Martin’s [1] model (for vaccination) when combined will yield:

15

Fig.5. Susceptible-Exposed-Infectious-Removed Model with Vaccination Group and Rate of Transfer from one population Group to another

As we can see, the rate by which persons in the susceptible group become one of the exposed is called the transmission rate, designated by Dargatz et al. as α (alpha). Naturally then, the total persons going from a susceptible to exposed is Sα, where S is the total susceptible population. This will measure how fast the disease spreads. A more detailed explanation on how to obtain this rate will be discussed later in this study.

We also have the reciprocal of the average latent period and the reciprocal of average infectious period as the rate of transfer from exposed to infectious and infectious to removed population respectively. Furthermore, we have a direct link from susceptible directly to removed population through the incorporation of vaccination rate. So, the total movement to removed population is Sv + I(1/β), where I is the total infectious population, β (beta) is the mean infectious period, and v is the vaccination rate.

There are many things assumed by the SEIR model above. First, we assume that other factors that control the population are ignored, such as the birth and death rate. If they cannot be ignored, they are assumed to be equal, so the total population remains the same.

Global SEIR Model

One assumption in the SEIR model described above is that the population (S+E+I+R) are fully mixed i.e. all people have equal chances of meeting each other. This presents us a serious limitation, particularly because in real life situation, a person is only in contact with a fraction of

16

the population (e.g. his co-workers and relatives). Aside from that, we are given no spatial information on how the disease spread in a particular region. For example, if we are studying an epidemic in a province, we cannot trace how the disease spreads from town to town. We can only know the total number of persons per SEIR population groups. As such, the model is hardly useful when the intention is to prevent the disease from spreading.

The study Spatial Heterogeneity in Epidemic Models [4] by Alun Lloyd and Robert May investigated on this inadequacy. Llyod and May wanted to explain how disease persists “globally” even if it dies “locally”. For example, even if a disease is no longer an epidemic in any locality, an epidemic can still exist within the region that contains these localities.

This prompts us to describe SEIR populations in terms of regions divided into subregions. This way, we can know how infectious people of one sub-region infect susceptible people from other sub-regions. Instead of dividing the population into usual SEIR, we now have Si, Ei, Ii, Ri where i is from 1 to n – the total number of sub-regions.

Dargatz et al. [5] then defined the connectivity matrix γ = [γij], where γij represents the rate by which people transfer from sub-region i to sub-region j. This is also called as the traffic or dispersal matrix. This is represented visually as:

17

Fig.6. Susceptible-Exposed-Infectious-Removed Model with Vaccination Group

As we can see, we also have to multiply the traffic rate to the population within the population group to get number of people from that sub-region transferring to another sub-region (logically, they will still remain on that same population group).

B. MATHEMATICAL MODELLING OF EPIDEMICS

As we have discussed, models necessarily lead to mathematical equations. These equations will then be used to compute future values of population groups given disease-related and population-related parameters. Since we are dealing with population groups that change with time, this brings us to the topic of differential equations.

Epidemiologic Models and Differential Equations

Derivatives are used when describing processes within a changing universe. The derivative dx/dt = f’(t) of a function f describes the rate at which the quantity x = f(t) changes with

18

respect to variable t. The equation that relates an unknown function and one or more of its derivatives is called a differential equation. A study involving differential equations necessarily have two goals: (1) to discover the differential equation that describes a specified physical situation, and (2) to find – either exactly or approximately – the appropriate solution of that equation [7].

The first goal actually involves a process called mathematical modeling. After a description or a visual model of a physical phenomenon had been constructed, a mathematical model had to be formulated so that we can describe, in a quantitative manner, the phenomenon at study. After that, an analysis or a solution can be derived from a mathematical problem resulting from the construction of a mathematical model and real-world data. The next step is the interpretation of these results in the context of the real-world (e.g. what does a particular value mean, how does it affect other physical factors, etc.). In figure, we have:

Fig.7. Mathematical Modeling Process

Oftentimes, we deal with physical situation involving more than one independent variable interacting with each other. When one or more functions involving one or more independent variables are related to a particular changing variable, we are said to have a system of simultaneous differential equations [7].

19

The SEIR model that we have is basically a system of simultaneous differential equations. An increase in a particular population group, for example, in infectious group, will cause a decrease in other sub-groups, particularly the susceptible group. Thus, the SEIR model represents a model which when transformed into a mathematical model, will yield quantitative solutions when used with real-life data, such as population or disease data (e.g. transmission rate, infectious period, etc.).

Stochastic Differential Equations

Real-life phenomenon can only be transformed perfectly into mathematical models if and only if all physical variables involved in that particular phenomenon can be accounted. This is a requirement beyond the ability of human beings. There will always be unknown variables that will interact with the known or accounted variables. Thus, it would be impossible for us to determine mathematical models that perfectly describe real physical processes.

We can, however, approximate solutions to mathematical problems posed by mathematical models and real-world data by incorporating the most important variables, i.e. those that affect the phenomenon significantly. The result would be only be an estimation – but an estimation of results would most of the times be adequate in practice.

We consider the ordinary differential equation (ODE)

where trajectory

is a given, smooth vector field and the solution is the .

20

Fig.8. Trajectory of an ODE

We see that x(t) is actually the state of the system at time t≥0, x(t) := dx(t)/dt.

As we have stated earlier, models will not necessarily behave as accurately as predicted due to our intrinsic inability to incorporate all variables involved. The trajectory will instead be:

Fig.9. Real world Trajectory

We must thus state formally the effects of the random or unknown effects disturbing the system as:

where noise”.

(=space of n by m matrices) and ξ(·) := m-dimensional “white

The concept of noise had been incorporated by Schwartz [6] treating the SEIR model as a stochastic dynamical system. Dargatz et al. [5] did this by transforming the equations into

21

stochastic Langevin forms, i.e. each term of the equations derived from the SEIR model is added or subtracted by a Gaussian white-noise factor.

The Stochastic Langevin Form

Stochastic equations usually take the Langevin form, first formulated by Paul Langevin in 1908. In statistical physicist it is a stochastic differential equation describing the time evolution of a subset of the degrees of freedom – typically collective (macroscopic) variables changing only slowly in comparison to the other fast (microscopic) variables of the system that are responsible for the stochastic nature equation.

Langevin equation was first used to describe Brownian motion, the random movement of a particle in a fluid due to collisions with the molecules of the fluid.

The equation has a noise term

(stochastic processes) representing the effect of the has a Gaussian probability – it is

collisions with the molecules of the fluid. Since the force

usually called as “Gaussian white noise”. Another prototypical feature of the Langevin equation is the occurrence of the damping coefficient λ in the correlation function of the random force.

Gaussian White Noise Factors and the Box-Muller Algorithm

Since Gaussian White Noise is defined to be normally-distributed, developing an algorithm that will produce such Gaussian White Noise requires a function which produces normally-distributed (zero expectation, unit variance) random numbers. Unfortunately, in most

22

computation software packages, what we have are in-built functions which only produce uniformly-distributed random numbers. Thus, what we need is to an algorithm which, having uniformly-distributed random numbers as input, would produce a set of normally-distributed random numbers.

Fortunately, such an algorithm had already been developed. Called the Box-Muller transform, the technique had been developed by George Edward Pelham Box and Mervin Edgar Muller [11], which involves generating pairs of independent standard normally-distributed random numbers, given a source of uniformly distributed random numbers.

The method is commonly expressed in two forms. The basic form, which is what originally was given by Box and Muller, takes two samples from the uniform distribution on the interval (0, 1] and maps them to two normally distributed samples. The polar form, which is what our system will be using, takes two samples from a different interval, [−1, +1], and maps them to two normally distributed samples without the use of sine or cosine functions [12].

The polar form of the Box-Muller transformation is both faster and more robust numerically. The algorithmic description of it is:

float x1, x2, w, y1, y2;

do { x1 = 2.0 * ranf() - 1.0; x2 = 2.0 * ranf() - 1.0; w = x1 * x1 + x2 * x2; } while ( w >= 1.0 );

w = sqrt( (-2.0 * ln( w ) ) / w );

23

y1 = x1 * w; y2 = x2 * w;

where ranf() is the routine to obtain a random number uniformly distributed in [0,1].

Approximating Stochastic Differential Equations: The Euler-Maruyama Scheme

Approximating numerical solutions of Stochastic Differential Equations (SDE) differ from methods used for Ordinary Differential Equations. For the purpose of SDEs, we use the Euler– Maruyama method – a simple generalization of the Euler method named after Leonhard Euler and Gisiro Maruyama.

Taken from Kloeden and Platten (1999) [13], consider the SDE:

with initial condition X0 = x0, where Wt stands for the Wiener process, and suppose that we wish to solve this SDE on some interval of time [0, T]. Then the Euler–Maruyama approximation to the true solution X is the Markov chain Y defined as follows:

1. partition the interval [0, T] into N equal subintervals of width δ > 0:

2. set Y0 = x0; 3. recursively define Yn for 1 ≤ n ≤ N by

where

24

Here, random variables ∆Wn are independent and identically distributed (IDD) normal random variables with expected value zero and variance δ.

C. THE DARGATZ ET AL. GLOBAL SEIR SDE MODEL

The Global SEIR model

In Dargatz et al.’s [5] Global SEIR model, we can actually relate the number of persons in a population group such as the infectious group in a particular sub-region with respect to a changing variable, such as time. We can also do this with other population groups in a particular sub-region. Thus, from Fig.5, we can actually derive the following simultaneous system of ODE [1,5]:

Susceptible

d s( t ) = −a s( t ) − v s( t ) dt
Latent

(1)

d l ( t ) = a s( t ) − ε l ( t ) dt
Exposed

(2)

d j( t ) = ε li − β j( t ) dt
Removed

(3)

d r( t ) = β j( t ) + v s( t ) dt

(4)

25

where α is the mean transmission rate, β is the reciprocal of the average latent period, ε is the reciprocal of average infectious period.

Since we are dealing with a spatially heterogeneous population and we will be using the Global SEIR model, let us mathematically describe Fig.6. We can see that instead of the original population sk , we now have a population of sk + si γi, k + sm γm, k for hypothetical Sub-region A. Similarly, instead of si and sm we now have populations of si − si γi, k and sm − sm γm, k for Sub-regions B and C respectively to account for the mass of people who went to Sub-region A.

Incorporating the effects of dispersal described by the traffic matrix to our earlier equations, we now have:

From (1)

d s( t ) = −a s( t ) − v s( t ) − ⎛ ∑ γi, k si( t ) ⎞ + ⎛ ∑ γk, i sk( t ) ⎞ ⎜ ⎟ ⎜ ⎟ dt ⎝ k ⎠ ⎝ k ⎠
From (2)

(5)

d l( t ) = a s( t ) − ε l( t ) − ⎛ ∑ γi, k li( t ) ⎞ + ⎛ ∑ γk, i lk( t ) ⎞ ⎜ ⎟ ⎜ ⎟ dt ⎝ k ⎠ ⎝ k ⎠

(6)

From (3)

d j( t ) = ε li − β j( t ) − ⎛ ∑ γi, k ji( t ) ⎞ + ⎛ ∑ γk, i jk( t ) ⎞ ⎜ ⎟ ⎜ ⎟ dt ⎝ k ⎠ ⎝ k ⎠
(7)

The equation for the removed population does not change since we are not interested with their movement. These equations are called the Global SEIR ODE.

26

Introducing Gaussian White Noise

We not, however, contented with deriving the deterministic equations since we are dealing with processes probabilistic in nature. We thus further transform the equations into its stochastic Langevin form as done by Dargatz et al. [5]. To do this, they introduced Gaussian

White Noise factors

. The algorithm is transformed as follows:

From (5)

d s( t ) = −a s( t ) − v s( t ) − ⎛ ∑ γi, k si( t ) ⎞ + ⎛ ∑ γk, i sk( t ) ⎞ ⎜ ⎟ ⎜ ⎟ dt ⎝ k ⎠ ⎝ k ⎠
a s( t ) ξ 1 ( t ) +
i

v s( t ) ξ2 ( t ) +
i

∑ γi, k si( t ) ξ4 ( t )
+
k i

∑ γk, i sk( t ) ξ5 ( t )

k i

Ni

Ni

Ni

Ni
(8)

From (6)

d l( t ) = a s( t ) − ε l( t ) − ⎛ ∑ γi, k li( t ) ⎞ + ⎛ ∑ γk, i lk( t ) ⎞ ⎜ ⎟ ⎜ ⎟ dt ⎝ k ⎠ ⎝ k ⎠ a s( t ) ξ 1 ( t ) −
i

ε l ( t ) ξ3 ( t ) +
i

∑ γi, k li( t ) ξ4 ( t )
+
k i

∑ γk, i lk( t ) ξ5 ( t )

k i

Ni

Ni

Ni

Ni
(9)

From (7)

d j( t ) = ε li − β j( t ) − ⎛ ∑ γi, k ji( t ) ⎞ + ⎛ ∑ γk, i jk( t ) ⎞ ⎜ ⎟ ⎜ ⎟ dt ⎝ k ⎠ ⎝ k ⎠

(10)

27

ε li ξ 3 ( t ) −
i

β j ( t ) ξ2 ( t ) +
i

∑ γi, k ji( t ) ξ4 ( t )
+
k i

∑ γk, i jk( t ) ξ5 ( t )

k i

Ni

Ni

Ni

Ni

From (4)

(11)

Generating the Gaussian White Noise

Dargatz [5] assumed the system to be closed, i.e.

⎛ ds i dl i dji dr i ⎞ ⎟ ∑⎜ ⎜ dt + dt + dt + dt ⎟ = 0 ⎠ i=1 ⎝
n

(13)

Expanding the equation, we find out that all addends cancel out except those with factors

ξ4, ξ5. To account for this, Dargatz et al. had to introduce a form of correlation between the two
white noise variables.

Computing for Mean Transmission Rate

The mean transmission rate α is not readily available. We have to derive it from other variables if we are to obtain it. Dargatz et al. [5] thus define the ratio ρ =

α (13) to be the β

reproductive number. We use the deterministic SIR model and divide the rate of change in infectious and the rate of change in the susceptible to obtain:

28

dj 1 = −1 + ds ρs

(14)

which has the solution:

j( t ) = −s( t ) +

ln( s( t ) ) +c ρ

(15)

At the beginning of an epidemic, we assume that all of the population are susceptibles ( s( 0 ) = 1, j( 0 ) = 0 ), letting us to obtain c = 1 . We then have:

ρ=

ln( s( t ) ) j ( t ) + s( t ) − 1 , t ≥ 0
(16)

Let the

t→ ∞

lim s( t )
be equal to the real percentage of reported cases of the disease and

t→ ∞

lim j( t ) = 0
. Dargatz stated that , if

t→ ∞

lim s( t )
is equal

0.955 where di is the population density of sub-region i. We can now obtain the transmission rate given the reproductive number and the mean infectious period.

Algorithm

The algorithm is as follows:

1. For i = 1, …, n, compute:

μi := α si( t ) ji( t )
and

,

υi := β ji( t )

,

φi := ε li( t )

29

ηi :=

k=1 n

n

γi, k si( t )
,

κi :=

k=1 n

n

γi, k li( t )
,

ρi :=

k=1 n

∑ γi, k ji( t )

n

ζ i :=

k=1

∑ γk, i sk( t )
,

λi :=

k=1

∑ γk, i lk( t )
,

τi :=

k=1

∑ γk, i jk( t )

2. For i = 1, …, n, compute:

xi = mi ( ηi +
mi =
, where
2

κi +
1 Ni

ρi )

and

yi = mi ( ζ i +
2

λi +

τi )
2

3. Set P4 = diag( x1 , … , xn-1 ) + xn 1n-11’n-1 and P5 = diag( y1 , … , yn-1 ) + yn 1n-11’n-1 4. Generate π = ( π1 ,…, πn
(j) (j) (j)

2

2

2

),j = 4,5, with ( π1 ,…, πn-1

(j)

(j)

) ~ N ( 0, Pj ) and πn ) = 0.
-1

(j

5. Compute u = (u1, …, un) = Mπ4 and v = (v1, …, vn) = Mπ5 where M = In – n 1n-11’n-1.

6. Evaluate ξ1, ξ2 ~ N (0, In) and ξ4, ξ5 with ξ4 = ui / xi and ξ5 = ui / xi, i = 1, …, n. 7. For i = 1, …, n, compute:

(i)

(i)

⎡ ds i ⎤ i ⎢ ⎥ ⎢ dt ⎥ = −μi − ηi + ζ i + mi ( μi ξ1 + ⎣ ⎦t

ηi ξ 4 −
i

i

ζ i ) ξ5

i

⎡ dl i ⎤ i ⎢ ⎥ ⎢ dt ⎥ = μi − φi − κi + λi + mi ( − μi ξ1 + ⎣ ⎦t

φi ξ3 +

κi ξ4 −

i

λ i ξ5 )

i

dj ⎡ i ⎢ i⎤ ⎥ ⎢ dt ⎥ = φi − υi − ρi + τi + mi ( − φi ξ1 + ⎣ ⎦
t

υi ξ2 +

i

ρi ξ4 −

i

τi ξ5 )

i

⎡ dji ⎤ ⎢ ⎥ =υ +m ⎢ dt ⎥ i i ⎣ ⎦t
8. Approximate

υi ξ 2

i

si( t + 1 ), li( t + 1 ), ji( t + 1 ), ri( t + 1 )

using the Euler-Maruyama

approximation scheme below:

⎡ ds i ⎤ ⎥ si( t ) = si( t − 1 ) + ⎢ ⎢ dt ⎥ ⎣ ⎦t − 1

⎡ dji ⎤ ⎥ ji( t ) = ji( t − 1 ) + ⎢ ⎢ dt ⎥ ⎣ ⎦t − 1

30

⎡ dl i ⎤ ⎥ li( t ) = li( t − 1 ) + ⎢ ⎢ dt ⎥ ⎣ ⎦t − 1

⎡ dr i ⎤ ⎥ ri( t ) = ri( t − 1 ) + ⎢ ⎢ dt ⎥ ⎣ ⎦t − 1

9. For i = 1, …, n, compute correct approximation errors by setting negative valuex of

si, li, ji, ri

to zero,

10. (Optional) Rescale i i i

s , l , j , ri

, i = 1, …, n, via:

si( t + 1 ) =
li( t + 1 ) = ji( t + 1 ) = ri( t + 1 ) =

si( t + 1 ) si( t + 1 ) + li( t + 1 ) + ji( t + 1 ) + ri( t + 1 )
li( t + 1 ) si( t + 1 ) + li( t + 1 ) + ji( t + 1 ) + ri( t + 1 ) ji( t + 1 ) si( t + 1 ) + li( t + 1 ) + ji( t + 1 ) + ri( t + 1 ) ri( t + 1 ) si( t + 1 ) + li( t + 1 ) + ji( t + 1 ) + ri( t + 1 )

Describing the algorithm as a flow chart, we have the following:

31

Fig.10. Flow chart of the Simulation Algorithm Used

32

Fig.11. Continuation: Flow chart of the Simulation Algorithm Used

33

IV. DESIGN AND IMPLEMENTATION

A. ENTITY RELATIONSHIP DIAGRAM

The Entity-Relationship-Diagram of the system is shown on Figure 12. Pathologist contributes Disease. Geographic Units, Regions, and Maps are all contributed by the Geographer, but Epidemiologist can also contribute Regions. Since Regions are defined by picking from Geographic Units its Sub-regions, we have an associative entity Subregion linking the two.

Fig.12. ERD (1) of the EISS

34

Fig.13. ERD (2) of the EISS

Traffic can be defined between any two Geographic Units, but defaults to zero when there is no value. Adjacency is like Traffic, only that it only needs two geographic units. The Account entity has four children – System Administrator, Pathologist, Geographer, and Epidemiologist which corresponds to the main users of the system.

35

B. CONTEXT DIAGRAM

Figure 11 illustrates the Context Diagram of the EISS. There are four different types of users in the system, each with different needs the system provides. The Epidemiologist is the one that does the simulations – thus, he is the responsible to input simulation parameters and utilize the geographic and disease information available in the system. The Geographer is the one responsible for updating information on regions and sub-regions. The Pathologist updates information on diseases. The System Administrator simply manages the accounts.

The system uses EISS_DB database as its data storage.

Fig.14. CD of the EISS

36

C. DATAFLOW DIAGRAM

The top-level data flow is shown in Figure 15. The main processes involved are Manage Accounts (1.0), Manage Disease (2.0), Manage Geographic Units and GU-related information such as traffic and adjacency (3.0), Manage Regions and Regions-related information including what can be called as “subregions” – information on what geographic units a region contains (4.0), Manage Maps – including uploading map files (5.0), and finally Simulate Epidemic data using Stochastic SLIR SDEs (6.0).

Fig.15. Top-level Data Flow

37

Process 1.0, 2.0, and 5.0 basically have the same database and file operations: add, edit, and delete. These processes were shown in Figure 16. Permission was needed because not all users can access a particular functionality and a database table. When a user adds a particular data entry, he will automatically be registered as a contributor of the system (see ERD).

Process 3.0 is on Managing Geographic Units and related information – including the adjacency matrix (via a table of connection relations) and the traffic matrix. The adjacency matrix is not edited per se, but via the Connect function (3.4). A geographic unit can be “connected” to one or more geographic units. Adjacency matrix is not in itself useful, but is used to estimate traffic. The traffic matrix can be edited directly through process (3.5) (See Figure 17).

Process 4.0 as shown in Figure 18 is for Managing Regions, available both for Geographers and, with some limitations, to Epidemiologists (Epidemiologist only have access to Regions it contributed i.e. created). Process 4.4 gets information from two tables, Geographic Units and Regions tables, which it uses to create an entry for the Subregions table.

38

Fig.16. Sub-explosion for Manage Accounts (1.0), Manage Diseases (2.0), Manage Maps (3.0)

39

Fig.17. Sub-explosion for Manage GUs and GU Information (3.0), Sub-explosion of Connect to GU (3.4) and Edit Traffic Matrix (3.5)

40

Fig.18. Sub-explosion for Manage Region and Region Information (4.0), Sub-explosion of Add GUs to Region (4.4)

41

Process 6.0 is the most important part of the system, for this is where data collected from other processes are aggregated and used to implement a simulation. It has four sub-processes: Input simulation parameters (6.1) in which the user selects a disease, a region to “infect”, and the SLIR table (in which he can select what geographic units within the region he will put infected people); Simulate (6.2), which uses SDEs in predicting the evolution of SLIR table over time; Input Simulation Interventions (6.3), where a user can simulate interventions such as quarantining and vaccinating; and finally View Simulation Results (6.4). (See Figure 19).

Fig.19. Sub-explosion for Simulate (6.0)

42

Inputting simulation parameters, as we said earlier, involves inputting a disease, a region, and an SLIR table. This is shown at the left hand panel of Figure 20. The inputting of the SLIR table (6.1.3) involves iteratively selecting a Geographic Unit from the region, inputting the Susceptible, Latent, Infectious and Removed Population, and finalizing the SLIR table (see righthand panel of Figure 20).

Fig.20. Sub-explosion of Input Simulation Parameters (6.1), Input SLIR Table (6.1.3)

43

Process 6.3 (illustrated in the left-hand panel of Figure 21), which involves iteratively inputting simulation intervention, includes selecting which type of intervention (6.3.1) to use (Quarantine or Vaccinate – rate of vaccination has to be inputted in this case, in terms of X persons a day), inputting location (geographic unit) and time frame (range in days or weeks), and adding the intervention to the list of interventions (6.3.4).

Viewing the simulation results (6.4) can be done in three ways: through the Data View (6.4.1) – the results of which you can download (6.4.4), the Graph View (6.4.2) with different graphs to view (6.4.5), and Map Animation View (6.4.3) – the parameters of which you can input and edit (6.4.6) (see right-hand panel of Figure 21).

Fig.21. Sub-explosion of Input Simulation Intervention (6.3), Input View Simulation (6.4)

44

D. DATA DICTIONARY

Listed below are the data tables derived from the Entity Relationship Diagram (ERD) that will be used in the system. The field name, attributes, data type, and description are also included. The field column contains the name of the data, the attribute column describes the nature of data with respect to a Relational Database System, the data type column gives information on the characteristic of the data, i.e. how the data will be stored in the machine. The data description column contains a friendly description of the nature of the data.

Account Data (accounts)
Field username password title first_name middle_name last_name gender email usertype Attributes primary key Data Type varchar(100) varchar(100) varchar(100) varchar(100) varchar(100) varchar(100) enum('male','female') varchar(100) enum('sysad', 'pathologist', 'epidemiologist', 'geographer') Description User-specified string that uniquely identifies a user with an account Password Title (e.g. Mr., Dr., Engr., Gen.) First name Middle name Last name Gender Email Identifies the user either as a System Administrator, Pathologist, Epidemiologist, or Geographer

Adjacency Data (adjacency)
Field g_unit1 Attributes primary key, foreign key (refers Geographic Unit:unit_no) primary key, foreign key (refers Geographic Unit:unit_no) Data Type int(11) Description Computer generated number that uniquely identifies geographic units Computer generated number that uniquely identifies geographic units

g_unit2

int(11)

45

Disease Data (disease)
Field disease_no name description contributor latent_pd infectious_pd foreign key (refers Account:username) Attributes primary key, auto increment Data Type int(11) varchar(100) longtext varchar(100) double double Description Computer generated number that uniquely identifies diseases Disease name (e.g. Influenza) Description of the disease The username of the Pathologist that contributed the disease to the system Mean latent period Mean infectious period

Geographic Unit Data (g_unit)
Field unit_no name description contributor population area foreign key (refers Account:username) Attributes primary key, auto increment Data Type int(11) varchar(100) longtext varchar(100) double double Description Computer generated number that uniquely identifies geographic units Name of the unit (e.g. Negros Occidental) Description of the unit Username of the Contributor Population Area in kilometer squared

Map Data (map)
Field filename name width height area units Attributes primary key Data Type varchar(100) varchar(100) int(11) int(11) int(11) int(11) Description This is the filename of the uploaded map. The extension is assumed to be .swf. Name of the map Width of the map (in pixels) Height of the map (in pixels) Area of the region represented (in square kilometers) Number of geographic units of the map

46

contributor

foreign key (refers Account:username)

varchar(100)

Username of the contributor

Region Data (region)
Field region_no code name description contributor foreign key (refers Account:username) Attributes primary key, auto increment Data Type int(11) varchar(100) varchar(100) longtext varchar(100) Description Computer generated number that uniquely identifies regions Code of the Region (e.g. District 4) Name of the region (e.g. Luzon region) Description of the Region Username of the Region Contributor

Subregion Data (subregion)
Field region Attributes foreign key (refers Region:region_no) foreign key (refers Geographic Unit:unit_no) Data Type int(11) Description The containing region The geographic unit contained within the region

g_unit

int(11)

Traffic Data (traffic)
Field source Attributes primary key, foreign key (refers Geographic Unit:unit_no) primary key, foreign key (refers Geographic Unit:unit_no) Data Type int(11) The unit_no of the destination unit Description The unit_no of the source unit

destination

int(11)

traffic

double

The traffic/dispersal rate between the two (in percentage)

47

E. TECHNICAL ARCHITECTURE

Operating System Requirements

Server-side o o o o Microsoft Windows 9x/NT/2000/ME/XP PHP-MySQL-Apache Minimum of 100Mb of system memory Minimum of 150Mb of hard disk space

Client-side o o Microsoft Windows 9x/NT/2000/ME/XP Internet Browser (preference: Chrome, Mozilla Firefox, Internet Explorer ver. 5.0 and above) o o o o System capable of displaying 1024 by 768 screen resolution Flash/Shockwave Player Minimum of 100Mb of system memory Minimum of 150Mb of hard disk space

Since the system is a simulation and information system software, processors with relatively high speeds are preferable (for the server) if users want processes to be finished in less time. Also, the system will be graphics-dependent, so it is also preferable that users use web browsers that are able to display images well.

48

V. RESULTS

Basic Parts

The EISS homepage has a simple and minimalist layout with a Login section at the upper right corner, a trivia bar and a “Featured Disease” (taken from the Diseases database) bar below it, a lower bar area containing links to the “About EISS 1.0”, “What is SLIR”, “The Math”, “System Features”, and “The Developer” pages. These links introduce the user to some basic facts about the system and how it works. To make it even easier for the user, a Macromedia flash object placed at the lower left area of the page – resembling part of the map of Luzon – was also placed containing all the links at the lower bar. On the lower right side is the logo of the software with its motto “Predict. Prevent. Restore.”, and to the left of the EISS logo is the logo of UP Manila and a label for the Department of Sciences and Mathematics (DPSM). This is shown in Figure 22.

Fig.22. EISS Homepage, Epidemic Information and Simulation System (EISS)

49

The “About Page”, as shown in Figure 23, contains information about the EISS, what it does and for what purpose it was created, and slight details about the logo.

Fig.23. About EISS page, Epidemic Information and Simulation System (EISS)

50

The “What is SLIR” (shown in Figure 24) page teaches the user about the SusceptibleLatent-Infectious-Removed model used by epidemiologist in simulating disease spreading. It describes the model in increasing complexity, from the Susceptible-Infectious-Removed model where SLIR was derived to spatially heterogeneous global SLIR model which was incorporated in the system’s algorithm. The computation for the mean transmission rate was also described.

Fig.24. What is SLIR page, Epidemic Information and Simulation System (EISS)

51

“The Math” page describes the mathematical modeling techniques for epidemiology, including some basics of stochastic modeling which will be used in the system’s algorithm. The stochastic differential equations (SDEs) describing the global SLIR model are thus presented, followed by the algorithm for epidemiologic simulation (see Figures 25 and 26).

Fig.25 .The Math page, Epidemic Information and Simulation System (EISS)

52

Fig.26. The Math page, Epidemic Information and Simulation System (EISS)

53

“System Features” contain “system capabilities” – which are the available functions the system provides, Assumptions of the System, and its Scope and Limitations. This is seen in Figure 27. It states what functions are available, and from what assumptions these functions are supposed to work.

Fig.27. The System Capabilities page, Epidemic Information and Simulation System (EISS)

54

“The Developer” gives a little information about the developer, including links to social networking and blogging sites the developer is using and contact details (see Figure 28).

Fig.28. The Developer page, Epidemic Information and Simulation System (EISS)

55

USER FUNCTIONS

Logging-in

As we noted earlier, the login bar is at the upper right side of the screen. Once a successful layout is made, the login bar will be replaced by a greeting to the name of the user and the account name or username the user is logged in to. This is followed by three links to the “Edit Profile”, “Edit your Password”, and “Logout” functions as shown in Figure 29.

Fig.29. The Developer page, Epidemic Information and Simulation System (EISS)

At the upper left corner, there will be a link to the available modules for the particular account, according to its account type. Using the username admin, the only available module is “Manage Accounts”. When the user clicks a particular module, a gray upper bar will appear, and the user will be taken to the main screen of that particular module. Logging admin, which has privilege as System Administrator, will take the user to the System Administration module screen.

56

The Control Panel

The “Control Panel”, which is generic to most other modules, is created with the idea of a one-stop-shop. It is composed of: 1. a “Right Panel” which initially set to “Search” function. Immediately below it is an option whether to search with “Enable Filter” function on, and a function to “Clear Filters”. If it is on, the user will notice that any search parameter as the user type it will instantaneously change the table contents without having to press the enter button. This is to aid the user in efficiently finding the desired entry in the table; 2. a Table title with buttons for “Search” and for “Add” functions. Notice that if they are clicked, the user do not have to leave or reload the screen: the Search Panel and Add Panels appears to replace whatever it is in the Right Panel; 3. a “Dynamic Table” below it that has “Sort” and “Filter” functions. Notice again that the contents of the dynamic table instantaneously changes with the sort and filter functions; 4. table entries which primary keys are clickable. There are Select buttons at the leftmost column, clicking which will highlight a particular entry. The Select button at the upper-leftmost of the table will select all the entries of the table; 5. Clicking the primary key of a particular entry makes visible the “Edit” function for a particular entry. Notice again that the user do not have to leave the page: the Edit panel for the entry appears instantaneously at the right side of the screen. The Delete button is bellow: clicking it would just refresh the screen with the entry selected deleted; 6. “View” and “Pagination” functions. There is a clickable <Previous and Next> buttons to allow the user to find entries on other pages. Notice that the user also does not have to leave the page when doing so. This is particularly useful for tables with many entries. The pagination can be controlled below, where the user can control how many entries to view at a time. The default is 5, but the user can either select 10 and 15 or just type a number at the input box at the right side. The user does not have to press any button to change the pagination.

57

SYSTEM ADMINISTRATOR

Account Management (for System Administrator)

The Accounts Table (as seen in Figure 30) available to System Administrators consists of five columns: Username, Last Name, First Name, Middle Name, and Email columns, with Username as the primary key. However, on top of the four keys associated with the username, there are four more keys that are not shown in the table. These are Password, Title, Gender, and Privilege. The Gender entry can only be male or female, and the Privilege key specifies whether a particular user can log-in as System Administrator, in which case he/she can access the Accounts Management page, as Epidemiologist who can access the Simulation and Manage your Regions pages, as Geographer who can access the Manage Geographic Units, Regions, and Maps page, or as Pathologist who can access the Manage Diseases page.

Fig.30. The Systems Administrator module, Epidemic Information and Simulation System (EISS)

58

To add an account, the user needs to provide all of the entries for the keys, including a Confirm Password input box which just checks if your password is consistent (Figure 31). The Search Account panel (Figure 32), with enabled filter, will instantaneously search the table just by typing, even without pressing the submit button. Here, bello is searched leading to an entry for Walden Bello. The entry can be edited by clicking the username bello, then the Edit Account panel shall appear (Figure 33).

Fig.31. The Systems Administrator module – Add New Account function, Epidemic Information and Simulation System (EISS)

59

Fig.32. The Systems Administrator module – Search Account function, Epidemic Information and Simulation System (EISS)

Fig.33. The Systems Administrator module – Edit Account function, Epidemic Information and Simulation System (EISS)

60

As illustrated, the “Edit your Profile” (Figure 34) and “Edit your Password” (Figure 35) functions are accessible for any logged-in user in any page.

Fig.34. The Systems Administrator module – Edit your Profile function, Epidemic Information and Simulation System (EISS)

Fig.35. The Systems Administrator module – Edit your Password function, Epidemic Information and Simulation System (EISS)

61

PATHOLOGIST

Diseases Management

The Diseases Table in Figure 36 available to Pathologists has five columns: Disease Name, Description, Contributor, Mean Latent Period, and Mean Infectious Period. All have filters except for Description, which have very long entries and a “Show/Hide” function to show or hide the rest of the abbreviated content.

Fig.36. The Disease Management Page, Epidemic Information and Simulation System (EISS)

62

The Search Disease panel (Figure 36) has a the same features as the Search of Accounts, only that they are also capable of searching for a range on the case of numeric keys Mean Latent Period and Mean Infectious Period, with More than/More than or Equal to and Less Than/Less than or Equal to options . Adding a disease is done by clicking on the Add New Disease button below (see Figure 37)

Fig.37. The Disease Management Page – Add New Disease function, Epidemic Information and Simulation System (EISS)

63

To edit a disease table entry, just click on the Disease Name, which is the primary key (illustrated in Figure 38).

Fig.38. The Disease Management Page – Edit Disease function, Epidemic Information and Simulation System (EISS)

64

GEOGRAPHER

Management of Geographic Units, Regions, and Maps

The Manage Geographic Units, Regions, and Maps page available to Geographers contains three tables: the Geographic Units Table, the Regions Table, and the Maps Table, each having its own Control Panel and dynamic table all on the same page but has a singular View/Pagination control at the bottom of the page. The searching, adding, editing, deleting is the same as in Diseases management, with range search parameters for specific entries such as Population, Density, and Area for Geographical Units. This is illustrated in Figure 39.

Geographical Units are basic units referring to actual locations in the real world, with its own fixed parameters. To estimate the transfer of people from one geographical unit to another, the system uses a Traffic Matrix (button illustrated in Figure 39) whose cells contain data on shared population. Since actual locations can be adjacent to each other, the system has an adjacency matrix to represents this. The system allows “connecting” one geographical unit to a set of other geographical units.

While an adjacency matrix is in itself not too relevant for simulating the spread of disease in a geographic area – because geographical units can “share” populations even if they are not geographically adjacent, an adjacency matrix makes it easier for the data for the Traffic Matrix to be estimated via a formula. Following the study of Dargatz, Volescu, Held, when considering the traffic between adjacent regions, we assume the attraction of a district to be proportional to its population density because it is usually the big cities which appeal commuters. Thus we estimate the strength of the connection between two districts with population densities d1 and d2 with number of adjacent regions n1 and n2 to d1 / n1 + d2 / n2.

65

Fig.39. The Geographers Module Page (Geographic Units Table, Regions Table, Map Table [see Figure 40), Epidemic Information and Simulation System (EISS).

Fig.40. The Geographers Module Page continued (Geographic Units Table [above], Regions Table, Map Table) , Epidemic Information and Simulation System (EISS). Note: Figure 40 is just Figure 30 scrolled down.

66

The Geographic Units Table (illustrated in Figure 41) contains the following columns: Geographical Unit – with Map Code (later we will see that the Map Code of a particular geographical unit refers to a particular position in an uploaded Map) which is the primary key, Description, Contributor, Population, Density, and Area. Below a Description entry, the user will see a View Adjacent Units link clicking which will show on the right panel the list of Geographical Units adjacent to the geographic unit entry with a checkbox on each should the user decide to “unlink” them from the entry. Beside the link is a Select this and adjacent units link, which makes it easier for adjusting traffic matrix for adjacent units or adding adjacent GUs to a region.

Fig.41. The Geographers Module Page (Geographic Units – “Select this and adjacent units” function), Epidemic Information and Simulation System (EISS)

67

To edit the Traffic Matrix (illustrated in Figure 42), the user can select the units in question (or use the “Select this and adjacent units” function in particular GU entries, or using the “Select GUs in the GUs Table” link of an entry at the Region Table) and click on Edit Traffic Matrix. A new window will pop-up containing the matrix, which is a table with columns and rows of GUs selected, arranged in a Source/Destination format. The cell entry represents the “traffic”, or shared population, of the two GUs in a particular row/column combination. Using the adjacency matrix, traffic can be estimated by clicking the “Estimate Traffic” button.

Fig.42. The Traffic Matrix page (Pop-up) , Epidemic Information and Simulation System (EISS)

68

Regions do not refer to actual political territories or regions but arbitrary ones. Regions only serve as a set of Geographical Units (where a particular disease will be applied and its effects simulated, as we will see at the Simulation module). Geographic Units can actually be added to a particular Region by selecting the geographical unit entries and clicking the Add to Region button below the table. The units will then appear in the Geographic Units column of the Regions table.

The Regions Table (see Figure 43) contains other columns: The Region Code which is the primary key, the Region Name, the Description which has a show/hide function and an information summary on the total population, population density, and area of its Geographic Units, and the Geographical Units with a view function, clicking which will show on the right panel the list of Geographical Units contained in the region, each with checkboxes should the user decide to delete them from the list. Still on the same column, there is a link called “Select GUs in the GUs Table” which will select the contained geographic units on the Geographical Units Table.

Fig.43. The Regions Table – View Geographical Units function, Epidemic Information and Simulation System (EISS)

69

Finally, there is a Maps Table with the following columns: Filename, Name, Area, Dimensions (with two entries for length and width), Units (number of units), Contributor, and Size. A new map is added not just by adding a particular entry but by uploading a particular .swf (shockwave flash) file made using the .fla (Adobe Flash) file uploaded in the site to be used for creating additional maps. Clicking “Add New Map” will allow the user to upload a map and edit its parameters (see Figure 44).

Fig.44. The Map Table (Add New Map, Edit field functions visible) , Epidemic Information and Simulation System (EISS)

To edit the parameters for a particular map entry, just click on the “Edit” button on the rightmost column entry of the map, and editable fields will appear.

70

EPIDEMIOLOGIST

For Epidemiologists two modules are available – the “Manage your Regions” and “Simulation” modules. “Simulation” involves “infecting” a particular region (taken from the Regions Table) with a particular disease (taken from the Disease Table) given a user-determined time frame introduced (through infected individuals) in particular geographic units in the region. From then, the Epidemiologist can simulate effects of exogenous interventions, such as that of quarantining or vaccinating particular geographic units within the region. These functions are seen at the top left corner of Figure 45.

Fig.45. The Epidemiologist Home Page, Epidemic Information and Simulation System (EISS)

71

Manage your Regions

There is a reason for why a “Manage your Regions” module is made available to an Epidemiologist. An epidemiologist should have the flexibility of determining which geographic areas are to “infect” with a particular disease, and thus could not rely solely on the pre-set Regions determined by the Geographer. For example, while it is not an official aggregation of cities, “Cities connected to EDSA” is a valid Region to observe because of high volume of people traveling to and fro via EDSA. Thus, Epidemiologists are given leeway to determine his/her own Regions available only to him.

The function (see Figure 46) is almost the same as with the last section except that Geographical Units are not editable and there is no Map Table. Instead, a particular user (an Epidemiologist) creates his/her own customized Regions which are accessible only to him.

Fig.46. The Epidemiologist Module, Manage your Regions Sub-module, Epidemic Information and Simulation System (EISS)

72

In this section, for example, Dr. Vincent Peter creates a Region for EDSA composed of EDSA adjacent cities. He then goes to the Geographic Units table and selects the cities, then adds them to EDSA. EDSA is only now available for him when he goes to the Simulation module (See Figures 47 and 48).

Fig.47. The Epidemiologist Module, Manage your Regions Sub-module – Add New Region, Epidemic Information and Simulation System (EISS)

73

Fig.48. The Epidemiologist Module, Manage your Regions Sub-module – Add Geographic Units to Your Region, Epidemic Information and Simulation System (EISS)

74

Simulation

The Simulation Page (seen in Figure 49) will initially display two tables, a Region Table and a Disease Table. They look the similar to the region and disease table for the Pathologist and the Geographer only that the user can only search for entries. The user must select a Disease and a Region by selecting an entry and clicking the Select Disease / Select Region button. At any time, the user may click on Reset Disease / Reset Region to reverse the process (see Figure 50).

Fig.49. The Epidemiologist Module, Simulation Sub-module, Epidemic Information and Simulation System (EISS)

75

Fig.50. The Epidemiologist Module, Simulation Sub-module – Selecting Region and Disease, Epidemic Information and Simulation System (EISS)

76

Once a disease and a region has been selected, the user will be taken in a three-column page (see Figure 51) containing information about the Disease selected at the left-most column, about the Region selected at the middle column – and here the user can see an expandable list of information about the Geographic Units the region contains, and an SLIR Table (see Figure 51) at the right-most column. The SLIR Table would contain a table of input cells where information on the number of Infected-Latent, Infected-Infectious, and Removed per Geographic Unit can be inputted (notice that as the user enter any amount in any row, the amount is automatically deducted from the Susceptibles cell of the same row). This is where the Epidemiologist “infect” particular geographic units in a region and simulate how it spreads throughout. Finding a particular geographic unit is made easy by a filter above, which searches for the geographic unit as the user type.

Fig.51. The Epidemiologist Module, Simulation Sub-module – Filling up the SLIR Table, Epidemic Information and Simulation System (EISS)

77

After the SLIR table has been submitted, the user will be taken to a two-part page (see Figure 52): a Simulation Control Panel at the top right-most part and below it, a three-column panel with Disease information at the left-most, Region information at the middle, and the SLIR table at the right-most. They can all be reset at any time. Resetting the Disease or the Region will automatically reset the SLIR Table.

The Simulation Control Panel (illustrated in Figure 52) initially asks for the “Number of Time Frames” and the “Time Step Unit” which can either be days, weeks, months, or years, with weeks as the default. There is also a checkbox containing an option whether the user want the simulation to be “Stochastic” or not. The user can leave it unchecked if the user want deterministic differential equations to be used instead of stochastic ones.

Fig.52. The Simulation Sub-module – Disease and Region Panel, SLIR Table, and Simulation Control Panel, Epidemic Information and Simulation System (EISS)

78

Clicking the submit button completes all the requirements for simulation, and the user will be taken to a five-part window containing the Simulation View at the left top most (with three functions, namely “Data View”, “Graph View”, and “Map View”, the Simulation Control Panel at its right. Below the two are three columns for Disease, Region, and the SLIR Table, all of which the user can reset at any other time (see Figure 53).

Fig.53. The Simulation Sub-module – Disease and Region Panel, SLIR Table, and Simulation Panel, Simulation Control Panel, Epidemic Information and Simulation System (EISS)

79

Data View Function

Clicking on the “Data View” function (see Figure 54) will bring the user to the “Pivot Table” function which displays the SLIR data results of the Simulation, over time. The default view is the user have the Geographic Units and its SLIR values at the rows, and time frames at the columns. Clicking the function “Change Layout” (see Figure 55) will make pivot table options visible. The user can switch locations of the Geographic Units, SLIR, and Time dimensions. On this example, we decided to place the SLIR values at the column.

Fig.54. The Simulation Sub-module –Simulation Control Panel, Data View, Epidemic Information and Simulation System (EISS)

80

Fig.55. The Simulation Sub-module –Simulation Control Panel, Change Layout Function of Pivot table, Epidemic Information and Simulation System (EISS)

81

The Simulation data is downloadable as a data dump in .csv (comma-separated values) document format, commonly readable through spreadsheet application. There are three options available in the “Downloadables” function: (1) Download the “Data dump” file, useful for useful for pivot table functions (e.g Microsoft Excel's™ Pivot Table™, OpenOffice.orgs Calc's DataPilot, Google Docs' Pivot Table etc.) as the outputed table is normalized, with flat data, suitable for general-purpose querying; (2) Download the “Subregion, disaggregated by SLIR, versus Time” file, (3) Download the “SLIR, disaggregated by Subregion, versus Time” file. Clicking on one will download the document, viewable in spreadsheet software (see Figure 56).

Fig.56. Pivot table, Sample CSV file download opened in spreadsheet software, Epidemic Information and Simulation System (EISS)

82

Map View Function

Let us skip the Graph view for a while and go straight to the Map View as illustrated in Figure 57. This will bring the user to the Map Table with information on the Filename, Name, Area (in km2, actual), Dimensions (of the .swf file, in pixes), Units (number of geographic units contained), Contributor, and Size (in bytes). To select any particular map, just click on the name.

Fig.57. Simulation Panel – Map View, Epidemic Information and Simulation System (EISS)

83

Clicking one will make two columns appear, one for the Map (with Map animation controls) and another for the map instructions, which the user can make visible/hide by clicking the “How to Use Map” button (see Figure 58). Clicking the button “Clear” will clear the map and bring the user again in the map table.

Fig.58. Simulation Panel – Map View, NCR Map selected, Epidemic Information and Simulation System (EISS)

84

The Map animation controls consist of three checkboxes for Latent, Infectious, and Removed populations (with Color Intensity controls), a frames-per-second option (scaled in 1/10 of a second per week), and movie controls Pause, Play, and Rewind. By clicking on one of the checkbox, the user are checking the geographic spread of the population over time. It works by translating the proportion of a Latent, Infectious and Removed population over the entire population to redness, blueness, and greenness of a particular area. This works by increasing the R, G, and the B values in a color. The proportion of the Susceptible population is represented by the blackness – with the absence of R, G, and B values. All black means that the entire population is susceptible – which means the entire map is black at the start of the animation.

85

We will see these map animation controls at work in our illustration for the animation of the Latent population (see Figure 59). We click on Latent, increase the color intensity to five (for better viewing, and at very low percentage of latent population, the redness might not be as visible), and set animation speed to 4 seconds per week (or 40 1/10ths). Clicking on the Play button will run the animation. The animation is a smooth transition from one color state to another. At Day 21 or Week 3, the number of infected (but not infectious yet) would have spread, judging from the redness in the geographic units, from Navotas to Manila, Quezon City, Makati and Mandaluyong – highly dense areas in which the infection is expected to spread more rapidly. There may be infected ones already in other towns, but they are not yet as visible.

Fig.59. Simulation Panel – Map View, Latent Population viewed, Epidemic Information and Simulation System (EISS)

86

Getting a comparison over time will show that the animation conforms to how a Latent Infected population is supposed to behave (see Figure 60). Infected people may have transferred from Manila, Makati, and San Juan to Mandaluyong (notice that there are at least three towns that can infect Mandaluyong, which means it is expected that latent-infected population will grow rapidly, if population density is enough), the number of which was already enough to trigger an accelerated growth in the latent-infected population. At Day 7/Week 1, Mandaluyong will be less red, because its latent-infected population may have already been either latent-infectious or would have out-migrated. Much later we can verify this by simultaneously running the animation for both Latent and Infectious infected populations. At Day 14/Week 2, areas will be less red, but more areas will have been red, indicating that the infected people spread (see Figure 61).

Fig.60. Simulation Panel – Map View, Latent Population animated, Epidemic Information and Simulation System (EISS)

87

Fig.61. Time Series Snapshots – Latent Population animated, Epidemic Information and Simulation System (EISS)

88

Let us try the same for Infectious-infected population, represented as the blueness (see Figure 62). As the screenshots show, it follows a similar behavior to that of Latent-infected population, but at a much slower rate. We only have to compare Day 7 and Day 108 to see that the spreading reaches a certain plateau and slows down, which means both maps will be similar even if they are weeks apart (see Figure 63).

Fig.62. Simulation Panel – Map View, Infectious Population animated, Epidemic Information and Simulation System (EISS)

Fig.63. Time Series Snapshots – Infectious Population animated, Epidemic Information and Simulation System (EISS)

89

Let us try the Removed population this time, with same color intensity. It is represented by the Greenness. As expected, the number of Removed in Navotas is already high to begin with because the number infected already became removed. As the user can see with the time capture, the greenness just increases through time and spreads to other units, this is because the growth in the Removed population is not reversible – the assumption is the disease does not reoccur on the same person (see Figure 64).

Fig.64. Simulation Panel – Map View, Removed Population animated, Epidemic Information and Simulation System (EISS)

90

At Day 266, the user can see that the removed population is already present at Las Piñas, which is at the South tip of Metro Manila (see Figure 65).

Fig.65. Time Series Snapshots – Removed Population animated, Epidemic Information and Simulation System (EISS)

91

Let us see the transition between populations (see animation settings in Figure 66). As the screenshots show, geographic regions are shown to be purple, which is consistent to our observation earlier that there is a presence of both Infected-Latent and Infected-Infectious in similar areas. The user will see that other areas are bluer than others, which indicates there is more infectious than latent in those areas. In Mandaluyong, on near Week 0, there is much more latent (redness) than infectious (blueness), making the area colored pink (see Figure 67).

Fig.66. Simulation Panel – Map View, Setting up Latent and Infectious Animation Settings, Epidemic Information and Simulation System (EISS)

92

Fig.67. Simulation Panel – Map View, Latent to Infectious Transition animated, Epidemic Information and Simulation System (EISS)

As illustrated in Figure 68, in the succeeding weeks, pinkness recedes and purple towns turn bluer, which indicates population transferring from Latent to Infectious, but they also fade to black which means Infectious population also recedes (later, we will observe that it transfers to the removed population, it turns greener as expected).

Fig.68. Time Series Snapshots – Latent to Infectious Transition animated, Epidemic Information and Simulation System (EISS)

93

Now, let us see the transition from infectious to removed population. Again, at the start, only at Navotas which we infected in the first place do we see green, but infectious individuals already would have spread at various locations, indicated by shades of blue (see Figure 69).

Fig.69. Simulation Panel – Map View, Infectious to Removed Transition animated, Epidemic Information and Simulation System (EISS)

94

By Week 3, the blueness would have spread more, and some blue areas already became blue-green, which means a transition from Infectious to Removed would have already occurred. At Day 280, we can see green at several parts, with only little shades of blue-green in some areas. In some areas like Muntinlupa, we do not see an explosion of the infected population – just slow transition of entire susceptible population to a limited number of latent, which quickly transitioned to infectious, then to removed – which explains why we did not see a blue (see Figure 70).

Fig.70. Time Series Snapshots –Infectious to Removed Transition animated, Epidemic Information and Simulation System (EISS)

95

Graph View Function

The graph view will show the user that the movement of populations conforms to the expectations of the SLIR model. On the graph view, the user can view by population (Susceptible, Latent, Infectious, or Removed) or geographic units in the x-axis. Time is always on the y-axis. Let us try to view how certain geographic units’ infectious population behaves through time. We select Infectious in the Compartments, click on certain locations, and click on “View Graph”. This is what appears (see Figure 71):

Fig.71. Simulation Panel – Graph View, Geographic Units by Compartments, Epidemic Information and Simulation System (EISS)

The graph resembles common Infectious graphs in SLIR models (see Figure 3). The “peak” is the period when the number of infectious shoots up, determined, theoretically, by what is called as the basic reproductive number (also known as basic reproductive ratio or rate) of the

96

infection. This concept, first applied by George MacDonald in 1952 in modern epidemiology on the spread of malaria, determines whether an infectious disease will spread through a population.

Now let us try simulating the SLIR populations of a particular geographic unit over time. We click on the “Switch” link to do this, and the result is illustrated in Figure 72. We select Mandaluyong and then check on all SLIR populations. When we click view graph, we will see that it conforms with an expected SLIR graph, with Susceptible (light blue) steadily decreasing, Removed (light green) steady increasing), Latent (red) high at the start but started to stabilize, and Infectious (purple) low at the start and then shoots up and then stabilizes.

Fig.72. Simulation Panel – Graph View, Compartments by Geographic Units, Epidemic Information and Simulation System (EISS)

97

Let us use the Graph View function to show that the Stochastic option works, as illustrated in Figure 73. We click on the stochastic check box and see the data for Latent population in Valenzuela over time. We can see rough edges instead of smooth ones we saw earlier.

Fig.73. Graph of a Stochastic Simulation, Epidemic Information and Simulation System (EISS)

98

Simulation Controls

The Simulation Control Panel does not just manipulate the time frame, it also allows for Simulation Commands, instructions the user can use to simulate what-if scenarios. For this purpose, there are two possible commands: Vaccinate and Quarantine. Both need a time and location parameter, where they are going to be imposed, when and for how long. For the time parameter, the user can choose whether to determine it by day or by week. Vaccinate has an additional parameter, the rate of vaccination i.e. how many to vaccinate in a day. This actually measures the intensity of the effort to intervene in a population.

Let us test the Vaccinate command. We saw in the figure the Susceptible-Removed graph for Las Piñas, without any intervention (see Figure 74). Since it is far from the town which we infected, few of the Susceptible became Removed, and at a slow pace. But if we conduct a vaccination activity in Las Piñas from Day 1 to 500 at the rate of 300 people a day, we will notice a change in the graph. Vaccination means transferring population from Susceptible directly to Removed, in order for it to avoid getting infected. This effectively increases the slope of the Susceptible and Removed lines, up to day 500, and then the slope normalizes (see Figure 75).

Fig.74. Simulation Panel – Without Simulation Commands, Epidemic Information and Simulation System (EISS)

99

Fig.75. Simulation Panel – Vaccinating Las Piñas from Day 1 to 500 at 300 people / day, Epidemic Information and Simulation System (EISS)

Now let’s try a sudden wave of vaccination in a day: still in Las Piñas but 50,000 people in one day – between Day 501 and 502. The effect would reflect in the graph in Figure 76, with the Removed population suddenly jumping.

Fig.76. Simulation Panel – Vaccinating Las Piñas from Day 1 to 500 at 300 people / day, and 50,000 at Day 501, Epidemic Information and Simulation System (EISS)

100

Let us try the Quarantine command. First, let us check the normal Latent curve of Malabon and Navotas, adjacent units in Figure 77.

Fig.77. Simulation Panel – No Quarantine Command Yet, Epidemic Information and Simulation System (EISS)

If we are going to quarantine Las Piñas from Day 1 to 100 as seen in Figure 78, there would be a weird effect at the Latent curve of Malabon: the rise will be steeper and the peak higher, but the fall would also be steeper, and there will be less Latent at Day 700 because of the quarantine (see Figure 76). What explains this? We can speculate that because Las Piñas was quarantined, less infected people went to it, which means those infected people stayed in other Metro Manila areas – which includes Malabon. This means a higher peak for Latent and rapid fall (according to SLIR).

101

Fig.78. Simulation Panel – Quarantining Las Piñas from Day 1 to 100, Epidemic Information and Simulation System (EISS)

Now if tried a second quarantine (illustrated in Figure 79), this time Parañaque, the result will even be a lower peak, flatter curve, and less latent population at Day 700. We can hypothesize that this is because less infected people from Parañaque can go back to Malabon than when no intervention happened. This just illustrated the systemic nature of intervening through quarantine.

Fig.79. Simulation Panel – Quarantining Las Piñas from Day 1 to 100, Parañaque from Day 100 to 100, Epidemic Information and Simulation System (EISS)

102

Quarantine and Vaccinate can actually be combined, and will have systemic effects as illustrated in Figure 80. If we apply a sudden vaccination wave Muntinlupa between Day 350 and 351, we will notice indirect effects of the vaccination for Malabon. Because the vaccination effect is indirect, we see not a sudden linear drop but a sudden steep (but still curvy) decrease.

Fig.80. Simulation Panel – Combining Quarantine and Vaccinate Effects (Systemic), Epidemic Information and Simulation System (EISS)

The effects of Quarantine and Vaccinate commands can also be in fact verified by the Map animation function. Let us consider the same data set and observe the behavior of the Removed population, with color intensity 3. At Day 49/Week 7 a noticeable spread of removed people is already visible (see Figure 81).

103

Fig.81. Simulation Panel – Map View, without Simulation Commands, Epidemic Information and Simulation System (EISS)

If we decide to quarantine Manila from Day 1 to 100 and re-simulate, we will notice that no Removed population will occur in Manila at Day 49/Week 7 – it will be all black (see Fig. 82). If we decide to have a sudden vaccination wave in Muntinlupa at Day 1 of 100,000 people, this will also be visible by the sudden greening of Muntinlupa (see Figure 83).

104

Fig.82. Simulation Panel – Map View, with Manila quarantined from Day 1 to 100, Epidemic Information and Simulation System (EISS)

Fig.83. Simulation Panel – Map View, with Manila quarantined from Day 1-100, a million vaccinated in Muntinlupa on Day 1, Epidemic Information and Simulation System (EISS)

105

Vaccination effect can also be seen in the transition from Latent to Infectious. We consider the same data parameter and set animation controls at Latent and Infectious both with color intensity 5. Notice the difference of when Manila receives vaccination rate of 50,000 a day from Day 7-14 versus that without intervention. The area will be redder because there will be less infectious people (blueness).

Fig.84. Simulation Panel – Map View, No Simulation Commands, Epidemic Information and Simulation System (EISS)

Fig.85. Simulation Panel – Map View, 50,000 vaccinated a day in Manila from Day 7 to 15, Epidemic Information and Simulation System (EISS)

106

Other Maps

Let us try maps other than that for NCR. First, we have to reselect our region by resetting it. Here, we chose Cavite as our next region for simulation. We choose a disease and a geographic unit to infect (see Figure 86).

Fig.86. Simulation Module – Selecting Cavite as region, Epidemic Information and Simulation System (EISS)

We then click on the map for Mega Manila as seen in Figure 87. We wanted in the case to track the spreading of the Removed population, so we click on it at the map controls and set the color intensity to five.

107

Fig.87. Simulation Panel – Map View, Mega Manila map, Cavite is region selected, Epidemic Information and Simulation System (EISS)

The same behavior noticed on the NCR map also happens to the Cavite are. In general, the spreading of the disease happens because of traffic connectivity of locations with each other. Just like in NCR, this was estimated using the population densities of geographic units (see Figures 88 and 89).

108

Fig.88. Simulation Panel – Map View, Mega Manila map, Simulating Cavite region, Epidemic Information and Simulation System (EISS)

Fig.89. Time Series Snapshots –Removed population spreading in Cavite, Epidemic Information and Simulation System (EISS)

109

VI. DISCUSSION

The Epidemiologic Information and Simulation System (EISS) has six modules for four identified users of the system: for the System Administrator, the module for Accounts Management; for the Pathologist, the module of Disease Management; for the Geographer, the modules for Geographic Units Management, Regions Management, and Maps Management; and for the Epidemiologist, (Owner-specific) Regions Management and Simulation. Simulation in turn, has several sub-modules, including selecting and changing the Disease and the Region, inputting the SLIR matrix, the simulation display – which has a Data, Graph, and Map animation view, the simulation controls – setting time frame and simulation commands of Vaccinating and Quarantining, and animation controls – to set color intensity, animation speed, and select which among the SLIR population is to be made visible through RGB colors.

The concept used for displaying the modules is the one-stop-shop – everything the user need for data management (adding, editing, deleting, and searching) and table viewing (sorting, filtering, and pagination) is already at the same page. The filter function in the search panels enables instantaneous viewing of search results without using Asynchronous JavaScript And XML (AJAX) technology. Other functions available for other modules are also incorporated in the same page as the module.

Moreover, as much as possible, related tables are grouped together in a single module. This is to facilitate a more intuitive handle of data management, to simplify the management of data relations. Thus, for Geographer module, the three tables he has access on are grouped together. But this is not just for simplicity – they have to be grouped together because there are functions, such as “Add to Region”, that needs to select entries from two tables.

Since functions and tables are related to specific users, it was initially thought that maybe the system can be designed in such a way that these functions are privileges. A user, for

110

instance, supposedly can simultaneously be an Epidemiologist and a Geographer. This enables the user to create arbitrary regions he/she can test. In reality however, users rarely overlap. A geographer much more often than not is a different person to that of a pathologist. Thus, the users can have access to a particular set of modules only. To resolve the dilemma on the epidemiologist who may want to define his or her region, he/she was given privilege to do it through “Manage Your Region” functionality.

All of these functionalities are made available at the top-most bar, as the bottom-most bar has been reserved for links to pages available for all users, even those not logged in. The rightmost side of the top bar contains the log-in and edit account settings panel. This means the user can log-in, log-out, edit his/her profile, and edit his/her password in any specific page he/she has accessed. This is with the objective of convenience for the user.

The color scheme and website design has been selected to be as minimalist and as light as possible, except at the front page, black, white, and gray colors in their varying shades had been used for the entire system. The font size was determined in consideration of the volume of web page parts that can possibly appear. Larger fonts may compromise the display of pages with multiple panels.

The EISS is more accurate the higher the infected persons are in a given geographic unit at time zero. The rule-of-thumb is that the infection spreads better when 20% or more of the selected geographic unit’s (the user will use to introduce the disease) populations are infected. This will not necessarily be visible in the map, so the rule-of-thumb for the map animation is increasing the color intensity by five times the normal proportion.

111

Regions, Subregions, Geographic Units, and Maps

In real world, all geographic units are first thought to be associated directly to a region. These geographic units and regions are fixed in the political sense – the real world cities, municipalities, and the provincial regions which contain them are all mandated by law. In the EISS, this was initially thought to be the case, and thus the system must represent this. In this case, any geographic unit is to be associated to one region alone, and EISS has to represent this in the g_unit table by having a foreign key for the region.

However, it will be extremely limiting if all the system can do is to simulate epidemics at fixed political regions. There is a need, for instance, to simulate contiguous areas that cut across political regions but form a logical whole. Even non-contiguous areas – even areas separated by waters - can be seen as a logical whole when connected by transportation infrastructure. Thus, regions should go beyond political regions, and it is with this notion that EISS Regions can be created and manipulated. Thus, a many-to-many relations is established between fixed geographic units and arbitrary regions. A subregion database table was created for this purpose.

Later, the user can now even add the geographic units, because the system was created to allow for an expanding geographic data. Earlier, the scope was only the Philippines – with geographic units being the provinces just like what Dargatz et al. [5] did in Germany. However, since the developer does not have traffic data on areas separated by waters (the method using adjacency matrix to estimate “connectedness” explained in the next section does not apply in this case), and this is the case for archipelagic Philippine islands, the developer had to stick on geographic areas that below to a single island. But because this will limit the algorithm so much, the system instead allowed for uploading new maps and expanding geographic information data. The user can just add entries to the traffic matrix as they are being gathered.

112

The Traffic Matrix

The traffic matrix is one of the more difficult parts to represent and to build in the system. At first, it was thought that the traffic should be associated with the regions, since it is more logical to edit the traffic matrix of a region. A traffic matrix for all geographic units is simply impractical and inconvenient. An X number of geographic units would require X2 number of traffic relations. Notwithstanding the capacity of the web client to display and submit such number of cells, this is extremely undesirable situation for the user.

However, it is still more logical to think that traffic between geographic units is centralized. They cannot differ across Regions - some of which are in fact arbitrarily set. It would also overburden the user, for every time the user creates a new Region, he will have to input a new set of traffic relations because traffic matrices are associated with the Regions.

The solution was to centralize traffic data for all Geographic Units, but the editing can be done via Regions. Now, the user wouldn’t have the problem of having diverse traffic matrices for the regions, and he wouldn’t have the inconvenience of editing all traffic relations at one time. Editing relations via Regions is more logical. This will later be extended to editing matrices of selected Geographic Units.

The adjacency matrix was not supposed to be a part of user functionality. After all, it has no direct use for the SLIR algorithm. Traffic matrix will be sufficient if it can be filled up. After all, people travel across places even if these places are not contiguous because of transportation infrastructure. However, given that the Philippine government data does not give adequate information about such transportation in any time frame, we have to estimate. And given Dargatz et al.’s [5] method in estimating “connectedness” using population density and adjacency, we have to have a faculty for inputting adjacency. But again, it is not necessary for the simulation.

113

Simulation Interventions: Quarantine and Vaccinate

EISS initially thought of integrating the effects of interventions – quarantine and vaccinate – to the SDEs itself. The difficulty was realized when it was thought that the interventions are actually time-based parameters. This means that their effect on the traffic matrix and on the SLIR population is not constant all throughout the simulation. This presented a problematique.

For the quarantine function, for instance, wow can the developer represent varying traffic matrix? The solution was to present the traffic matrix as three-dimensional abstract data structures, with time as the additional dimension. There will be traffic matrices 0 to n, representing time zero to time n. Traffic matrix entries between a location X and any location Y will be set to zero for traffic matrices l to k, representing time l to time k.

As for vaccinate, the technique was placed on the algorithm itself. After computing for the SLIR table of a geographic unit at time i to j, the algorithm will deduct x number of persons from susceptible and transfer it to the removed. Thus, the effect of vaccination already has an effect on the next rounds of computation for the next SLIR table.

114

VII. CONCLUSION

As demonstrated by the results, the web-based Epidemiologic Information and Simulation System (EISS) can be used to make predictions about how a particular infection spreads over a certain geographic area, generating visual data displayed in an intuitive form. It may not replicate reality even with its capability to generate stochastic data (which, visually, does not affect the general behavior of data), but it nonetheless is a powerful tool to make inductions and hypothesis about patterns so government health and epidemic managers generally have an idea about how they can intervene, through quarantining or vaccinating, to mitigate epidemics. Given the waves of previously unknown infections, due to previous interventions, changing climate, lifestyle trends and urbanization growth, EISS promises to be an invaluable tool in the next few years.

Simulation generally requires four things: a disease, a region, places in the region to infect, and a disease. EISS provides the facility to select and manage all conveniently and effectively. But more than that, EISS gives the user, the epidemiologist, capacity to test out the effects of possible interventions. This is important because interventions entail financial costs, and thus have to be managed. More importantly, its effectiveness is hinged on the systemic nature of epidemics. As we have shown earlier in the results, quarantining one area may in fact increase incidence in another area. These systemic, global results of local interventions have to be handled as well.

One of the great limiting factors is the system’s dependence on traffic data. We only get to estimate using population densities. In fact, the adjacency matrix wouldn’t have been necessary for the system (since there can be traffic even between non-contiguous areas, facilitated via transportation infrastructure) if the government have data on population transference from one place to another, but since this is not the case, the system provides facility for estimation. But if this is wrong, e.g. when transference from one place to another via

115

transportation infrastructure is significant, then the system may not estimate the SLIR data effectively and accurately.

The web-based nature of the system gives it a great advantage of usability. With the advent of mobile devices which can connect to the internet, users can manage the data and do simulations in any area with access to the internet. This makes it more applicable to ground epidemiologists who are actually physically involved in direct interventions. The centralized nature of the data also enables system-wide changes, particularly because data such as population and traffic are dynamic and always subject to government census.

But even if the data is centralized, the system relies on client-side computational capacity – from simulating to the fact that the system loads the data first before displaying them. This is because the number of computation and database transaction may overload the server, especially since the system is web-based. For example, it has been tried by the developer to implement the algorithm with Stochastic Differential Equations (SDE) in predicting results on mathematical software and it took minutes. If that is done on multiple transactions by multiple users, the server might crash. The solution would be to off-load it using client-side scripting. Client-side scripting is what in fact made possible the one-stop-shop concept employed in the system without using new technologies such as Asynchronous JavaScript And XML (AJAX) – which is still accessing the server from time to time.

The idea of a one-stop-shop (all needed faculties are usually in a single page) for data management and simulation makes the system very convenient for common users, but may be a little too complicated than usual for beginners. For this, a certain degree of preliminary trial usage will be useful. Learning curve is expected to be fast since the system display has been made as ergonomic as possible.

116

VIII. RECOMMENDATIONS

The EISS, like any decision-support system, has to work on accurate data if it is to function effectively. Disease, for instance, requires accurate data on mean latent and mean infectious period. Geographic units need data on population density and areas. Finally, traffic matrix requires the strength of connectivity between two places – denoted by the percentage of the population they share. It is thus recommended that the government prepare a national database on this and connect it to the system if it is to use EISS. Disease and geographic data are easy to obtain and are actually being obtained. Disease data, however, can be context specific, so it has to be continuously observed in a real-life situation on the Philippine context. It is recommended that the Philippine government establish a national database for the EISS, and a subsequent organizational infrastructure for gathering data.

There will be difficulty, however, in obtaining the traffic matrix. Dargatz et al. used an aggregate of three components for this: “neighbours”, “trains”, and “flights” for Germany, standing for the exchange between adjacent regions, by long distance trains, and by airplane, respectively. The EISS only used the first one, and only through estimation. It is recommended that the government collect data for this. But that necessitates a data for transportation mapping (this is easier for Germany because of the precedence of a long-term strategic framework for transportation and urban development planning) which may be difficult for the government to obtain as of the present. Once such transportation mapping is accomplished, it can in fact be used to improve the adjacency matrix.

One of the possibilities seen by the developer is the use of employment data, data on who is employed to where. This gives an estimate of who travels where daily, and from there we can deduce the connectivity by treating as shared population between two areas the employees registered to a residential address in one area and employed in another. Data from the Social

117

Security System (SSS) and Government Social Insurance System (GSIS) can actually provide this, also the Department of Labor and Employment (DOLE).

The possibilities for EISS as a system are far from exhausted. The developer is in fact already seeing a possible extension for version 2.0, which is a capability to optimize interventions (quarantining and vaccinating) via assigning costs (more likely limited to financial at the start) on them. By optimization we mean the greatest number of people prevented with the least amount of costs. Once employed, optimized interventions capability can serve as an intelligent tool to systematically contain epidemics. Basically, this is a min-max problem, and we can think of intervening at the most “infected” locations in order to maximize interventions. But the spatially heterogeneous nature of the system means that interventions have systemic effects. In this case, we can think of using graph algorithms, representing geographic units within regions as a network or a weighted graph.

The EISS uses specified maps in shockwave flash format for animating the simulation. With the advance in javascript technology, flash maps may be rendered obsolete. Next versions are recommended to take stock of this possibility. This will be easy because the javascript code in the EISS communicates with the flash file in a format easy to understand.

Because of the proliferation of mobile computing devices (such as iPad, android devices, and other technologies), it is also recommended that the visual display be also adjusted for the purpose of convenient viewing, especially since it is the objective of the system to be useful for epidemiologist and geographers on the run and on site who probably have these devices.

118

IX. BIBLIOGRAPHY

[1]

Allen, Linda and Clyde Martin. The Black Death, AIDS and Mathematics: What's the Connection? Source: http://jupiter.phys.ttu.edu/corner/2000/feb00.pdf.

[2]

Dunham, Jill Bigley, F. Brett Berlin, Scale-Free Network Models in Epidemiology: Preliminary Findings. George Mason University, 19 August 2004. Source: http://academic.reed.edu/epi/papers/scalefree.ppt.

[3]

Pourbohloul, Babak, Lauren Ancel Meyers, Danuta M. Skowronski, Mel Krajden, David M. Patrick, Robert C. Brunham. Modeling Control Strategies of Respiratory Pathogens. Source: http://www.cdc.gov/ncidod/EID/vol11no08/04-0449.htm.

[4]

Lloyd, Alun L., and Robert M. May. Spatial Heterogeneity in Epidemic Models. University of Oxford, Department of Zoology. 4 September 1995.

[5]

Dargatz, Christiane, Vera Georgescu, Leonhard Held. Stochastic Modelling of the Spatial Spread of Influenza in Germany. Ludwig-Maximilians-University, Munich.

[6]

Schwartz, Ira B., Lora Billings, Erik M. Bollt. Dynamical epidemic suppression using stochastic prediction and control. Department of Mathematics and Computer Science, and Department of Physics, Clarkson University, Potsdam, New York 13699, USA. Source: http://www.csam.montclair.edu/~billings/research/PRE_046220.pdf.

[7]

Edwards, Henry C., David E. Penney. Differential Equations: Computing and Modelling 2nd Edition. Prentice-Hall, Inc. New Jersey. © 2000.

119

[8]

Evans, Lawrence C. An Introduction to Stochastic Differential Equations Version 1.2. Department of Mathematics. UC Berkeley.

[9]

Small, Michael and Prof. C.K. Michael Tse. Modelling SARS Transmission Dynamics: A SmallWorld Network Approach. Applied Nonlinear Circuits and Systems Research Group. Dept. of Electronic & Information Engineering. Hong Kong Polytechnic University. Source: http://chaos.eie.polyu.edu.hk/

[10]

Eisenberg, Joseph N. S., M. Alan Brookhart, Glenn Rice, Mary Brown, and John M. Colford, Jr. Disease Transmission Models for Public Health Decision Making: Analysis of Epidemic and Endemic Conditions Caused by Waterborne Pathogens. Center for Occupational and Environmental Health and School of Public Health, University of California, Berkeley, California, USA, U.S. Environmental Protection Agency, Office of Research and Development/National Center for Environmental Assessment, Cincinnati, Ohio, USA.

[11]

G. E. P. Box and Mervin E. Muller, A Note on the Generation of Random Normal Deviates, The Annals of Mathematical Statistics (1958), Vol. 29, No. 2 pp. 610-611

[12]

L. Devroye: 'Non-Uniform Random Variate Generation', Springer-Verlag, New York, 1986.

[13]

Kloeden, P.E., & Platen, E. (1999). Numerical Solution of Stochastic Differential Equations. Springer, Berlin. ISBN 978-3-540-54062-5.

120

X. APPENDIX – Source Code

...\eiss\main\
...\eiss\main\about.php <? require('../script/header.php'); ?> <table cellpadding="5" cellspacing="5"> <tr> <td width="30%" valign="center"> <br><br><br><img src="../images/eissicon.jpg" width="380" height="178"> <h2 align="center">Predict. Prevent. Restore.</h2></td> <td width="70%" valign="center" rowspan="2"> <font style="font-size: 11px"> <h1>About EISS</h1> <i>Version <? displayVersion() ?></i> <p>Epidemiologic surveillance, currently, is one of the main endeavors by the scientific community, particularly those in the biological and medical professions. Recent studies on epidemiologic surveillance had gradually gravitated towards the discussion on the proliferation of anthroponotic or human transferable diseases. The reason for this is apparently the current emergence of such diseases as the A/H1N1 Flu Strain, the Avian Flu, Severe Acute Respiratory Syndrome (SARS) and the constant threat of bio-terrorism in many countries. </p> <p>The <b>Epidemiologic Information and Simulation System (EISS)</b> takes off from these efforts. Using SLIR <a href="slir.php" style="color:red">[ what the hell is this? ]</a> spatially heterogeneous SDEs (stochastic differential equations), it models and represents the spread of the diseases. EISS uses differential equations to calculate the SLIR percentages in the population as time progresses and at the same time determine the spatial movement of the disease. To realistically model fluctuations, the model is a stochastic and probabilistic one.</p> <p>EISS responds to the following needs of epidemiologists:</p> <ul> <li>need to aggregate and collate large amounts of data necessary for simulation.</li> <li>need to perform complex calculations (using the large amounts of data that had been collated) that are involved in using spatially heterogeneous SDE in predicting the behavior of an epidemic.</li> <li>need to be able to manipulate parameters of the simulation at any time instance. This is important in answering &ldquo;what if&rdquo; questions during the course of scenario planning for epidemic control.</li> </ul> <p>The significance of the system, in a the period of emergence of new pathologic-epidemic strains like A/H1N1 SARS and bio-terrorism agents like Anthrax, is very much apparent. The need to respond to a crisis brought by a sudden epidemiologic attack through sound containment and control strategies is an imperative if we are to save hundreds or possibly thousands of lives not to mention thousand to million pesos worth of properties.</p> <p>This is especially true when there are no conceivable or if there is, feasible methods of prevention. This has caused a great concern among mathematical scientists and epidemiologists, since epidemics might have been caused by a deliberate introduction of diseases by bio-terrorists themselves. Thus, such cases are unpredictable outside the realm of epidemiology.</p> <p>In the case of the Philippines, EISS would prove to be indispensable. The fact that we have limited number of health workers just proves that to for epidemiologic containment and control to be effective, we must be able to maximize our resources by employing the best possible strategy to contain diseases.</p> </font> </td></tr> <tr> <td valign="top" align="center"><i><h3>About the Logo</h3></i> <p><i> The EISS logo is a representation of the most common curve result in SLIR SDE. The dropping red line is representative of the usual drop in the number of susceptibles, while the blue one represents the rise in the number of removed population. The yellow triangle represents the sudden boost of infectives, which will then decline after the percentage of removed surpasses that of susceptibles.</i></p> <p>&nbsp;</p> <p align="center"><img onclick="location.href='http://upm.edu.ph';" src="../images/upmanila.jpg" alt="" width="120" height="120" /></p></td> </tr></table> <? require('../script/footer.php'); ?> ...\eiss\main\developer.php <? require('../script/header.php'); ?> <table width="80%" height="70%" cellpadding="5" cellspacing="5" align="center"> <tr valign="top" > <td width="40%" valign="center" align="center"> <font style="font-size: 11px"> <img src="../images/1.jpg" width="281" height="335" /><br> </font> </td> <td width="60%" valign="top" rowspan="2"> <font style="font-size: 11px"> <h1>About the Developer</h1> <p>The developer, James Matthew Miraflor, is an undergraduate computer science student from UP Manila, choosing statistical computing as his track. </p> <p>He participated in various intercollegiate programming contests, including the <a href="http://www.acm.org/">Associated Computing Machinery (ACM)</a> - <a href="http://en.wikipedia.org/wiki/ACM_International_Collegiate_Programming_Contest">International Collegiate Programming Contest (ICPC)</a>, which was held on November of 2004 at the <a href="">University of Asia and the Pacific</a> (UA&P), the very first university to host the ACM-ICPC in Manila (see more info <a href="http://iits.uap.edu.ph/acm/">here</a>). His team was awarded Honorable Mention during the said contest.</p> <p>James was one of the student-programmers who developed the <a href="http://portal.doh.gov.ph/ssdd/main/">Web Portal for the Systems Software and Development Division</a>, <a href="http://doh.gov.ph/ssdd/main/">Department of Health (DOH)</a> - Philippines.<p> <p>James currently works as researcher and campaigner of the <a href="www.fdc.ph">Freedom from Debt Coalition</a>, Debt and Public Finance campaign (see his FDC profile <a href="http://fdc.ph/index.php?option=com_content&view=category&layout=blog&id=62&Itemid=104">here</a>).</p> <p>&nbsp;</p> <style type="text/css"> .nostyle A:link { color:#FFFFFF; font-weight: bold; text-decoration: none; } .nostyle A:visited { color:#FFFFFF; font-weight: bold; text-decoration: none; } .nostyle A:active { color:#FFFFFF; font-weight: bold; textdecoration: none; } </style> <span class="nostyle"> <p align="center"><a href="http://twitter.com/jamesmiraflor"><img src="../images/twitter.png" alt="twitter" width="50" height="50" /></a><a href="http://www.facebook.com/james.miraflor"><img src="../images/facebook.png" alt="facebook" width="50" height="50" /></a><a href="http://www.plurk.com/jamesmiraflor"><img src="../images/plurk.png" alt="plurk" width="50" height="50" /></a><a href="http://www.blogger.com/profile/13692885462172351019"><img src="../images/blogger.png" alt="blogger" width="50" height="50" /></a><a href="http://destabilizer.multiply.com/"><img src="../images/multiply.png" alt="multiply" width="60" height="50" /></a><a href="http://www.technorati.com/people/technorati/jamesmiraflor"><img src="../images/technorati.png" alt="technorati" width="50" height="50" /></a><br /> <a href="http://www.friendster.com/jmmiraflor"><img src="../images/friendster.png" alt="friendster" width="217" height="30" /></a><a href="http://www.linkedin.com/in/miraflor"><img src="../images/linkedin.png" alt="linkedin" width="130" height="30" /></a></p> </span> <p align="center">&nbsp;</p> <table align="center"><tr> <p

121

align="center"> <td align="center"><strong>Politics for Breakfast</strong><br /> <a href="http://politicsforbreakfast.blogspot.com/">[ politicsforbreakfast.blogspot.com ]</a></td> <td align="center"><strong>Rantings in Free Verse</strong><br /> <a href="http://rantingsinfreeverse.blogspot.com/">[ rantingsinfreeverse.blogspot.com ]</a></td> <tr></table> </font> </td> </tr> <tr> <td valign="top" align="center"> <font style="font-size: 11px"> <i> <h3>Contact Details</h3> </i> <p><i>Block 49 Lot 29 Phase 3 E2, Dagat-dagatan, Malabon City. +639088840465. james_miraflor@yahoo.com. james.miraflor@gmail.com. 9246399. 9211985. ym: james_miraflor. googletalk: james.miraflor</i></p> </font> </td> </tr> </table> <? require('../script/footer.php'); ?> ...\eiss\main\index.php <? header("Location: main.php"); ?> ...\eiss\main\main.php <? require('../script/header.php'); ?> <style type="text/css"> <!-- .root { font-family: Verdana, Geneva, sans-serif; fontsize:10px; align: center; } --> </style> <div id="logo" style="width: 30%; position: absolute; bottom: 50px; right: 90px; zindex:1;"> <img onclick="location.href='about.php';" src="../images/eisslogo.png" width="395" height="203" /> </div> <!-- <div style="width: 30%; position: absolute; top: 0px; right: 0px; z-index:-1;"> <img onclick="location.href='http://upm.edu.ph';" src="../images/upmanilapeek.png" alt="" width="197" height="279" align="right" /> </div> --> <!-- either -20 or -80 --> <div id="flashnavigator" style="width: 70%; position: absolute; bottom: 40px; left: -80px; z-index:0;"> <object classid="clsid:d27cdb6eae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="450" height="550" id="navigator" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="navigator.swf" /> <param name="wmode" value="transparent" /> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <embed src="navigator.swf" quality="high" bgcolor="#ffffff" width="450" height="550" name="navigator" align="middle" allowscriptaccess="sameDomain" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> </div> <div style="font-size:30px; width: 200px; position: absolute; top: 60px; right: 50px; z-index:1;"> <? $i = 0; $query = " SELECT * FROM `disease`"; $query .= " WHERE 1"; $result = mysql_query($query); while($data = mysql_fetch_array($result)) { $current[$i] = new Disease($data); $i++; } $selected = rand(0,$i-1); ?> <table cellpadding="2px"> <tr align="center" bgcolor="<? echo($highlight); ?>"><td><b><font size="2px">Featured Disease</font></b></td></tr> <tr bgcolor="<? echo($bgcolor[0]); ?>"><td align="center"><p><b><? echo($current[$selected]->name); ?></b></p></td></tr> <tr bgcolor="<? echo($bgcolor[1]); ?>"><td><p> <div id="desc_a" style="display: block"> <? echo(substr($current[$selected]->desc,0,200)); ?> <? if(strlen($current[$selected]->desc)>200) { ?> ... <a href="#" onclick="toggle_visibility('desc_a'); toggle_visibility('desc_b');">show</a> <? } ?> </div> <div id="desc_b" style="display: none"> <? echo($current[$selected]->desc); ?> <a href="#" onclick="toggle_visibility('desc_a'); toggle_visibility('desc_b');">hide</a> </div> </p></td></tr> </table> </div> <div style="font-size:30px; width: 200px; position: absolute; top: 60px; right: 275px; z-index:2;"> <table cellpadding="2px"> <tr align="center" bgcolor="<? echo($highlight); ?>"><td><b><font size="2px">Trivia</font></b></td></tr> <? $handle = fopen("trivia.txt", "r"); $contents = fread($handle, filesize("trivia.txt")); fclose($handle); $trivias = explode("[::]",$contents); srand((double)microtime()*1000000); $rand_trivia_num = rand(1,count($trivias)-1); $rand_trivia = $trivias[$rand_trivia_num]; unset($trivias); $disp_trivia = explode("[:]",$rand_trivia); ?> <tr bgcolor="<? echo($bgcolor[0]); ?>"><td><p><b>Q. <? echo($disp_trivia[1]); /* Displays question */ ?></b></p></td></tr> <tr bgcolor="<? echo($bgcolor[1]); ?>"><td><p>A. <? echo($disp_trivia[2]); /* Displays answer */ ?></p></td></tr> </table> </div> <div id="logo" style="width: 30%; position: absolute; bottom: 50px; right: 400px; z-index:-1;"> <p align="center"><img onclick="location.href='http://www.upm.edu.ph';" src="../images/upmanila.jpg" width="150" height="150" /></p> <p align="center"> <font size="2"><b>Department of Physical Sciences and Mathematics </a></b></font><br> <b>College of Arts and Sciences</b><br> University of the Philippines Manila </p> </div> <? require('../script/footer.php'); ?> ...\eiss\main\math.php <? require('../script/header.php'); ?> <font style="font-size: 11px"> <h1>Mathematical Modelling of Epidemics</h1> <p>Models necessarily lead to mathematical equations. These equations will then be used to compute future values of population groups given disease-related and population-related parameters. Since we are dealing with population groups that change with time, this brings us to the topic of differential equations.</p> <h2>Epidemiologic Models and Differential Equations</h2> <p>Derivatives are used when describing processes within a changing universe. The derivative <em>dx/dt </em>= <em>f'(t)</em> of a function <em>f</em> describes the rate at which the quantity <em>x = f(t)</em> changes with respect to variable <em>t</em>. The equation that relates an unknown function and one or more of its derivatives is called a <u>differential equation</u>. A study involving differential equations necessarily have two goals: (1) to discover the differential equation that describes a specified physical situation, and (2) to find - either exactly or approximately - the appropriate solution of that equation</p> <p>The first goal actually involves a process called <u>mathematical modeling</u>. After a description or a visual model of a physical phenomenon had been constructed, a mathematical model had to be formulated so that we can describe, in a quantitative manner, the phenomenon at study. After that, an analysis or a solution can be derived from a mathematical problem resulting from the construction of a mathematical model and real-world data. The next step is the interpretation of these results in the context of the real-world (e.g. what does a particular value mean, how does it affect other physical factors, etc.). In figure, we have:</p> <p align="center"><img width="315" height="228" src="../images/math/clip_image002.jpg" alt="real" /></p> <p align="center"><em><strong>Fig.1.</strong> Mathematical Modeling Process</em></p> <p>Oftentimes, we deal with physical situation involving more than one independent variable interacting with each other. When one or more functions involving one or more independent variables are related to a particular changing variable, we are said to have a <u>system of simultaneous differential equations</u>.</p> <p>The SEIR model that we have is basically a system of simultaneous differential equations. An increase in a particular population group, for example, in infectious group, will cause a decrease in other sub-groups, particularly the susceptible group. Thus, the SEIR model represents a model which when transformed into a mathematical model, will yield

122

quantitative solutions when used with real-life data, such as population or disease data (e.g. transmission rate, infectious period, etc.).</p> <h2>Stochastic Differential Equations</h2> <p>Real-life phenomenon can only be transformed perfectly into mathematical models if and only if all physical variables involved in that particular phenomenon can be accounted. This is a requirement beyond the ability of human beings. There will always be unknown variables that will interact with the known or accounted variables. Thus, it would be impossible for us to determine mathematical models that perfectly describe real physical processes.</p> <p>We can, however, approximate solutions to mathematical problems posed by mathematical models and realworld data by incorporating the most important variables, i.e. those that affect the phenomenon significantly. The result would be only be an estimation - but an estimation of results would most of the times be adequate in practice.</p> <p>We consider the ordinary differential equation (ODE)<br /> <img src="../images/math/clip_image004.jpg" alt="" width="242" height="73" /> <br /> where <img src="../images/math/clip_image006.jpg" alt="" width="130" height="20" />is a given, smooth vector field and the solution is the trajectory<img src="../images/math/clip_image008.jpg" alt="" width="160" height="28" />.</p> <p align="center"><img src="../images/math/clip_image010.jpg" alt="" width="624" height="126" /> <br /> <em><strong>Fig.2.</strong> Trajectory of an ODE</em></p> <p>We see that <em>x(t)</em> is actually the state of the system at time <em>t>=0</em>, <em>x(t) := dx(t)/dt</em>.</p> <p>As we have stated earlier, models will not necessarily behave as accurately as predicted due to our intrinsic inability to incorporate all variables involved. The trajectory will instead be:</p> <p align="center"><img src="../images/math/clip_image012.jpg" alt="" width="624" height="129" /><br /> <em><strong>Fig.3.</strong> Real world Trajectory</em></p> <p>We must thus state formally the effects of the random or unknown effects disturbing the system as:<br /> <img src="../images/math/clip_image014.jpg" alt="" width="379" height="68" /> <br /> where <img src="../images/math/clip_image016.jpg" alt="" width="147" height="27" />(=space of n by m matrices) and &xi;() := m-dimensional "white noise".</p> <p>The concept of noise had been incorporated by Schwartz [6] treating the SEIR model as a stochastic dynamical system. Dargatz [5] did this by transforming the equations into stochastic Langevin forms (i.e. each term of the equations derived from the SEIR model is added or subtracted by a Gaussian white-noise factor).</p> <h2>Global SEIR model and SDE representation</h2> <p>In our Global SEIR model, we can actually relate the number of persons in a population group such as the infectious group in a particular sub-region with respect to a changing variable, such as time. We can also do this with other population groups in a particular sub-region. Thus, we can actually derive the following simultaneous system of ODE:</p> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="595" valign="top"><p align="left"><br /><u>Susceptible </u><br /><br /> <img src="../images/math/clip_image018.gif" alt="" width="164" height="39" /></p></td> <td width="43" valign="bottom"><p align="center">(1)</p></td> </tr> <tr> <td width="595" valign="top"><p align="left"><br /><u>Latent</u><br /><br /> <img src="../images/math/clip_image020.gif" alt="" width="152" height="39" /></p></td> <td width="43" valign="bottom"><p align="center">(2)</p></td> </tr> <tr> <td width="595" valign="top"><p align="left"><br /><u>Exposed</u><br /><br /> <img src="../images/math/clip_image022.gif" alt="" width="137" height="39" /></p></td> <td width="43" valign="bottom"><p align="center">(3)</p></td> </tr> <tr> <td width="595" valign="top"><p align="left"><br /><u>Removed</u><br /><br /> <img src="../images/math/clip_image024.gif" alt="" width="155" height="39" /></p></td> <td width="43" valign="bottom"><p align="center">(4)</p></td> </tr> </table> <p> <br /> where <u>&alpha; is the mean transmission rate</u>, <u>&beta; is the reciprocal of the average latent period</u>, <u>&epsilon; is the reciprocal of average infectious period</u>. </p> <p>Since we are dealing with a spatially heterogeneous population and we will be using the Global SEIR model, let us mathematically describe Fig.6. We can see that instead of the original population<img src="../images/math/clip_image026.gif" alt="" width="19" height="24" />, we now have a population of <img src="../images/math/clip_image028.gif" alt="" width="128" height="24" />for hypothetical Sub-region A. Similarly, instead of <img src="../images/math/clip_image030.gif" alt="" width="17" height="24" />and <img src="../images/math/clip_image032.gif" alt="" width="23" height="24" />we now have populations of <img src="../images/math/clip_image034.gif" alt="" width="67" height="24" />and <img src="../images/math/clip_image036.gif" alt="" width="82" height="24" />for Sub-regions B and C respectively to account for the mass of people who went to Sub-region A.</p> <p>Incorporating the effects of dispersal described by the traffic matrix to our earlier equations, we now have:</p> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="595" valign="top"><p align="left"><br />From (1)<br /><br /> <img src="../images/math/clip_image038.gif" alt="" width="376" height="44" /></p></td> <td width="43" valign="bottom"><p align="center">(5)</p></td> </tr> <tr> <td width="595" valign="top"><p align="left"><br />From (2)<br /><br /> <img src="../images/math/clip_image040.gif" alt="" width="360" height="44" /></p></td> <td width="43" valign="bottom"><p align="center">(6)</p></td> </tr> <tr> <td width="595" valign="top"><p align="left"><br />From (3)<br /><br /> <img src="../images/math/clip_image042.gif" alt="" width="343" height="44" /></p></td> <td width="43" valign="bottom"><p align="center">(7)</p></td> </tr> </table> <p>The equation for the removed population does not change since we are not interested with their movement. These equations are called the Global SEIR ODE.</p> <p>We not, however, contented with deriving the deterministic equations since we are dealing with processes probabilistic in nature. We thus further transform the equations into its stochastic Langevin form as done by Dargatz [5]:</p> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="595" valign="top"><p align="left"><br />From (5)<br /><br /> <img src="../images/math/clip_image038_0000.gif" alt="" width="376" height="44" /><br /> <img src="../images/math/clip_image044.gif" alt="" width="522" height="68" /></p></td> <td width="43" valign="bottom"><p align="center">(8)</p></td> </tr> <tr> <td width="595" valign="top"><p align="left"><br />From (6)<br /><br /> <img src="../images/math/clip_image040_0000.gif" alt="" width="360" height="44" /> <br /> <img src="../images/math/clip_image046.gif" alt="" width="519" height="68" /></p></td> <td width="43" valign="bottom"><p align="center">(9)</p></td> </tr> <tr> <td width="595" valign="top"><p align="left"><br />From (7)<br /><br /> <img src="../images/math/clip_image042_0000.gif" alt="" width="343" height="44" /> <br /> <img src="../images/math/clip_image048.gif" alt="" width="506" height="68" /></p></td> <td width="43" valign="bottom"><p align="center"> (10)</p></td> </tr> <tr> <td width="595" valign="top"><p align="left"><br />From (4)<br /><br /> <img src="../images/math/clip_image050.gif" alt="" width="369" height="64" /></p> <p align="left">&nbsp;</p></td> <td width="43" valign="bottom"><p align="center">(11)</p></td> </tr> </table> <p align="left">Dargatz [5] assumed the system to be closed, i.e. </p> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="595" valign="top"><p><img src="../images/math/clip_image052.gif" alt="" width="205" height="49" /></p></td> <td width="43" valign="bottom"><p align="center">(13)</p></td> </tr> </table> <p align="left">To account for this, she had to introduce a form of dependence between <em>&xi;4</em>, <em>&xi;5</em> which had been incorporated in the algorithm below.</p> <p><strong><em>Computing for Mean Transmission Rate</em></strong></p> <p>The mean transmission rate &alpha; is not readily available. We have to derive it from other variables if we are to obtain it. We thus define the ratio<img

123

src="../images/math/clip_image054.gif" alt="" width="48" height="39" />(13) to be the reproductive number. We use the deterministic SIR model and divide the rate of change in infectious and the rate of change in the susceptible to obtain:</p> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="595" valign="top"><p><img src="../images/math/clip_image056.gif" alt="" width="100" height="39" /></p></td> <td width="43" valign="bottom"><p align="center">(14)</p></td> </tr> </table> <p>which has the solution:</p> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="595" valign="top"><p><img src="../images/math/clip_image058.gif" alt="" width="178" height="39" /></p></td> <td width="43" valign="bottom"><p align="center">(15)</p></td> </tr> </table> <p>At the beginning of an epidemic, we assume that all of the population are susceptibles (<img src="../images/math/clip_image060.gif" alt="" width="120" height="18" />), letting us to obtain <img src="../images/math/clip_image062.gif" alt="" width="40" height="18" />. We then have:</p> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="595" valign="top"><p><img src="../images/math/clip_image064.gif" alt="" width="126" height="39" />, <em>t >= 0</em></p></td> <td width="43" valign="bottom"><p align="center">(16)</p></td> </tr> </table> <p>Let the <img src="../images/math/clip_image066.gif" alt="" width="69" height="30" />be equal to the real percentage of reported cases of the disease and <img src="../images/math/clip_image068.gif" alt="" width="91" height="30" />. Dargatz stated that <img src="../images/math/clip_image070.jpg" alt="" width="201" height="45" />, if <img src="../images/math/clip_image066_0000.gif" alt="" width="69" height="30" />is equal 0.955 where di is the population density of sub-region i. We can now obtain the transmission rate given the reproductive number and the mean infectious period.</p> <p>&nbsp;</p> <p><strong><em>Algorithm</em></strong></p> <p>The algorithm is as follows:</p> <ol> <li>For <em>i</em> = 1, i <=<em>n</em>, compute:</li> </ol> <p><img src="../images/math/clip_image072.gif" alt="" width="112" height="24" />, <img src="../images/math/clip_image074.gif" alt="" width="81" height="24" />, <img src="../images/math/clip_image076.gif" alt="" width="78" height="24" /><br /> and</p> <div align="center"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="144" valign="top"><br /> <img src="../images/math/clip_image078.gif" alt="" width="119" height="49" />, </td> <td width="144" valign="top"><p><img src="../images/math/clip_image080.gif" alt="" width="115" height="49" />, </p></td> <td width="144" valign="top"><p><img src="../images/math/clip_image082.gif" alt="" width="115" height="49" /></p></td> </tr> <tr> <td width="144" valign="top"><p><img src="../images/math/clip_image084.gif" alt="" width="119" height="49" />, </p></td> <td width="144" valign="top"><p><img src="../images/math/clip_image086.gif" alt="" width="119" height="49" />, </p></td> <td width="144" valign="top"><p><img src="../images/math/clip_image088.gif" alt="" width="115" height="49" /></p></td> </tr> </table> </div> <ol> <li>For <em>i</em> = 1...<em>n</em>, compute: <img src="../images/math/clip_image090.gif" alt="" width="178" height="26" />and <img src="../images/math/clip_image092.gif" alt="" width="176" height="26" />, where <img src="../images/math/clip_image094.gif" alt="" width="72" height="47" /></li> <li>Set <strong>P4</strong> = diag(<em>x</em><em>1</em><em>2</em>, ...,<em>x</em><em>n-1</em><em>2</em> ) + <em>x</em><em>n</em><em>2</em><em>1n-11'n-1</em> and <strong>P5</strong> = diag( <em>y</em><em>1</em><em>2</em>, ...,<em>y</em><em>n-1</em><em>2</em> ) + y<em>n</em><em>2</em><em>1n-11'n1</em></li> <li>Generate <em>&pi;(j)</em> = ( <em>&pi;1(j)</em> ,i<=<em>&pi;n(j)</em> ),<em>j</em> = 4,5, with ( <em>&pi;1(j)</em> ,i<=<em>&pi;n-1(j)</em> ) ~ <em>N </em>( 0, <strong>Pj</strong> ) and <em>&pi;n(j</em>) = 0.</li> <li>Compute u=(<em>u1</em>, i<=<em>un</em>) = <strong>M</strong><em>&pi;4</em> and v=(v<em>1</em>...v<em>n</em>)=<strong>M</strong><em>&pi;5</em> where <strong>M</strong> = <em>In - n-11n-11'n1</em>. </li> <li>Evaluate <em>&xi;1</em>, <em>&xi;2</em> ~ <em>N</em> (0, <em>I</em><em>n</em>) and <em>&xi;4</em>, <em>&xi;5</em> with <em>&xi;4(i)</em> = <em>ui</em> / <em>xi</em> and <em>&xi;5(i)</em> = <em>ui</em> / <em>xi</em>, <em>i</em> = 1...<em>n</em>. </li> <li>For <em>i</em> = 1...<em>n</em>, compute: </li> </ol> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="535" valign="top"><p align="left"><img src="../images/math/clip_image096.gif" alt="" width="364" height="53" /></p></td> </tr> <tr> <td width="535" valign="top"><p align="left"><img src="../images/math/clip_image098.gif" alt="" width="449" height="53" /></p></td> </tr> <tr> <td width="535" valign="top"><p align="left"><img src="../images/math/clip_image100.gif" alt="" width="447" height="53" /></p></td> </tr> <tr> <td width="535" valign="top"><p align="left"><img src="../images/math/clip_image102.gif" alt="" width="157" height="53" /></p></td> </tr> </table> <ol> <li>Approximate <img src="../images/math/clip_image104.gif" alt="" width="237" height="24"/>using the Euler-Maruyama approximation scheme below:</li> </ol> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="268" valign="top"><p align="left"><img src="../images/math/clip_image106.gif" alt="" width="178" height="53" /></p></td> <td width="268" valign="top"><p align="left"><img src="../images/math/clip_image108.gif" alt="" width="172" height="53" /></p></td> </tr> <tr> <td width="268" valign="top"><p align="left"><img src="../images/math/clip_image110.gif" alt="" width="174" height="53" /></p></td> <td width="268" valign="top"><p align="left"><img src="../images/math/clip_image112.gif" alt="" width="178" height="53" /></p></td> </tr> </table> <ol> <li>For <em>i</em> = 1...<em>n</em>, compute correct approximation errors by setting negative valuex of <img src="../images/math/clip_image114.gif" alt="" width="64" height="21" />to zero, </li> <li>(Optional) Rescale<img src="../images/math/clip_image114_0000.gif" alt="" width="64" height="21" />,<em> i</em> = 1...<em>n</em>, via:</li> </ol> <p align="left"><img src="../images/math/clip_image116.gif" alt="" width="334" height="49" /> <br /> <img src="../images/math/clip_image118.gif" alt="" width="332" height="49" /> <br /> <img src="../images/math/clip_image120.gif" alt="" width="333" height="49" /> <br /> <img src="../images/math/clip_image122.gif" alt="" width="334" height="49" /></p> <h2>Sources</h2> <p>[1] Allen, Linda and Clyde Martin. <em>The Black Death, AIDS and Mathematics: What's the Connection?</em> Source: <a href="http://jupiter.phys.ttu.edu/corner/2000/feb00.pdf">http://jupiter.phys.ttu.edu/corner/2000/feb00.pdf</a>.</p> <p>[2] Dunham, Jill Bigley, F. Brett Berlin, <em>Scale-Free Network Models in Epidemiology: Preliminary Findings</em>. George Mason University, 19 August 2004. Source: <a href="http://academic.reed.edu/epi/papers/scalefree.ppt">http://academic.reed.edu/epi/papers/scalefree.ppt</a>.</p> <p>[3] Pourbohloul, Babak, Lauren Ancel Meyers, Danuta M. Skowronski, Mel Krajden, David M. Patrick, Robert C. Brunham. <em>Modeling Control Strategies of Respiratory Pathogens</em>. Source: <a href="http://www.cdc.gov/ncidod/EID/vol11no08/040449.htm">http://www.cdc.gov/ncidod/EID/vol11no08/04-0449.htm</a>.</p> <p>[4] Lloyd, Alun L., and Robert M. May. <em>Spatial Heterogeneity in Epidemic Models</em>. University of Oxford, Department of Zoology. 4 September 1995.</p> <p>[5] Dargatz, Christiane, Vera Georgescu, Leonhard Held. <em>Stochastic Modelling of the Spatial Spread of Influenza in Germany</em>. Ludwig-Maximilians-University, Munich.</p> <p>[6] Schwartz, Ira B., Lora Billings, Erik M. Bollt. <em>Dynamical

124

epidemic suppression using stochastic prediction and control.</em> Department of Mathematics and Computer Science, and Department of Physics, Clarkson University, Potsdam, New York 13699, USA. Source: <a href="http://www.csam.montclair.edu/~billings/research/PRE_046220.pdf">http://www.csam.montclair.edu/~billings/research/PRE_0 46220.pdf</a>. </p> </font> <? require('../script/footer.php'); ?> ...\eiss\main\slir.php <? require('../script/header.php'); ?> <font style="font-size: 11px"> <h1>What is SLIR?</h1> <h2>Epidemiologic Simulation and Popular Models</h2> <p>Epidemiologists, in order to keep track of spread of diseases, usually divide the population at study into various population groups. An example of such grouping is the model where the population is divided into two groups, those susceptible to the disease and those who are not susceptible or the immune. A person moves from the susceptible group to the immune group only through vaccination or when his body recovers and develops immunity to the disease. It is generally believed that there is no movement in the other direction.</p> <p align="center"><img width="340" height="59" src="../images/slir/clip_image002.gif" alt="SI" /> </p> <p align="center"><em><strong>Fig.1.</strong> Susceptible-Immune Model</em></p> <p>A more useful population grouping is called the SIR Model, or the Susceptible-Infectious-Removed model. In SIR model, the population is grouped into (a) Susceptible, those who had not contracted to the disease but is vulnerable to be infected; (b) Infectious, those who have contracted the disease and can transfer it to others i.e. the Susceptible population; and finally (c) Removed, those who are either immune from the disease (naturally or through vaccination) or dead. As we can see, the sum of these population groups is equal to the total population. Visually, we can think of the model as:</p> <p align="center"><img width="520" height="119" src="../images/slir/clip_image004.gif" alt="SIR" /> </p> <p align="center"><em><strong>Fig.2.</strong> Susceptible-Infectious-Removed Model</em></p> <p>One can then predict how fast a disease spread in a certain population by plotting the Susceptible and Infectious population in graph with respect to time. Furthermore, one can also know how fast people in the Infectious population transfer into the Removed population (through host i.e. the person affected, developing immunity or the host dying).</p> <p>When one, for example, had already obtained an empirical value for how fast people are infected and on how fast and how many people die (mortality rate) or get immune, then future values can actually be predicted by using the same parameters. Furthermore, when these disease-related parameters are obtained, one can actually use it for any location or population infected by the disease. </p> <p>This is how simulation of epidemics is being done in the present. We first obtain a model involving the population groups we want to observe. When a model had adequately been presented or devised, the necessary step is to represent the model into mathematical equations. But the model, first and foremost, should be accurate in presenting reality.</p> <h2>Susceptible-Exposed-Infectious-Removed Model</h2> <p>A more complicated model is the SLIR/SEIR model, or the Susceptible-Latent/Exposed-Infectious-Removed Model. This now tackles four different groups: (a) Susceptible, those who are vulnerable to the disease: (2) Exposed, also called as Latent &ndash; those who have contracted the disease but are not yet infectious. (3) Infectious &ndash; those who can infect others with the disease. Infectious people are, most of the times, already symptomatic. (4) Finally, we have Removed &ndash;those who already immune from the disease or dead. Usually, immunity is obtained through vaccination.&nbsp;</p> <p align="center"><img width="520" height="119" src="../images/slir/clip_image006.gif" alt="Seir" /> </p> <p align="center"><em><strong>Fig.3.</strong> Susceptible-Exposed-Infectious-Removed Model with Vaccination Group </em></p> <p>Let us analyze the transfer of population from one grouping to another. The rate by which people transfer from one group to another can be obtained empirically and be used to predict future values. Dargatz&rsquo;s and Allen &amp; Martin&rsquo;s [1] model (for vaccination) when combined will yield:</p> <p align="center"><img width="627" height="117" src="../images/slir/clip_image008.gif" alt="Seir" /> </p> <p align="center"><em><strong>Fig.4.</strong> Susceptible-ExposedInfectious-Removed Model with Vaccination Group and <br /> Rate of Transfer from one population Group to another</em></p> <p>As we can see, the rate by which persons in the susceptible group become one of the exposed is called the <u>transmission rate</u>, designated by Dargatz as &alpha; (alpha). Naturally then, the total persons going from a susceptible to exposed is S&alpha;, where S is the total susceptible population. This will measure how fast the disease spreads.</p> <p>We also have the <u>reciprocal of the average latent period</u> and the <u>reciprocal of average infectious period</u> as the rate of transfer from exposed to infectious and infectious to removed population respectively. Furthermore, we have a direct link from susceptible directly to removed population through the incorporation of <u>vaccination rate</u>. So, the total movement to removed population is Sv + I(1/&beta;), where I is the total infectious population, &beta; (beta) is the mean infectious period, and v is the vaccination rate. </p> <p> There are many things assumed by the SEIR model above. First, we assume that other factors that control the population are ignored, such as the birth and death rate. If they cannot be ignored, they are assumed to be equal, so the total population remains the same.</p> <h2>Global SEIR Model</h2> <p> One assumption in the SEIR model described above is that the population (S+E+I+R) are fully mixed i.e. all people have equal chances of meeting each other. This presents us a serious limitation, particularly because in real life situation, a person is only in contact with a fraction of the population (e.g. his co-workers and relatives). Aside from that, we are given no spatial information on how the disease spread in a particular region. For example, if we are studying an epidemic in a province, we cannot trace how the disease spreads from town to town. We can only know the total number of persons per SEIR population groups. As such, the model is hardly useful when the intention is to <em>prevent</em> the disease from spreading.</p> <p> The study Spatial Heterogeneity in Epidemic Models [2] by Alun Lloyd and Robert May investigated on this inadequacy. Llyod and May wanted to explain how disease persists &ldquo;globally&rdquo; even if it dies &ldquo;locally&rdquo;. For example, even if a disease is no longer an epidemic in any locality, an epidemic can still exist within the region that contains these localities. This prompts us to describe SEIR populations in terms of regions divided into sub-regions. This way, we can know how infectious people of one sub-region infect susceptible people from other sub-regions. Instead of dividing the population into usual SEIR, we now have Si, Ei, Ii, Ri where i is from 1 to n &ndash; the total number of subregions.</p> <p> Dargatz [3] then defined the connectivity matrix &gamma; = [&gamma;ij], where &gamma;ij represents the rate by which people transfer from sub-region i to sub-region j. This is also called as the <u>traffic or dispersal matrix</u>. This is represented visually as: </p> <p align="center"><img width="628" height="325" src="../images/slir/clip_image010.gif" alt="Global" /> </p> <p align="center"><em><strong>Fig.5.</strong> Susceptible-Exposed-Infectious-Removed Model with Vaccination Group As we can see, we also have to multiply the traffic rate to the population within the population group to get number of people from that sub-region transferring to another sub-region (logically, they will still remain on that same population group).</em></p> <h2>Computing for Mean Transmission Rate</h2> <p>The mean transmission rate &alpha; is not readily available. We have to

125

derive it from other variables if we are to obtain it. Through operations on the differential equation representation of the SLIR model, we obtain: </p> <p><img src="../images/slir/clip_image012.gif" alt="1" width="126" height="39" />, <em>t &ge; 0</em></p> <p>at the beginning of an epidemic, assuming that all of the population are susceptibles [ s(0)=1, j(0)=0 ]. Let the <img src="../images/slir/clip_image014.gif" alt="2" width="69" height="30" />be equal to the real percentage of reported cases of the disease and <img src="../images/slir/clip_image016.gif" alt="4" width="91" height="30" />. &nbsp;</p> <p>Dargatz stated that <img src="../images/slir/clip_image018.jpg" alt="5" width="201" height="45" />, if <img src="../images/slir/clip_image014_0000.gif" alt="3" width="69" height="30" />is equal 0.955 where di is the population density of sub-region i. We can now obtain the transmission rate given the reproductive number and the mean infectious period.&nbsp;</p> <h2>Sources</h2> <p>[1] Allen, Linda and Clyde Martin. <em>The Black Death, AIDS and Mathematics: What's the Connection?</em>. </p> <p>[2] Lloyd, Alun L., and Robert M. May. <em>Spatial Heterogeneity in Epidemic Models</em>. University of Oxford, Department of Zoology. 4 September 1995. </p> <p>[3] Dargatz, Christiane, Vera Georgescu, Leonhard Held. <em>Stochastic Modelling of the Spatial Spread of Influenza in Germany</em>. Ludwig-Maximilians-University, Munich. </p></font> <? require('../script/footer.php'); ?> ...\eiss\main\system.php <? require('../script/header.php'); ?> <table width="100%" cellpadding="5" cellspacing="5"> <tr> <td valign="top" width="50%"> <font style="font-size: 11px"> <h1>System Capabilities</h1> <p>The Epidemiologic Information and Simulation System (EISS) allows users to perform the stated functions:</p> <ul> <li><strong>Users categorized as <u>Epidemiologist</u> can perform the simulation process through the following functionalities:</strong></li> </ul> <ul> <ul> <li>Input the simulation parameters</li> </ul> </ul> <ul> <ul> <ul> <li>Number (tmax) of time frames (t &#1028; [0,..,tmax]) to generate<u></u></li> <li>Time step unit (e.g. days, hours, weeks, etc.)<u></u></li> <li>Number of times the simulation is to be performed<u></u></li> <li>The region at study (R)<u></u></li> <li>The disease to be used<u></u></li> <ul> <li>The infected sub-regions, and the following information: <u></u></li> <li>The number <u>of</u> exposed people (less than total population)</li> <li>The <u>number</u> of infectious people (less than the number of exposed people)</li> <li>The <u>number</u> of vaccinated/immune people (less than the difference of total and exposed population)</li> </ul> </ul> </ul> </ul> <ul> <ul> <li>Update the simulation commands registry through adding, editing and deleting commands so as to allow the user to create a sound containment strategy for the epidemic.&nbsp; A particular command will contain the following arguments:</li> </ul> </ul> <ul> <ul> <ul> <li>Time step the command will take effect (t &#1028; [0,..,tmax])</li> <li>The sub-region the command will take effect (Si)</li> <li>Command type and its required parameters. The available commands are: </li> <ul> <li><u>Quarantine</u> – sets all the entries in the traffic/dispersal array to zero<u></u></li> <li><u>Vaccinate</u> – provides a vaccination rate of a particular sub-region (zero by default). This command requires vaccination rate vi as an argument.</li> </ul> </ul> </ul> </ul> <ul> <ul> <li>Run the simulation using the simulation parameters and simulation commands.</li> </ul> </ul> <ul> <ul> <li>View simulation results for each population category (Susceptible, Latent/Exposed, Infectious, Removed/Immunized) containing the following:</li> </ul> </ul> <ul> <ul> <ul> <li>Animation of the spread of the disease (time-frames/second are adjustable) using the average data </li> <li>Data of the following for each population category at time tmax:</li> <ul> <li>Average final population for each sub-region for each population category (printable)</li> <li>Total average final population for each population category (printable)</li> <li>Graph of total average final population versus sub-regions for each population category (printable)</li> </ul> <li>Downloadable table of average population for each population category versus against time for every Sub-region in .txt format (simulation data dump)</li> </ul> </ul> </ul> <ul> <li><strong>Users categorized as <u>Pathologist</u> can:</strong></li> </ul> <ul> <ul> <li>Insert an entry to the list of characterized diseases available for use in the system. Each disease entry would contain following information: </li> <ul> <li>Disease Name</li> <li>Disease Description</li> <li>Mean latent period (&epsilon;-1)</li> <li>Mean infectious period (&beta;-1)</li> </ul> </ul> </ul> <ul> <ul> <li>Edit disease information</li> <li>Delete disease information</li> </ul> </ul> <ul> <li><strong>Users categorized as <u>Geographer</u> can:</strong></li> </ul> <ul> <ul> <li>Create a new region, which contains the following information:</li> <ul> <li>Region name</li> <li>Description</li> <li>Sub-regions it contains (S1, S2, S3, &hellip;, Sn) &ndash; taken from the geographic units</li> <li>Traffic/Dispersal matrix, which describes the movement of people from one sub-region to another (an n by n connectivity matrix &gamma; = [&gamma;i,j ], where &gamma;i,j is the movement rate from sub-region Si to sub-region Sj)</li> </ul> </ul> </ul> <ul> <ul> <li>Edit region information</li> <li>Edit information of pre-defined geographic units, which contains the following information</li> <ul> <li>Geographic unit name</li> <li>Descriptions</li> <li>The current population of the geographic unit (Ni)</li> <li>The current population density of the geographic unit (di)</li> </ul> </ul> </ul> <ul> <li><strong>Users categorized as <u>System Administrator</u> can create, edit, and delete an account categorized either as Pathologist, Geographer, Epidemiologist, or System Administrator</strong></li> </ul> </font> </td> <td valign="top">&nbsp;</td> <td valign="top"> <font style="font-size: 11px"> <br /> <p align="center"><img src="../images/eisslogo.jpg" width="425" height="195" /></p> <h2>Assumptions</h2> <ul> <li>The simulation parameters inputted are assumed to be true and correct.</li> <li>Sub-regions are assumed to be fully mixed i.e. all individuals in a sub-region have equal chances of meeting each other.</li> <li>The region at study is assumed to be closed (that is, migration from and to the outside of the region is discounted). This does not mean, however, that the population does not change &ndash; in fact, the birth and the death rate of each of the sub-regions directly affects the total population.</li> <li>A particular simulation command inputted is assumed to be feasible and can be done in real life situation. For example, when the Epidemiologists test the effect of quarantining a particular sub-region at a particular time, resources are indeed enough to effectively quarantine that area at that time.</li> <li>The effects of quarantine and vaccination are assumed to be perfectly effective, i.e. for quarantine, there is absolutely zero traffic from and to the sub-region; for vaccination, all people vaccinated are considered immune and will never be infected.</li> </ul> <h2>Scope</h2> <ul> <li>The system will be using the numerical method Euler-Maruyama approximation scheme in computing for Stochastic Differential Equations (SDE) defined in the Global SEIR model to be used.</li> <li>The system only simulates the spread of diseases with human vectors (anthroponotic/human-transferable diseases). Animate vectors other than human beings are (e.g. insects, animals, plants) are also not included in the study and system development. Other environmental factors are also ignored, except when it affects the traffic/dispersal matrix.</li> <li>Since the system will treat the population as homogenous, it will only be tackling diseases which affect everyone from all age and gender groups.</li> </ul> <h2>Limitations</h2> <ul> <li>The system envisioned will not concern itself with the obtaining of information listed in the whether by simulation, by

126

experimentation or by direct observation. The system is only concerned on what happens after we are able to characterize the disease and to determine the population description of the region at study.&nbsp; </li> <li>The system will not be able to determine the veracity or correctness of the data inputted &ndash; except perhaps the type of data (e.g. the system can check when a user inputted an alphanumeric character when it should be inputting only a number).</li> </ul> </font> </td> </tr> </table> <? require('../script/footer.php'); ?> ...\eiss\main\trivia.txt [::][:]How many types of the HIV virus have been identified?[:]There are two, called HIV-1 and HIV-2. They are a part of a family of viruses called retroviruses.[:] [::][:]What percentage of AIDS patients die within 3 to 5 years after the diagnosis is made?[:]80 to 90%. Signs and symptoms of acute HIV usually occure withing days to weeks after initial exposure and last from a few days to more than 10 weeks. Unfortunately, this syndrome is often undiagnosed or misdiagnosed because the anitbodies are not usually detected during this stage.[:] [::][:]As of February 1998, approximately how many people were infected with HIV worldwide?[:]The correct answer was 30 million. It was estimated that more tha 30 million people were infected, with as many as 16,000 individuals becoming infected daily in 1997. AIDS is a pandemic disease.[:] [::][:]Can AIDS can be transmitted by a broken glass injury?[:]Yes. It can also be transmitted by direct sexual contact (homosexual or heterosexual), sharing needles and syringes, transfusion of contaminated blood, transplancental from mother-to-child, breast feeding, needlestick, and scalpel injuries.[:] [::][:]What percentage of HIVinfected adults will have developed AIDS within 10 years of infection?[:]The correct answer was 50%. The incubation period is variable. It can take less than 1 year to 10 years or longer; generally 1 to 3 months.[:] [::][:]Is Colorado tick fever a chronic viral infection?[:]No. It is an acute viral infection characterized by fever, headache, fatigue, aching, and occasionally rash, encephalitis, myocarditis, and tendency to bleed.[:] [::][:]What is the incubation period for Colorado tick fever?[:]The correct answer was 4 to 5 days. Colorado tick fever is one of 10 known tickborne diseases in the United States.[:] [::][:]Is Colorado tick fever caused by an unclassified arthropod-borne virus?[:]Yes. It is transmitted by the bite of a virus-infected tick. Most commonly affected animals are ground squirrels, porcupines, chipmunks, and mice.[:] [::][:]Can Colorado tick fever be treated with antiviral medications?[:]There is no treatment except removal of the tick, rest, and nutritious diet.[:] [::][:]Does Colorado tick fever occur most frequently in hikers and fisherman?[:]Yes. It is endemic in mountainous regions above 5,000 feet elevation of western United States and Canada.[:] [::][:]Does Mononucleosis sometimes have no symptoms?[:]Yes. "Mono" is an acute viral disease that is often asymptomatic, but may be characterized by fever, sore throat, lymphadenopathy, enlarged spleen, and fatigue.[:] [::][:]What is the pathogen that causes mononucleosis?[:]Epstein-Barr. The Epstein-Barr virus (EBV) is a human herpes virus that is known to be cancer causing. It invades B lymphocytes.[:] [::][:]Can Mononuecleosis be transmitted person-to-person by direct contact with saliva?[:]Yes. This is why it is sometimes known as the "kissing disease". It can also be transmitted via blood transfusions.[:] [::][:]What is the incubation period for mononucleosis?[:]The correct answer was 4 to 6 weeks. Infected individuals should avoid salivary contact with others, including sharing drinking containers and kissing.[:] [::][:]If infected with mononucleosis, it is all right to go about your reguar routine?[:]People with mono should get plenty of rest and eat a nutritious diet. They should also avoid heavy lifting and contact sports to prevent rupturing of the spleen. Children should not be given aspirin to prevent Reye's syndrome.[:] [::][:]Is Mumps also known as infectious parotitis?[:]Yes. Mumps is an acute viral infection. Symptoms include fever and swelling and tenderness of the salivary glands.[:] [::][:]What type of virus causes mumps?[:]The correct answer was Paranyxovirus.Mumps is transmitted by droplet spread and direct contact with the saliva of an infected person.[:] [::][:]What is the incubation period for mumps?[:]The correct answer was 12 to 25 days. Most commonly 18 days.[:] [::][:]How many U.S. cases of mumps were reported in 1998?[:]The correct answer was 606. Complications of mumps can include inflammation of the testes or ovaries.[:] [::][:]Is there no known vaccine for mumps?[:]False. MMR (measles-mumps-rubella) is a vaccine for children and nonimmune adults.[:] [::][:]What are other names for the common cold?[:]Acute rhinitis and Acute coryza. The common cold is an infection of the lining of the nose, sinuses, throat, and large airways. It produces discharge from the nostrils, sneezing, runny eyes, sore throat, chilliness, and malaise. It may be accompanied by laryngitis or bronchitis.[:] [::][:]What is the incubation period for the common cold?[:]It is between 12 hours and 5 days, usually about 48 hours.[:] [::][:]Is the common cold is communicable before symptoms begin?[:]Yes. It is communicable from 24 hours before the onset of symptoms to 5 days after onset.[:] [::][:]In which season are colds the least common?[:]Summer. Colds are the most common in fall, winter, and spring.[:] [::][:]Does antibiotics offer relief for the common cold?[:]No. The person should also stay warm and comfortable and drink plenty of fluids. Antibiotics are ineffective against viruses.[:] [::][:]Is high blood pressure a symptom of hantavirus pulmonary syndrome (HPS)?[:]No. Low blood pressure (hypotension) is.[:]

127

...\eiss\modules\
...\eiss\modules\create_csv.php <? header("Content-Type: application/octet-stream"); if($_POST['whichdata']==1) { $csvFile = "data_simulation.csv"; $fileHandle = fopen($csvFile, 'w') or die("Can't open file."); fwrite($fileHandle, $_POST['data1_post']); fclose($fileHandle); } else if($_POST['whichdata']==2) { $csvFile = "data_subregion_SLIR_vs_time.csv"; $fileHandle = fopen($csvFile, 'w') or die("Can't open file."); fwrite($fileHandle, $_POST['data2_post']); fclose($fileHandle); } else if($_POST['whichdata']==3) { $csvFile = "data_SLIR_subregion_vs_time.csv"; $fileHandle = fopen($csvFile, 'w') or die("Can't open file."); fwrite($fileHandle, $_POST['data3_post']); fclose($fileHandle); } header("Content-Disposition: attachment; filename=$csvFile"); header("Content-Transfer-Encoding: binary"); readfile($csvFile); unlink($csvFile); ?> ...\eiss\modules\eme.php <? $page_is_eme = true; require('../script/header.php'); if($user->usertype=="epidemiologist") $login_as = "eme"; else { ?> <meta http-equiv="refresh" content="0; URL='../main/main.php?login_failure=1&login_message=<? echo("not_allowed"); ?>'"> <? exit(); } ?> <form method="POST" action=""> <? if(!isset($simulation->disease)) { ?> <? require("select_disease.php"); ?> <br><br> <? } ?> <? if(!isset($simulation->region)) { ?> <? require("select_regions.php"); ?> <? } ?> </form> <? if( isset($simulation->disease)&& isset($simulation->region)&& ( isset($simulation>susceptible)|| isset($simulation->latent)|| isset($simulation->infectious)|| isset($simulation->removed) ) ) { ?> <table width="100%"><tr> <!-- Content panel --> <td width="65%" valign="top" > <div id="masterdiv"> <table width="100%" cellpadding ="2"> <? if(isset($simulation->time_steps)&&isset($simulation->time_unit)) { ?> <tr> <td width="5">&nbsp;</td> <td width="100" align="center" style="border-style: solid; border-color: #DADADA; border-width:1px; cursor:pointer; background: #F0F0F0" id="dataViewButton" onclick=" SwitchMenu('dataView'); dataViewButton.style.background='#FFFFFF'; graphViewButton.style.background='#F0F0F0'; mapViewButton.style.background='#F0F0F0'; " ><font size="2"><b>Data View</b></font> </td> <td width="5">&nbsp;</td> <td width="100" align="center" style="border-style: solid; border-color: #DADADA; border-width:1px; cursor:pointer; background: #F0F0F0" id="graphViewButton" onclick=" SwitchMenu('graphView'); dataViewButton.style.background='#F0F0F0'; graphViewButton.style.background='#FFFFFF'; mapViewButton.style.background='#F0F0F0'; " ><font size="2"><b>Graph View</b></font> </td> <td width="5">&nbsp;</td> <td width="100" align="center" style="border-style: solid; border-color: #DADADA; border-width:1px; cursor:pointer; background: #F0F0F0" id="mapViewButton" onclick=" SwitchMenu('mapView'); dataViewButton.style.background='#F0F0F0'; graphViewButton.style.background='#F0F0F0'; mapViewButton.style.background='#FFFFFF'; " ><font size="2"><b>Map View</b></font> </td> <td></td> </tr> </table> <table width="100%" cellpadding ="2"> <tr> <td colspan="7" valign="top" style="border-style: solid; border-color: #DADADA; border-width: 1px; background-color: #FAFAFA;" width="100%"> <span class="submenu" style="color:black" id="dataView"> <div id="tableOne" style="width: 625px; height: 400px; overflow: auto;"></div> <form action="create_csv.php" method="POST" target="_blank" name="create_csv"> <input type="hidden" id="data1_post" name="data1_post" value="12"> <input type="hidden" id="data2_post" name="data2_post" value="13"> <input type="hidden" id="data3_post" name="data3_post" value="14"> <input type="hidden" id="whichdata" name="whichdata" value="0"> <script type="text/javascript"> /* Create downloadable CSV files using result[time][compartment][location] + data_simulation.csv + data_subregion_SLIR_vs_time.csv + data_SLIR_subregion_vs_time.csv Variables: time,cycle,num_units,units,results */ // data_simulation.csv var data1 = ""; for(t=1;t<time;t++) { // S for(j=0;j<num_units;j++) data1 += "Day "+(t*cycle)+",Susceptible,"+units[j+1]+","+Math.round(results[t]['s'][j])+"\n"; // L for(j=0;j<num_units;j++) data1 += ("Day "+(t*cycle)+",Latent,"+units[j+1]+","+Math.round(results[t]['l'][j])+"\n"); // I for(j=0;j<num_units;j++) data1 += ("Day "+(t*cycle)+",Infectious,"+units[j+1]+","+Math.round(results[t]['i'][j])+"\n"); // R for(j=0;j<num_units;j++) data1 += ("Day "+(t*cycle)+",Removed,"+units[j+1]+","+Math.round(results[t]['r'][j])+"\n"); } // data_subregion_SLIR_vs_time.csv = data2 var data2 = ""; for(j=0;j<num_units;j++) { // S data2 += (units[j+1]+",Susceptible"); for(t=1;t<time;t++) data2 += ","+Math.round(results[t]['s'][j]); data2 += "\n"; // L data2 += (units[j+1]+",Latent"); for(t=1;t<time;t++) data2 += ","+Math.round(results[t]['l'][j]); data2 += "\n"; // I data2 += (units[j+1]+",Infectious"); for(t=1;t<time;t++) data2 += ","+Math.round(results[t]['i'][j]); data2 += "\n"; // R data2 += (units[j+1]+",Removed"); for(t=1;t<time;t++) data2 += ","+Math.round(results[t]['r'][j]); data2 += "\n"; } // data_SLIR_subregion_vs_time.csv = data3 // S var data3 = ""; for(j=0;j<num_units;j++) { data3 += ("Susceptible,"+units[j+1]); for(t=1;t<time;t++) data3 += ","+Math.round(results[t]['s'][j]); data3 += "\n"; } // L for(j=0;j<num_units;j++) { data3 += ("Latent,"+units[j+1]); for(t=1;t<time;t++) data3 += ","+Math.round(results[t]['l'][j]); data3 += "\n"; } // I for(j=0;j<num_units;j++) { data3 += ("Infectious,"+units[j+1]); for(t=1;t<time;t++) data3 += ","+Math.round(results[t]['i'][j]); data3 += "\n"; } // R for(j=0;j<num_units;j++) { data3 += ("Removed,"+units[j+1]); for(t=1;t<time;t++) data3 += ","+Math.round(results[t]['r'][j]); data3 += "\n"; } document.getElementById('data1_post').value = data1; document.getElementById('data2_post').value = data2; document.getElementById('data3_post').value = data3; </script> <table cellspacing="5"> <tr colspan="2"><td><b><u>Downloadables</u></b></td></tr> <tr> <td valign="top">Download the .csv (Comma-Separated Values) dump file here:</td> <td valign="top"> <a href="#" onclick="document.getElementById('whichdata').value = 1; document.create_csv.submit()">data_simulation.csv</a> </td> <td valign="top">This is useful for pivot table functions (e.g Microsoft Excel's&trade; Pivot Table&trade;, OpenOffice.orgs Calc's DataPilot, Google Docs' Pivot Table etc.) as the outputed table is normalized, with flat data, suitable for general-purpose querying. </td> </tr> <tr> <td valign="top">Download the .csv "Subregion, disaggregated by SLIR, versus Time" file here:</td> <td valign="top"> <a href="#" onclick="document.getElementById('whichdata').value = 2; document.create_csv.submit()">data_subregion_SLIR_vs_time.csv</a> </td> <td valign="top">This contains subregions disaggregated by SLIR compartment at the rows and time at the

128

columns</td> </tr> <tr> <td valign="top">Download the .csv "SLIR, disaggregated by Subregion, versus Time" file here: </td> <td valign="top"> <a href="#" onclick="document.getElementById('whichdata').value = 3; document.create_csv.submit()">data_SLIR_subregion_vs_time.csv</a> </td> <td valign="top">This contains SLIR compartments disaggregated by subregions at the rows and time at the columns</td> </tr> </table> </form> </span> <span class="submenu" style="color:black" id="graphView"><br /> <div id="graph" align="center"><br>[ Graph to Appear Here ]<br><br><br></div> <script type="text/javascript"> // @format (hex|rgb|null) : Format to return, default is integer function random_color(format) { var rint = Math.round(0xffffff * Math.random()); switch(format) { case 'hex': return ('#0' + rint.toString(16)).replace(/^#0([0-9a-f]{6})$/i, '#$1'); break; case 'rgb': return 'rgb(' + (rint >> 16) + ',' + (rint >> 8 & 255) + ',' + (rint & 255) + ')'; break; default: return rint; break; } } function generateChart(dataset,title,xLabel,xPeriod,yRange) { var myChart = new JSChart('graph', 'line'); // Chart Options myChart.setAxisValuesNumberY(5); myChart.setIntervalStartY(0); myChart.setIntervalEndY(yRange); myChart.setTitle(title); myChart.setTitleColor('#454545'); myChart.setAxisValuesColor('#454545'); myChart.setAxisPaddingBottom(40); myChart.setTextPaddingBottom(10); myChart.setTextPaddingLeft(40); myChart.setFlagColor('#9D16FC'); myChart.setFlagRadius(4); // Graph Data with Colors for(var i in dataset) myChart.setDataArray(dataset[i], 'color'+i); for(var i in dataset) myChart.setLineColor(random_color('hex'), 'color'+i); // Label limit var tooltiplimit = 10; // Tooltips if(dataset[0].length<=tooltiplimit) for(var i=1;i<=dataset[0].length;i++) myChart.setTooltip([i]); else { var tooltipperiod = Math.round(dataset[0].length/tooltiplimit); for(var i=1;i<=dataset[0].length;i+=tooltipperiod) myChart.setTooltip([i]); } // Label limit var labellimit = 10; // Set LabelX if(dataset[0].length/2<=labellimit) { for(var i=0;i<=dataset[0].length;i+=2) if(i!=0) myChart.setLabelX([i,xLabel+' '+i*xPeriod]); myChart.setAxisValuesNumberX(dataset[0].length/2); } else { labelperiod = Math.round(dataset[0].length/labellimit); for(var i=0;i<=dataset[0].length;i+=labelperiod) if(i!=0) myChart.setLabelX([i,xLabel+' '+i*xPeriod]); myChart.setAxisValuesNumberX(dataset[0].length/2); } myChart.setShowXValues(false); // Draw Chart myChart.setSize(630, 350); myChart.draw(); } </script> <? $query = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$simulation->region."'"; $total_subreg = mysql_num_rows(mysql_query($query)); if($result = mysql_query($query)) { $i = 0; while($data = mysql_fetch_array($result)) { $unit = mysql_fetch_array(mysql_query(" SELECT * FROM `g_unit` WHERE `unit_no` = ".$data['g_unit'])); $gunit[$i] = new GeographicalUnit($unit); $i++; } } ?> <script type="text/javascript"> one_region_view = true; function generateDataforGraph(base,children) { var graphData = Array(); var maximumValue = 0; var title = ''; if(base=='s'||base=='l'||base=='i'||base=='r'||base=='t') { regions = children.split(','); for(var j=0;j<regions.length;j++) { for(var k=0;k<unit_nos.length;k++) { if(unit_nos[k]==regions[j]) unit = k; } graphData[j] = Array(); for(var i=0;i<results.length;i++) { var data = 0; if(base!='t') data = results[i][base][unit]; else data = results[i]['s'][unit] + results[i]['l'][unit] + results[i]['i'][unit] + results[i]['r'][unit]; graphData[j][i] = Array(i+1,Math.round(data)); if(data>maximumValue) maximumValue = data; } } title = 'Geographic Units by Compartments'; } else { if(base!='total') { for(var k=0;k<unit_nos.length;k++) if(unit_nos[k]==base) unit = k; } compartments = children.split(','); for(var j in compartments) { compartment = compartments[j]; if(compartment!='') { graphData[j] = Array(); for(var i=0;i<results.length;i++) { var data=0; if(base!='total') data = Math.round(results[i][compartment][unit]); else { for(var k=0;k<unit_nos.length;k++) { data += Math.round(results[i][compartment][k]); } } graphData[j][i] = Array(i+1,data); if(data>maximumValue) maximumValue = data; } } } title = 'Compartments by Geographic Units'; } generateChart(graphData,title,'Day',cycle,maximumValue); } </script> <p align="center"><input type="button" class="buttonClass" style="background-color: #DADADA" onClick=" var parameter1 = ''; var parameter2=''; if(one_region_view) { parameter1 = document.getElementById('compartment_graph').value; for(var i=0;i<<? echo($i); ?>;i++) { if(document.getElementById('region_'+i).checked) { parameter2 += document.getElementById('region_'+i).value+','; } } } else { parameter1 = document.getElementById('compartment_region').value; if(document.getElementById('s').checked) parameter2 += 's,'; if(document.getElementById('l').checked) parameter2 += 'l,'; if(document.getElementById('i').checked) parameter2 += 'i,'; if(document.getElementById('r').checked) parameter2 += 'r,'; } generateDataforGraph(parameter1,parameter2); " value="View Graph"/></p> <table align="center"><tr> <td> <div id="compartment_then_region" style="display: block"> <table> <tr> <td align="center"><b>Compartments</b></td></div> <td rowspan="2" align="center" align="center" valign="top"> <a name="#switch" href="#switch" onclick="toggle_visibility('compartment_then_region'); toggle_visibility('region_then_compartment');one_region_view=false;"> -- Switch -- </a> </td> <? $entries_per_column = 7; $columns = floor($i/$entries_per_column); if($i%$entries_per_column!=0) $columns++; if($columns>3) { $columns = 3; $entries_per_column = ceil($i/$columns); } ?> <td align="center" colspan="<? echo($columns+1); ?>"><b>Geographic Units</b></td> </tr> <tr> <td valign="top"><select id="compartment_graph" name="compartment_graph"> <option value="s">Susceptible</option> <option value="l">Latent</option> <option value="i">Infectious</option> <option value="r">Removed</option> <option value="t">Total</option> </select></td> <? for($j=0;$j<$i;$j++) { ?> <? if($j%$entries_per_column==0) { ?><td valign="top"><? }?> <input type="checkbox" id="region_<? echo($j); ?>" value="<? echo($gunit[$j]->unit_no); ?>"> <? echo($gunit[$j]->name); ?><br> <? if($j%$entries_per_column==$entries_per_column-1) { ?></td><? }?> <? } ?> </tr> </table> </div> <div id="region_then_compartment" style="display: none"> <table> <tr> <td align="center"><b>Geographic Units</b></td></div> <td rowspan="2" align="center" valign="top"> <a name="#switch" href="#switch" onclick="toggle_visibility('compartment_then_region'); toggle_visibility('region_then_compartment');one_region_view=true;"> -- Switch -- </a> </td> <td align="center" colspan="<? echo($i/7); ?>"><b>Compartments</b></td> </tr> <tr> <td valign="top"><select id="compartment_region" name="compartment_region"> <? for($j=0;$j<$i;$j++) { ?> <option value="<? echo($gunit[$j]->unit_no); ?>"> <? echo($gunit[$j]->name); ?> </option> <? } ?> <option value="total">Total</option> </select></td> <td> <input type="checkbox" id="s" value="Susceptible"> Susceptible<br> <input type="checkbox" id="l" value="Latent"> Latent<br> <input type="checkbox" id="i" value="Infectious"> Infectious<br> <input type="checkbox" id="r" value="Removed"> Removed<br> </td> </tr> </table> </div> </td> </tr></table> </span> <span class="submenu" style="color:black" id="mapView"><?

129

require('map.php'); ?></span> <div id="logo" style="width: 30%; position: absolute; top: 110px; left: 30px; z-index:-1;"> <img src="../images/eissiconshadow.gif"/> </div> <span class="submenu" style="color:black" id="defaultView" style="padding: 10px"><br /> &#160;&#160;&#160;The following are the features which can be used: <p> <ul> <li><b>Data View</b> displays all the data after computation, in Pivot Table format.</li><br> <li><b>Graph View</b> use JS Charts to show the changing proportion of Susceptible, Infected-Latent, Infected-Infectious, and Removed (SLIR) populations.</li><br> <li><b>Map View</b> shows an Adobe Flash (TM) animation of the disease, so we can track the growth and travel of the epidemic among various geographic units.</li><br> </ul> </p> </span> </td> </tr> <? } else { ?> <tr><td> <td></tr> <? } ?> </table> </div> </td> <form method="POST" action=""> <!-- Sidebar panel --> <td width="35%" valign="top"> <div style="display:block; width:350px;"> <table width="100%"><tr> <td><font size="+1"><b>Simulation</b></font></td> <td style="border-style: solid; border-color: #DADADA; border-width: 1px; backgroundcolor: #EAEAEA;"> <label> <input type="checkbox" name="stochastic" id="stochastic" <? if($simulation->stochastic) echo("checked"); ?>/> &nbsp;&nbsp;<b>Stochastic?</b> </label><input type="submit" class="buttonClass" name="submit_stochastic" value="Refresh"> </td> </tr></table> <table style="border-style: solid; border-color: #DADADA; border-width: 1px; background-color: #FAFAFA;" cellpadding="3"> <? if(!isset($simulation->time_steps)||!isset($simulation>time_unit)) { ?> <tr> <td width="70%" style="border: solid 0 #DADADA; border-right-width:1px;" colspan="2">Number of Time Frames</td> <td width="30%"><input type="text" name="time_steps" class="textFieldClass" size="5" /></td> </tr> <tr> <td width="70%" style="border: solid 0 #DADADA; border-right-width:1px;" colspan="2">Time Step Unit</td> <td width="30%"> <select name="time_unit" class="textFieldClass" onchange=" if(this.options[this.selectedIndex].value=='n-day Cycle') document.getElementById('cyclefield').style.display = 'block'; else document.getElementById('cyclefield').style.display = 'none'; " > <option value="Day">Days</option> <option value="Week">Weeks</option> <option value="Month">Months (30 days)</option> <option value="Quarter">Quarters (90 days)</option> <option value="Semester">Semesters (180 days)</option> <option value="Year">Years (365 days)</option> <option value="n-day Cycle">n-day Cycle</option> </select> <div id="cyclefield" style="display: none"> <p>Days in a Cycle<input type="text" name="daysinacycle" class="textFieldClass" size="5" /></p> </div> </td> </tr> <tr> <td colspan="2" align="center"> <input type="submit" class="buttonClass" name="submit_time" value="Submit Time Parameters"> </td> </tr> <? } else { ?> <tr> <td width="70%" style="border: solid 0 #DADADA; border-right-width:1px;">Time Parameters</td> <td width="30%"><? echo($simulation->time_steps." ".$simulation->time_unit."(s)"); ?></td> </tr> <tr> <td colspan="2" align="center"> <input type="submit" class="buttonClass" name="reset_time" value="Reset Time Parameters"> </td> </tr> <? } ?> <? if(isset($simulation->time_steps)&&isset($simulation->time_unit)) { ?> <tr> <td colspan="2" style="border: solid 0 #DADADA; border-top-width:1px; border-bottom-width:1px;" align="center" bgcolor="#EAEAEA"><b>Quarantine Commands</b><input type="submit" class="buttonClass" name="reset_quarantine" value="Reset Quarantine" style="background-color: #DADADA" ><br /><u>Note</u>: A location can be quarantined again as long as an earlier quarantine is effectively lifted. </td> </tr> <tr> <td align="center" colspan="2" valign="center" width="70%" style="border: solid 0 #DADADA; border-bottom-width:1px;"> <p> Location: <select name="q_location"> <? $query = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$simulation->region."'"; if($result_sub = mysql_query($query)) { while($data_sub = mysql_fetch_array($result_sub)) { $unit_sub = mysql_fetch_array(mysql_query(" SELECT * FROM `g_unit` WHERE `unit_no` = ".$data_sub['g_unit'])); $gunit_sub = new GeographicalUnit($unit_sub); ?> <option value="<? echo($gunit_sub->unit_no); ?>"><? echo($gunit_sub->name); ?></option> <? } } ?> </select>&nbsp;&nbsp;<br> </p> <? if($simulation->time_unit!="Day") { ?> <p> <a style="cursor:hand;" onclick=" document.getElementById('q_by_day').style.display='block'; document.getElementById('q_by_time').style.display='none'; "> [ By Day ] </a> <a onclick=" document.getElementById('q_by_day').style.display='none'; document.getElementById('q_by_time').style.display='block'; "> [ By <? echo($simulation->time_unit); ?> ] </a> </p> <? } ?> <p> <? if($simulation->time_unit!="Day") { ?> <!-- Using Days --> <div id="q_by_day" style="display:none"> From Day<input type="text" size="3" name="q_day_time_from" id="q_day_time_from"/> to Day<input type="text" size="3" name="q_day_time_to" id="q_day_time_to"/> <input type="submit" class="buttonClass" name="quarantine_days" value="Quarantine"> </div> <!-- --> <? } ?> <!-- Using Time Unit --> <div id="q_by_time"> From <? echo($simulation->time_unit); ?> <select name="q_time_from" id="q_time_from"> <? for($i=1;$i<=$simulation>time_steps;$i++) { ?> <option value="<? echo($i); ?>"><? echo($i); ?></option> <? } ?> </select> to <? echo($simulation->time_unit); ?> <select name="q_time_to" id="q_time_to"> <? for($i=1;$i<=$simulation>time_steps;$i++) { ?> <option value="<? echo($i); ?>"><? echo($i); ?></option> <? } ?> </select> <input type="submit" class="buttonClass" name="quarantine" value="Quarantine"> </div> <!-- --> </p> </td> </tr> <? if(trim($q_message)!="") echo("<p><font color=red align=center><u>Error</u>: ".$q_message."</font></p>"); ?> <? if(trim($simulation->quarantine)!="") {?> <tr><td colspan="2" align="left"> <? $strings = explode("&",$simulation>quarantine); sort($strings); echo("<ul>"); foreach ($strings as $value) { if(trim($value)!="") { echo("<li>"); $item = explode("|", $value); if((trim($item[0])!="")||(trim($item[1])!="")) $unit_name = mysql_fetch_array(mysql_query(" SELECT `name` FROM `g_unit` WHERE `unit_no` = '".$item[0]."'")); echo("Quarantine ".$unit_name[0]." from Day ".$item[1]." to Day ".$item[2]."."); ?>&nbsp;[<a href="eme.php?delete_quarantine=<? echo($item[0]."|".$item[1]."|".$item[2]);?>">Delete</a>]<? echo("</li>"); } } echo("</ul>"); ?> </td></tr> <? } ?> <tr> <td colspan="2" style="border: solid 0 #DADADA; border-top-width:1px; border-bottom-width:1px;" align="center" bgcolor="#EAEAEA"><b>Vaccinate Commands</b><input type="submit" class="buttonClass" name="reset_vaccinate" value="Reset Vaccinate" style="background-color: #DADADA"><br /><u>Note</u>: Vaccination is assumed to be permanent. Vaccinated people are considered part of the Removed compartment. </td> </tr> <tr> <td align="center" colspan="2" valign="center" width="70%" style="border: solid 0 #DADADA; border-bottom-width:1px;"> <p> Location: <select name="v_location"> <? $query = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$simulation->region."'"; if($result_sub = mysql_query($query)) { while($data_sub = mysql_fetch_array($result_sub)) { $unit_sub = mysql_fetch_array(mysql_query(" SELECT * FROM `g_unit` WHERE `unit_no` = ".$data_sub['g_unit'])); $gunit_sub = new GeographicalUnit($unit_sub); ?> <option value="<? echo($gunit_sub->unit_no); ?>"><? echo($gunit_sub->name); ?></option> <? } } ?> </select>&nbsp;.&nbsp; </p> <p>Vaccinate at the rate of<input type="text" name="v_rate" size="3" /> people a day.</p> <? if($simulation->time_unit!="Day") { ?> <p> <a style="cursor:hand;" onclick=" document.getElementById('v_by_day').style.display='block';

130

document.getElementById('v_by_time').style.display='none'; "> [ By Day ] </a> <a onclick=" document.getElementById('v_by_day').style.display='none'; document.getElementById('v_by_time').style.display='block'; "> [ By <? echo($simulation->time_unit); ?> ] </a> </p> <? } ?> <p> <? if($simulation->time_unit!="Day") { ?> <!-- Using Days --> <div id="v_by_day" style="display:none"> From Day<input type="text" size="3" name="v_day_time_from" id="v_day_time_from"/> to Day<input type="text" size="3" name="v_day_time_to" id="v_day_time_to"/> <input type="submit" class="buttonClass" name="vaccinate_days" value="Vaccinate"> </div> <!- --> <? } ?> <!-- Using Time Unit --> <div id="v_by_time"> From <? echo($simulation->time_unit); ?> <select name="v_time_from" id="v_time_from"> <? for($i=1;$i<=$simulation->time_steps;$i++) { ?> <option value="<? echo($i); ?>"><? echo($i); ?></option> <? } ?> </select> to <? echo($simulation->time_unit); ?> <select name="v_time_to" id="v_time_to"> <? for($i=1;$i<=$simulation->time_steps;$i++) { ?> <option value="<? echo($i); ?>"><? echo($i); ?></option> <? } ?> </select> <input type="submit" class="buttonClass" name="vaccinate" value="Vaccinate"> </div> <!-- --> </p> </td> </tr> <!-- --> <? if(trim($v_message)!="") echo("<p><font color=red align=center><u>Error</u>: ".$v_message."</font></p>"); ?> <? if(trim($simulation->vaccinate)!="") {?> <tr><td colspan="2" align="left"> <? $strings = explode("&",$simulation->vaccinate); sort($strings); echo("<ul>"); foreach ($strings as $value) { if(trim($value)!="") { echo("<li>"); $item = explode("|", $value); if((trim($item[0])!="")||(trim($item[1])!="")) $unit_name = mysql_fetch_array(mysql_query(" SELECT `name` FROM `g_unit` WHERE `unit_no` = '".$item[0]."'")); echo("Vaccinate ".$unit_name[0]." from Day ".$item[1]." to Day ".$item[2]." at the rate of ".$item[3]." people a day."); ?>&nbsp;[<a href="eme.php?delete_vaccinate=<? echo($item[0]."|".$item[1]."|".$item[2]."|".$item[3]);?>">Delete</a>]<? echo("</li>"); } } echo("</ul>"); ?> </td></tr> <? } ?> <? } ?> </table> </div> </td> </form> </tr></table> <? } ?> <table><tr> <form method="POST" action=""> <? if(isset($simulation->disease)) { $query = " SELECT * FROM `disease` WHERE disease_no = '".$simulation>disease."'"; $disease = mysql_fetch_array(mysql_query($query)); ?> <td valign="top" width="30%"> <p> <font size="+1"><b>Disease</b></font> <input type="submit" class="buttonClass" name="reset_disease" value="Reset Disease" style="background-color: #DADADA;"> </p> <table style="border-style: solid; border-color: #DADADA; border-width: 1px; background-color: #FAFAFA;" cellpadding="4"> <tr><td valign="top"><b>Disease Name</b></td><td width="70%" valign="top"><? echo($disease['name']);?></td></tr> <tr><td valign="top"><b>Contributor</b></td><td valign="top"><? echo($disease['contributor']);?></td></tr> <tr><td valign="top"><b>Mean Latent Period</b></td><td width="70%" valign="top"><? echo($disease['latent_pd']);?> day(s)</td></tr> <tr><td valign="top"><b>Mean Infectious Period</b></td><td width="70%" valign="top"><? echo($disease['infectious_pd']);?> day(s)</td></tr> <tr><td valign="top" colspan="2"><b>Description</b></td><td valign="top">&nbsp;</td></tr> <tr><td valign="top" colspan="2"><? echo($disease['description']);?></td></tr> </table> </td> <? } ?> <? if(isset($simulation->region)) { $result = mysql_query(" SELECT * FROM `region` WHERE `region_no` = ".$simulation->region); $region = new Region(mysql_fetch_array($result)); ?> <td valign="top" width="30%"> <p> <font size="+1"><b>Region</b></font> <input type="submit" class="buttonClass" name="reset_region" value="Reset Region" style="background-color: #DADADA;"> </p> <table style="border-style: solid; border-color: #DADADA; border-width: 1px; background-color: #FAFAFA;" cellpadding="4"> <tr><td valign="top"><b>Region Code</b></td><td width="70%" valign="top"><? echo($region->code);?></td></tr> <tr><td valign="top"><b>Region Name</b></td><td width="70%" valign="top"><? echo($region->name);?></td></tr> <tr><td valign="top"><b>Contributor</b></td><td valign="top"><? echo($region->contributor);?></td></tr> <tr> <td valign="top"><b>Total Population</b></td> <td valign="top"> <? $regional_population = 0; $query_sub = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$region->region_no."'"; if($result_sub = mysql_query($query_sub)) { while($data_sub = mysql_fetch_array($result_sub)) { $g_unit = mysql_fetch_array(mysql_query(" SELECT `population`, `area` FROM `g_unit` WHERE `unit_no` = ".$data_sub['g_unit'])); $regional_population += intval($g_unit['population']); } } echo(number_format($regional_population)); ?> </td> </tr> <tr><td valign="top" colspan="2"><b>Description</b></td><td valign="top">&nbsp;</td></tr> <tr><td valign="top" colspan="2"><? echo($region>desc);?></td></tr> <tr><td valign="top" colspan="2"><b>Geographical Units</b></td><td valign="top">&nbsp;</td></tr> <tr> <td valign="top" colspan=2> <table> <? $panel_sub = 0; $query_sub = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$region->region_no."'"; if($result_sub = mysql_query($query_sub)) { $count = 0; while($data_sub = mysql_fetch_array($result_sub)) { $count++; $g_sub = mysql_fetch_array(mysql_query(" SELECT * FROM `g_unit` WHERE `unit_no` = ".$data_sub['g_unit'])); $current_sub = new GeographicalUnit($g_sub); ?> <!-- GU Description --> <tr><td colspan=2> <a name="gu<? echo($count); ?>" ?> <div id="GUdesc<? echo($panel_sub."".$count); ?>_a" style="display: block"> <a href="#gu<? echo($count); ?>" onclick="toggle_visibility('GUdesc<? echo($panel_sub."-".$count); ?>_a'); toggle_visibility('GUdesc<? echo($panel_sub."-".$count); ?>_b');"><? echo($current_sub>name);?>&nbsp;+&nbsp;</a> </div> <div id="GUdesc<? echo($panel_sub."-".$count); ?>_b" style="display: none"> <a href="#gu<? echo($count); ?>" onclick="toggle_visibility('GUdesc<? echo($panel_sub."-".$count); ?>_a'); toggle_visibility('GUdesc<? echo($panel_sub."-".$count); ?>_b');"><u><? echo($current_sub->name);?></u>&nbsp;-&nbsp;</a> <table bgcolor="#F0F0F0"> <tr> <td valign="top"><b><i>Description</i></b></td> <td valign="top">&nbsp;</td> </tr> <tr> <td valign="top" colspan=2><? echo($current_sub->desc);?></td> </tr> <tr> <td valign="top"><b><i>Contributor</i></b></td> <td valign="top"><? echo($current_sub->contributor);?></td> </tr> <tr> <td valign="top"><b><i>Population</i></b></td> <td valign="top"><? echo(number_format($current_sub>population));?></td> </tr> <tr> <td valign="top"><b><i>Population Density (per km²)</i></b></td> <td valign="top"><? echo(round($current_sub->population/$current_sub->area));?></td> </tr> <tr> <td valign="top"><b><i>Area (in km²) </i></b></td> <td valign="top"><? echo(number_format($current_sub->area));?></td> </tr> <tr> <td valign="top"><b><i>Adjacent Units</i></b></td> <td valign="top"> <? $query_sub2 = " SELECT `g_unit2` FROM `adjacency` WHERE `g_unit1` = '".$current_sub->unit_no."'"; if($result_sub2 = mysql_query($query_sub2)) { while($data_sub2 = mysql_fetch_array($result_sub2)) { $query_now = " SELECT `name` FROM `g_unit` WHERE `unit_no` = ".$data_sub2['g_unit2']; $name_sub2 = mysql_fetch_array(mysql_query($query_now)); ?> <? echo($name_sub2['name']); ?><br> <? } } else echo("None."); ?> </td> </tr> </table> </div> </td></tr> <!-- --> <? $panel_sub++; } } else echo("None."); ?> </table> </td> </tr> </table> </td> <td valign="top" width="30%"> <? require("slir.php"); ?> </td> <? } else { ?> <td>&nbsp;</td><td>&nbsp;</td> <? } ?> </form>

131

</tr></table> <? if(!isset($simulation->disease)||!isset($simulation->region)) { ?> <br><hr><p> <!-- Pagination Panel --> <table> <tr><td> <!-- Pagination Control --> View <select name="repaginate" onChange="location.href='../script/process_navigation.php?<? echo($parameters);?>&entries_per_page_eme='+this.value+'';" > <option value="5" <? if($nav->entries_per_page_eme==5) echo("selected");?> >5</option> <option value="10" <? if($nav>entries_per_page_eme==10) echo("selected");?> >10</option> <option value="15" <? if($nav->entries_per_page_eme==15) echo("selected");?> >15</option> <? if(($nav->entries_per_page_eme!=5)&&($nav->entries_per_page_eme!=10)&&($nav>entries_per_page_eme!=15)) { ?> <option value=<? echo($nav->entries_per_page_eme);?> selected> - </option> <? } ?> </select> entries at a time, or type here <input type="text" name="entries_per_page_eme" class="textFieldClass" size="3" onBlur="location.href='../script/process_navigation.php?<? echo($parameters);?>&entries_per_page_eme='+this.value+'';" > &nbsp;the number entries per page and click outside. </td></tr> </table> </p> <? } ?> <? /* Saves simulation session */ if(isset($_SESSION['simulation'])) unset($_SESSION['simulation']); $_SESSION['simulation'] = serialize($simulation); ?> <!-- Show panel --> <? if($repeat) { ?> <script type="text/javascript">eval("SwitchMenu('subSearch')");</script> <script type="text/javascript">eval("SwitchMenu2('sub2Add')");</script> <? } else { ?> <script type="text/javascript">eval("SwitchMenu('subSearch')");</script> <script type="text/javascript">eval("SwitchMenu2('sub2Search')");</script> <? } ?> <? require('../script/footer.php'); ?> ...\eiss\modules\gie.php <? require('../script/header.php'); if($user->usertype=="geographer") $login_as = "ge"; else { ?> <meta httpequiv="refresh" content="0; URL='../main/main.php?login_failure=1&login_message=<? echo("not_allowed"); ?>'"> <? exit(); } ?> <!-- Process Geographical Unit queries --> <? // Process Add query if(isset($HTTP_POST_VARS['add_gu_submit'])) { if(!isset($HTTP_POST_VARS['add_name'])||trim($HTTP_POST_VARS['add_name'])=="") $add_message_gu = "Please enter a geographic unit name."; else if(!isset($HTTP_POST_VARS['add_population'])||!is_numeric(trim($HTTP_POST_VARS['add_population']))) $add_message_gu = "Please input a number for the population."; else if(!isset($HTTP_POST_VARS['add_area'])||!is_numeric(trim($HTTP_POST_VARS['add_area']))) $add_message_gu = "Please input a number for the area (in km²)."; else { $find_query = " SELECT * FROM `g_unit` WHERE `name` = '".$HTTP_POST_VARS['add_name']."'"; $found = mysql_num_rows(mysql_query($find_query)); if($found>0) $add_message_gu = "Geographical Unit already exists."; else { $query_gu = " INSERT INTO `g_unit` ( `unit_no`, `name`, `description`, `contributor`, `population`, `area` ) VALUES ( '', '".$HTTP_POST_VARS['add_name']."', '".$HTTP_POST_VARS['add_desc']."', '".$user->username."', '".$HTTP_POST_VARS['add_population']."', '".$HTTP_POST_VARS['add_area']."' ) "; if($result = mysql_query($query_gu)) $add_message_gu = "New geographical unit added."; else $add_message_gu = "Failed to add geographical unit."; } } } // Process Delete query if(isset($HTTP_POST_VARS['delete_gu_submit'])&&isset($HTTP_POST_VARS['row_box'])) { $row_box = $HTTP_POST_VARS['row_box']; foreach($row_box as $key => $value) { if(isset($value)||trim($value)!="") { $find_query = " SELECT * FROM `g_unit` WHERE `unit_no` = '".$value."'"; $data_found = mysql_fetch_array(mysql_query($find_query)); $query_gu1 = " DELETE FROM `g_unit` WHERE `unit_no` = '$value' LIMIT 1 "; $query_gu2 = " DELETE FROM `traffic` WHERE `source` = '$value' LIMIT 1 "; $query_gu3 = " DELETE FROM `traffic` WHERE `destination` = '$value' LIMIT 1 "; $query_gu4 = " DELETE FROM `subregion` WHERE `g_unit` = '$value' LIMIT 1 "; if( mysql_query($query_gu1)&& mysql_query($query_gu2)&& mysql_query($query_gu3)&& mysql_query($query_gu4) ) $success[$value] = $data_found['name']; else $success[$value] = ""; } } if(count($success)!=count($row_box)) $message_query_gu = "There had been problems with deletion. "; else $message_query_gu = ""; if(count($success)>0) { $message_query_gu .= "The following geographical units had been successfully deleted: "; foreach($success as $key => $value) { if(trim($value)!==""); $message_query_gu .= $value."; "; } } else $message_query_gu .= "No geographical units had been deleted."; } // Process Edit query if(isset($HTTP_POST_VARS['update_gu_submit'])) { $update_gu_submit = $HTTP_POST_VARS['update_gu_submit']; // Gets the last (or only) key as the entry foreach($update_gu_submit as $key => $value) $unit_updated = $key; if( !isset($HTTP_POST_VARS['new_name'][$unit_updated])|| trim($HTTP_POST_VARS['new_name'][$unit_updated])=="" ) $message_query_gu = "Please enter a geographic unit name."; else if( !isset($HTTP_POST_VARS['new_population'][$unit_updated])|| !is_numeric(trim($HTTP_POST_VARS['new_population'][$unit_updated])) ) $message_query_gu = "Please input a number for the population."; else if( !isset($HTTP_POST_VARS['new_area'][$unit_updated])|| !is_numeric(trim($HTTP_POST_VARS['new_area'][$unit_updated])) ) $message_query_gu = "Please input a number for the population area."; else { $query_gu = " UPDATE `g_unit` SET "; if(isset($HTTP_POST_VARS['new_name'][$unit_updated])) $query_gu .= " `name` = '".$HTTP_POST_VARS['new_name'][$unit_updated]."'"; if(isset($HTTP_POST_VARS['new_desc'][$unit_updated])) $query_gu .= ", `description` = '".$HTTP_POST_VARS['new_desc'][$unit_updated]."'"; if(isset($HTTP_POST_VARS['new_contributor'][$unit_updated])) $query_gu .= ", `contributor` = '".$HTTP_POST_VARS['new_contributor'][$unit_updated]."'"; if(isset($HTTP_POST_VARS['new_population'][$unit_updated])) $query_gu .= ", `population` = '".$HTTP_POST_VARS['new_population'][$unit_updated]."'"; if(isset($HTTP_POST_VARS['new_area'][$unit_updated])) $query_gu .= ", `area` = '".$HTTP_POST_VARS['new_area'][$unit_updated]."'"; $query_gu .= " WHERE `unit_no` = '".$unit_updated."'"; if(mysql_query($query_gu)) $message_query_gu = "Geographical Unit update successful."; else $message_query_gu = "Geographical Unit update unsuccessful."; } } // Process Add to Region query if(isset($HTTP_POST_VARS['add_to_region'])) { $row_box = $HTTP_POST_VARS['row_box']; foreach($row_box as $key => $value) { if(isset($value)||trim($value)!="") { $query_sub = " SELECT * FROM `subregion` WHERE `region` = '".$HTTP_POST_VARS['subregion']."' AND `g_unit` = '".$value."' "; if(mysql_num_rows(mysql_query($query_sub))==0) { $query_sub = " INSERT INTO `subregion` ( `region`,

132

`g_unit` ) VALUES ( '".$HTTP_POST_VARS['subregion']."', '".$value."' ) "; if(mysql_query($query_sub)) { $find_query = " SELECT * FROM `g_unit` WHERE `unit_no` = '".$value."'"; $data_found = mysql_fetch_array(mysql_query($find_query)); $success[$value] = $data_found['name']; } else $success[$value] = ""; } } } if(count($success)!=count($row_box)) $message_query_sub = "There had been problems with adding geographical units to regions. "; else $message_query_gu = ""; if(count($success)>0) { $find_query = " SELECT * FROM `region` WHERE `region_no` = '".$HTTP_POST_VARS['subregion']."'"; $data_found = mysql_fetch_array(mysql_query($find_query)); $message_query_gu .= "The following geographical units had been successfully added to ".$data_found['name'].": "; foreach($success as $key => $value) { if($value) $message_query_gu .= $value."; "; } } else $message_query_gu .= "No geographical units had been add to the region."; } // Process Connect With query if(isset($HTTP_POST_VARS['connect_with'])) { $row_box = $HTTP_POST_VARS['row_box']; foreach($row_box as $key => $value) { if($HTTP_POST_VARS['adjacency']==$value) $message_query_sub = "Unit connected to itself by default. "; else if(isset($value)||trim($value)!="") { $query_sub = " INSERT INTO `adjacency` ( `g_unit1`, `g_unit2` ) VALUES ( '".$HTTP_POST_VARS['adjacency']."', '".$value."' ) "; if(mysql_query($query_sub)) $success[$value] = true; $query_sub = " INSERT INTO `adjacency` ( `g_unit1`, `g_unit2` ) VALUES ( '".$value."', '".$HTTP_POST_VARS['adjacency']."' ) "; if(mysql_query($query_sub)) $success[$value] &= true; } } $result = mysql_query(" SELECT * FROM `g_unit` WHERE `unit_no` = '".$HTTP_POST_VARS['adjacency']."'"); $adjacency = new GeographicalUnit(mysql_fetch_array($result)); $name = $adjacency->name; if(count($success)!=count($row_box)) $message_query_sub = "There had been problems with connecting geographical units to ".$name."."; else $message_query_gu = ""; if(count($success)>0) { $message_query_gu .= "The following geographical units had been successfully connected to ".$name.": "; foreach($success as $key => $value) { $result = mysql_query(" SELECT * FROM `g_unit` WHERE `unit_no` = '".$key."'"); $adjacency = new GeographicalUnit(mysql_fetch_array($result)); $name = $adjacency->name; if($value) $message_query_gu .= $name."; "; } } else $message_query_gu .= "No geographical units had been add to the region."; } // Process Delete Adjacency query if(isset($HTTP_POST_VARS['delete_adjacency_submit'])) { $subadj = $HTTP_POST_VARS['subadj']; $unit_no = $HTTP_POST_VARS['unit_no']; foreach($subadj as $key => $value) { if(isset($value)||trim($value)!="") { $query_sub = " DELETE FROM `adjacency` WHERE `g_unit1` = '$unit_no' AND `g_unit2` = '$value' LIMIT 1 "; if(mysql_query($query_sub)) $success[$value] = true; $query_sub = " DELETE FROM `adjacency` WHERE `g_unit1` = '$value' AND `g_unit2` = '$unit_no' LIMIT 1 "; if(mysql_query($query_sub)) $success[$value] &= true; } } $result = mysql_query(" SELECT * FROM `g_unit` WHERE `unit_no` = '".$unit_no."'"); $adjacency = new GeographicalUnit(mysql_fetch_array($result)); $name_orig = $adjacency->name; if(count($success)!=count($subadj)) $message_query_gu = "There had been problems with deletion. "; else $message_query_gu = ""; if(count($success)>0) { $message_query_gu .= "The following geographical units had been successfully disconnected from ".$name_orig.": "; foreach($success as $key => $value) { $result = mysql_query(" SELECT * FROM `g_unit` WHERE `unit_no` = '".$key."'"); $adjacency = new GeographicalUnit(mysql_fetch_array($result)); $name = $adjacency->name; if($value) $message_query_gu .= $name."; "; } } else $message_query_gu .= "No geographical units had been disconnected from ".$name_orig."."; } // Process Select query $query_gu = " SELECT * FROM `g_unit`"; $query_gu .= " WHERE 1"; require("../script/process_query.php"); $total_gu = mysql_num_rows(mysql_query($query_gu)); // Get the total number of entries regardless of entries per page ?> <!-- Process Regions queries --> <? // Process Add query if(isset($HTTP_POST_VARS['add_reg_submit'])) { if(!isset($HTTP_POST_VARS['add_code'])||trim($HTTP_POST_VARS['add_code'])=="") $add_message_reg = "Please enter a region code."; else { $find_query = " SELECT * FROM `region` WHERE `name` = '".$HTTP_POST_VARS['add_name']."'"; $found = mysql_num_rows(mysql_query($find_query)); if($found>0) $add_message_reg = "Region already exists."; else { $query_reg = " INSERT INTO `region` ( `region_no`, `code`, `name`, `description`, `contributor` ) VALUES ( '', '".$HTTP_POST_VARS['add_code']."', '".$HTTP_POST_VARS['add_name']."', '".$HTTP_POST_VARS['add_desc']."', '".$user->username."' ) "; if($result = mysql_query($query_reg)) $add_message_reg = "New region added."; else $add_message_reg = "Failed to add region."; } } } // Process Delete query if(isset($HTTP_POST_VARS['delete_reg_submit'])&&isset($HTTP_POST_VARS['row_box2'])) { $row_box2 = $HTTP_POST_VARS['row_box2']; foreach($row_box2 as $key => $value) { if(isset($value)||trim($value)!="") { $find_query = " SELECT * FROM `region` WHERE `region_no` = '".$value."'"; $data_found = mysql_fetch_array(mysql_query($find_query)); $query_reg = " DELETE FROM `region` WHERE `region_no` = '$value' LIMIT 1 "; if(mysql_query($query_reg)) $success[$value] = $data_found['name']; else $success[$value] = ""; } } if(count($success)!=count($row_box2)) $message_query_reg = "There had been problems with deletion. "; else $message_query_reg = ""; if(count($success)>0) { $message_query_reg .= "The following regions had been successfully deleted: "; foreach($success as $key => $value) { if($value) $message_query_reg .= $value."; "; } } else $message_query_reg .= "No regions had been deleted."; } // Process Edit query if(isset($HTTP_POST_VARS['update_reg_submit'])) { $update_reg_submit = $HTTP_POST_VARS['update_reg_submit']; // Gets the last (or only) key as the entry foreach($update_reg_submit as $key => $value) $region_updated = $key; if( !isset($HTTP_POST_VARS['new_code'][$region_updated])|| trim($HTTP_POST_VARS['new_code'][$region_updated])=="" ) $message_query_reg = "Please enter a region code."; else { $query_reg = " UPDATE `region` SET "; if(isset($HTTP_POST_VARS['new_code'][$region_updated])) $query_reg .= " `code` = '".$HTTP_POST_VARS['new_code'][$region_updated]."'"; if(isset($HTTP_POST_VARS['new_name'][$region_updated])) $query_reg .= ", `name` = '".$HTTP_POST_VARS['new_name'][$region_updated]."'"; if(isset($HTTP_POST_VARS['new_desc'][$region_updated])) $query_reg .= ", `description` = '".$HTTP_POST_VARS['new_desc'][$region_updated]."'"; if(isset($HTTP_POST_VARS['new_contributor'][$region_updated])) $query_reg .= ", `contributor` = '".$HTTP_POST_VARS['new_contributor'][$region_updated]."'"; $query_reg .= " WHERE `region_no` = '".$region_updated."'"; if(mysql_query($query_reg)) $message_query_reg = "Region update successful."; else $message_query_reg = "Region update unsuccessful."; } } // Process Delete Subregions query if(isset($HTTP_POST_VARS['delete_subreg_submit'])) { $subreg = $HTTP_POST_VARS['subreg']; $region_no = $HTTP_POST_VARS['region_no']; foreach($subreg as $key => $value) { if(isset($value)||trim($value)!="") { $query_sub = " DELETE FROM `subregion` WHERE `g_unit` = '$value' AND `region` = '$region_no' LIMIT 1 "; if(mysql_query($query_sub)) { $find_query = " SELECT * FROM `g_unit` WHERE `unit_no` = '".$value."'"; $data_found =

133

mysql_fetch_array(mysql_query($find_query)); $success[$value] = $data_found['name']; } else $success[$value] = ""; } } if(count($success)!=count($subreg)) $message_query_reg = "There had been problems with deletion. "; else $message_query_reg = ""; if(count($success)>0) { $find_query = " SELECT * FROM `region` WHERE `region_no` = '".$region_no."'"; $data_found = mysql_fetch_array(mysql_query($find_query)); $message_query_reg .= "The following geographical units had been successfully deleted from ".$data_found['name'].": "; foreach($success as $key => $value) { if($value) $message_query_reg .= $value."; "; } } else $message_query_reg .= "No geographical units had been deleted from its region."; } // Process Select query $query_reg = " SELECT * FROM `region`"; $query_reg .= " WHERE 1"; require("../script/process_query.php"); $total_reg = mysql_num_rows(mysql_query($query_reg)); // Get the total number of entries regardless of entries per page ?> <!-- Message table: Geographical Units --> <div style="color:#CE2029;"> <b><? echo($message_query_gu); ?></b> </div> <!-- Contents: Geographical Units --> <div id="masterdiv"> <p> <? if(trim($nav>search_str_gie_gu)==""){ ?> <font size="+1"><b><a onclick="toggle_visibility('gutable');" style="cursor: hand;">Geographical Units Table</a></b></font> <input type="button" class="buttonClass" onclick="SwitchMenu('subSearch')" name="search_show" value="Search Panel"> <? } else { ?> <input type="button" class="buttonClass" onclick="SwitchMenu('subSearch')" name="search_show" value="Search Panel" style="background-color: #DADADA;">&nbsp;<u>with results</u> <? } ?> <input type="button" class="buttonClass" onclick=" var parameters = 'gu='; var i = 0; <? $result = mysql_query($query_gu); while($data = mysql_fetch_array($result)) { $current = new GeographicalUnit($data); $i++; ?> if(row_box<?echo($current->unit_no);?>.checked) { parameters += '<?echo($current->unit_no);?>|'; i++; } <? } ?> else if(i<2) alert('You must select at least two Geographical Units.'); else popUp('matrix.php?'+parameters); " name="matrix_button" value="Edit Traffic Matrix" style="background-color: #DADADA;"> <input type="button" class="buttonClass" onclick="SwitchMenu('subAdd')" name="add_show" value="Add New Geographical Unit"> </p> <div id="gutable"> <table border="0" cellspacing="1" cellpadding="1"> <tr> <td width="70%" valign="top"> <!-- Geographical Units table --> <div id="table"> <form method="POST" action=""> <TABLE id="t1" class="content table-autosort table-autofilter tableautopage:<? if($nav->entries_per_page_gie>0) echo($nav->entries_per_page_gie); else echo("5"); ?> table-pagenumber:t1page table-page-count:t1pages table-filtered-rowcount:t1filtercount table-rowcount:t1allcount" cellpadding="3"> <THEAD> <tr> <td colspan=7> <? if($total_gu>1) {?> There are <? echo($total_gu) ?> entries in this table. <? } else if($total_gu>0) { ?> There is only one entry in this table. <? } else { ?> There are no entries in this table. <? } ?> </td> </tr> <tr bgcolor='#DADADA'> <th align=center> <input type="checkbox" name="row" onClick=" if(this.checked) { <? if($result = mysql_query($query_gu)) { $i = 0; while($data = mysql_fetch_array($result)) { $current = new GeographicalUnit($data); ?> row<?echo($current>unit_no);?>.style.background='<? echo($highlight); ?>' row_box<?echo($current->unit_no);?>.checked = true; <? $i++; } } ?> } else { <? if($result = mysql_query($query_gu)) { $i = 0; while($data = mysql_fetch_array($result)) { $current = new GeographicalUnit($data); ?> row<?echo($current->unit_no);?>.style.background='<? echo($bgcolor[fmod($i,2)]); ?>' row_box<?echo($current>unit_no);?>.checked = false; <? $i++; } } ?> } " > </td> <th class="tablesortable:default table-sortable" title="Click to sort"><b>Geographical Unit*</b></th> <th class=""><b>Description</b></th> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Contributor</b></th> <th class="tablesortable:numeric table-sortable" title="Click to sort"><b>Population</b></th> <th class="table-sortable:numeric table-sortable" title="Click to sort"><b>Density (per km²)</b></th> <th class="table-sortable:numeric table-sortable" title="Click to sort"><b>Area</b> (in km²) </th> </tr> </THEAD> <script type="text/javascript"> var rowIDs = Array(); var names = Array(); var descriptions = Array(); var contributors = Array(); </script> <? if($result = mysql_query($query_gu)) { $i = 0; if($total_gu==0) { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } while($data = mysql_fetch_array($result)) { $current = new GeographicalUnit($data); ?> <script type="text/javascript"> rowIDs[<? echo($i); ?>] = "row<? echo($current->unit_no); ?>"; names[<? echo($i); ?>] = "<? echo($current->name); ?>"; descriptions[<? echo($i); ?>] = "<? echo(trim($current->desc)); ?>"; contributors[<? echo($i); ?>] = "<? echo($current->contributor); ?>"; </script> <tr id="row<? echo($current->unit_no); ?>" bgcolor='<? echo($bgcolor[fmod($i,2)]); ?>' valign="top"> <td align="center"> <!-- id is for javascript purposes, name for php purposes --> <input type="checkbox" id="row_box<?echo($current->unit_no);?>" name="row_box[<?echo($current->unit_no);?>]" value="<? echo($current->unit_no); ?>" onClick=" if(this.checked) { row<?echo($current->unit_no);?>.style.background='<? echo($highlight); ?>' } else { row<?echo($current>unit_no);?>.style.background='<? echo($bgcolor[fmod($i,2)]); ?>' } " > </td> <a name="gu<? echo($current>unit_no); ?>"> <td> <u><a onclick="SwitchMenu('sub<? echo($current->unit_no); ?>')" style="cursor: hand;"><? echo($current->name); ?></a></u><br><br> <i>Map Code: <? echo($current->unit_no); ?></i> </td> <td> <div id="desc<? echo($current->unit_no); ?>_a" style="display: block"> <? echo(substr($current->desc,0,100)); ?> <? if(strlen($current->desc)>100) { ?> ... <a href="#gu<? echo($current->unit_no); ?>" onclick="toggle_visibility('desc<? echo($current->unit_no); ?>_a'); toggle_visibility('desc<? echo($current->unit_no); ?>_b');">show</a> <? } ?> </div> <div id="desc<? echo($current->unit_no); ?>_b" style="display: none"> <? echo($current->desc); ?> <a href="#gu<? echo($current->unit_no); ?>" onclick="toggle_visibility('desc<? echo($current->unit_no); ?>_a'); toggle_visibility('desc<? echo($current->unit_no); ?>_b');">hide</a> </div> <hr /> <? if(mysql_num_rows(mysql_query(" SELECT `g_unit2` FROM `adjacency` WHERE `g_unit1` = '".$current->unit_no."'"))>0) { ?> <table><tr> <td>[</td> <td align="center" width="45%"> <a onclick="SwitchMenu('subadjacency<? echo($current->unit_no); ?>')" style="cursor: hand;" value =""/>View Adjacent Units</a> </td> <td>]</td> <td>[</td> <td align="center" width="45%"> <a onclick=" row<? echo($current->unit_no); ?>.style.background='<? echo($highlight); ?>' row_box<? echo($current->unit_no); ?>.checked = true; <? $query_sub = " SELECT `g_unit2` FROM `adjacency` WHERE `g_unit1` = '".$current->unit_no."'"; $result_sub = mysql_query($query_sub); while($data_sub = mysql_fetch_array($result_sub)) { ?> row<? echo($data_sub['g_unit2']); ?>.style.background='<? echo($highlight); ?>' row_box<? echo($data_sub['g_unit2']); ?>.checked = true; <? } ?> " style="cursor: hand;">Select this and adjacent units</a> </td> <td>]</td> </tr></table> <? } else {?> No units adjacent. <? } ?> </td> <td align="center"><? echo($current->contributor); ?></td> <td align="right"><? echo(number_format($current->population)); ?></td> <td align="right"><? echo(round($current>population/$current->area)); ?></td> <td align="right"><? echo(number_format($current->area)); ?></td> </tr> <? $i++; } } else { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center>

134

</td> </tr> <? } ?> <!-- Pages --> <TFOOT> <TR> <TD class="table-page:previous" style="cursor:pointer;">&lt;Previous</TD> <TD style="text-align:center;">Page <SPAN id="t1page" style="color:black">1</SPAN>&nbsp;of&nbsp; <? if($nav->entries_per_page_gie>0) echo(ceil($i/$nav->entries_per_page_gie)); else echo(ceil($i/5)); ?></TD> <TD class="table-page:next" style="cursor:pointer;">Next&gt;</TD> <td colspan=4 ><p><b>*Map codes are automatically assigned.<b></p></td> </TR> </TFOOT> </table> <!-- --> <!-- Remarks --> <!-- --> <table> <td><input type="submit" class="buttonClass" name="delete_gu_submit" value="Delete"></td> <td>&nbsp;</td> <td>&nbsp;</td> <td> <table bgcolor="#EEEEEE" bordercolor="#DDDDDD" width="100%"> <tr> <td align="center"><input type="submit" class="buttonClass" name="connect_with" value="Connect with"><td> <td align=""><select name="adjacency"> <? $result = mysql_query(" SELECT * FROM `g_unit` WHERE 1"); while($data = mysql_fetch_array($result)) { $current = new GeographicalUnit($data); ?> <option value="<? echo($current->unit_no); ?>"><? echo($current->name); ?></option> <? } ?> </select></td> </tr> </table> </td> <td>&nbsp;</td> <td>&nbsp;</td> <td> <table bgcolor="#EEEEEE" bordercolor="#DDDDDD" width="100%"> <tr> <td align="center"><input type="submit" class="buttonClass" name="add_to_region" value="Add to Region"><td> <td align=""><select name="subregion"> <? $result = mysql_query(" SELECT * FROM `region` WHERE 1"); while($data = mysql_fetch_array($result)) { $current = new Region($data); ?> <option value="<? echo($current>region_no); ?>"><? echo($current->code); ?></option> <? } ?> </select></td> </tr> </table> </td> </table> </form> </div> </td> <td width="30%" valign="top"> <div id="panel"> <font color="#CE2029"> <b><? echo($add_message_gu);?></b> </font> <? $result = mysql_query($query_gu); while($data = mysql_fetch_array($result)) { $current = new GeographicalUnit($data); ?> <!-- Edit GIU Pane --> <span class="submenu" id="sub<? echo($current>unit_no); ?>"> <form method="POST" action=""> <table> <tr> <td colspan="2" valign="top"><b>Edit Geographical Unit</b></td> </tr> <tr> <td width="115" valign="top"></td> </tr> <tr> <td valign="top">&nbsp;</td> <td valign="top">&nbsp;</td> </tr> <tr> <td valign="top">Geographical Unit Name</td> <td width="168" valign="top"><input name="new_name[<? echo($current->unit_no);?>]" type="text" class="textFieldClass" value="<? echo($current->name);?>" size="25" /></td> </tr> <tr> <td valign="top">Description</td> <td valign="top">&nbsp;</td> </tr> <tr> <td colspan="2" valign="top"><textarea name="new_desc[<? echo($current->unit_no);?>]" cols="50" rows="10" class="textFieldClass"><? echo($current>desc);?></textarea></td> </tr> <tr> <td valign="top">Contributor</td> <td valign="top"><input name="new_contributor[<? echo($current->unit_no);?>]" type="text" disabled="disabled" class="textFieldClass"" value="<? echo($current->contributor);?>" size="25" /></td> </tr> <tr> <td valign="top">Population</td> <td valign="top"><input name="new_population[<? echo($current->unit_no);?>]" type="text" class="textFieldClass" value="<? echo($current->population);?>" size="10" style="text-align:right" /></td> </tr> <tr> <td valign="top">Area (in km²)</td> <td valign="top"><input name="new_area[<? echo($current->unit_no);?>]" type="text" class="textFieldClass" value="<? echo($current->area);?>" size="10" style="text-align:right"/></td> </tr> <tr> <td valign="top">&nbsp;</td> </tr> <tr align="left"> <td colspan="2" valign="top"><input type="submit" class="buttonClass" value="Update" name="update_gu_submit[<? echo($current->unit_no);?>]" /> <input type="reset" class="buttonClass" value="Reset" name="update_gu_reset[<? echo($current->unit_no);?>]" /></td> </tr> </table> </form> </span> <!-- --> <? } ?> <!-- --> <!-- Add Geographical Unit Pane --> <span class="submenu" id="subAdd"> <form method="POST" action=""> <? $repeat = false; if(trim($add_message_gu)!=""&&trim($add_message_gu)!="New geographical unit added.") $repeat = true; ?> <table> <tr> <td colspan="2" valign="top"><b>Add New Geographical Unit</b></td></tr> <tr><td colspan="2" valign="top">&nbsp;</td></tr> <tr> <td width="115" valign="top">Geographical Unit Name</td> <td width="168" valign="top"><input name="add_name" type="text" class="textFieldClass" id="add_name" size="25" value="<? if($repeat) echo($HTTP_POST_VARS['add_name']); ?>" /></td> </tr> <tr> <td valign="top">Description</td> <td valign="top">&nbsp;</td> </tr> <tr> <td colspan="2" valign="top"><textarea name="add_desc" cols="50" rows="10" class="textFieldClass" id="add_desc"><? if($repeat) echo($HTTP_POST_VARS['add_desc']); ?></textarea></td> </tr> <tr> <td valign="top">Contributor</td> <td valign="top"><input name="add_contributor" type="text" disabled="disabled" class="textFieldClass" id="add_contributor" value="<? echo($user->username); ?>" size="25" /></td> </tr> <tr> <td valign="top">Population</td> <td valign="top"><input name="add_population" type="text" class="textFieldClass" style="textalign:right" id="add_population" size="10" value="<? if($repeat) echo($HTTP_POST_VARS['add_population']); ?>" /></td> </tr> <tr> <td valign="top">Area (in km²) </td> <td valign="top"><input name="add_area" type="text" class="textFieldClass" style="text-align:right" id="add_area" size="10" value="<? if($repeat) echo($HTTP_POST_VARS['add_area']); ?>" /></td> </tr> <tr><td colspan="2" valign="top">&nbsp;</td></tr> <tr align="left"> <td colspan="2" valign="top"> <input type="submit" class="buttonClass" value="Add" name="add_gu_submit"> <input type="reset" class="buttonClass" value="Reset" name="add_gu_reset"> </td> </tr> </table> </form> </span> <!-- --> <!-- Search Geographical Unit Pane --> <span class="submenu" id="subSearch"> <form method="POST" action="../script/process_navigation.php"> <input type="hidden" name="src" value="gie"/> <table> <tr><td colspan="3"><b>Search Geographical Unit</b></td></tr> <tr> <td colspan="2" align="right"> <input type="button" value="Clear Filters" class="buttonClass" style="background-color: #DADADA;" onclick="filterTable('',names,rowIDs);" /> Enable Filter? </td> <td><input type="checkbox" id="enable_filter" checked></td> </tr> <tr> <td width="115">Geographical Unit Name</td> <td width="168"> <input name="name_search" id="name_search" type="text" class="textFieldClass" size="25" value="<? echo($name_search_entry); ?>" onclick = "document.getElementById('name_filter').checked = true;"; onkeypress = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('name_search').value,names,rowIDs);" onBlur = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('name_search').value,names,rowIDs);"/> </td> <td><input type="radio" name="filter" id="name_filter" value="name"></td> </tr> <tr> <td>Description</td> <td> <input name="desc_search" id="desc_search" type="text" class="textFieldClass" size="25" value="<? echo($desc_search_entry); ?>" onclick = "document.getElementById('desc_filter').checked = true;"; onkeypress = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('desc_search').value,descriptions,rowIDs);" onBlur = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('desc_search').value,descriptions,rowIDs);" /> </td> <td><input type="radio" name="filter" id="desc_filter" value="description"></td> </tr> <tr> <td>Contributor</td> <td> <input

135

name="contributor_search" id="contributor_search" type="text" class="textFieldClass" size="25" value="<? echo($contributor_search_entry); ?>" onclick = "document.getElementById('contributor_filter').checked = true;"; onkeypress = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('contributor_search').value,contributors,rowIDs);" onBlur = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('contributor_search').value,contributors,rowIDs);" /> </td> <td><input type="radio" name="filter" id="contributor_filter" value="contributor"></td> </tr> <tr><td colspan="3">Population (range)</td></tr> <td colspan="3" align="center"><table width="00" border="0" cellspacing="1" cellpadding="1"> <tr> <td align="center"> <select name="population_lowercond"> <option value="more" <? if($population_lowerlimit_cond=="more") echo("selected");?>>More than</option> <option value="more_equal" <? if($population_lowerlimit_cond=="more_equal") echo("selected");?>>More than or equal to</option> <option value="none" <? if($population_lowerlimit_cond=="none") echo("selected");?>>-</option> </select> </td> <td align="left"><input name="population_lowerlimit" type="text" size="10" style="text-align:right" value="<? echo($population_lowerlimit_search); ?>"/></td> </tr> <tr> <td align="center"> <select name="population_uppercond"> <option value="less" <? if($population_upperlimit_cond=="less") echo("selected");?>>Less than</option> <option value="less_equal" <? if($population_upperlimit_cond=="less_equal") echo("selected");?>>Less than or equal to</option> <option value="none" <? if($population_upperlimit_cond=="none") echo("selected");?>>-</option> </select> </td> <td align="left"><input name="population_upperlimit" type="text" size="10" style="text-align:right" value="<? echo($population_upperlimit_search); ?>"/></td> </tr> </table></td> </tr> <tr><td colspan="3">Population Density (range, person per km²)</td></tr> <td colspan="3" align="center"><table width="00" border="0" cellspacing="1" cellpadding="1"> <tr> <td align="center"> <select name="density_lowercond"> <option value="more" <? if($density_lowerlimit_cond=="more") echo("selected");?>>More than</option> <option value="more_equal" <? if($density_lowerlimit_cond=="more_equal") echo("selected");?>>More than or equal to</option> <option value="none" <? if($density_lowerlimit_cond=="none") echo("selected");?>>-</option> </select> </td> <td align="left"><input name="density_lowerlimit" type="text" size="10" style="text-align:right" value="<? echo($density_lowerlimit_search); ?>"/></td> </tr> <tr> <td align="center"> <select name="density_uppercond"> <option value="less" <? if($density_upperlimit_cond=="less") echo("selected");?>>Less than</option> <option value="less_equal" <? if($density_upperlimit_cond=="less_equal") echo("selected");?>>Less than or equal to</option> <option value="none" <? if($density_upperlimit_cond=="none") echo("selected");?>>-</option> </select> </td> <td align="left"><input name="density_upperlimit" type="text" size="10" style="text-align:right" value="<? echo($density_upperlimit_search); ?>"/></td> </tr> </table></td> </tr> <tr><td colspan="3">Area (range, in km²)</td></tr> <tr> <td colspan="3" align="center"><table width="00" border="0" cellspacing="1" cellpadding="1"> <tr> <td align="center"> <select name="area_lowercond"> <option value="more" <? if($area_lowerlimit_cond=="more") echo("selected");?>>More than</option> <option value="more_equal" <? if($area_lowerlimit_cond=="more_equal") echo("selected");?>>More than or equal to</option> <option value="none <? if($area_lowerlimit_cond=="none") echo("selected");?>">-</option> </select> </td> <td align="left"><input name="area_lowerlimit" type="text" size="10" style="text-align:right" value="<? echo($area_lowerlimit_search); ?>"/></td> </tr> <tr> <td align="center"> <select name="area_uppercond"> <option value="less" <? if($area_upperlimit_cond=="less") echo("selected");?>>Less than</option> <option value="less_equal" <? if($area_upperlimit_cond=="less_equal") echo("selected");?>>Less than or equal to</option> <option value="none" <? if($area_upperlimit_cond=="none") echo("selected");?>>-</option> </select> </td> <td align="left"><input name="area_upperlimit" type="text" size="10" style="text-align:right" value="<? echo($area_upperlimit_search); ?>"/></td> </tr> </table></td> </tr> <tr><td colspan="3">&nbsp;</td></tr> <tr align="left"> <td colspan="3"> <input type="submit" class="buttonClass" value="Search" name="search_gu_submit" /> <input type="reset" class="buttonClass" value="Reset Entries" name="search_gu_reset2" /> <input type="submit" class="buttonClass" value="Reset Parameters" name="search_gu_reset" style="background-color: #DADADA;"/> </td> </tr> </table> </form> </span> </div> <!-- View Adjacency Pane --> <? $result = mysql_query($query_gu); while($data = mysql_fetch_array($result)) { $current = new GeographicalUnit($data); ?> <span class="submenu" id="subadjacency<? echo($current->unit_no); ?>"> <form method="POST" action="#"> <input type="hidden" name="src" value="gie"/> <table> <tr><td colspan="2"><b>Geographical Units connected to <? echo($current->name); ?></b></td></tr> <tr><td colspan="2">&nbsp;</td></tr> <tr><td colspan="2"> <table> <? $query_sub = " SELECT `g_unit2` FROM `adjacency` WHERE `g_unit1` = '".$current->unit_no."'"; if($result_sub = mysql_query($query_sub)) { while($data_sub = mysql_fetch_array($result_sub)) { $name = mysql_fetch_array(mysql_query(" SELECT `name` FROM `g_unit` WHERE `unit_no` = ".$data_sub['g_unit2'])); ?> <tr> <td valign="top"><input type="checkbox" name="subadj[<? echo($panel); ?>]" value="<? echo($data_sub['g_unit2']); ?>" /></td> <td valign="top"><? echo($name['name']); ?></td> </tr> <? } } else echo("None."); ?> </table> </td></tr> <tr><td colspan="2">&nbsp;</td></tr> <tr align="left"> <td colspan="2" > <input type='hidden' value="<? echo($current->unit_no); ?>" name="unit_no"> <input type="submit" class="buttonClass" value="Delete" name="delete_adjacency_submit" /> <input type="reset" class="buttonClass" value="Reset" name="delete_adjacency_reset" /> </td> </tr> </table> </form> </span> </div> <? } ?> </td> </tr> </table> <br><br><br> </div> <!-- for gutable --> </div> <!-- for masterdiv --> <!-- Show panel --> <? if($repeat) { ?> <script type="text/javascript">eval("SwitchMenu('subAdd')");</script> <? } else { ?> <script type="text/javascript">eval("SwitchMenu('subSearch')");</script> <? } ?> <!-- Message table: Regions --> <div style="color:#CE2029;"> <b><? echo($message_query_reg); ?></b> </div> <!-- Contents: Regions --> <div id="masterdiv2"> <p> <font size="+1"><b><a onclick="toggle_visibility('regtable');" style="cursor: hand;">Regions Table</a></b></font> <? if(trim($nav->search_str_gie_reg)==""){ ?> <input type="button" class="buttonClass" onclick="SwitchMenu2('sub2Search')" name="search_show" value="Search Panel"> <? } else { ?> <input type="button" class="buttonClass" onclick="SwitchMenu2('sub2Search')" name="search_show" value="Search Panel" style="background-color: #DADADA;">&nbsp;<u>with results</u> <? } ?> <input type="button" class="buttonClass" onclick="SwitchMenu2('sub2Add')" name="add_show" value="Add New Region"> </p> <div id="regtable"> <table border="0" cellspacing="1" cellpadding="1"> <tr> <td width="70%" valign="top"> <!-- Regions table --> <div id="table"> <form method="POST" action=""> <TABLE id="t1" class="content table-autosort table-autofilter table-autopage:<? if($nav->entries_per_page_gie==0) echo("5");

136

else echo($nav->entries_per_page_gie) ?> table-page-number:t1page table-page-count:t1pages table-filteredrowcount:t1filtercount table-rowcount:t1allcount" cellpadding="3"> <THEAD> <tr> <td colspan=7> <? if($total_reg>1) {?> There are <? echo($total_reg) ?> entries in this table. <? } else if($total_reg>0) { ?> There is only one entry in this table. <? } else { ?> There are no entries in this table. <? } ?> </td> </tr> <tr bgcolor='#DADADA'> <th align=center> <input type="checkbox" name="row" onClick=" if(this.checked) { <? for($i=0;$i<$total_reg;$i++) { ?> row_<?echo($i);?>.style.background='<? echo($highlight); ?>' row_box_<?echo($i);?>.checked = true; <? } ?> } else { <? for($i=0;$i<$total_reg;$i++) { ?> row_<?echo($i);?>.style.background='<? echo($bgcolor[fmod($i,2)]); ?>' row_box_<?echo($i);?>.checked = false; <? } ?> } " > </td> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Region Code</b></th> <th class="table-sortable:default table-sortable" title="Click to sort"><b>Region Name</b></th> <th class=""><b>Description</b></th> <th class=""><b>Geographical Units</b></th> <th class="table-filterable tablesortable:default table-sortable" title="Click to sort"><b>Contributor</b></th> </td> </tr> </THEAD> <script type="text/javascript"> var rowIDs2 = Array(); var codes2 = Array(); var names2 = Array(); var descriptions2 = Array(); var contributors2 = Array(); </script> <? if($result = mysql_query($query_reg)) { $i = 0; if($total_reg==0) { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } while($data = mysql_fetch_array($result)) { $current = new Region($data); ?> <script type="text/javascript"> rowIDs2[<? echo($i); ?>] = "row_<? echo($i); ?>"; codes2[<? echo($i); ?>] = "<? echo($current->code); ?>"; names2[<? echo($i); ?>] = "<? echo($current->name); ?>"; descriptions2[<? echo($i); ?>] = "<? echo(trim($current->desc)); ?>"; contributors2[<? echo($i); ?>] = "<? echo($current->contributor); ?>"; </script> <tr id="row_<? echo($i); ?>" bgcolor='<? echo($bgcolor[fmod($i,2)]); ?>' valign="top"> <td align="center"> <!-- id is for javascript purposes, name for php purposes --> <input type="checkbox" id="row_box_<?echo($i);?>" name="row_box2[<?echo($i);?>]" value="<? echo($current>region_no); ?>" onClick=" if(this.checked) { row_<?echo($i);?>.style.background='<? echo($highlight); ?>' } else { row_<?echo($i);?>.style.background='<? echo($bgcolor[fmod($i,2)]); ?>' } " > </td> <a name="reg<? echo($current->unit_no); ?>"> <td><u><a onclick="SwitchMenu2('sub2_<? echo($i); ?>')" style="cursor: hand;"><? echo($current->code); ?></a></u></td> <td><? echo($current->name); ?></td> <td> <div id="reg_desc<? echo($current->region_no); ?>_a" style="display: block"> <? echo(substr($current->desc,0,100)); ?> <? if(strlen($current>desc)>100) { ?> ... <a href="#reg<? echo($current->unit_no); ?>" onclick="toggle_visibility('reg_desc<? echo($current>region_no); ?>_a'); toggle_visibility('reg_desc<? echo($current->region_no); ?>_b');">show</a> <? } ?> </div> <div id="reg_desc<? echo($current->region_no); ?>_b" style="display: none"> <? echo($current->desc); ?> <a href="#reg<? echo($current->unit_no); ?>" onclick="toggle_visibility('reg_desc<? echo($current->region_no); ?>_a'); toggle_visibility('reg_desc<? echo($current->region_no); ?>_b');">hide</a> </div> <hr> <table> <? $regional_population = 0; $regional_density = 0; $regional_area = 0; $query_sub = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$current->region_no."'"; if($result_sub = mysql_query($query_sub)) { while($data_sub = mysql_fetch_array($result_sub)) { $g_unit = mysql_fetch_array(mysql_query(" SELECT `population`, `area` FROM `g_unit` WHERE `unit_no` = ".$data_sub['g_unit'])); $regional_population += intval($g_unit['population']); $regional_area += intval($g_unit['area']); } if($regional_area!=0) $regional_density = $regional_population/$regional_area; } ?> <tr> <td>Population</td><td>&nbsp;</td> <td><u><? echo(number_format($regional_population)); ?></u></td> </tr> <tr> <td>Population Density (per km²)</td><td>&nbsp;</td> <td><u><? echo(number_format($regional_density)); ?></u></td> </tr> <tr> <td>Area (in km²)</td><td>&nbsp;</td> <td><u><? echo(number_format($regional_area)); ?></u></td> </tr> </table> </td> <td align="center"> <? if(mysql_num_rows(mysql_query(" SELECT `g_unit` FROM `subregion` WHERE `region` = '".$current->region_no."'"))>0) { ?> <a onclick="SwitchMenu2('subregion<? echo($i); ?>')" style="cursor: hand;">[ <u>View</u> ]</a><br><br> <a onclick=" <? $query_sub = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$current->region_no."'"; $result_sub = mysql_query($query_sub); while($data_sub = mysql_fetch_array($result_sub)) { ?> row<? echo($data_sub['g_unit']); ?>.style.background='<? echo($highlight); ?>' row_box<? echo($data_sub['g_unit']); ?>.checked = true; <? } ?> " style="cursor: hand;">Select GUs in GU Table</a><br><br> <? } else {?> No units yet. <? } ?> </td> <td align="center"><? echo($current>contributor); ?></td> </tr> <? $i++; } } else { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } ?> <!-- Pages --> <TFOOT> <TR> <TD class="table-page:previous" style="cursor:pointer;">&lt;Previous</TD> <TD style="text-align:center;">Page <SPAN id="t1page" style="color:black">1</SPAN>&nbsp;of&nbsp; <? if($nav->entries_per_page_gie>0) echo(ceil($i/$nav->entries_per_page_gie)); else echo(ceil($i/5)); ?></TD> <TD class="table-page:next" style="cursor:pointer;">Next&gt;</TD> </TR> </TFOOT> </table> <!-- --> <br /> <input type="submit" class="buttonClass" name="delete_reg_submit" value="Delete"> </form> <br /> </div> </td> <td width="30%" valign="top"> <div id="panel"> <!-- Message --> <font color="#CE2029"> <b><? echo($add_message_reg);?></b> </font> <? $panel = 0; $result = mysql_query($query_reg); while($data = mysql_fetch_array($result)) { $current = new Region($data); ?> <!-- Edit Region Pane --> <span class="submenu" id="sub2_<? echo($panel); ?>"> <form method="POST" action=""> <table> <tr> <td colspan="2" valign="top"><b>Edit Region</b></td> </tr> <tr> <td width="115" valign="top"></td> </tr> <tr> <td valign="top">&nbsp;</td> <td valign="top">&nbsp;</td> </tr> <tr> <td valign="top">Region Code</td> <td width="168" valign="top"><input name="new_code[<? echo($current->region_no);?>]" type="text" class="textFieldClass" value="<? echo($current->code);?>" size="25" /></td> </tr> <tr> <td valign="top">Region Name</td> <td width="168" valign="top"><input name="new_name[<? echo($current->region_no);?>]" type="text" class="textFieldClass" value="<? echo($current->name);?>" size="25" /></td> </tr> <tr> <td valign="top">Description</td> <td valign="top">&nbsp;</td> </tr> <tr> <td colspan="2" valign="top"><textarea name="new_desc[<? echo($current>region_no);?>]" cols="50" rows="10" class="textFieldClass"><? echo($current->desc);?></textarea></td> </tr> <tr> <td valign="top">Contributor</td> <td valign="top"><input name="new_contributor[<? echo($current->region_no);?>]" type="text" disabled="disabled" class="textFieldClass"" value="<? echo($current->contributor);?>" size="25" /></td> </tr> <tr> <td valign="top">&nbsp;</td> </tr> <tr align="left"> <td colspan="2" valign="top"><input type="submit" class="buttonClass" value="Update" name="update_reg_submit[<? echo($current->region_no);?>]" /> <input type="reset" class="buttonClass" value="Reset" name="update_reg_reset[<? echo($current->region_no);?>]" /></td> </tr> </table>

137

</form> </span> <!-- --> <? $panel++; } ?> <!-- --> <!-- Add Region Pane --> <span class="submenu" id="sub2Add"> <? $repeat = false; if(trim($add_message_reg)!=""&&trim($add_message_reg)!="New region added.") $repeat = true; ?> <form method="POST" action=""> <table> <tr> <td colspan="2" valign="top"><b><u>Add New Region</u></b></td></tr> <tr><td colspan="2" valign="top">&nbsp;</td></tr> <tr> <td width="115" valign="top">Region Code</td> <td width="168" valign="top"><input name="add_code" type="text" class="textFieldClass" id="add_code" size="25" value="<? if($repeat) echo($HTTP_POST_VARS['add_code']); ?>" /></td> </tr> <tr> <td width="115" valign="top">Region Name</td> <td width="168" valign="top"><input name="add_name" type="text" class="textFieldClass" id="add_name" size="25" value="<? if($repeat) echo($HTTP_POST_VARS['add_name']); ?>" /></td> </tr> <tr> <td valign="top">Description</td> <td valign="top">&nbsp;</td> </tr> <tr> <td colspan="2" valign="top"><textarea name="add_desc" cols="50" rows="10" class="textFieldClass" id="add_desc"><? if($repeat) echo($HTTP_POST_VARS['add_desc']); ?></textarea></td> </tr> <tr> <td valign="top">Contributor</td> <td valign="top"><input name="add_contributor" type="text" disabled="disabled" class="textFieldClass" id="add_contributor" value="<? echo($user->username); ?>" size="25" /></td> </tr> <tr><td colspan="2" valign="top">&nbsp;</td></tr> <tr align="left"> <td colspan="2" valign="top"> <input type="submit" class="buttonClass" value="Add" name="add_reg_submit"> <input type="reset" class="buttonClass" value="Reset" name="add_reg_reset"> </td> </tr> </table> </form> </span> <!---> <!-- Search Region Pane --> <span class="submenu" id="sub2Search"> <form method="POST" action="../script/process_navigation.php"> <input type="hidden" name="src" value="gie"/> <table> <tr><td colspan="3"><b>Search Region</b></td></tr> <tr> <td colspan="2" align="right"> <input type="button" value="Clear Filters" class="buttonClass" style="background-color: #DADADA;" onclick="filterTable('',codes2,rowIDs2);" /> Enable Filter? </td> <td><input type="checkbox" id="enable_filter2" checked></td> </tr> <tr> <td width="115">Region Code</td> <td width="168"> <input name="code_search_reg" id="code_search_reg" type="text" class="textFieldClass" size="25" value="<? echo($code_search_reg_entry); ?>" onclick = "document.getElementById('code_filter2').checked = true;"; onkeypress = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('code_search_reg').value,codes2,rowIDs2);" onBlur = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('code_search_reg').value,codes2,rowIDs2);"/> </td> <td><input type="radio" name="filter_reg" id="code_filter2" value="code"></td> </tr> <tr> <td width="115">Region Name</td> <td width="168"> <input name="name_search_reg" id="name_search_reg" type="text" class="textFieldClass" size="25" value="<? echo($name_search_reg_entry); ?>" onclick = "document.getElementById('name_filter2').checked = true;"; onkeypress = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('name_search_reg').value,names2,rowIDs2);" onBlur = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('name_search_reg').value,names2,rowIDs2);"/> </td> <td><input type="radio" name="filter_reg" id="name_filter2" value="name"></td> </tr> <tr> <td>Description</td> <td> <input name="desc_search_reg" id="desc_search_reg" type="text" class="textFieldClass" size="25" value="<? echo($desc_search_reg_entry); ?>" onclick = "document.getElementById('desc_filter2').checked = true;"; onkeypress = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('desc_search_reg').value,descriptions2,rowIDs2);" onBlur = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('desc_search_reg').value,descriptions2,rowIDs2);" /> </td> <td><input type="radio" name="filter_reg" id="desc_filter2" value="description"></td> </tr> <tr> <td>Contributor</td> <td> <input name="contributor_search_reg" id="contributor_search_reg" type="text" class="textFieldClass" size="25" value="<? echo($contributor_search_reg_entry); ?>" onclick = "document.getElementById('contributor_filter2').checked = true;"; onkeypress = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('contributor_search_reg').value,contributors2,rowIDs2);" onBlur = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('contributor_search_reg').value,contributors2,rowIDs2);" /> </td> <td><input type="radio" name="filter_reg" id="contributor_filter2" value="contributor"></td> </tr> <tr><td colspan="3">&nbsp;</td></tr> <tr align="left"> <td colspan="3" > <input type="submit" class="buttonClass" value="Search" name="search_reg_submit" /> <input type="reset" class="buttonClass" value="Reset Entries" name="search_reg_reset2" /> <input type="submit" class="buttonClass" value="Reset Parameters" name="search_reg_reset" style="background-color: #DADADA;"/> </td> </tr> </table> </form> </span> </div> <!-- View Subregions Pane --> <? $panel = 0; $result = mysql_query($query_reg); while($data = mysql_fetch_array($result)) { $current = new Region($data); ?> <span class="submenu" id="subregion<? echo($panel); ?>"> <form method="POST" action="#"> <input type="hidden" name="src" value="gie"/> <table> <tr><td colspan="2"><b>Geographical Units included in <? echo($current->name); ?></b></td></tr> <tr><td colspan="2">&nbsp;</td></tr> <tr><td colspan="2"> <table> <? $query_sub = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$current->region_no."'"; if($result_sub = mysql_query($query_sub)) { $subregcount = 0; while($data_sub = mysql_fetch_array($result_sub)) { $name = mysql_fetch_array(mysql_query(" SELECT `name` FROM `g_unit` WHERE `unit_no` = ".$data_sub['g_unit'])); ?> <tr> <td valign="top"><input type="checkbox" name="subreg[<? echo($subregcount); ?>]" value="<? echo($data_sub['g_unit']); ?>" /></td> <td valign="top"><? echo($name['name']); ?></td> </tr> <? $subregcount++; } } else echo("None."); ?> </table> </td></tr> <tr><td colspan="2">&nbsp;</td></tr> <tr align="left"> <td colspan="2" > <input type='hidden' value="<? echo($current->region_no); ?>" name="region_no"> <input type="submit" class="buttonClass" value="Delete" name="delete_subreg_submit" /> <input type="reset" class="buttonClass" value="Reset" name="delete_subreg_reset" /> </td> </tr> </table> </form> </span> </div> <? $panel++; } ?> </td> </tr> </table> <br><br><br> </div> <!-- for regtable --> </div> <!-- for masterdiv2 --> <!-- Show panel --> <? if($repeat) { ?> <script type="text/javascript">eval("SwitchMenu2('sub2Add')");</script> <? } else { ?> <script type="text/javascript">eval("SwitchMenu2('sub2Search')");</script> <? } ?> <!-- Process Maps queries --> <? // Process Add query if(isset($HTTP_POST_VARS['add_map_submit'])) { $find_query = " SELECT * FROM `map` WHERE `filename` = '".$_FILES['add_filename']['name']."'"; $found = mysql_num_rows(mysql_query($find_query)); if($found>0)

138

$message_query_map = "Map already exists."; else if(!isset($_FILES['add_filename']['name'])||trim($_FILES['add_filename']['name'])=="") $message_query_map = "Please select a file."; else if( substr($_FILES['add_filename']['name'],strlen($_FILES['add_filename']['name'])-strlen(".swf"))!=".swf" ) $message_query_map = "The file you are trying to upload is not a .swf file."; else if(!isset($HTTP_POST_VARS['add_name'])||trim($HTTP_POST_VARS['add_name'])=="") $message_query_map = "Please input a name for the map."; else if(!isset($HTTP_POST_VARS['add_width'])||!is_numeric(trim($HTTP_POST_VARS['add_width']))) $message_query_map = "Please input a number for the width."; else if(!isset($HTTP_POST_VARS['add_height'])||!is_numeric(trim($HTTP_POST_VARS['add_height']))) $message_query_map = "Please input a number for the height."; else { $target_path = "maps/".basename($_FILES['add_filename']['name']); if(move_uploaded_file($_FILES['add_filename']['tmp_name'], $target_path)) { $uploaded = true; $query_map = " INSERT INTO `map` ( `filename`, `name`, `area`, `width`, `height`, `units`, `contributor` ) VALUES ( '".$_FILES['add_filename']['name']."', '".$HTTP_POST_VARS['add_name']."', '".$HTTP_POST_VARS['add_area']."', '".$HTTP_POST_VARS['add_width']."', '".$HTTP_POST_VARS['add_height']."', '".$HTTP_POST_VARS['add_units']."', '".$user->username."' ) "; if($result = mysql_query($query_map)) { $message_query_map = "The file ".basename($_FILES['uploadedfile']['name'])." has been uploaded. New map added in the database."; } else { unlink($target_path); $message_query_map = "There was an error uploading the file, please try again!"; } } else $message_query_map = "There was an error uploading the file, please try again!"; } } // Process Delete query if(isset($HTTP_POST_VARS['delete_map_submit'])&&isset($HTTP_POST_VARS['row_box3'])) { $row_box3 = $HTTP_POST_VARS['row_box3']; foreach($row_box3 as $key => $value) { if(isset($value)||trim($value)!="") { $query_map = " DELETE FROM `map` WHERE `filename` = '$value' LIMIT 1 "; if(mysql_query($query_map)) $success[$value] = true; } unlink("maps/".$value); } if(count($success)!=count($row_box3)) $message_query_map = "There had been problems with deletion. "; else $message_query_map = ""; if(count($success)>0) { $message_query_map .= "The following maps had been successfully deleted: "; foreach($success as $key => $value) { if($value) $message_query_map .= $key.";"; } } else $message_query_map .= "No maps had been deleted."; } // Process Edit query if(isset($HTTP_POST_VARS['update_map_submit'])) { $update_map_submit = $HTTP_POST_VARS['update_map_submit']; // Gets the last (or only) key as the entry foreach($update_map_submit as $key => $value) $map_updated = $key; if(!isset($HTTP_POST_VARS['new_name'][$map_updated])||trim($HTTP_POST_VARS['new_name'][$map_updated])=="") $message_query_map = "Please input a name for the map."; else if( !isset($HTTP_POST_VARS['new_width'])|| !is_numeric(trim($HTTP_POST_VARS['new_width'][$map_updated][$map_updated])) ) $message_query_map = "Please input a number for the width."; else if( !isset($HTTP_POST_VARS['new_height'][$map_updated])|| !is_numeric(trim($HTTP_POST_VARS['new_height'][$map_updated])) ) $message_query_map = "Please input a number for the height."; else { $query_map = " UPDATE `map` SET "; if(isset($HTTP_POST_VARS['new_name'][$map_updated])) $query_map .= " `name` = '".$HTTP_POST_VARS['new_name'][$map_updated]."'"; if(isset($HTTP_POST_VARS['new_area'][$map_updated])) $query_map .= ", `area` = '".$HTTP_POST_VARS['new_area'][$map_updated]."'"; if(isset($HTTP_POST_VARS['new_width'][$map_updated])) $query_map .= ", `width` = '".$HTTP_POST_VARS['new_width'][$map_updated]."'"; if(isset($HTTP_POST_VARS['new_height'][$map_updated])) $query_map .= ", `height` = '".$HTTP_POST_VARS['new_height'][$map_updated]."'"; if(isset($HTTP_POST_VARS['new_units'][$map_updated])) $query_map .= ", `units` = '".$HTTP_POST_VARS['new_units'][$map_updated]."'"; $query_map .= " WHERE `filename` = '".$map_updated."'"; if(mysql_query($query_map)) $message_query_map = "Map update successful."; else $message_query_map = "Map update unsuccessful."; } } // Process Select query $query_map = " SELECT * FROM `map`"; $query_map .= " WHERE 1"; require("../script/process_query.php"); $total_map = mysql_num_rows(mysql_query($query_map)); // Get the total number of entries regardless of entries per page ?> <!-- Message table: Maps --> <div style="color:#CE2029;"> <b><? echo($message_query_map); ?></b> </div> <!-- Contents: Maps --> <div id="masterdiv3"> <p> <font size="+1"><b><a onclick="toggle_visibility('maptable');" style="cursor: hand;">Maps Table</a></b></font> <input type="button" class="buttonClass" onclick="toggle_visibility('addmappane')" name="add_show" value="Add New Map"> </p> <div id="maptable"> <table border="0" cellspacing="1" cellpadding="1"> <tr> <td width="100%" valign="top"> <!-- Maps table --> <div id="table"> <!-- Add Map Pane --> <div id="addmappane" style="display: none"> <form method="POST" action="" enctype="multipart/form-data"> <table> <tr> <td colspan="2" valign="top"><b><u>Add New Map</u></b></td> <td valign="top" rowspan="2"><b><u>How to Make a New Map</u></b></td> </tr> <tr> <td colspan="2" valign="top">&nbsp;</td> </tr> <tr> <td width="115" valign="top">Map File (.swf)*</td> <td width="168" valign="top"><input type="file" name="add_filename" id="add_filename" size="25" ACCEPT="image/gif,image/jpeg" /></td> <td rowspan="10" width="350" > Making EISS maps requires that you have <a href="http://www.adobe.com/products/flash/">Adobe Flash </a>(or at least Macromedia Flash 2004 MX Professional 7.0.1). In order to make maps, you must follow these directions: <ol> <li>Download <a href="mm.fla">mm.fla</a> (<? echo(filesize("mm.fla")); ?> bytes) which will serve as your template for creating future maps.</li> <li>You may edit the "map" layer. This layer is supposed to contain polygons/vectors which can serves as representations of your geographical units. Make sure that these polygons/vectors are coverted to "movieclip" symbols.</li> <li>In order to link a geographical unit saved in the EISS database to the flash map you are creating, just click on any particular movieclip symbol. In properties, edit the "instance name" to "block_" where "_" is the map code of the geographical unit. For example, in the EISS database, if you see that a particular region Malabon has a map code of 6, then the proper instance name to the movieclip symbol that represents Malabon is block6.</li> <li>You may wish to move the objects in the "panel" layer. To do so, you must click the onion-skin selector and select all the frames in the layer. You can also do the same to the play/pause/rewind object on the "control" layer.</li> <li>After you're finished, just publish or export a movie from your flash file and keep the .swf file. This is the one uploaded to the map database.</li> </ol> </td> </tr> <tr> <td width="115" valign="top">Map Name*</td> <td width="168" valign="top"><input name="add_name" type="text" class="textFieldClass" id="add_name" size="25" /></td> </tr> <tr> <td width="115" valign="top">Map Area (in km.<sup>2</sup>)</td> <td width="168" valign="top"><input name="add_area" type="text" class="textFieldClass" id="add_area" size="25" /></td> </tr> <tr> <td width="115"

139

valign="top">Map Width*</td> <td width="168" valign="top"><input name="add_width" type="text" class="textFieldClass" id="add_width" size="25" /></td> </tr> <tr> <td width="115" valign="top">Map Height*</td> <td width="168" valign="top"><input name="add_height" type="text" class="textFieldClass" id="add_height" size="25" /></td> </tr> <tr> <td width="115" valign="top">Number of Map Units</td> <td width="168" valign="top"><input name="add_units" type="text" class="textFieldClass" id="add_units" size="25" /></td> </tr> <tr> <td valign="top">Contributor</td> <td valign="top"><input name="add_contributor" type="text" disabled="disabled" class="textFieldClass" id="add_contributor" value="<? echo($user->username); ?>" size="25" /></td> </tr> <tr><td colspan="2" valign="top">&nbsp;</td></tr> <tr><td colspan="2" valign="top"><i>* Required fields<i></td></tr> <tr align="left"> <td colspan="2" valign="top"> <input type="submit" class="buttonClass" value="Add" name="add_map_submit"> <input type="reset" class="buttonClass" value="Reset" name="add_map_reset"> </td> </tr> </table> </form> <br /><br /><br /> </div> <!-- --> <form method="POST" action=""> <TABLE id="t1" class="content table-autosort table-autofilter table-autopage:<? if($nav>entries_per_page_gie==0) echo("5"); else echo($nav->entries_per_page_gie) ?> table-page-number:t1page table-pagecount:t1pages table-filtered-rowcount:t1filtercount table-rowcount:t1allcount" cellpadding="3"> <THEAD> <tr> <td colspan=8> <? if($total_map>1) {?> There are <? echo($total_map) ?> entries in this table. <? } else if($total_map>0) { ?> There is only one entry in this table. <? } else { ?> There are no entries in this table. <? } ?> </td> </tr> <th bgcolor='#DADADA'> <input type="checkbox" name="row" onClick=" if(this.checked) { <? for($i=0;$i<$total_map;$i++) { ?> row_<?echo($i);?>.style.background='<? echo($highlight); ?>' row_box3<?echo($i);?>.checked = true; <? } ?> } else { <? for($i=0;$i<$total_map;$i++) { ?> row_<?echo($i);?>.style.background='<? echo($bgcolor[fmod($i,2)]); ?>' row_box3<?echo($i);?>.checked = false; <? } ?> } " > </th> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Filename</b></th> <th class="table-sortable:default table-sortable" title="Click to sort"><b>Name</b></th> <th class="table-sortable:default table-sortable" title="Click to sort"><b>Area (km<sup>2</sup>)</b></th> <th title="Click to sort"><b>Dimensions</b> (pixels)</th> <th class="table-sortable:default table-sortable" title="Click to sort"><b>Units</b></th> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Contributor</b></th> <th class="tablesortable:default table-sortable" title="Click to sort"><b>Size</b><i> (bytes)</i></th> </tr> </THEAD> <? if($result = mysql_query($query_map)) { $i = 0; if($total_map==0) { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } while($data = mysql_fetch_array($result)) { $current_map = new Map($data); ?> <tr id="row3_<? echo($i); ?>" bgcolor='<? echo($bgcolor[fmod($i,2)]); ?>' valign="top"> <td align="center"> <!-- id is for javascript purposes, name for php purposes --> <input type="checkbox" id="row_box3<?echo($i);?>" name="row_box3[<?echo($i);?>]" value="<? echo($current_map->filename); ?>" onClick=" if(this.checked) { row3_<?echo($i);?>.style.background='<? echo($highlight); ?>' } else { row3_<?echo($i);?>.style.background='#FAFAFA' } " > </td> <td align="center"> <? echo($current_map<u><? >filename); ?> </td> <td align="center"> <div id="name_view[<? echo($i);?>]" style="display: block"> echo($current_map->name); ?></u> </div> <div id="name_update[<? echo($i);?>]" style="display: none"> <input name="new_name[<? echo($current_map->filename);?>]" type="text" style="text-align: center;" class="textFieldClass" value="<? echo($current_map->name); ?>" size="20" /> </div> </td> <td align="center"> <div id="area_view[<? echo($i);?>]" style="display: block"> <? echo($current_map->area); ?> </div> <div id="area_update[<? echo($i);?>]" style="display: none"> <input name="new_area[<? echo($current_map->filename);?>]" type="text" style="text-align: center;" class="textFieldClass" value="<? echo($current_map->area); ?>" size="10" /> </div> </td> <td align="center"> <div id="dimension_view[<? echo($i);?>]" style="display: block"> <? echo($current_map->width." x ".$current_map->height); ?> </div> <div id="dimension_update[<? echo($i);?>]" style="display: none"> Width : <input name="new_width[<? echo($current_map->filename);?>]" type="text" style="text-align: center;" class="textFieldClass" value="<? echo($current_map>width); ?>" size="5" /><hr /> Height : <input name="new_height[<? echo($current_map->filename);?>]" type="text" style="text-align: center;" class="textFieldClass" value="<? echo($current_map->height); ?>" size="5" /> </div> </td> <td align="center"> <div id="units_view[<? echo($i);?>]" style="display: block"> <? echo($current_map->units); ?> </div> <div id="units_update[<? echo($i);?>]" style="display: none"> <input name="new_units[<? echo($current_map>filename);?>]" type="text" style="text-align: center;" class="textFieldClass" value="<? echo($current_map->units); ?>" size="5" /> </div> </td> <td align="center"> <? echo($current_map->contributor); ?> </td> <td align="center"> <div id="misc_view[<? echo($i);?>]" style="display: block"> <? echo(filesize("maps/".$current_map->filename)); ?> </div> <div id="misc_update[<? echo($i);?>]" style="display: none"> <input type="submit" class="buttonClass" style="backgroundcolor: #DADADA;" value="Update" name="update_map_submit[<? echo($current_map->filename);?>]" /><hr /> <input type="reset" class="buttonClass" style="background-color: #DADADA;" value="Reset" name="update_map_reset[<? echo($current_map->filename);?>]" /> </div> </td> <td align="center"> <div id="update_view[<? echo($i);?>]" style="display: block"> <input type="button" value="Edit" class="buttonClass" style="background-color: #DADADA;" onclick=" toggle_visibility('name_view[<? echo($i); ?>]'); toggle_visibility('name_update[<? echo($i); ?>]'); toggle_visibility('area_view[<? echo($i); ?>]'); toggle_visibility('area_update[<? echo($i); ?>]'); toggle_visibility('dimension_view[<? echo($i); ?>]'); toggle_visibility('dimension_update[<? echo($i); ?>]'); toggle_visibility('units_view[<? echo($i); ?>]'); toggle_visibility('units_update[<? echo($i); ?>]'); toggle_visibility('misc_view[<? echo($i); ?>]'); toggle_visibility('misc_update[<? echo($i); ?>]'); toggle_visibility('update_view[<? echo($i); ?>]'); toggle_visibility('update_update[<? echo($i); ?>]'); "/> </div> <div id="update_update[<? echo($i);?>]" style="display: none"> <input type="button" value="Back" class="buttonClass" style="background-color: #DADADA;" onclick=" toggle_visibility('name_view[<? echo($i); ?>]'); toggle_visibility('name_update[<? echo($i); ?>]'); toggle_visibility('area_view[<? echo($i); ?>]'); toggle_visibility('area_update[<? echo($i); ?>]'); toggle_visibility('dimension_view[<? echo($i); ?>]'); toggle_visibility('dimension_update[<? echo($i); ?>]'); toggle_visibility('units_view[<? echo($i); ?>]'); toggle_visibility('units_update[<? echo($i); ?>]'); toggle_visibility('misc_view[<? echo($i); ?>]'); toggle_visibility('misc_update[<? echo($i); ?>]'); toggle_visibility('update_view[<? echo($i); ?>]'); toggle_visibility('update_update[<? echo($i); ?>]'); "/> </div> </td> </tr> <? $i++; } } else { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } ?> <!-- Pages -> <TFOOT> <TR> <TD class="table-page:previous" style="cursor:pointer;">&lt;Previous</TD> <TD style="text-

140

align:center;">Page <SPAN id="t1page" style="color:black">1</SPAN>&nbsp;of <SPAN id="t1pages">1</SPAN></TD> <TD class="table-page:next" style="cursor:pointer;">Next&gt;</TD> </TR> </TFOOT> </table> <!-- --> <br /> <input type="submit" class="buttonClass" name="delete_map_submit" value="Delete"> </form> <br /> </div> </td> </tr> </table> </div> <!-- for maptable --> </div> <!-- for masterdiv3 --> <br><hr><p> <!-- Pagination Panel --> <table> <tr><td> <!-- Pagination Control --> View <select name="repaginate" onChange="location.href='../script/process_navigation.php?<? echo($parameters);?>&entries_per_page_gie='+this.value+'';" > <option value="5" <? if($nav->entries_per_page_gie==5) echo("selected");?> >5</option> <option value="10" <? if($nav->entries_per_page_gie==10) echo("selected");?> >10</option> <option value="15" <? if($nav->entries_per_page_gie==15) echo("selected");?> >15</option> <? if(($nav>entries_per_page_gie!=5)&&($nav->entries_per_page_gie!=10)&&($nav->entries_per_page_gie!=15)) { ?> <option value=<? echo($nav->entries_per_page_gie);?> selected> - </option> <? } ?> </select> entries at a time, or type here <input type="text" name="entries_per_page_gie" class="textFieldClass" size="3" onBlur="location.href='../script/process_navigation.php?<? echo($parameters);?>&entries_per_page_gie='+this.value+'';" > &nbsp;the number entries per page and click outside. </td></tr> </table> </p> <? require('../script/footer.php'); ?> ...\eiss\modules\ gie2.php <? require('../script/header.php'); if($user->usertype=="epidemiologist") $login_as = "eme"; else { ?> <meta httpequiv="refresh" content="0; URL='../main/main.php?login_failure=1&login_message=<? echo("not_allowed"); ?>'"> <? exit(); } ?> <!-- Process Geographical Unit queries --> <? // Process Add to Region query if(isset($HTTP_POST_VARS['add_to_region'])) { $row_box = $HTTP_POST_VARS['row_box']; foreach($row_box as $key => $value) { if(isset($value)||trim($value)!="") { $query_sub = " SELECT * FROM `subregion` WHERE `region` = '".$HTTP_POST_VARS['subregion']."' AND `g_unit` = '".$value."' "; if(mysql_num_rows(mysql_query($query_sub))==0) { $query_sub = " INSERT INTO `subregion` ( `region`, `g_unit` ) VALUES ( '".$HTTP_POST_VARS['subregion']."', '".$value."' ) "; if(mysql_query($query_sub)) { $find_query = " SELECT * FROM `g_unit` WHERE `unit_no` = '".$value."'"; $data_found = mysql_fetch_array(mysql_query($find_query)); $success[$value] = $data_found['name']; } else $success[$value] = ""; } } } if(count($success)!=count($row_box)) $message_query_sub = "There had been problems with adding geographical units to regions. "; else $message_query_gu = ""; if(count($success)>0) { $find_query = " SELECT * FROM `region` WHERE `region_no` = '".$HTTP_POST_VARS['subregion']."'"; $data_found = mysql_fetch_array(mysql_query($find_query)); $message_query_gu .= "The following geographical units had been successfully added to ".$data_found['name'].": "; foreach($success as $key => $value) { if($value) $message_query_gu .= $value."; "; } } else $message_query_gu .= "No geographical units had been add to the region."; } // Process Select query $query_gu = " SELECT * FROM `g_unit`"; $query_gu .= " WHERE 1"; require("../script/process_query.php"); $total_gu = mysql_num_rows(mysql_query($query_gu)); // Get the total number of entries regardless of entries per page ?> <!-- Process Regions queries --> <? // Process Add query if(isset($HTTP_POST_VARS['add_reg_submit'])) { if(!isset($HTTP_POST_VARS['add_code'])||trim($HTTP_POST_VARS['add_code'])=="") $add_message_reg = "Please enter a region code."; else { $find_query = " SELECT * FROM `region` WHERE `name` = '".$HTTP_POST_VARS['add_name']."'"; $found = mysql_num_rows(mysql_query($find_query)); if($found>0) $add_message_reg = "Region already exists."; else { $query_reg = " INSERT INTO `region` ( `region_no`, `code`, `name`, `description`, `contributor` ) VALUES ( '', '".$HTTP_POST_VARS['add_code']."', '".$HTTP_POST_VARS['add_name']."', '".$HTTP_POST_VARS['add_desc']."', '".$user->username."' ) "; if($result = mysql_query($query_reg)) $add_message_reg = "New region added."; else $add_message_reg = "Failed to add region."; } } } // Process Delete query if(isset($HTTP_POST_VARS['delete_reg_submit'])&&isset($HTTP_POST_VARS['row_box2'])) { $row_box2 = $HTTP_POST_VARS['row_box2']; foreach($row_box2 as $key => $value) { if(isset($value)||trim($value)!="") { $find_query = " SELECT * FROM `region` WHERE `region_no` = '".$value."'"; $data_found = mysql_fetch_array(mysql_query($find_query)); $query_reg = " DELETE FROM `region` WHERE `region_no` = '$value' LIMIT 1 "; if(mysql_query($query_reg)) $success[$value] = $data_found['name']; else $success[$value] = ""; } } if(count($success)!=count($row_box2)) $message_query_reg = "There had been problems with deletion. "; else $message_query_reg = ""; if(count($success)>0) { $message_query_reg .= "The following regions had been successfully deleted: "; foreach($success as $key => $value) { if($value) $message_query_reg .= $value."; "; } } else $message_query_reg .= "No regions had been deleted."; } // Process Edit query if(isset($HTTP_POST_VARS['update_reg_submit'])) { $update_reg_submit = $HTTP_POST_VARS['update_reg_submit']; // Gets the last (or only) key as the entry foreach($update_reg_submit as $key => $value) $region_updated = $key; if( !isset($HTTP_POST_VARS['new_code'][$region_updated])|| trim($HTTP_POST_VARS['new_code'][$region_updated])=="" ) $message_query_reg = "Please enter a region code."; else { $query_reg = " UPDATE `region` SET "; if(isset($HTTP_POST_VARS['new_code'][$region_updated])) $query_reg .= " `code` = '".$HTTP_POST_VARS['new_code'][$region_updated]."'"; if(isset($HTTP_POST_VARS['new_name'][$region_updated])) $query_reg .= ", `name` = '".$HTTP_POST_VARS['new_name'][$region_updated]."'"; if(isset($HTTP_POST_VARS['new_desc'][$region_updated])) $query_reg .= ", `description` = '".$HTTP_POST_VARS['new_desc'][$region_updated]."'"; if(isset($HTTP_POST_VARS['new_contributor'][$region_updated])) $query_reg .= ", `contributor` = '".$HTTP_POST_VARS['new_contributor'][$region_updated]."'"; $query_reg .= " WHERE `region_no` = '".$region_updated."'"; if(mysql_query($query_reg)) $message_query_reg = "Region update successful."; else $message_query_reg = "Region update unsuccessful."; } } // Process Delete Subregions query if(isset($HTTP_POST_VARS['delete_subreg_submit'])) { $subreg = $HTTP_POST_VARS['subreg']; $region_no = $HTTP_POST_VARS['region_no']; foreach($subreg as $key => $value) { if(isset($value)||trim($value)!="") { $query_sub = " DELETE FROM `subregion` WHERE `g_unit` = '$value' AND `region` = '$region_no' LIMIT 1 "; if(mysql_query($query_sub)) { $find_query = " SELECT * FROM `g_unit` WHERE `unit_no` = '".$value."'"; $data_found = mysql_fetch_array(mysql_query($find_query)); $success[$value] = $data_found['name']; } else $success[$value] = ""; } } if(count($success)!=count($subreg)) $message_query_reg = "There had been problems with deletion. "; else $message_query_reg = ""; if(count($success)>0) { $find_query = " SELECT * FROM `region` WHERE `region_no` =

141

'".$region_no."'"; $data_found = mysql_fetch_array(mysql_query($find_query)); $message_query_reg .= "The following geographical units had been successfully deleted from ".$data_found['name'].": "; foreach($success as $key => $value) { if($value) $message_query_reg .= $value."; "; } } else $message_query_reg .= "No geographical units had been deleted from its region."; } // Process Select query $query_reg = " SELECT * FROM `region`"; $query_reg .= " WHERE `contributor` = '".$user->username."'"; require("../script/process_query.php"); $total_reg = mysql_num_rows(mysql_query($query_reg)); // Get the total number of entries regardless of entries per page ?> <!-- Message table: Geographical Units --> <div style="color:#CE2029;"> <b><? echo($message_query_gu); ?></b> </div> <!-- Contents: Geographical Units --> <div id="masterdiv"> <p> <table><tr> <td> <font size="+1"><b><a onclick="toggle_visibility('gutable');" style="cursor: hand;">Geographical Units Table</a></b></font> </td> <? if(trim($nav>search_str_gie_gu)==""){ ?> <td> <input type="button" class="buttonClass" onclick="SwitchMenu('subSearch')" name="search_show" value="Search Panel"> </td> <? } else { ?> <td> <input type="button" class="buttonClass" onclick="SwitchMenu('subSearch')" name="search_show" value="Search Panel" style="background-color: #DADADA;">&nbsp;<u>with results</u> </td> <? } ?> <td>&nbsp;&nbsp;</td> </tr></table> </p> <div id="gutable"> <table border="0" cellspacing="1" cellpadding="1"> <tr> <td width="70%" valign="top"> <!-- Geographical Units table --> <div id="table"> <form method="POST" action=""> <TABLE id="t1" class="content table-autosort tableautofilter table-autopage:<? if($nav->entries_per_page_gie>0) echo($nav->entries_per_page_gie); else echo("5"); ?> table-page-number:t1page table-page-count:t1pages table-filtered-rowcount:t1filtercount table-rowcount:t1allcount" cellpadding="3"> <THEAD> <tr> <td colspan=7> <? if($total_gu>1) {?> There are <? echo($total_gu) ?> entries in this table. <? } else if($total_gu>0) { ?> There is only one entry in this table. <? } else { ?> There are no entries in this table. <? } ?> </td> </tr> <tr bgcolor='#DADADA'> <th align=center> <input type="checkbox" name="row" onClick=" if(this.checked) { <? if($result = mysql_query($query_gu)) { $i = 0; while($data = mysql_fetch_array($result)) { $current = new GeographicalUnit($data); ?> row<?echo($current>unit_no);?>.style.background='<? echo($highlight); ?>' row_box<?echo($current->unit_no);?>.checked = true; <? $i++; } } ?> } else { <? if($result = mysql_query($query_gu)) { $i = 0; while($data = mysql_fetch_array($result)) { $current = new GeographicalUnit($data); ?> row<?echo($current->unit_no);?>.style.background='<? echo($bgcolor[fmod($i,2)]); ?>' row_box<?echo($current>unit_no);?>.checked = false; <? $i++; } } ?> } " > </td> <th class="tablesortable:default table-sortable" title="Click to sort"><b>Geographical Unit*</b></th> <th class=""><b>Description</b></th> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Contributor</b></th> <th class="tablesortable:numeric table-sortable" title="Click to sort"><b>Population</b></th> <th class="table-sortable:numeric table-sortable" title="Click to sort"><b>Density (per km²)</b></th> <th class="table-sortable:numeric table-sortable" title="Click to sort"><b>Area</b> (in km²) </th> </tr> </THEAD> <script type="text/javascript"> var rowIDs = Array(); var names = Array(); var descriptions = Array(); var contributors = Array(); </script> <? if($result = mysql_query($query_gu)) { $i = 0; if($total_gu==0) { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } while($data = mysql_fetch_array($result)) { $current = new GeographicalUnit($data); ?> <script type="text/javascript"> rowIDs[<? echo($i); ?>] = "row<? echo($current->unit_no); ?>"; names[<? echo($i); ?>] = "<? echo($current->name); ?>"; descriptions[<? echo($i); ?>] = "<? echo(trim($current->desc)); ?>"; contributors[<? echo($i); ?>] = "<? echo($current->contributor); ?>"; </script> <tr id="row<? echo($current->unit_no); ?>" bgcolor='<? echo($bgcolor[fmod($i,2)]); ?>' valign="top"> <td align="center"> <!-- id is for javascript purposes, name for php purposes --> <input type="checkbox" id="row_box<?echo($current->unit_no);?>" name="row_box[<?echo($current->unit_no);?>]" value="<? echo($current->unit_no); ?>" onClick=" if(this.checked) { row<?echo($current->unit_no);?>.style.background='<? echo($highlight); ?>' } else { row<?echo($current>unit_no);?>.style.background='<? echo($bgcolor[fmod($i,2)]); ?>' } " > </td> <a name="gu<? echo($current>unit_no); ?>"> <td> <u><a onclick="SwitchMenu('sub<? echo($current->unit_no); ?>')" style="cursor: hand;"><? echo($current->name); ?></a></u><br><br> <i>Map Code: <? echo($current->unit_no); ?></i> </td> <td> <div id="desc<? echo($current->unit_no); ?>_a" style="display: block"> <? echo(substr($current->desc,0,100)); ?> <? if(strlen($current->desc)>100) { ?> ... <a href="#gu<? echo($current->unit_no); ?>" onclick="toggle_visibility('desc<? echo($current->unit_no); ?>_a'); toggle_visibility('desc<? echo($current->unit_no); ?>_b');">show</a> <? } ?> </div> <div id="desc<? echo($current->unit_no); ?>_b" style="display: none"> <? echo($current->desc); ?> <a href="#gu<? echo($current->unit_no); ?>" onclick="toggle_visibility('desc<? echo($current->unit_no); ?>_a'); toggle_visibility('desc<? echo($current->unit_no); ?>_b');">hide</a> </div> <hr /> <? if(mysql_num_rows(mysql_query(" SELECT `g_unit2` FROM `adjacency` WHERE `g_unit1` = '".$current->unit_no."'"))>0) { ?> <table><tr> <td>[</td> <td align="center" width="45%"> <a onclick="SwitchMenu('subadjacency<? echo($current->unit_no); ?>')" style="cursor: hand;" value =""/>View Adjacent Units</a> </td> <td>]</td> <td>[</td> <td align="center" width="45%"> <a onclick=" row<? echo($current->unit_no); ?>.style.background='<? echo($highlight); ?>' row_box<? echo($current->unit_no); ?>.checked = true; <? $query_sub = " SELECT `g_unit2` FROM `adjacency` WHERE `g_unit1` = '".$current->unit_no."'"; $result_sub = mysql_query($query_sub); while($data_sub = mysql_fetch_array($result_sub)) { ?> row<? echo($data_sub['g_unit2']); ?>.style.background='<? echo($highlight); ?>' row_box<? echo($data_sub['g_unit2']); ?>.checked = true; <? } ?> " style="cursor: hand;">Select this and adjacent units</a> </td> <td>]</td> </tr></table> <? } else {?> No units adjacent. <? } ?> </td> <td align="center"><? echo($current->contributor); ?></td> <td align="right"><? echo(number_format($current->population)); ?></td> <td align="right"><? echo(round($current>population/$current->area)); ?></td> <td align="right"><? echo(number_format($current->area)); ?></td> </tr> <? $i++; } } else { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } ?> <!-- Pages --> <TFOOT> <TR> <TD class="table-page:previous" style="cursor:pointer;">&lt;Previous</TD> <TD style="text-align:center;">Page <SPAN id="t1page" style="color:black">1</SPAN>&nbsp;of&nbsp; <? if($nav->entries_per_page_gie>0) echo(ceil($i/$nav->entries_per_page_gie)); else echo(ceil($i/5)); ?></TD> <TD class="table-page:next" style="cursor:pointer;">Next&gt;</TD> <td colspan=4 ><p><b>*Map codes are automatically assigned.<b></p></td> </TR> </TFOOT> </table> <!-- --> <!-- Remarks --> <!-- --> <table bgcolor="#EEEEEE" bordercolor="#DDDDDD"> <tr> <td align="center"><input type="submit" class="buttonClass" name="add_to_region" value="Add to Region"><td> <td align=""><select name="subregion"> <?

142

$result = mysql_query(" SELECT * FROM `region` WHERE 1"); while($data = mysql_fetch_array($result)) { $current = new Region($data); ?> <option value="<? echo($current->region_no); ?>"><? echo($current->code); ?></option> <? } ?> </select></td> </tr> </table> </form> </div> </td> <td width="30%" valign="top"> <div id="panel"> <!-- Search Geographical Unit Pane --> <span class="submenu" id="subSearch"> <form method="POST" action="../script/process_navigation.php"> <input type="hidden" name="src" value="gie"/> <table> <tr><td colspan="3"><b>Search Geographical Unit</b></td></tr> <tr> <td colspan="2" align="right"> <input type="button" value="Clear Filters" class="buttonClass" style="background-color: #DADADA;" onclick="filterTable('',names,rowIDs);" /> Enable Filter? </td> <td><input type="checkbox" id="enable_filter" checked></td> </tr> <tr> <td width="115">Geographical Unit Name</td> <td width="168"> <input name="name_search" id="name_search" type="text" class="textFieldClass" size="25" value="<? echo($name_search_entry); ?>" onclick = "document.getElementById('name_filter').checked = true;"; onkeypress = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('name_search').value,names,rowIDs);" onBlur = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('name_search').value,names,rowIDs);"/> </td> <td><input type="radio" name="filter" id="name_filter" value="name"></td> </tr> <tr> <td>Description</td> <td> <input name="desc_search" id="desc_search" type="text" class="textFieldClass" size="25" value="<? echo($desc_search_entry); ?>" onclick = "document.getElementById('desc_filter').checked = true;"; onkeypress = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('desc_search').value,descriptions,rowIDs);" onBlur = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('desc_search').value,descriptions,rowIDs);" /> </td> <td><input type="radio" name="filter" id="desc_filter" value="description"></td> </tr> <tr> <td>Contributor</td> <td> <input name="contributor_search" id="contributor_search" type="text" class="textFieldClass" size="25" value="<? echo($contributor_search_entry); ?>" onclick = "document.getElementById('contributor_filter').checked = true;"; onkeypress = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('contributor_search').value,contributors,rowIDs);" onBlur = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('contributor_search').value,contributors,rowIDs);" /> </td> <td><input type="radio" name="filter" id="contributor_filter" value="contributor"></td> </tr> <tr><td colspan="3">Population (range)</td></tr> <td colspan="3" align="center"><table width="00" border="0" cellspacing="1" cellpadding="1"> <tr> <td align="center"> <select name="population_lowercond"> <option value="more" <? if($population_lowerlimit_cond=="more") echo("selected");?>>More than</option> <option value="more_equal" <? if($population_lowerlimit_cond=="more_equal") echo("selected");?>>More than or equal to</option> <option value="none" <? if($population_lowerlimit_cond=="none") echo("selected");?>>-</option> </select> </td> <td align="left"><input name="population_lowerlimit" type="text" size="10" style="text-align:right" value="<? echo($population_lowerlimit_search); ?>"/></td> </tr> <tr> <td align="center"> <select name="population_uppercond"> <option value="less" <? if($population_upperlimit_cond=="less") echo("selected");?>>Less than</option> <option value="less_equal" <? if($population_upperlimit_cond=="less_equal") echo("selected");?>>Less than or equal to</option> <option value="none" <? if($population_upperlimit_cond=="none") echo("selected");?>>-</option> </select> </td> <td align="left"><input name="population_upperlimit" type="text" size="10" style="text-align:right" value="<? echo($population_upperlimit_search); ?>"/></td> </tr> </table></td> </tr> <tr><td colspan="3">Population Density (range, person per km²)</td></tr> <td colspan="3" align="center"><table width="00" border="0" cellspacing="1" cellpadding="1"> <tr> <td align="center"> <select name="density_lowercond"> <option value="more" <? if($density_lowerlimit_cond=="more") echo("selected");?>>More than</option> <option value="more_equal" <? if($density_lowerlimit_cond=="more_equal") echo("selected");?>>More than or equal to</option> <option value="none" <? if($density_lowerlimit_cond=="none") echo("selected");?>>-</option> </select> </td> <td align="left"><input name="density_lowerlimit" type="text" size="10" style="text-align:right" value="<? echo($density_lowerlimit_search); ?>"/></td> </tr> <tr> <td align="center"> <select name="density_uppercond"> <option value="less" <? if($density_upperlimit_cond=="less") echo("selected");?>>Less than</option> <option value="less_equal" <? if($density_upperlimit_cond=="less_equal") echo("selected");?>>Less than or equal to</option> <option value="none" <? if($density_upperlimit_cond=="none") echo("selected");?>>-</option> </select> </td> <td align="left"><input name="density_upperlimit" type="text" size="10" style="text-align:right" value="<? echo($density_upperlimit_search); ?>"/></td> </tr> </table></td> </tr> <tr><td colspan="3">Area (range, in km²)</td></tr> <tr> <td colspan="3" align="center"><table width="00" border="0" cellspacing="1" cellpadding="1"> <tr> <td align="center"> <select name="area_lowercond"> <option value="more" <? if($area_lowerlimit_cond=="more") echo("selected");?>>More than</option> <option value="more_equal" <? if($area_lowerlimit_cond=="more_equal") echo("selected");?>>More than or equal to</option> <option value="none <? if($area_lowerlimit_cond=="none") echo("selected");?>">-</option> </select> </td> <td align="left"><input name="area_lowerlimit" type="text" size="10" style="text-align:right" value="<? echo($area_lowerlimit_search); ?>"/></td> </tr> <tr> <td align="center"> <select name="area_uppercond"> <option value="less" <? if($area_upperlimit_cond=="less") echo("selected");?>>Less than</option> <option value="less_equal" <? if($area_upperlimit_cond=="less_equal") echo("selected");?>>Less than or equal to</option> <option value="none" <? if($area_upperlimit_cond=="none") echo("selected");?>>-</option> </select> </td> <td align="left"><input name="area_upperlimit" type="text" size="10" style="text-align:right" value="<? echo($area_upperlimit_search); ?>"/></td> </tr> </table></td> </tr> <tr><td colspan="3">&nbsp;</td></tr> <tr align="left"> <td colspan="3"> <input type="submit" class="buttonClass" value="Search" name="search_gu_submit" /> <input type="reset" class="buttonClass" value="Reset Entries" name="search_gu_reset2" /> <input type="submit" class="buttonClass" value="Reset Parameters" name="search_gu_reset" style="background-color: #DADADA;"/> </td> </tr> </table> </form> </span> </div> <!-- View Adjacency Pane --> <? $result = mysql_query($query_gu); while($data = mysql_fetch_array($result)) { $current = new GeographicalUnit($data); ?> <span class="submenu" id="subadjacency<? echo($current->unit_no); ?>"> <form method="POST" action="#"> <input type="hidden" name="src" value="gie"/> <table> <tr><td colspan="2"><b>Geographical Units connected to <? echo($current->name); ?></b></td></tr> <tr><td

143

colspan="2">&nbsp;</td></tr> <tr><td colspan="2"> <table> <? $query_sub = " SELECT `g_unit2` FROM `adjacency` WHERE `g_unit1` = '".$current->unit_no."'"; if($result_sub = mysql_query($query_sub)) { while($data_sub = mysql_fetch_array($result_sub)) { $name = mysql_fetch_array(mysql_query(" SELECT `name` FROM `g_unit` WHERE `unit_no` = ".$data_sub['g_unit2'])); ?> <tr> <td valign="top"><? echo($name['name']); ?></td> </tr> <? } } else echo("None."); ?> </table> </td></tr> </table> </form> </span> </div> <? } ?> </td> </tr> </table> <br><br><br> </div> <!-- for gutable --> </div> <!-- for masterdiv --> <!-- Message table: Regions --> <div style="color:#CE2029;"> <b><? echo($message_query_reg); ?></b> </div> <!-- Contents: Regions --> <div id="masterdiv2"> <p> <font size="+1"><b><a onclick="toggle_visibility('regtable');" style="cursor: hand;"> <? echo($user->title); ?> <? echo($user>first_name); ?>'s Regions </a></b></font> <? if(trim($nav->search_str_gie_reg)==""){ ?> <input type="button" class="buttonClass" onclick="SwitchMenu2('sub2Search')" name="search_show" value="Search Panel"> <? } else { ?> <input type="button" class="buttonClass" onclick="SwitchMenu2('sub2Search')" name="search_show" value="Search Panel" style="background-color: #DADADA;">&nbsp;<u>with results</u> <? } ?> <input type="button" class="buttonClass" onclick="SwitchMenu2('sub2Add')" name="add_show" value="Add New Region"> </p> <div id="regtable"> <table border="0" cellspacing="1" cellpadding="1"> <tr> <td width="70%" valign="top"> <!-- Regions table --> <div id="table"> <form method="POST" action=""> <TABLE id="t1" class="content table-autosort table-autofilter table-autopage:<? if($nav>entries_per_page_gie==0) echo("5"); else echo($nav->entries_per_page_gie) ?> table-page-number:t1page table-pagecount:t1pages table-filtered-rowcount:t1filtercount table-rowcount:t1allcount" cellpadding="3"> <THEAD> <tr> <td colspan=7> <? if($total_reg>1) {?> There are <? echo($total_reg) ?> entries in this table. <? } else if($total_reg>0) { ?> There is only one entry in this table. <? } else { ?> There are no entries in this table. <? } ?> </td> </tr> <tr bgcolor='#DADADA'> <th align=center> <input type="checkbox" name="row" onClick=" if(this.checked) { <? for($i=0;$i<$total_reg;$i++) { ?> row_<?echo($i);?>.style.background='<? echo($highlight); ?>' row_box_<?echo($i);?>.checked = true; <? } ?> } else { <? for($i=0;$i<$total_reg;$i++) { ?> row_<?echo($i);?>.style.background='<? echo($bgcolor[fmod($i,2)]); ?>' row_box_<?echo($i);?>.checked = false; <? } ?> } " > </td> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Region Code</b></th> <th class="table-sortable:default table-sortable" title="Click to sort"><b>Region Name</b></th> <th class=""><b>Description</b></th> <th class=""><b>Geographical Units</b></th> </td> </tr> </THEAD> <script type="text/javascript"> var rowIDs2 = Array(); var codes2 = Array(); var names2 = Array(); var descriptions2 = Array(); </script> <? if($result = mysql_query($query_reg)) { $i = 0; if($total_reg==0) { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } while($data = mysql_fetch_array($result)) { $current = new Region($data); ?> <script type="text/javascript"> rowIDs2[<? echo($i); ?>] = "row_<? echo($i); ?>"; codes2[<? echo($i); ?>] = "<? echo($current->code); ?>"; names2[<? echo($i); ?>] = "<? echo($current->name); ?>"; descriptions2[<? echo($i); ?>] = "<? echo(trim($current->desc)); ?>"; </script> <tr id="row_<? echo($i); ?>" bgcolor='<? echo($bgcolor[fmod($i,2)]); ?>' valign="top"> <td align="center"> <!-- id is for javascript purposes, name for php purposes --> <input type="checkbox" id="row_box_<?echo($i);?>" name="row_box2[<?echo($i);?>]" value="<? echo($current->region_no); ?>" onClick=" if(this.checked) { row_<?echo($i);?>.style.background='<? echo($highlight); ?>' } else { row_<?echo($i);?>.style.background='<? echo($bgcolor[fmod($i,2)]); ?>' } " > </td> <a name="reg<? echo($current->unit_no); ?>"> <td><u><a onclick="SwitchMenu2('sub2_<? echo($i); ?>')" style="cursor: hand;"><? echo($current->code); ?></a></u></td> <td><? echo($current->name); ?></td> <td> <div id="reg_desc<? echo($current->region_no); ?>_a" style="display: block"> <? echo(substr($current->desc,0,100)); ?> <? if(strlen($current->desc)>100) { ?> ... <a href="#reg<? echo($current>unit_no); ?>" onclick="toggle_visibility('reg_desc<? echo($current->region_no); ?>_a'); toggle_visibility('reg_desc<? echo($current>region_no); ?>_b');">show</a> <? } ?> </div> <div id="reg_desc<? echo($current->region_no); ?>_b" style="display: none"> <? echo($current->desc); ?> <a href="#reg<? echo($current->unit_no); ?>" onclick="toggle_visibility('reg_desc<? echo($current->region_no); ?>_a'); toggle_visibility('reg_desc<? echo($current->region_no); ?>_b');">hide</a> </div> <hr> <table> <? $regional_population = 0; $regional_density = 0; $regional_area = 0; $query_sub = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$current->region_no."'"; if($result_sub = mysql_query($query_sub)) { while($data_sub = mysql_fetch_array($result_sub)) { $g_unit = mysql_fetch_array(mysql_query(" SELECT `population`, `area` FROM `g_unit` WHERE `unit_no` = ".$data_sub['g_unit'])); $regional_population += intval($g_unit['population']); $regional_area += intval($g_unit['area']); } if($regional_area!=0) $regional_density = $regional_population/$regional_area; } ?> <tr> <td>Population</td><td>&nbsp;</td> <td><u><? echo(number_format($regional_population)); ?></u></td> </tr> <tr> <td>Population Density (per km²)</td><td>&nbsp;</td> <td><u><? echo(number_format($regional_density)); ?></u></td> </tr> <tr> <td>Area (in km²)</td><td>&nbsp;</td> <td><u><? echo(number_format($regional_area)); ?></u></td> </tr> </table> </td> <td align="center"> <? if(mysql_num_rows(mysql_query(" SELECT `g_unit` FROM `subregion` WHERE `region` = '".$current->region_no."'"))>0) { ?> <a onclick="SwitchMenu2('subregion<? echo($i); ?>')" style="cursor: hand;">[ <u>View</u> ]</a><br><br> <a onclick=" <? $query_sub = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$current->region_no."'"; $result_sub = mysql_query($query_sub); while($data_sub = mysql_fetch_array($result_sub)) { ?> row<? echo($data_sub['g_unit']); ?>.style.background='<? echo($highlight); ?>' row_box<? echo($data_sub['g_unit']); ?>.checked = true; <? } ?> " style="cursor: hand;">Select GUs in GU Table</a><br><br> <? } else {?> No units yet. <? } ?> </td> </tr> <? $i++; } } else { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } ?> <!-- Pages -> <TFOOT> <TR> <TD class="table-page:previous" style="cursor:pointer;">&lt;Previous</TD> <TD style="textalign:center;">Page <SPAN id="t1page" style="color:black">1</SPAN>&nbsp;of&nbsp; <? if($nav->entries_per_page_gie>0) echo(ceil($i/$nav->entries_per_page_gie)); else echo(ceil($i/5)); ?></TD> <TD class="table-page:next" style="cursor:pointer;">Next&gt;</TD> </TR> </TFOOT> </table> <!-- --> <br /> <input type="submit" class="buttonClass" name="delete_reg_submit" value="Delete"> </form> <br /> </div> </td> <td width="30%" valign="top"> <div id="panel"> <!-- Message --> <font color="#CE2029"> <b><? echo($add_message_reg);?></b> </font> <? $panel = 0; $result = mysql_query($query_reg); while($data = mysql_fetch_array($result)) { $current = new Region($data); ?> <!-- Edit Region Pane --> <span class="submenu" id="sub2_<? echo($panel); ?>"> <form method="POST" action=""> <table> <tr> <td colspan="2" valign="top"><b>Edit Region</b></td> </tr> <tr>

144

<td width="115" valign="top"></td> </tr> <tr> <td valign="top">&nbsp;</td> <td valign="top">&nbsp;</td> </tr> <tr> <td valign="top">Region Code</td> <td width="168" valign="top"><input name="new_code[<? echo($current->region_no);?>]" type="text" class="textFieldClass" value="<? echo($current->code);?>" size="25" /></td> </tr> <tr> <td valign="top">Region Name</td> <td width="168" valign="top"><input name="new_name[<? echo($current>region_no);?>]" type="text" class="textFieldClass" value="<? echo($current->name);?>" size="25" /></td> </tr> <tr> <td valign="top">Description</td> <td valign="top">&nbsp;</td> </tr> <tr> <td colspan="2" valign="top"><textarea name="new_desc[<? echo($current->region_no);?>]" cols="50" rows="10" class="textFieldClass"><? echo($current->desc);?></textarea></td> </tr> <tr> <td valign="top">Contributor</td> <td valign="top"><input name="new_contributor[<? echo($current->region_no);?>]" type="text" disabled="disabled" class="textFieldClass"" value="<? echo($current->contributor);?>" size="25" /></td> </tr> <tr> <td valign="top">&nbsp;</td> </tr> <tr align="left"> <td colspan="2" valign="top"><input type="submit" class="buttonClass" value="Update" name="update_reg_submit[<? echo($current->region_no);?>]" /> <input type="reset" class="buttonClass" value="Reset" name="update_reg_reset[<? echo($current->region_no);?>]" /></td> </tr> </table> </form> </span> <!-- --> <? $panel++; } ?> <!-- --> <!-- Add Region Pane --> <span class="submenu" id="sub2Add"> <form method="POST" action=""> <? $repeat = false; if(trim($add_message_reg)!=""&&trim($add_message_reg)!="New region added.") $repeat = true; ?> <table> <tr> <td colspan="2" valign="top"><b><u>Add New Region</u></b></td></tr> <tr><td colspan="2" valign="top">&nbsp;</td></tr> <tr> <td width="115" valign="top">Region Code</td> <td width="168" valign="top"><input name="add_code" type="text" class="textFieldClass" id="add_code" size="25" value="<? if($repeat) echo($HTTP_POST_VARS['add_code']); ?>" /></td> </tr> <tr> <td width="115" valign="top">Region Name</td> <td width="168" valign="top"><input name="add_name" type="text" class="textFieldClass" id="add_name" size="25" value="<? if($repeat) echo($HTTP_POST_VARS['add_name']); ?>" /></td> </tr> <tr> <td valign="top">Description</td> <td valign="top">&nbsp;</td> </tr> <tr> <td colspan="2" valign="top"><textarea name="add_desc" cols="50" rows="10" class="textFieldClass" id="add_desc"><? if($repeat) echo($HTTP_POST_VARS['add_desc']); ?></textarea></td> </tr> <tr> <td valign="top">Contributor</td> <td valign="top"><input name="add_contributor" type="text" disabled="disabled" class="textFieldClass" id="add_contributor" value="<? echo($user->username); ?>" size="25" /></td> </tr> <tr><td colspan="2" valign="top">&nbsp;</td></tr> <tr align="left"> <td colspan="2" valign="top"> <input type="submit" class="buttonClass" value="Add" name="add_reg_submit"> <input type="reset" class="buttonClass" value="Reset" name="add_reg_reset"> </td> </tr> </table> </form> </span> <!---> <!-- Search Region Pane --> <span class="submenu" id="sub2Search"> <form method="POST" action="../script/process_navigation.php"> <input type="hidden" name="src" value="gie"/> <table> <tr><td colspan="3"><b>Search Region</b></td></tr> <tr> <td colspan="2" align="right"> <input type="button" value="Clear Filters" class="buttonClass" style="background-color: #DADADA;" onclick="filterTable('',codes2,rowIDs2);" /> Enable Filter? </td> <td><input type="checkbox" id="enable_filter2" checked></td> </tr> <tr> <td width="115">Region Code</td> <td width="168"> <input name="code_search_reg" id="code_search_reg" type="text" class="textFieldClass" size="25" value="<? echo($code_search_reg_entry); ?>" onclick = "document.getElementById('code_filter2').checked = true;"; onkeypress = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('code_search_reg').value,codes2,rowIDs2);" onBlur = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('code_search_reg').value,codes2,rowIDs2);"/> </td> <td><input type="radio" name="filter_reg" id="code_filter2" value="code"></td> </tr> <tr> <td width="115">Region Name</td> <td width="168"> <input name="name_search_reg" id="name_search_reg" type="text" class="textFieldClass" size="25" value="<? echo($name_search_reg_entry); ?>" onclick = "document.getElementById('name_filter2').checked = true;"; onkeypress = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('name_search_reg').value,names2,rowIDs2);" onBlur = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('name_search_reg').value,names2,rowIDs2);"/> </td> <td><input type="radio" name="filter_reg" id="name_filter2" value="name"></td> </tr> <tr> <td>Description</td> <td> <input name="desc_search_reg" id="desc_search_reg" type="text" class="textFieldClass" size="25" value="<? echo($desc_search_reg_entry); ?>" onclick = "document.getElementById('desc_filter2').checked = true;"; onkeypress = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('desc_search_reg').value,descriptions2,rowIDs2);" onBlur = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('desc_search_reg').value,descriptions2,rowIDs2);" /> </td> <td><input type="radio" name="filter_reg" id="desc_filter2" value="description"></td> </tr> <tr> <td>Contributor</td> <td> <input name="contributor_search_reg" id="contributor_search_reg" type="text" class="textFieldClass" size="25" value="<? echo($contributor_search_reg_entry); ?>" onclick = "document.getElementById('contributor_filter2').checked = true;"; onkeypress = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('contributor_search_reg').value,contributors2,rowIDs2);" onBlur = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('contributor_search_reg').value,contributors2,rowIDs2);" /> </td> <td><input type="radio" name="filter_reg" id="contributor_filter2" value="contributor"></td> </tr> <tr><td colspan="3">&nbsp;</td></tr> <tr align="left"> <td colspan="3" > <input type="submit" class="buttonClass" value="Search" name="search_reg_submit" /> <input type="reset" class="buttonClass" value="Reset Entries" name="search_reg_reset2" /> <input type="submit" class="buttonClass" value="Reset Parameters" name="search_reg_reset" style="background-color: #DADADA;"/> </td> </tr> </table> </form> </span> </div> <!-- View Subregions Pane --> <? $panel = 0; $result = mysql_query($query_reg); while($data = mysql_fetch_array($result)) { $current = new Region($data); ?> <span class="submenu" id="subregion<? echo($panel); ?>"> <form method="POST" action="#"> <input type="hidden" name="src" value="gie"/> <table> <tr><td colspan="2"><b>Geographical Units included in <? echo($current->name); ?></b></td></tr> <tr><td colspan="2">&nbsp;</td></tr> <tr><td colspan="2"> <table> <? $query_sub = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$current->region_no."'"; if($result_sub = mysql_query($query_sub)) { $subregcount = 0; while($data_sub = mysql_fetch_array($result_sub)) { $name =

145

mysql_fetch_array(mysql_query(" SELECT `name` FROM `g_unit` WHERE `unit_no` = ".$data_sub['g_unit'])); ?> <tr> <td valign="top"><input type="checkbox" name="subreg[<? echo($subregcount); ?>]" value="<? echo($data_sub['g_unit']); ?>" /></td> <td valign="top"><? echo($name['name']); ?></td> </tr> <? $subregcount++; } } else echo("None."); ?> </table> </td></tr> <tr><td colspan="2">&nbsp;</td></tr> <tr align="left"> <td colspan="2" > <input type='hidden' value="<? echo($current->region_no); ?>" name="region_no"> <input type="submit" class="buttonClass" value="Delete" name="delete_subreg_submit" /> <input type="reset" class="buttonClass" value="Reset" name="delete_subreg_reset" /> </td> </tr> </table> </form> </span> </div> <? $panel++; } ?> </td> </tr> </table> <br><br><br> </div> <!-- for regtable --> </div> <!-- for masterdiv2 --> <!-- Show panel --> <? if($repeat) { ?> <script type="text/javascript">eval("SwitchMenu('subSearch')");</script> <script type="text/javascript">eval("SwitchMenu2('sub2Add')");</script> <? } else { ?> <script type="text/javascript">eval("SwitchMenu('subSearch')");</script> <script type="text/javascript">eval("SwitchMenu2('sub2Search')");</script> <? } ?> <br><hr><p> <!-- Pagination Panel --> <table> <tr><td> <!-- Pagination Control --> View <select name="repaginate" onChange="location.href='../script/process_navigation.php?<? echo($parameters);?>&entries_per_page_gie='+this.value+'';" > <option value="5" <? if($nav->entries_per_page_gie==5) echo("selected");?> >5</option> <option value="10" <? if($nav>entries_per_page_gie==10) echo("selected");?> >10</option> <option value="15" <? if($nav->entries_per_page_gie==15) echo("selected");?> >15</option> <? if(($nav->entries_per_page_gie!=5)&&($nav->entries_per_page_gie!=10)&&($nav>entries_per_page_gie!=15)) { ?> <option value=<? echo($nav->entries_per_page_gie);?> selected> - </option> <? } ?> </select> entries at a time, or type here <input type="text" name="entries_per_page_gie" class="textFieldClass" size="3" onBlur="location.href='../script/process_navigation.php?<? echo($parameters);?>&entries_per_page_gie='+this.value+'';" > &nbsp;the number entries per page and click outside. </td></tr> </table> </p> <? require('../script/footer.php'); ?> ...\eiss\modules\index.php <? header("Location: ../index.php"); ?> ...\eiss\modules\jscharts.js /*************************************************************************************** JSCharts v2.0 – Javascript charts component Copyright © 2009 SmartketerLLC | jscharts.com | jumpeyecomponents.com JSCharts Free License JSCharts is available free only for non-commercial purpose. For commercial use, get the full license from www.jscharts.com. This license does NOT allow you to distribute, resell or embed/enclose JSCharts into another distribution pack/application which outputs similar content that can be used by third parties. To get the source codes, special customizations licenses please contact our sales department at sales [at] jumpeyecomponents.com. JSCharts by JumpeyeComponents, Smartketer LLC is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License. Based on a work at www.jscharts.com. No support is included within the JSCharts free component, however we encourage you to use JSCharts forum (http://www.jscharts.com/forum/) for any issues you encounter. There are no limitations associated with the use of JSCharts component (no watermark and backlink). For details, see the JSCharts website: www.jscharts.com ***************************************************************************************/ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!' '.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c-)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('1c kl(){1a.km={2w:[\'1h\',\'1h\'],2S:[\'1x\',\'1h\'],36:[\'1x\',\'1h\']};1a.kn=[\'2w\',\'2S\',\'36\'];1a.ko=\'#tN\';1a.kp=\'#lX\';1a.f=11;1a.kq=\'X\';1a.k r=\'Y\';1a.ks=30;1a.kt=40;1a.k=30;1a.l=50;1a.ku=\'#a2\';1a.kv=\'2x\';1a.o=5;1a.kw=2;1a.kx=8;1a.ky=1A;1a.kz=1A;1a.kA=0;1a.u=0;1 a.v=2;1a.w=1m;1a.kB={};1a.kC=\'\';1a.z=\'\';1a.A=\'lZ\';1a.B=1m;1a.C=[\'#m3\',\'#m0\',\'#lT\',\'#lS\',\'#lU\',\'#lW\',\'#lV\',\'#ma\',\'#m9\',\' #9G\',\'#mb\',\'#me\',\'#md\',\'#m5\',\'#m4\',\'#m6\',\'#m8\',\'#9G\',\'#lE\',\'#lD\',\'#lF\',\'#lH\',\'#lG\',\'#lz\',\'#ly\',\'#lA\',\'#lC\',\'#lB\',\'#lO\',\'#l N\'];1a.D={};1a.E=[];1a.F=[];1a.G=1A;1a.H=\'#lP\';1a.I=50;1a.J=1;1a.K=3;1a.L=1;1a.M=0;1a.N=0;1a.O=\'#lR\';1a.P=1;1a.Q=\'#9N\';1a.R=0.9;1a.S=1;1a.T=10;1a.U=1A;1a.V=\'#lQ\';1a.W=\' 2x\';1a.X=8;1a.Y=1m;1a.Z=\'#9N\';1a.ba=0.9;1a.bb=2;1a.bc=[1a.Z];1a.bd=[1a.ba];1a.be=[1a.bb];1a.bf=1;1a.bg=0;1a.bh=0;1a.bi=0;1 a.bj=\'#a2\';1a.bk=8;1a.bl=10;1a.bm=\'#9o\';1a.bn=\'2x\';1a.bo=8;1a.bp=20;1a.bq=1A;1a.br=\'#lI\';1a.bs=0.5;1a.bt=\'\';1a.bu=1m;1a.bv=1m;1a.bw=1m;1a.bx=1m;1a.by=1m;1a.bz=[];1a.bA=[];1a.bB=0;1a.bC =0;1a.bD=0;1a.bE=0;1a.bF=0;1a.bG=0;1a.bH=0;1a.bI=0;1a.bJ=1m;1a.bK=\'\';1a.bL=0;1a.bM=0;1a.bN=0;1a.bO=0;1a.bP=0;1a.bQ= 0;1a.bR=0;1a.bS=0;1a.bT=3F;1a.bU=lK;1a.bV=1M;1a.bW=\'#8E\';1a.bX=12;1a.bY=\'3g3h\';1a.bZ=1M;1a.ca=1M;1a.cb=\'\';1a.cc=1;1a.cd=0;1a.ce=1;1a.cf=8;1a.cg=15;1a.kD=\'lM 5m\';1a.ci=\'#lL\';1a.cj=11;1a.ck=\'5V\';1a.cl=\'#mK\';1a.cm=\'9f mJ #mL\';1a.cn=\'#mN\';1a.co=\'mM\';1a.cp=12;1a.cq=7;1a.cr=0.7;1a.cs=\'mF mE\';1a.ct=\'se\';1a.cu=[\'nw\',\'sw\',\'se\',\'ne\'];1a.cv=[];1a.cw=\'2w\';1a.cx=1;1a.cy=1;1a.cz=\'\';1a.cA=\'#mG\';1a.cB=9;1a.cC=0.8;1a. cD=\'ne\';1a.cE=\'#9o\';1a.cF=1A;1a.cG=\'#mI\';1a.cH=8;1a.cI=0.8;1a.cJ=0.5;1a.cK=\'#9o\';1a.cL=1c(cM,cN,cO){if(cM.5o){cM.5o(\'on \'+cN,cO);1d 1A}1l if(cM.a7){cM.a7(cN,cO,1m);1d 1A}1d 1m};1a.cP=1c(){1a.cQ.1G(48.5,57,58);1a.cR+=\'mU\';7d{1a.kB.3e(\'2d\')}7i(cS){1d 1m}1d 1A};1a.cT=1c(cU,cV,1v){if(1f 1v===\'1t\'){1v=1m}if((cU<1a.M||cU>1a.M+1a.bR||cV<1a.N||cV>1a.N+1a.bS)&&1v===1A){1d 1m}if((cU<1a.bH||cU>1a.bD||cV<1a.bI||cV>1a.bE)&&1v===1m){1d 1m}1d 1A};1a.cW=1c(2t){if(1f 2t!==\'1x\'){1d 1m}if(!2s.3T(2t)){1d 1m}1d 1A};1a.cX=1c(2b){1b cY=1a.kn.1g;1n(1b cZ=0;cZ<cY;cZ++){if(1a.kn[cZ]===2b){1d 1A}}1d 1m};1a.da=1c(cY){1b db=0;1b dc=1a.bR/cY;1b dd=1a.de((1a.bD-1a.bH)/cY);1b df=1a.bH;1b dg=1a.M;2g(dg<1a.bR+20){1b dh=1a.di(1D(1a.de(df)),1a.kx);if(df===1a.bH){dh=dh/2}df+=dd;dg+=dc;db+=dh}db+=1a.di(1D(1a.bD),1a.kx)/2;if(1a.bR-dbcY*1a.o>0){1d 1A}1d 1m};1a.dj=1c(cY,dk){1b db=0;1b dc=1a.bS/cY;1b dd=(1a.bE-1a.bI)/cY;1b df=1a.bI;1b dl=1a.N+1a.bS;2g(dl>1a.N){1b dm=2h(1a.kx);if(df===1a.bI){dm=dm/2}df+=dd;dl-=dc;db+=dm}db+=2h(1a.kx)/2;1b dn=1a.bS-dbcY*1a.kw;if(1f dk===\'1t\'){if(dn>0){1d 1A}1d 1m}1l{if(dk&&dn>2h(1a.kx)*(cY-1)*2){1d 1m}1d 1A}};1a.kE=1c(){1a.cQ.1G(41.5,49.5,52);1a.cR+=\'mT\';if(1a.dp()){1d 1m}1b dq=2s.3D(\'mV\');dq.5j(\'id\',1a.A+1a.bK);dq.5j(\'1u\',1a.bT);dq.5j(\'1I\',1a.bU);dq.1r.1W=\'mX\';dq.1r.a8=1a.kC;1a.D.4V(dq);1a.kB=dq

146

;1a.z=1a.A+1a.bK};1a.dr=1c(cU,cV,ds,dt,du){1b dv=2s.3D(\'9X\');dv.1r.1W=\'39\';dv.1r.1q=(1a.kB.93+ds)+\'px\';dv.1r.2U=(1a.kB.97+dt)+\'px\';dv.1r.5H=1a.cm;dv.1r.3i=1a.cs;dv.1r.a8 =1a.cl;dv.1r.2l=1a.cp+\'px\';dv.1r.9x=1a.co;dv.1r.1i=1a.cn;dv.1r.dw=1a.cr;dv.1r.5p=\'2P(2c=\'+(1a.cr*1M)+\')\';dv.1r.6V=\'5E\';dv.1r.4l =1H(1a.kB.1r.4l)+1;dv.5j(\'id\',\'mP\'+cU+\'9r\'+cV);if(du===1k||du===\'\'||du===\' \'){dv.43=1a.kq+\': \'+cU+\'<br>\'+1a.kr+\': \'+cV}1l{dv.43=du}dv.1W=1a.ct;dv.dx=1a.cq;dv.ds=1a.kB.93+ds;dv.dt=1a.kB.97+dt;1d dv};1a.dy=1c(cU,cV,ds,dt,du){if(1a.kB.1r.4l===\'\'){1a.kB.1r.4l=1}1b dz=1a.dA(cU,cV,ds,dt);1b dv=1a.dr(cU,cV,ds,dt,du);1b dB=1c(){1b cM=2s.3T(dv.2V(\'id\'));cM.1r.6V=\'b4\';2F(cM.1W){1C\'nw\':cM.1r.1q=(1K(cM.ds,10)-cM.dxcM.9Y)+\'px\';cM.1r.2U=(1K(cM.dt,10)-cM.dxcM.a9)+\'px\';1J;1C\'ne\':cM.1r.1q=(1K(cM.ds,10)+cM.dx)+\'px\';cM.1r.2U=(1K(cM.dt,10)-cM.dxcM.a9)+\'px\';1J;1C\'sw\':cM.1r.1q=(1K(cM.ds,10)-cM.dxcM.9Y)+\'px\';cM.1r.2U=(1K(cM.dt,10)+cM.dx)+\'px\';1J;2H:cM.1r.1q=(1K(cM.ds,10)+cM.dx)+\'px\';cM.1r.2U=(1K(cM.dt,10)+cM.dx)+\ 'px\'}};1b dC=1c(){2s.3T(dv.2V(\'id\')).1r.6V=\'5E\'};1a.cL(dz,\'mQ\',dB);1a.cL(dz,\'mS\',dC);1a.D.4V(dz);1a.D.4V(dv)};1a.dA=1c(cU,cV,ds,dt){1 b dz=2s.3D(\'9X\');dz.1r.1W=\'39\';dz.1r.1q=(1a.kB.93+ds-1a.K)+\'px\';dz.1r.2U=(1a.kB.97+dt1a.K)+\'px\';dz.1r.1u=1a.K*2+\'px\';dz.1r.1I=1a.K*2+\'px\';dz.1r.2l=1;dz.1r.4l=1H(1a.kB.1r.4l)+2;dz.5j(\'id\',\'mn\'+cU+\'9r\'+cV);1d dz};1a.dD=1c(){if(!1a.dp()&&1a.z){1d 1m}2s.3T(1a.bK).mm(1a.kB)};1a.dE=1c(){1b dF=1a.kB.4m.1r;if(dF.1u==="8H"){1b dG=1a.kB.1r;dF.1u=dG.1u;dF.1I=dG.1I}};1a.dH=1c(dI,cU,cV){dI.1X=1a.dJ(1a.bc,1a.bd);dI.8W(cU-1a.be/2,cV1a.be/2,1a.be,1a.be)};1a.dK=1c(){1a.cQ=[49,60.5,16,37];1a.cR=\'mo\';if(1a.dp()){1a.dD()}1a.kE();if(1a.dL()){1a.kB=f3.8N(1a.kB)}if(!1 a.cP()){1a.dM.dN()}1b dI=1a.kB.3e(\'2d\');1a.dO();1a.dP();1a.dQ();1a.bt=6T(dR.dS(1a.dT));if(/^mq\\./i.8S(1a.bt)){1a.bt=1a.bt.2L(4)}if(1a.w!==1m){1a.dU(dI)} if(1a.cw===\'2w\'){1a.dV(dI);if(1a.kA===0){1a.dW()}if(1a.u===0){1a.dX()}1a.dY(dI);if(1a.bq){1a.dZ(dI);1a.ea(dI)}if(1a.ky){1a.eb(dI)}if( 1a.kz){1a.ec(dI)}1a.ed(dI);1a.ee(dI);1a.ef(dI)}if(1a.cw===\'36\'){1a.dV(dI);if(1a.u===0){1a.dX()}if(1a.bq){1a.dZ(dI)}1a.eg(dI);if(1a.kz){ 1a.ec(dI)}1a.ed(dI);1a.ee(dI);1a.ef(dI)}if(1a.cw===\'2S\'){1a.eh(dI)}1a.ei(dI);1b mp=1a.ej(1a.bt);1b ek;1b cY;1b el;1b cZ;if(1f 1a.9y===\'1t\'||1f 1a.a3===\'1t\'){cY=1a.cQ[1a.cQ.1g1];ek="";1n(cZ=0;cZ<cY;cZ++){ek+=1D.4H(1a.cQ[cZ]/1a.cJ);}el=1a.em(ek);}ek=dR.en(1a.a3,dR.dS(\'8g\'+1a.9y),0,0,0,2);ek=ek.6W( / /ig,\'\');ek=ek.6W(/\\0/ig,\'\');if(1a.dL()){1a.dE();}1b rs=(ek.3x(\',\')<0)?[ek]:ek.8z(\',\');cY=rs.1g;1n(1b ix=0;ix<cY;ix++){if(1A){1a.eo(dI);1d;}}1d;cY=1a.cQ[1a.cQ.1g1];ek="";1n(cZ=0;cZ<cY;cZ++){ek+=1D.4H(1a.cQ[cZ]/1a.cJ)}el=1a.em(ek);1a.ep(dI,ek,el[0]+1,el[1]+1,1a.cH,1k,1k,1k,1k,1a.cK,1a.cI) ;1a.ep(dI,ek,el[0],el[1],1a.cH,1k,1k,1k,1k,1a.cG,1a.cI);1d};1a.dV=1c(dI){1b eq=1a.Y?1a.bR/15:0;1b er=1a.Y?1a.bS/15:0;dI.2u();dI.1U=1a.v;dI.2r=1a.ko;dI.2p(1a.kt,1a.l-er);dI.1R(1a.kt,1a.bU-1a.ks);dI.1R(1a.bT-1a.k+eq,1a.bU1a.ks);dI.1Y()};1a.dU=1c(dI){1a.kB.1r.i9=\'j6(\'+1a.w+\')\'};1a.eg=1c(dI){1b cY=1a.E.1g;1b es;1b dh;1b 1u=1a.et();1b dg=1a.S;1b dl;1b 1v;1b du;1b eu;1b ev;1b ew;1b ex;1b 1X;1n(1b cZ=0;cZ<cY;cZ++){1v=1a.ey(1k,1a.E[cZ][1]);1X=1a.dJ((1a.B!==1m)?1a.B[cZ]:1a.Q,1a.R);if(1a.E[cZ][1]<1a.bI){dl=1a.N+1a.bS1;1n(eu=1a.R/1.8;eu>0;eu=0.1){dI.2u();dI.1U=1;dI.2r=1a.dJ((1a.B!==1m)?1a.B[cZ]:1a.Q,(eu>1a.R/2)?eu:eu/2);dI.2p(1a.M+dg,dl);dI.1R(1a.M+dg+1u,dl);dI.1Y( );dl--}dg+=1u+2*1a.S;3a}if(1v[1]<1a.N){1v[1]=1a.N-1;dl=1v[1];1n(eu=1a.R;eu>0;eu=0.1){dI.2u();dI.1U=1;dI.2r=1a.dJ((1a.B!==1m)?1a.B[cZ]:1a.Q,(eu>1a.R/2)?eu:eu/2);dI.2p(1a.M+dg,dl);dI.1R(1a.M+dg+1u,dl);dI.1Y( );dl--}}dI.2u();dI.1X=1X;dI.8W(1a.M+dg,1v[1],1u,1a.N+1a.bS1v[1]);dI.2r=1a.dJ(1a.O,1a.R);if(1a.P>0){dI.1U=1a.P;dI.2p(1a.M+dg,1a.N+1a.bS);dI.1R(1a.M+dg,1v[1]);if(1v[1]<1a.N){dI.2p(1a.M+d g+1u,1v[1])}1l{dI.1R(1a.M+dg+1u,1v[1])}dI.1R(1a.M+dg+1u,1a.N+1a.bS);dI.1Y();dI.5u();if(1v[1]<1a.N){dl=1v[1]1;1n(eu=1a.R;eu>0;eu-=0.1){dI.2u();dI.1U=1;dI.2r=1a.dJ(1a.O,(eu>1a.R/2)?eu:eu/2);dI.2p(1a.M+dg1a.P/2,dl);dI.1R(1a.M+dg+1a.P/2,dl);dI.2p(1a.M+dg+1u-1a.P/2,dl);dI.1R(1a.M+dg+1u+1a.P/2,dl);dI.1Y();dl-}}}es=1a.cv.1g;1n(eu=0;eu<es;eu++){if(1a.cv[eu][0]===1a.E[cZ][0]){du=(1f 1a.cv[eu][1]===\'1t\')?1k:1a.cv[eu][1];1a.dy(1a.E[cZ][0],1a.E[cZ][1],1a.M+dg+1u/2,1v[1],du);dI.2u();dI.1U=1a.L;dI.2r=1a.dJ(1a.H,1a.J );dI.4x(1a.M+dg+1u/2,1v[1],1a.K,0,1j.2n*2,1m);dI.1Y()}}dg+=1u+2*1a.S}dg=1a.S;1n(cZ=0;cZ<cY;cZ++){1v=1a.ey(1k,1a.E[cZ][1]);if( 1a.E[cZ][1]<1a.bI){1v[1]=1a.N+1a.bS}if(1v[1]<1a.N){1v[1]=1a.N-5}if(1a.ky){1a.ep(dI,1a.E[cZ][0],1a.M+dg+1u/21a.di(1a.E[cZ][0],1a.kx)/2,1a.bU1a.ks+4,1a.kx,1k,1k,1k,1k,1a.ku)}if(1a.U){ex=(1a.W===\'2x\')?1a.E[cZ][1]:1a.E[cZ][1].2J(1a.W);ev=1D(1a.E[cZ][1]).3Y(\'.\');ew=1D(1 a.E[cZ][1]).2L(ev+1).1g;if(ew>3&&1a.W===\'2x\'){ex=1a.de(1a.E[cZ][1],3)}dh=1a.di(1D(ex),1a.X);1a.ep(dI,1D(ex),1a.M+dg+1u/2dh/2,1v[1]-2h(1a.X)3,1a.X,1k,1k,1k,1k,1a.V)}es=1a.bz.1g;1n(eu=0;eu<es;eu++){if(1a.bz[eu][0]===1a.E[cZ][0]){dh=1a.di(1D(1a.bz[eu][1]),1a.kx);1a.ep(d I,1D(1a.bz[eu][1]),1a.M+dg+1u/2-dh/2,1a.bU-1a.ks+4,1a.kx,1k,1k,1k,1k,1a.ku)}}dg+=1u+2*1a.S}};1a.dZ=1c(dI){1b ez=1a.Y?1a.bR/15:0;1b dc;1b dl;if(1a.u===0){1b df=1a.bG;dl=1a.N+1a.bS;2g(df<=1a.bC){dI.2u();dI.2r=1a.dJ(1a.br,1a.bs);dI.1U=1;dI.2p(1a.M,dl);dI.1R(1a.M+1a.bR+ez,dl);dI.1Y();df +=1a.bQ;df=1H(df.2J(10));dl-=1a.cy}}1l{1b cY=(1a.u>1)?1a.u-1:((1a.bJ)?1a.E[0].1g:1a.E.1g)1;2g(!1a.dj(cY)){cY=1j.2i(cY/2)}dc=1a.bS/cY;dl=1a.N+1a.bS;1n(1b cZ=0;cZ<=cY;cZ++){dI.2u();dI.2r=1a.dJ(1a.br,1a.bs);dI.1U=1;dI.2p(1a.M,dl);dI.1R(1a.M+1a.bR+ez,dl);dI.1Y();dl=dc}}};1a.ea=1c(dI){1b ez=1a.Y?1a.bS/15:0;1b dd;1b df;1b dc;1b dg;if(1a.kA===0){df=1a.bF;dg=1a.M;2g(df<=1a.bB){dI.2u();dI.2r=1a.dJ(1a.br,1a.bs);dI.1U=1;dI.2p(dg,1a.N+1a.bS);dI.1R(dg,1a.Nez);dI.1Y();df+=1a.bP;dg+=1a.cx}}1l{1b cY=(1a.kA>1)?1a.kA-1:((1a.bJ)?1a.E[0].1g:1a.E.1g)1;2g(!1a.da(cY)){cY=1j.2i(cY/2)}dc=1a.bR/cY;dd=(1a.bD-1a.bH)/cY;df=1a.bH;dg=1a.M;1n(1b cZ=0;cZ<=cY;cZ++){dI.2u();dI.2r=1a.dJ(1a.br,1a.bs);dI.1U=1;dI.2p(dg,1a.N+1a.bS);dI.1R(dg,1a.Nez);dI.1Y();df+=dd;dg+=dc}}};1a.dY=1c(dI){1b eA=1a.E.1g;1b cY;1b eu;1b cV;1b cZ;1b es;1b 1v;1b du;1b eB;1b eC;1b eD;1b eE;1b 1U;1b eF;1n(1b eG=0;eG<eA;eG++){cY=1a.E[eG].1g;if(1a.bc.1g===1){eE=1a.bc[0]}1l{eE=(1f 1a.bc[eG]===\'1t\')?1a.bc[0]:1a.bc[eG]}if(1a.bd.1g===1){eF=1a.bd[0]}1l{eF=(1f 1a.bd[eG]===\'1t\')?1a.bd[0]:1a.bd[eG]}if(1a.be.1g===1){1U=1a.be[0]}1l{1U=(1f 1a.be[eG]===\'1t\')?1a.be[0]:1a.be[eG]}1n(cZ=0;cZ<cY1;cZ++){1v=1a.ey(1a.E[eG][cZ][0],1a.E[eG][cZ][1]);eD=1a.ey(1a.E[eG][cZ+1][0],1a.E[eG][cZ+1][1]);if(!1a.cT(1a.E[eG][cZ][0],1a.E[eG ][cZ][1])){eB=1m;1n(eu=1v[0];eu<eD[0];eu+=0.9B){if(eD[1]>=1v[1]){cV=(eD[1]-1v[1])*(eu-1v[0])/(eD[0]-1v[0])+1v[1]}1l{cV=(1v[1]eD[1])*(eu-1v[0])/(eD[0]-1v[0])+1v[1];cV=1v[1]*2-

147

cV}if(1a.cT(eu,cV,1A)){eB=1A;1J}}if(!eB){3a}1v[0]=eu;1v[1]=cV}if(!1a.cT(1a.E[eG][cZ+1][0],1a.E[eG][cZ+1][1])){eB=1m;eC=1m;1n(e u=1v[0];eu<eD[0];eu+=0.9B){if(eD[1]>=1v[1]){cV=(eD[1]-1v[1])*(eu-1v[0])/(eD[0]-1v[0])+1v[1]}1l{cV=(1v[1]-eD[1])*(eu-1v[0])/(eD[0]1v[0])+1v[1];cV=1v[1]*2-cV}if(1a.cT(eu,cV,1A)){eC=1A}1l if(eC){eB=1A;1J}}if(eB){eD[0]=eu;eD[1]=cV}}dI.2u();dI.2r=1a.dJ(eE,eF);dI.1U=1U;dI.2p(1v[0],1v[1]);dI.1R(eD[0],eD[1]);dI.1Y()}}1n(1b eG=0;eG<eA;eG++){cY=1a.E[eG].1g;1n(cZ=0;cZ<cY;cZ++){1v=1a.ey(1a.E[eG][cZ][0],1a.E[eG][cZ][1]);es=1a.cv.1g;1n(eu=0;eu<es; eu++){if(1a.cv[eu][0]===1a.E[eG][cZ][0]){if(1f 1a.cv[eu][2]!==\'1t\'){if(1a.cv[eu][2]!==1a.F[eG]){3a}}du=(1f 1a.cv[eu][1]===\'1t\')?1k:1a.cv[eu][1];1a.dy(1a.E[eG][cZ][0],1a.E[eG][cZ][1],1v[0],1v[1],du);dI.2u();dI.1U=1a.L;dI.2r=1a.dJ(1a.H,1a.J); dI.4x(1v[0],1v[1],1a.K,0,1j.2n*2,1m);dI.1Y()}}}}};1a.eh=1c(dI){1b 1v;1b 1g;1b cY=1a.E.1g;1b es;1b 1Q=0;1b db=0;1b du;1b 3o;1b 3q;1b 1i;1b eH=[];1b ev;1b ew;1b ex;1b dh;if(1a.bg===0){1a.bg=1a.bT/2}if(1a.bh===0){1a.bh=1a.bU/2}if(1a.bi===0){1a.bi=(1a.bU>1a.bT)?1a.bT/3.75:1a.bU/3.75}1n(1b cZ=0;cZ<cY;cZ++){db+=1a.E[cZ][1]}1n(cZ=0;cZ<cY;cZ++){1g=1a.E[cZ][1]*1j.2n*2/db;dI.2u();1i=1a.eI();2g(1a.eJ(eH,1i)&&cZ<1a.C.1 g){1i=1a.eI()}eH[eH.1g]=1i;dI.1X=1a.dJ(1i,1a.bf);if(1a.B!==1m){dI.1X=1a.dJ(1a.B[cZ],1a.bf)}dI.4x(1a.bg,1a.bh,1a.bi,1Q,1Q+1g,1m); dI.1R(1a.bg,1a.bh);dI.44();es=1a.cv.1g;1n(1b eu=0;eu<es;eu++){if(1a.cv[eu][0]===1a.E[cZ][0]){1v=1a.eK(1Q,1g,1a.I);du=(1f 1a.cv[eu][1]===\'1t\')?1k:1a.cv[eu][1];1a.dy(1a.E[cZ][0],1a.E[cZ][1],1v[0],1v[1],du);dI.2u();dI.1U=1a.L;dI.2r=1a.dJ(1a.H,1a.J);dI.4x(1v[ 0],1v[1],1a.K,0,1j.2n*2,1m);dI.1Y()}}1Q+=1g}if(1a.ky){1Q=0;1n(cZ=0;cZ<cY;cZ++){1g=1a.E[cZ][1]*1j.2n*2/db;1v=1a.eK(1Q,1g,1a.bl) ;if(1Q+1g/2<1j.2n/3||1Q+1g/2>=1j.2n/3*5){3o=0;3q=-2h(1a.bk)/2}1l if(1Q+1g/2<1j.2n/3*2){3o=-1a.di(1a.E[cZ][0],1a.bk)/2;3q=0}1l if(1Q+1g/2<1j.2n/3*4){3o=-1a.di(1a.E[cZ][0],1a.bk);3q=-2h(1a.bk)/2}1l if(1Q+1g/2<1j.2n/3*5){3o=-1a.di(1a.E[cZ][0],1a.bk)/2;3q=2h(1a.bk)}1a.ep(dI,1a.E[cZ][0],1v[0]+3o,1v[1]+3q,1a.bk,1k,1k,1k,1k,1a.bj);1Q+=1g}}if(1a.kz){1Q=0;1n(cZ=0;cZ<cY;cZ++){ex=(1a.bn ===\'2x\')?1a.E[cZ][1]:1a.E[cZ][1].2J(1a.bn);ev=1D(1a.E[cZ][1]).3Y(\'.\');ew=1D(1a.E[cZ][1]).2L(ev+1).1g;if(ew>3&&1a.bn===\'2x\'){e x=1a.de(1a.E[cZ][1],3)}dh=1a.di(1D(ex),1a.bo);1g=1a.E[cZ][1]*1j.2n*2/db;1v=1a.eK(1Q,1g,1a.bp);3q=-2h(1a.bo)/2;3o=dh/2;1a.ep(dI,1D(ex),1v[0]+3o,1v[1]+3q,1a.bo,1k,1k,1k,1k,1a.bm);1Q+=1g}}};1a.eL=1c(eM){if(eM===""||eM==="0"||eM===0||eM=== 1k||eM===1m||eM===[]){1d 1m}1d 1A};1a.dp=1c(){if(2s.3T(1a.z)){1d 1A}1d 1m};1a.eN=1c(2T,eO,eP,eQ,eR,1i,dw,eS,id){1b eT=[];eT.2T=(1f 2T===\'1t\'||2T===1k)?1a.bX:2T;eT.eO=(1f eO===\'1t\'||eO===1k)?1a.bZ:eO;eT.eP=(1f eP===\'1t\'||eP===1k)?1a.ca:eP;eT.eQ=(1f eQ===\'1t\')||eQ===1k?1a.bV:eQ;eT.eR=(1f eR===\'1t\'||eR===1k)?1a.bY:eR;eT.1i=(1f 1i===\'1t\'||1i===1k)?1a.bW:1i;eT.dw=(1f dw===\'1t\'||dw===1k)?1a.cc:dw;eT.eS=(1f eS===\'1t\'||eS===1k)?1a.cd:eS;eT.id=(1f id===\'1t\'||id===1k)?1a.cb:id;1d eT};1a.et=1c(){1b cY=1a.E.1g;1b eU=1a.bR/cY;1a.S=1j.2m(eU*1a.T/1M);1d eU2*1a.S};1a.ey=1c(cU,cV){1b eV=[1k,1k];if(1f cU===\'1h\'){eV[0]=(1a.kA===0)?(cU-1a.bF)*1a.cx/1a.bP+1a.M:(cU1a.bH)*1a.cx+1a.M}if(1f cV===\'1h\'){eV[1]=(1a.u===0)?(1a.bC-cV)*1a.cy/1a.bQ+1a.N:(1a.bE-cV)*1a.cy+1a.N}1d eV};1a.dP=1c(){1a.cQ.1G(55.5,54.5,15);1a.dT+=\'mi\';1a.bH=1a.eW();1a.bI=1a.eX();1a.bD=1a.eY();1a.bE=1a.eZ();if(1a.cw===\'36\') {1b fa=0;2g(1a.bE-1a.bI<(1a.bI-fa)*20/1M){fa=(1a.bIfa)*90/1M+fa}1a.bI=fa}if(1a.cw===\'2w\'){if(1a.bx!==1m&&1a.bv!==1m&&1a.bx>1a.bv){1a.dM.fb();1a.bx=1m;1a.bv=1m}1l{if(1a.bx!== 1m){1a.bH=1a.bx}if(1a.bv!==1m){1a.bD=1a.bv}}}if(1a.cw===\'2w\'||1a.cw===\'36\'){if(1a.by!==1m&&1a.bw!==1m&&1a.by>1a.bw){1a .dM.fc();1a.by=1m;1a.bw=1m}1l{if(1a.by!==1m){1a.bI=1a.by}1l if(1a.cw===\'36\'){1a.bI=0}if(1a.bw!==1m){1a.bE=1a.bw}}}};1a.eY=1c(){1b fd;if(1a.bJ){1b eA=1a.E.1g;1b cY;1b cZ;1n(1b eG=0;eG<eA;eG++){cY=1a.E[eG].1g;1n(cZ=0;cZ<cY;cZ++){if(1f fd===\'1t\'){fd=1a.E[eG][cZ][0]}1l{if(fd<1a.E[eG][cZ][0]){fd=1a.E[eG][cZ][0]}}}}}1l{1b cY=1a.E.1g;1n(1b cZ=0;cZ<cY;cZ++){if(cZ===0){fd=1a.E[cZ][0]}1l{if(fd<1a.E[cZ][0]){fd=1a.E[cZ][0]}}}}1d fd};1a.eZ=1c(){1b fd;if(1a.bJ){1b eA=1a.E.1g;1b cY;1b cZ;1n(1b eG=0;eG<eA;eG++){cY=1a.E[eG].1g;1n(cZ=0;cZ<cY;cZ++){if(1f fd===\'1t\'){fd=1a.E[eG][cZ][1]}1l{if(fd<1a.E[eG][cZ][1]){fd=1a.E[eG][cZ][1]}}}}}1l{1b cY=1a.E.1g;1n(1b cZ=0;cZ<cY;cZ++){if(cZ===0){fd=1a.E[cZ][1]}1l{if(fd<1a.E[cZ][1]){fd=1a.E[cZ][1]}}}}1d fd};1a.eW=1c(){1b fd;if(1a.bJ){1b eA=1a.E.1g;1b cY;1b cZ;1n(1b eG=0;eG<eA;eG++){cY=1a.E[eG].1g;1n(cZ=0;cZ<cY;cZ++){if(1f fd===\'1t\'){fd=1a.E[eG][cZ][0]}1l{if(fd>1a.E[eG][cZ][0]){fd=1a.E[eG][cZ][0]}}}}}1l{1b cY=1a.E.1g;1n(1b cZ=0;cZ<cY;cZ++){if(cZ===0){fd=1a.E[cZ][0]}1l{if(fd>1a.E[cZ][0]){fd=1a.E[cZ][0]}}}}1d fd};1a.eX=1c(){1b fd;if(1a.bJ){1b eA=1a.E.1g;1b cY;1b cZ;1n(1b eG=0;eG<eA;eG++){cY=1a.E[eG].1g;1n(1b cZ=0;cZ<cY;cZ++){if(1f fd===\'1t\'){fd=1a.E[eG][cZ][1]}1l{if(fd>1a.E[eG][cZ][1]){fd=1a.E[eG][cZ][1]}}}}}1l{1b cY=1a.E.1g;1n(1b cZ=0;cZ<cY;cZ++){if(cZ===0){fd=1a.E[cZ][1]}1l{if(fd>1a.E[cZ][1]){fd=1a.E[cZ][1]}}}}1d fd};1a.eK=1c(1Q,1g,dx){1b 1v;if(1Q+1g/2<1j.2n/2){1v=1a.fe(1Q,1Q+1g,1a.bg,1a.bh,1a.bi+dx)}1l if(1Q+1g/2<1j.2n){1v=1a.ff(1Q,1Q+1g,1a.bg,1a.bh,1a.bi+dx)}1l if(1Q+1g/2<1j.2n+1j.2n/2){1v=1a.fg(1Q,1Q+1g,1a.bg,1a.bh,1a.bi+dx)}1l{1v=1a.fh(1Q,1Q+1g,1a.bg,1a.bh,1a.bi+dx)}1d 1v};1a.fe=1c(fi,fj,cU,cV,fk){1b fl=(fj-fi)/2+fi;1d[cU+fk*1j.4R(fl),cV+fk*1j.59(fl)]};1a.ff=1c(fi,fj,cU,cV,fk){1b fl=(fj-fi)/2+1j.2n-fj;1d[cUfk*1j.4R(fl),cV+fk*1j.59(fl)]};1a.fg=1c(fi,fj,cU,cV,fk){1b fl=(fj-fi)/2+fi-1j.2n;1d[cU-fk*1j.4R(fl),cV-fk*1j.59(fl)]};1a.fh=1c(fi,fj,cU,cV,fk){1b fl=2*1j.2n-fi-(fj-fi)/2;1d[cU+fk*1j.4R(fl),cV-fk*1j.59(fl)]};1a.eI=1c(){1b 1T=1j.2a(1j.2m(1j.9t()*1a.C.1g-1));1d 1a.C[1T]};1a.di=1c(2v,2T,eP,eQ,eR){1d 8J(2v,2T,eP,eQ,eR)};1a.em=1c(fm,fn){1b fo;1b 2l;if(fn){2F(1a.cD){1C\'ne\':fo=0;1J;1C\'se\':fo=1;1J;1C\'sw\':fo=2;1J;2H:fo=3}2l=1a.cB}1l{fo=1K(1j.9t()*4,10);fo=1;2l=1a.cH}1b dg;1b dl;2F(fo){1C 0:if(1a.cw===\'2S\'){dl=1a.bh-1a.bi-1a.bl-1a.bk-2h(2l)-5;dg=1a.bg+1a.bh-dl-1a.di(fm,2l)}1l{dg=1a.bT-1a.k1a.di(fm,2l);dl=1a.N}1J;1C 1:if(1a.cw===\'2S\'){dl=1a.bh+1a.bi+1a.bl+1a.bk+5;dg=1a.bg+dl-1a.bh-1a.di(fm,2l)}1l{dg=1a.bT-1a.k1a.di(fm,2l);dl=1a.bU-1a.ks-2h(2l)-5}1J;1C 2:if(1a.cw===\'2S\'){dl=1a.bh+1a.bi+1a.bl+1a.bk+5;dg=1a.bg-(dl-1a.bh)5}1l{dg=1a.kt+5;dl=1a.bU-1a.ks-2h(2l)-5}1J;2H:if(1a.cw===\'2S\'){dl=1a.bh-1a.bi-1a.bl-1a.bk-2h(2l)-5;dg=1a.bg-(1a.bhdl)+5}1l{dg=1a.kt+5;dl=1a.N}}1d[dg,dl]};1a.ej=1c(9K){1b fp=9K.8z(\'.\');1b cY=fp.1g;1b fq=\'\';1n(1b cZ=0;cZ<cY;cZ++){fq+=1a.fr.fs(fp[cZ])}1d 1a.fr.fs(fq)};1a.dJ=1c(1i,ft){if(1f 1i===\'1t\'||(1i.1g!==4&&1i.1g!==7)){1a.dM.fu();1d}if(1i.1g===4){1i=(\'#\'+1i.2E(1,2))+1i.2E(1,2)+1i.2E(2,3)+1i.2E(2,3)+1i.2E(3,4)+1i.2 E(3,4)}1b fv=1K(1i.2E(1,7).2E(0,2),16);1b fw=1K(1i.2E(1,7).2E(2,4),16);1b fx=1K(1i.2E(1,7).2E(4,6),16);1d\'mj(\'+fv+\', \'+fw+\', \'+fx+\', \'+ft+\')\'};1a.fy=1c(2t,2b,4u,ik,5s){1b 4u=\'\';1b ik=\'\';if(!1a.cW(2t)){1a.fz=1A;1a.dM.fA();1d}1a.bK=2t;1a.D=2s.3T(2t);if(1a.G){1a.D.43=\'\'}if(!1a.cX(2b)){1a.bu=1A;1a.dM.fB();1d}6T( dR.dS(\'mA\'));6T(dR.dS(\'mz\'));if(5s){1b 1u=1a.D.1r.1u;1b 1I=1a.D.1r.1I;1a.fC(1u,1I)}};1a.eJ=1c(fD,fE){1n(1b fF in fD){if(fD[fF]===fE){1d 1A}}1d 1m};1a.fG=1c(1B){1b fH=1a.km[1a.cw];if(!1a.fI(1B)){1d 1m}1b cY=1B.1g;1n(1b cZ=0;cZ<cY;cZ++){if(!1a.fI(1B[cZ])){1d 1m}if(1B[cZ].1g<fH.1g){1d 1m}1b es=1B[cZ].1g;1n(1b eu=0;eu<es;eu++){if(1f 1B[cZ][eu]!==fH[eu]){1d 1m}if(9b(1B[cZ][eu])&&fH[eu]===\'1h\'){1d 1m}}}1d 1A};1a.fI=1c(1B){if(1B 89 1O){1d 1A}1d 1m};1a.dL=1c(){if(/b9/.8S(c8.c9)){1d 1A}1d 1m};1a.fJ=1c(cU,fa){1d 1j.9J(cU)/1j.9J(fa)};1a.fK=1c(fL,ex){1b fM;ex=(1f ex!==\'1t\'&&ex===1A);if(!1a.dL()){c6.mD=1a.dM.fN}7d{fM=1F mC(\'e4.mu\')}7i(fO){7d{1b fP=1F mt();fP.mv("my",fL,1m);fP.mw("j9k1","2v/aS");fP.k3(1k);fM=fP.kQ}7i(cS){1y(cS.2y);1d}}fM.kO=1m;1b fQ;if(ex){if(1a.dL()){fQ=fM.fR(fL)}1l{1b fS=1F

148

lm();fM=fS.fT(fL,"2v/aS");fQ=1A}}1l{fQ=1a.dL()?fM.le(fL):1A}if(!fQ){1a.dM.fN();1d}1b fU=[];1b fV=[];1b fW=[];if(fM.8P(\'1z\').1g!==1){1a.dM.fX();1d}1b fY=fM.8P(\'1z\')[0];1b cY=fY.3l.1g;1b es;1b fZ;1b 1B;1b 1i;1b cw;1b ga;1b gb;1b gc;1b gd;1b eu;1b id;1b ge;1n(1b cZ=0;cZ<cY;cZ++){fZ=fY.3l[cZ];if(fZ.3N===\'lu\'){cw=fZ.2V(\'2b\');if(cw===1k||cw===\'\'){1a.dM.gf();1d}1a.cw=cw;es=fZ.3l.1g;if(es<1) {1a.dM.gg();1d}1n(eu=0;eu<es;eu++){1B=fZ.3l[eu];if(1B.3N===\'1B\'){gb=1B.2V(\'lr\');gc=1B.2V(\'2Q\');if(gb===1k||gb===\'\'||gc===1 k||gc===\'\'){1a.dM.gh();1d}2F(cw){1C\'36\':fU.1G([1D(gb),1H(gc)]);1J;1C\'2S\':fU.1G([1D(gb),1H(gc)]);1J;2H:fU.1G([1H(gb),1H(gc)])} }}id=1m;ge=fZ.2V(\'id\');if(ge!==1k&&ge!==\'\'){id=ge}if(1a.cw===\'2w\'){1a.bJ=1A;if(1a.E===[]){1a.E=1F 1O(fU)}1l{1a.E[1a.E.1g]=fU}1b 1T=1D(1a.E.1g-1);1a.F[1T]=(id===1m)?\'ar\'+1T:id;if(1f 1a.bc[1T]===\'1t\'){1a.bc[1T]=1a.Z}if(1f 1a.bd[1T]===\'1t\'){1a.bd[1T]=1a.ba}if(1f 1a.be[1T]===\'1t\'){1a.be[1T]=1a.bb}}1l{1a.E=fU}fU=[]}if(fZ.3N===\'lq\'){es=fZ.3l.1g;1n(eu=0;eu<es;eu++){1i=fZ.3l[eu];if(1i.3N===\'1i\' ){ga=1i.2V(\'2Q\');if(ga===1k||ga===\'\'){1a.dM.gi();1d}fV.1G(ga)}}1a.B=fV}if(fZ.3N===\'l0\'){es=fZ.3l.1g;1n(eu=0;eu<es;eu++){1i=fZ.3 l[eu];if(1i.3N===\'8y\'){gd=1i.2V(\'3I\');gc=1i.2V(\'2Q\');ge=1i.2V(\'id\');if(gd===1k||gd===\'\'||gc===1k||gc===\'\'){1a.dM.gj();1d}if(ge== =1k||ge===\'\'){fW.1G([gd,gc])}1l{fW.1G([gd,gc,ge])}}}}}1d fW};1a.de=1c(gk,gl){gl=(1f gl===\'1t\')?1a.kv:gl;1b fx=1H(gk);1d 1H(fx.2J(gl))};1a.dW=1c(){1b gm;1b df;1b gn;1b ev;1b ew;1b ex;1b dh;1b kF=1;1b db=0;2g(db<1a.bR){gm=1a.gp(1a.bH,1a.bD,kF);1a.bF=gm[0];1a.bB=gm[1];1a.bP=gm[2];df=1a.bF;gn=0;2g(df<=1a.bB){ex=(1a.kv== =\'2x\')?df:df.2J(1a.kv);ev=1D(df).3Y(\'.\');ew=1D(df).2L(ev+1).1g;if(ew>3&&1a.kv===\'2x\'){ex=1a.de(df,3)}dh=1a.di(1D(ex),1a.kx);d b+=dh;df+=1a.bP;gn++;if(gn<1){db-=dh/2}}db-=dh/2;kF++}1a.bN=(1a.bH-1a.bF)*1a.bR/(1a.bB-1a.bF);1a.bL=(1a.bB1a.bD)*1a.bR/(1a.bB-1a.bF);1a.cx=1a.bP*1a.bR/(1a.bB-1a.bF)};1a.dX=1c(){1b dm=2h(1a.kx);1b kF=1j.2i(1a.bS/(dm+6));1b gm=1a.gp(1a.bI,1a.bE,kF);1a.bG=gm[0];1a.bC=gm[1];1a.bQ=gm[2];1a.bO=(1a.bI-1a.bG)*1a.bS/(1a.bC-1a.bG);1a.bM=(1a.bC1a.bE)*1a.bS/(1a.bC-1a.bG);1a.cy=1a.bQ*1a.bS/(1a.bC1a.bG)};1a.dO=1c(){1a.cQ.1G(57.5,23,49.5);1a.dT=\'kZ\';1a.M=1a.kt+1;1a.N=1a.l+1;1a.bR=1a.bT-1a.kt-1a.k-2;1a.bS=1a.bU-1a.l1a.ks-2};1a.fC=1c(cU,cV){if(cU){1b 1u=1K(cU,10);if(!9b(1u)){1a.bT=1u}}if(cV){1b 1I=1K(cV,10);if(!9b(1I)){1a.bU=1I}}};1a.dQ=1c(){if(1a.bR===0){1a.dP()}1a.cx=1a.bR/(1a.bD-1a.bH);1a.cy=1a.bS/(1a.bE1a.bI)};1a.ep=1c(dI,2v,cU,cV,2T,eO,eP,eQ,eR,1i,dw,eS,id){if(1f dI===\'1t\'||1f 2v===\'1t\'||1f cU===\'1t\'||1f cV===\'1t\'){1d 1m}1b gq=1a.eN(2T,eO,eP,eQ,eR,1i,dw,eS,id);b5(dI);if(!1a.dL()&&b6(dI)){dI.2r=1a.dJ(gq.1i,gq.dw);dI.4W(2v,cU,cV,gq.2T,gq.eO,gq.eP,gq. eQ,gq.eR,gq.1i,gq.dw,gq.eS,gq.id)}if(1a.dL()&&e0()){1b ex=8C(2v,cU,cV,gq.2T,gq.eO,gq.eP,gq.eQ,gq.eR,gq.1i,gq.dw,gq.eS,gq.id);2s.3T(1a.z).43+=ex}};1a.ed=1c(dI){1b gr=1a.di(1a.kq,1a.f);1b dg=(1a.bR-gr)/2+1a.kt;1b dl=1a.bU-1a.ce-2h(1a.f);1a.ep(dI,1a.kq,dg,dl,1a.f,1k,1k,1k,1k,1a.kp);1b cY=1a.kr.1g;1b dm=cY*2h(1a.f);dl=1j.2m((1a.bU-dm)/2);1n(1b cZ=0;cZ<cY;cZ++){dg=1a.cf+(1a.di(\'M\',1a.f)1a.di(1a.kr.2L(cZ,1),1a.f))/2;1a.ep(dI,1a.kr.2L(cZ,1),dg,dl,1a.f,1k,1k,1k,1k,1a.kp);dl+=2h(1a.f)}};1a.ee=1c(dI){if(1a.cw!==\'2w\'){1d 1m}1b cY=(1a.bJ)?1a.E[0].1g:1a.E.1g;1b eu;1b es;1b 1v;1b dh;1b 1B;1n(1b cZ=0;cZ<cY;cZ++){1B=(1a.bJ)?1a.E[0][cZ]:1a.E[cZ];1v=1a.ey(1B[0],1B[1]);es=1a.bz.1g;1n(eu=0;eu<es;eu++){if(1a.bz[eu][0]===1B[ 0]){dh=1a.di(1D(1a.bz[eu][1]),1a.kx);1a.ep(dI,1D(1a.bz[eu][1]),1v[0]-dh/2,1a.bU-1a.ks+4,1a.kx,1k,1k,1k,1k,1a.ku)}}}};1a.ef=1c(dI){1b cY=(1a.bJ)?1a.E[0].1g:1a.E.1g;1b eu;1b es;1b 1v;1b dh;1b 1B;1n(1b cZ=0;cZ<cY;cZ++){1B=(1a.bJ)?1a.E[0][cZ]:1a.E[cZ];1v=1a.ey(1B[0],1B[1]);es=1a.bA.1g;1n(eu=0;eu<es;eu++){if(1a.bA[eu][0]===1B [1]){dh=1a.di(1D(1a.bA[eu][1]),1a.kx);1a.ep(dI,1D(1a.bA[eu][1]),1a.kt-dh-4,1v[1]2h(1a.kx/2),1a.kx,1k,1k,1k,1k,1a.ku)}}}};1a.ei=1c(dI){1b gs=1a.di(1a.kD,1a.cj);1b dg;2F(1a.ck){1C\'1q\':dg=1a.kt;1J;1C\'1s\':dg=1a.bT-1a.k-gs;1J;2H:dg=1j.2m((1a.bT-gs)/2)}1b dl=1a.cg;1a.ep(dI,1a.kD,dg,dl,1a.cj,1k,1k,1k,1k,1a.ci)};1a.eo=1c(dI){1b el=1a.em(1a.cz,1A);1a.ep(dI,1a.cz,el[0]+1,el[1]+1,1a.cB,1k,1k,1k,1k,1a.cE,1a.cC);1a.ep(dI,1a.cz,el[0],el[1],1a.cB,1k,1k,1k,1k,1a.cA, 1a.cC)};1a.eb=1c(dI){1b dh;1b ex;1b ew;1b ev;1b dc;1b dd;1b df;1b dg;1b dl=1a.bU1a.ks+4;if(1a.kA===0){df=1a.bF;dg=1a.M;2g(df<=1a.bB){ex=(1a.kv===\'2x\')?df:df.2J(1a.kv);ev=1D(df).3Y(\'.\');ew=1D(df).2L(ev+1). 1g;if(ew>3&&1a.kv===\'2x\'){ex=1a.de(df,3)}dh=1a.di(1D(ex),1a.kx);1a.ep(dI,1D(ex),dgdh/2,dl,1a.kx,1k,1k,1k,1k,1a.ku);df+=1a.bP;dg+=1a.cx}}1l{1b eB=1m;1n(1b cZ=2;cZ<au;cZ++){if((1a.bD1a.bH)%cZ===0){eB=cZ;if(!1a.da(cZ,1A)){3a}1J}}1b cY=(eB)?eB:cZ;if(1a.kA>1){cY=1a.kA-1}1b gt=0;1b 1B=(1a.bJ)?1a.E[0]:1a.E;1n(cZ=0;cZ<1B.1g;cZ++){ev=1D(1B[cZ][0]).3Y(\'.\');if(ev>=0){ew=1D(1B[cZ][0]).2L(ev+1).1g;if(gt<ew){gt=e w}}}gt++;2g(!1a.da(cY)){cY=1j.2i(cY/2)}dc=1a.bR/cY;dd=(1a.bD1a.bH)/cY;df=1a.bH;dg=1a.kt;dl=1a.N+1a.bS+4;1n(cZ=0;cZ<=cY;cZ++){ex=(1a.kv===\'2x\'&&1a.de(df)!==df)?1a.de(df,gt):df.2J(1a.k v);dh=1a.di(1D(ex),1a.kx);1a.ep(dI,1D(ex),dg-dh/2,dl,1a.kx,1k,1k,1k,1k,1a.ku);df+=dd;dg+=dc}}};1a.ec=1c(dI){1b dh;1b ex;1b ew;1b ev;1b dc;1b dd;1b df;1b dl;1b dg=1a.kt-4;1b dm=2h(1a.kx);if(1a.u===0){df=1a.bG;dl=1a.N+1a.bS;2g(df<=1a.bC){ex=(1a.kv===\'2x\')?df:df.2J(1a.kv);ev=1D(df).3Y(\'.\');ew=1D(df ).2L(ev+1).1g;if(ew>3&&1a.kv===\'2x\'){ex=1a.de(df,3)}dh=1a.di(1D(ex),1a.kx);1a.ep(dI,1D(ex),dg-dh,dldm/2,1a.kx,1k,1k,1k,1k,1a.ku);df+=1a.bQ;df=1H(df.2J(10));dl-=1a.cy}}1l{1b eB=1m;1n(1b cZ=2;cZ<au;cZ++){if((1a.bE1a.bI)%cZ===0){eB=cZ;if(!1a.dj(cZ,1A)){3a}1J}}1b cY=(eB)?eB:cZ;if(1a.u>1){cY=1a.u-1}1b gt=0;1b 1B=(1a.bJ)?1a.E[0]:1a.E;1n(cZ=0;cZ<1B.1g;cZ++){ev=1D(1B[cZ][1]).3Y(\'.\');if(ev>=0){ew=1D(1B[cZ][1]).2L(ev+1).1g;if(gt<ew){gt=e w}}}gt++;2g(!1a.dj(cY)){cY=1j.2i(cY/2)}dc=1a.bS/cY;dd=(1a.bE-1a.bI)/cY;df=1a.bI;dg=1a.kt4;dl=1a.N+1a.bS;1n(cZ=0;cZ<=cY;cZ++){dm=2h(1a.kx);ex=(1a.kv===\'2x\'&&1a.de(df)!==df)?1a.de(df,gt):df.2J(1a.kv);dh=1a.di(1D( ex),1a.kx);1a.ep(dI,1D(ex),dg-dh,dl-dm/2,1a.kx,1k,1k,1k,1k,1a.ku);df+=dd;dl=dc}}};1a.gu=1m;1a.gv=1m;1a.gw=0;1a.gx=0;1a.gy=1m;1a.gz=1c(1o,1p,gA,gB){if(1f gB===\'1t\'){gB=1A}1o=1j.2i(1o);1p=1j.38(1p);if(1j.2a(1o-1p)===0){--1o;++1p}gA=1j.2i(gA);1b gC=1j.2m((1a.gw/1M.0)*1j.2a(1p1o));1b gD=1j.2m((1a.gx/1M.0)*1j.2a(1p-1o));if(1f 1a.gu===\'1h\'){1o=1j.38(1a.gu);if(1o>=1p){1y(\'80 7W 4j a 1o 2Q 7V ak() 7T is ax 4X 3c aw 2Q 7U 1n 3c 4Q. 81 is 2M 4n.\');1d}}if(1f 1a.gv===\'1h\'){1p=1j.38(1a.gv);if(1o>=1p){1y(\'80 7W 4j a 1p 2Q 7V b1() 7T is aA 4X 3c aB 2Q 7U 1n 3c 4Q. 81 is 2M 4n.\');1d}}if(1j.2a(1o-1p)===0){++1p;--1o}1o-=gD;1p+=gC;1b fd;1b gE;1b gF;1b gG;1b gH;1b gI;1b gJ;1b gK;1b gL;1b gM;1b gN;1b gO;1b gP;if(gB){fd=1a.gQ(gA,1o,1p,1);gE=fd[0];gK=fd[1];gL=fd[2];gH=fd[3]}1l{gK=1o;gL=1p;fd=1a.gR(gA,1o,1p,1);gE=fd[0];gH=fd[1]}if(1j.2 a(1o1p)>2){if(gB){fd=1a.gQ(gA,1o,1p,5);gF=fd[0];gM=fd[1];gN=fd[2];gI=fd[3]}1l{gM=1o;gN=1p;fd=1a.gR(gA,1o,1p,5);gF=fd[0];gI=fd[1]}}1l {gF=99}if(1j.2a(1o1p)>5){if(gB){fd=1a.gQ(gA,1o,1p,2);gG=fd[0];gO=fd[1];gP=fd[2];gJ=fd[3]}1l{gO=1o;gP=1p;fd=1a.gR(gA,1o,1p,2);gG=fd[0];gJ=fd[1]}} 1l{gG=99}1b gS=1j.2a(gE-gA);1b gT=1j.2a(gF-gA);1b gU=(!1a.eL(gJ)&&gJ>1)?1j.2a(gG-gA):gU=99;1b

149

fv;if(gS<gT){fv=(gS<gU)?1:3}1l{fv=(gT<gU)?2:3}2F(fv){1C 1:1d[gK,gL,gH];1C 2:1d[gM,gN,gI];1C 3:1d[gO,gP,gJ];2H:1y(\'aC r (l5) \');1d}};1a.gp=1c(1o,1p,gA,gB){if(1f gB===\'1t\'){gB=1A}if(1a.gy){1a.gz(1o,1p,gA,gB);1d}if(1j.2a(1o1p)<0.8v){if(1o===0&&1p===0){1o=-1;1p=1}1l{1b gV=(1j.2a(1p)+1j.2a(1o))*0.l4;1o-=gV;1p+=gV}}1b gC=(1a.gw/1M.0)*1j.2a(1p1o);1b gD=(1a.gx/1M.0)*1j.2a(1p-1o);if(1f 1a.gu===\'1h\'){1o=1a.gu;if(1o>=1p){1y(\'80 7W 4j a 1o 2Q 7V ak() 7T is ax 4X 3c aw 2Q 7U 1n 3c 4Q. 81 is 2M 4n.\');1d}if(1j.2a(1o-1p)<0.8v){1p*=1.2}}if(1f 1a.gv===\'1h\'){1p=1a.gv;if(1o>=1p){1y(\'80 7W 4j a 1p 2Q 7V b1() 7T is aA 4X 3c aB 2Q 7U 1n 3c 4Q. 81 is 2M 4n.\');1d}if(1j.2a(1o-1p)<0.8v){1o*=0.8}}1o-=gD;1p+=gC;1b fd;1b gE;1b gF;1b gG;1b gK;1b gL;1b gM;1b gN;1b gO;1b gP;1b gW;1b gH;1b gX;1b gI;1b gY;1b gJ;if(gB){fd=1a.gZ(gA,1o,1p,1,2);gE=fd[0];gK=fd[1];gL=fd[2];gW=fd[3];gH=fd[4]}1l{gK=1o;gL=1p;fd=1a.ha(gA,1o,1p,1,2,1m);gE=fd[0] ;gW=fd[1];gH=fd[2]}if(gB){fd=1a.gZ(gA,1o,1p,5,2);gF=fd[0];gM=fd[1];gN=fd[2];gX=fd[3];gI=fd[4]}1l{gM=1o;gN=1p;fd=1a.ha(gA,1o,1p, 5,2,1m);gF=fd[0];gX=fd[1];gI=fd[2]}if(gB){fd=1a.gZ(gA,1o,1p,2,5);gG=fd[0];gO=fd[1];gP=fd[2];gY=fd[3];gJ=fd[4]}1l{gO=1o;gP=1p;fd= 1a.ha(gA,1o,1p,2,5,1m);gG=fd[0];gY=fd[1];gJ=fd[2]}1b gS=1j.2a(gE-gA);1b gT=1j.2a(gF-gA);1b gU=1j.2a(gG-gA);1b fv=1a.hb(gS,gT,gU,0.8);2F(fv){1C 1:1d[gK,gL,gH];1C 2:1d[gM,gN,gI];1C 3:1d[gO,gP,gJ];2H:1y(\'aC r (os) \');1d}};1a.gZ=1c(gA,1o,1p,gk,fx,gB){if(1f gB===\'1t\'){gB=1A}1b hc=1p-1o;1b hd=(hc===0)?0:1j.2i(1a.fJ(hc,10));if(1o>0&&1o<1j.2X(10,hd)){1o=0}1b he=1j.2X(10,hd)/gk;1b hf=he/fx;1b hg=1j.38(1p/hf)*hf;1b hh=1j.2i(1o/hf)*hf;1b hi=hg-hh;1b hj=hi/he;2g(hj>gA){he=1j.2X(10,hd)/gk;hj=hi/he;++hd}hf=he/fx;hh=1j.2i(1o/hf)*hf;hi=hghh;if(gB){hh=1j.2i(1o/he)*he;hi=hg-hh;hg=1j.38(hi/he)*he+hh}1l{hg=1j.38(1p/hf)*hf}1d[hj,hh,hg,hf,he]};1a.ha=1c(gA,1o,1p,gk,fx){1b hc=1p-1o;1b hd=(hc===0)?0:1j.2i(1a.fJ(hc,10));1b he=1j.2X(10,hd)/gk;1b hf=1j.he/fx;1b hj=1j.2i(hc/he);2g(hj>gA){he=1j.2X(10,hd)/gk;hj=1j.2i(hc/he);++hd}hf=he/fx;1d[hj,hf,he]};1a.gQ=1c(gA,1o,1p,gk,gB){if(1f gB===\'1t\'){gB=1A}1b hc=1p-1o;if(hc===0){1y(\'aI\\\'t aJ aD ag 9L 1o == 1p.\');1d}1l{1b hd=1j.2i(1a.fJ(hc,10))}if(1o>0&&1o<1j.2X(10,hd)){1o=0}if(hd===0){hd=1}1b he=(gk===1)?1:1j.2X(10,hd)/gk;1b hg=1j.38(1p/he)*he;1b hh=1j.2i(1o/he)*he;1b hi=hg-hh;1b hj=hi/he;2g(hj>gA){he=1j.2X(10,hd)/gk;hj=hi/he;++hd}hh=1j.2i(1o/he)*he;hi=hg-hh;if(gB){hh=1j.2i(1o/he)*he;hi=hghh;hg=1j.38(hi/he)*he+hh}1l{hg=1j.38(1p/he)*he}1d[hj,hh,hg,he]};1a.gR=1c(gA,1o,1p,gk){1b hc=1p-1o;if(hc===0){1y(\'aI\\\'t aJ aD ag 9L 1o == 1p.\');1d}1l{1b hd=1j.2i(1a.fJ(hc,10))}if(hd===0){hd=1}1b he=(gk===1)?1:1j.2X(10,hd)/gk;1b hj=1j.2i(hc/he);2g(hj>gA){he=1j.2X(10,hd)/gk;hj=1j.2i(hc/he);++hd}1d[hj,he]};1a.hb=1c(gk,fx,hk,hl){if(gk<fx){if(gk<hk*hl){1d 1}1d 3}1l if(fx<hk*hl){1d 2}1d 3};1a.fr={hm:0,hn:"",ho:8,fs:1c(eG){1d 1a.hp(1a.hq(1a.hr(eG),eG.1g*1a.ho))},hs:1c(eG){1d 1a.ht(1a.hq(1a.hr(eG),eG.1g*1a.ho))},hu:1c(eG){1d 1a.hv(1a.hq(1a.hr(eG),eG.1g*1a.ho))},hw:1c(fF,1B){1d 1a.hp(1a.hx(fF,1B))},hy:1c(fF,1B){1d 1a.ht(1a.hx(fF,1B))},hz:1c(fF,1B){1d 1a.hv(1a.hx(fF,1B))},hA:1c(){1d 1a.fs("pq")==="pG"},hq:1c(cU,cY){cU[cY>>5]|=4Y<<((cY)%32);cU[(((cY+64)>>>9)<<4)+14]=cY;1b gk=pb;1b fx=-pm;1b hk=-pl;1b hB=ph;1n(1b cZ=0;cZ<cU.1g;cZ+=16){1b hC=gk;1b hD=fx;1b hE=hk;1b hF=hB;gk=1a.hG(gk,fx,hk,hB,cU[cZ+0],7,nt);hB=1a.hG(hB,gk,fx,hk,cU[cZ+1],12,-nm);hk=1a.hG(hk,hB,gk,fx,cU[cZ+2],17,nD);fx=1a.hG(fx,hk,hB,gk,cU[cZ+3],22,nA);gk=1a.hG(gk,fx,hk,hB,cU[cZ+4],7,-nz);hB=1a.hG(hB,gk,fx,hk,cU[cZ+5],12,n4);hk=1a.hG(hk,hB,gk,fx,cU[cZ+6],17,n2);fx=1a.hG(fx,hk,hB,gk,cU[cZ+7],22,-n8);gk=1a.hG(gk,fx,hk,hB,cU[cZ+8],7,na);hB=1a.hG(hB,gk,fx,hk,cU[cZ+9],12,n9);hk=1a.hG(hk,hB,gk,fx,cU[cZ+10],17,-o7);fx=1a.hG(fx,hk,hB,gk,cU[cZ+11],22,o9);gk=1a.hG(gk,fx,hk,hB,cU[cZ+12],7,o0);hB=1a.hG(hB,gk,fx,hk,cU[cZ+13],12,-o5);hk=1a.hG(hk,hB,gk,fx,cU[cZ+14],17,ol);fx=1a.hG(fx,hk,hB,gk,cU[cZ+15],22,od);gk=1a.hH(gk,fx,hk,hB,cU[cZ+1],5,-nL);hB=1a.hH(hB,gk,fx,hk,cU[cZ+6],9,nO);hk=1a.hH(hk,hB,gk,fx,cU[cZ+11],14,nG);fx=1a.hH(fx,hk,hB,gk,cU[cZ+0],20,-nJ);gk=1a.hH(gk,fx,hk,hB,cU[cZ+5],5,nI);hB=1a.hH(hB,gk,fx,hk,cU[cZ+10],9,nW);hk=1a.hH(hk,hB,gk,fx,cU[cZ+15],14,-nT);fx=1a.hH(fx,hk,hB,gk,cU[cZ+4],20,nQ);gk=1a.hH(gk,fx,hk,hB,cU[cZ+9],5,nR);hB=1a.hH(hB,gk,fx,hk,cU[cZ+14],9,-nX);hk=1a.hH(hk,hB,gk,fx,cU[cZ+3],14,nY);fx=1a.hH(fx,hk,hB,gk,cU[cZ+8],20,nV);gk=1a.hH(gk,fx,hk,hB,cU[cZ+13],5,-nK);hB=1a.hH(hB,gk,fx,hk,cU[cZ+2],9,nN);hk=1a.hH(hk,hB,gk,fx,cU[cZ+7],14,nM);fx=1a.hH(fx,hk,hB,gk,cU[cZ+12],20,-nZ);gk=1a.hI(gk,fx,hk,hB,cU[cZ+5],4,oe);hB=1a.hI(hB,gk,fx,hk,cU[cZ+8],11,-oc);hk=1a.hI(hk,hB,gk,fx,cU[cZ+11],16,oj);fx=1a.hI(fx,hk,hB,gk,cU[cZ+14],23,oa);gk=1a.hI(gk,fx,hk,hB,cU[cZ+1],4,-nf);hB=1a.hI(hB,gk,fx,hk,cU[cZ+4],11,n0);hk=1a.hI(hk,hB,gk,fx,cU[cZ+7],16,n3);fx=1a.hI(fx,hk,hB,gk,cU[cZ+10],23,-n6);gk=1a.hI(gk,fx,hk,hB,cU[cZ+13],4,n7);hB=1a.hI(hB,gk,fx,hk,cU[cZ+0],11,nE);hk=1a.hI(hk,hB,gk,fx,cU[cZ+3],16,-pe);fx=1a.hI(fx,hk,hB,gk,cU[cZ+6],23,po);gk=1a.hI(gk,fx,hk,hB,cU[cZ+9],4,pw);hB=1a.hI(hB,gk,fx,hk,cU[cZ+12],11,-py);hk=1a.hI(hk,hB,gk,fx,cU[cZ+15],16,pu);fx=1a.hI(fx,hk,hB,gk,cU[cZ+2],23,oy);gk=1a.hJ(gk,fx,hk,hB,cU[cZ+0],6,-oz);hB=1a.hJ(hB,gk,fx,hk,cU[cZ+7],10,oC);hk=1a.hJ(hk,hB,gk,fx,cU[cZ+14],15,oF);fx=1a.hJ(fx,hk,hB,gk,cU[cZ+5],21,-oG);gk=1a.hJ(gk,fx,hk,hB,cU[cZ+12],6,oo);hB=1a.hJ(hB,gk,fx,hk,cU[cZ+3],10,oU);hk=1a.hJ(hk,hB,gk,fx,cU[cZ+10],15,-oX);fx=1a.hJ(fx,hk,hB,gk,cU[cZ+1],21,oL);gk=1a.hJ(gk,fx,hk,hB,cU[cZ+8],6,oI);hB=1a.hJ(hB,gk,fx,hk,cU[cZ+15],10,-oN);hk=1a.hJ(hk,hB,gk,fx,cU[cZ+6],15,oO);fx=1a.hJ(fx,hk,hB,gk,cU[cZ+13],21,l7);gk=1a.hJ(gk,fx,hk,hB,cU[cZ+4],6,-l8);hB=1a.hJ(hB,gk,fx,hk,cU[cZ+11],10,ls);hk=1a.hJ(hk,hB,gk,fx,cU[cZ+2],15,mB);fx=1a.hJ(fx,hk,hB,gk,cU[cZ+9],21,mR);gk=1a.hK(gk,hC);fx=1a.hK(fx,hD);hk=1a.hK(hk,hE);hB=1a.hK(hB,hF)}1d[gk,fx,hk,hB]},hL:1c(hM,gk,fx,cU,eG,hN){1d 1a.hK(1a.hO(1a.hK(1a.hK(gk,hM),1a.hK(cU,hN)),eG),fx)},hG:1c(gk,fx,hk,hB,cU,eG,hN){1d 1a.hL((fx&hk)|((~fx)&hB),gk,fx,cU,eG,hN)},hH:1c(gk,fx,hk,hB,cU,eG,hN){1d 1a.hL((fx&hB)|(hk&(~hB)),gk,fx,cU,eG,hN)},hI:1c(gk,fx,hk,hB,cU,eG,hN){1d 1a.hL(fx^hk^hB,gk,fx,cU,eG,hN)},hJ:1c(gk,fx,hk,hB,cU,eG,hN){1d 1a.hL(hk^(fx|(~hB)),gk,fx,cU,eG,hN)},hx:1c(fF,1B){1b hP=1a.hr(fF);if(hP.1g>16){hP=1a.hq(hP,fF.1g*1a.ho)}1b hQ=[16],hR=[16];1n(1b cZ=0;cZ<16;cZ++){hQ[cZ]=hP[cZ]^mO;hR[cZ]=hP[cZ]^mW}1b d2=1a.hq(hQ.8e(1a.hr(1B)),9h+1B.1g*1a.ho);1d 1a.hq(hR.8e(d2),9h+m7)},hK:1c(cU,cV){1b hS=(cU&9n)+(cV&9n);1b hT=(cU>>16)+(cV>>16)+(hS>>16);1d(hT<<16)|(hS&9n)},hO:1c(hU,hV){1d(hU<<hV)|(hU>>>(32-hV))},hr:1c(hW){1b hX=[];1b hY=(1<<1a.ho)-1;1n(1b cZ=0;cZ<hW.1g*1a.ho;cZ+=1a.ho){hX[cZ>>5]|=(hW.1V(cZ/1a.ho)&hY)<<(cZ%32)}1d hX},hv:1c(hX){1b hW="";1b hY=(1<<1a.ho)-1;1n(1b cZ=0;cZ<hX.1g*32;cZ+=1a.ho){hW+=1D.4H((hX[cZ>>5]>>>(cZ%32))&hY)}1d hW},hp:1c(hZ){1b ia=1a.hm?"lJ":"mH";1b hW="";1n(1b cZ=0;cZ<hZ.1g*4;cZ++){hW+=ia.3E((hZ[cZ>>2]>>((cZ%4)*8+4))&g4)+ia.3E((hZ[cZ>>2]>>((cZ%4)*8))&g4)}1d hW},ht:1c(hZ){1b ib="mh+/";1b hW="";1n(1b cZ=0;cZ<hZ.1g*4;cZ+=3){1b ic=(((hZ[cZ>>2]>>8*(cZ%4))&9c)<<16)|(((hZ[cZ+1>>2]>>8*((cZ+1)%4))&9c)<<8)|((hZ[cZ+2>>2]>>8*((cZ+2)%4))&9c);1n(1b kG=0;kG<4;kG++){if(cZ*8+kG*6>hZ.1g*32){hW+=1a.hn}1l{hW+=ib.3E((ic>>6*(3-kG))&mf)}}}1d hW}};1a.dM={ie:1c(){1y(\'1z: j7 2t 1L be 1x\')},kH:1c(){1y(\'1z: e5 1h of 88 3z 1L be a 1h mk 4X 1\')},ig:1c(){1y(\'1z: j7 1u 1L be a 1h\')},ih:1c(){1y(\'1z: kP 2k 2t 1L be 1x\')},ii:1c(){1y(\'1z: e9 5H 1u 1L be a 1h\')},ij:1c(){1y(\'1z: e9 k0 lf 1L be a 1h d9 0 4g 1M\')},kI:1c(){1y(\'1z: lt 3z 7a 1L be 3b

150

(1A/1m)\')},il:1c(){1y(\'1z: lx 5D 1g 1L lv 1B 1g in 1C of 2S 4g 36 lp\')},im:1c(){1y(\'1z: lo 1B 2M 5D\')},kJ:1c(){1y(\'1z: go 1B 2M 5D\')},io:1c(){1y(\'1z: go 1B in lb 5h 1n l6 7g 2b\')},ip:1c(){1y(\'1z: 5B mY 7a 1L be 3b (1A/1m)\')},iq:1c(){1y(\'1z: h6 2I 1L be a 1h\')},ir:1c(){1y(\'1z: h6 2w 1u 1L be a 1h\')},is:1c(){1y(\'1z: 5w 1N oQ 1L be 4z\')},it:1c(){1y(\'1z: oP 7a 1L be 3b (1A/1m)\')},iu:1c(){1y(\'1z: oM 2M 1x\')},kK:1c(){1y(\'1z: 5w 8s oJ 1L be 4z\')},fu:1c(){1y(\'1z: 5w 1i 3z 1L be in oV 5h (#9E or #ou)\')},fb:1c(){1y(\'1z: 4O 8s on 88 X\')},fc:1c(){1y(\'1z: 4O 8s on 88 Y\')},iw:1c(){1y(\'1z: 4O 2B 5h\')},kL:1c(){1y(\'1z: 4O i8 5h\')},iy:1c(){1y(\'1z: nq 1u 1L be a 1h\')},dN:1c(){1y(\'1z: d8 3y np\')},iz:1c(){1y(\'1z: d8 1B 9z\')},iA:1c(){1y(\'1z: nn nC 1B to nx 7g\')},iB:1c(){1y(\'1z: ny 7c or nj\')},fA:1c(){1y(\'1z: mZ 1L be 1x 4g n1 to an ng ni\')},fB:1c(){1y(\'1z: 5m 2b 2M nh\')},iC:1c(){1y(\'1z: 5m is 2M nd 2b\')},iD:1c(){1y(\'1z: 5m is 2M 2w 2b\')},iE:1c(){1y(\'1z: 5m is 2M 2S 2b\')},iF:1c(){1y(\'1z: nc 2c 1L be a 1h d9 0 (nb) 4g 1 (nF)\')},iG:1c(){1y(\'1z: o8 3I 2M 5D\')},iH:1c(){1y(\'1z: o6 3z 1L be 4z\')},iI:1c(){1y(\'1z: e5 7f of o3 o4 3c 3y 1w\')},iJ:1c(){1y(\'1z: 5y 1W ob 1L be 4z\')},iK:1c(){1y(\'1z: 5y e1 1N 1w 1L be a 1h\')},iL:1c(){1y(\'1z: 5y e1 2I 1L be a 1h\')},iM:1c(){1y(\'1z: 5y 3z 2I 1L be a 1h\')},iN:1c(){1y(\'1z: oi id 6S 1L be 1x\')},iO:1c(){1y(\'1z: 5w 4k oh 1L be 4z\')},iP:1c(){1y(\'1z: 5B 1w 2f 1L be 4z\')},iQ:1c(){1y(\'1z: i6 1L be 1x\')},iR:1c(){1y(\'1z: i6 1W 1L be 1x (5V, 1q or 1s)\')},iS:1c(){1y(\'1z: 5l 5H 1L be 1x\')},iT:1c(){1y(\'1z: 5l 1N 5d 1L be 1x\')},iU:1c(){1y(\'1z: 5l 2I 1L be a 1h\')},iV:1c(){1y(\'1z: 5l 3i 1L be 1x\')},iW:1c(){1y(\'1z: 5l 1W 1L be 1x\')},iX:1c(){1y(\'1z: j5 i8 1W, 4n 3z h1 nw, ne, sw 4g se\')},iY:1c(){1y(\'1z: 5B 2B 1L be 1x\')},iZ:1c(){1y(\'1z: 5B 2B 1W 1L be 1x\')},ja:1c(){1y(\'1z: j5 nP 2B 1W, 4n 3z h1 nw, ne, sw 4g se\')},jb:1c(){1y(\'1z: nS 1L be a 1h\')},jc:1c(){1y(\'1z: nU 3W 7a 1L be 3b (1A/1m)\')},gg:1c(){1y(\'1z 3d: 77 1B 3I\');1d},jd:1c(){1y(\'1z 3d: 77 or 7c nH\');1d},je:1c(){1y(\'1z 3d: 77 or 7c 7g 2t\');1d},gf:1c(){1y(\'1z 3d: 77 or 7c 7g 2b\');1d},fN:1c(2y,jf,2w){1y(\'1z 3d: og 2M 9z or ok 1i/1B/8y 3I\');1d},gi:1c(){1y(\'1z 3d: 8I 1i 3I\');1d},gh:1c(){1y(\'1z 3d: 8I 1B 3I\');1d},gj:1c(){1y(\'1z 3d: 8I 8y 3I\');1d},fX:1c(){1y(\'1z 3d: lY 5h\');1d}}}1c 1z(2t,2b,4u,fF,5s){1a.jg=1F kl();1b jg=1a.jg;jg.fy(2t,2b.92(),4u,fF,5s);1a.8R=1c(jh){if(jg.E.1g===0){jg.dM.iz();1d}if(!jg.fI(jh)){jg.dM.im();1d}if(jg.E.1g!==jh.1g&&jg.cw!==\'2 w\'){jg.dM.il();1d}jg.B=jh};1a.n5=1c(jh){if(jg.cw===\'36\'){1a.8R(jh)}1l{jg.dM.iC()}};1a.nv=1c(jh){if(jg.cw===\'2S\'){1a.8R(jh)}1l{jg.dM.iE ()}};1a.nB=1c(){if(jg.E.1g===0){jg.dM.iz();1d}if(((jg.E.1g===1&&!jg.bJ)||(jg.E[0].1g===1&&jg.bJ))&&jg.cw===\'2w\'){jg.dM.iA();1d}jg.d K()};1a.nu=1c(){1d jg.F};1a.5s=1c(cU,cV){if(1f cU!==\'1h\'||1f cV!==\'1h\'){jg.dM.iP();1d}jg.fC(cU,cV);jg.dK()};1a.nk=1c(1i){if(1f 1i!==\'1x\'||jg.dJ(1i)===1m){jg.dM.fu();1d}jg.ko=1i};1a.nl=1c(1i){if(1f 1i!==\'1x\'||jg.dJ(1i)===1m){jg.dM.fu();1d}jg.kp=1i};1a.ns=1c(1w){if(1f 1w!==\'1h\'){jg.dM.is();1d}jg.f=1H(1w)};1a.nr=1c(2t){if(1f 2t!==\'1x\'){jg.dM.ie();1d}jg.kq=2t};1a.pg=1c(2t){if(1f 2t!==\'1x\'){jg.dM.ie();1d}jg.kr=2t};1a.pf=1c(1h){if(1f 1h!==\'1h\'){jg.dM.iH();1d}if(jg.l+1h>=jg.bU){jg.dM.iI();1d}jg.ks=1H(1h)};1a.pi=1c(1h){if(1f 1h!==\'1h\'){jg.dM.iH();1d}if(1h+jg.k>=jg.bT){jg.dM.iI();1d}jg.kt=1H(1h)};1a.pj=1c(1h){if(1f 1h!==\'1h\'){jg.dM.iH();1d}if(jg.kt+1h>=jg.bT){jg.dM.iI();1d}jg.k=1H(1h)};1a.pk=1c(1h){if(1f 1h!==\'1h\'){jg.dM.iH();1d}if(1h+jg.ks>=jg.bU){jg.dM.iI();1d}jg.l=1H(1h)};1a.pd=1c(1i){if(1f 1i!==\'1x\'||jg.dJ(1i)===1m){jg.dM.fu();1d}jg.ku=1i};1a.p6=1c(1h){if(1f 1h!==\'1h\'){jg.dM.jb();1d}jg.kv=1h};1a.p7=1c(1h){if(1f 1h!==\'1h\'){jg.dM.ig();1d}jg.v=1h};1a.p4=1c(1w){if(1f 1w!==\'1h\'){jg.dM.is();1d}jg.kx=1H(1w)};1a.p5=1c(1h){if(1f 1h!==\'1h\'&&1h>1){jg.dM.kH();1d}jg.kA=1h};1a.p8=1c(1h){if(1f 1h!==\'1h\'&&1h>1){jg.dM.kH();1d}jg.u=1h};1a.pc=1c(1i){if(1f 1i!==\'1x\'||jg.dJ(1i)===1m){jg.dM.fu();1d}jg.kC=1i};1a.p9=1c(46){if(1f 46!==\'1x\'){jg.dM.ih();1d}jg.w=46};1a.pa=1c(1i){if(1f 1i!==\'1x\'||jg.dJ(1i)===1m){jg.dM.fu();1d}jg.O=1i};1a.pn=1c(1i){if(1f 1i!==\'1x\'||jg.dJ(1i)===1m){jg.dM.fu();1d}jg.Q=1i};1a.pC=1c(dw){if(1f dw!==\'1h\'||(dw<0||dw>1)){jg.dM.iF();1d}jg.R=dw};1a.pD=1c(1h){if(1f 1h!==\'1h\'){jg.dM.ii();1d}jg.P=1H(1h)};1a.pA=1c(1h){if(1f 1h!==\'1h\'||(1h<0||1h>1M)){jg.dM.ij();1d}jg.T=1H(1h)/2};1a.pB=1c(gl){if(1f gl!==\'3b\'){jg.dM.kI();1d}jg.U=gl};1a.pE=1c(1i){if(1f 1i!==\'1x\'||jg.dJ(1i)===1m){jg.dM.fu();1d}jg.V=1i};1a.pH=1c(1h){if(1f 1h!==\'1h\'){jg.dM.jb();1d}jg.W=1h};1a.pI=1c(1w){if(1f 1w!==\'1h\'){jg.dM.is();1d}jg.X=1H(1w)};1a.pF=1c(6S){if(1f 6S!==\'1x\'){jg.dM.iN();1d}jg.A=6S};1a.pz=1c(1B,id){if(jg.bu){1d}if(!jg.fI(1B)){jg.dM.kJ();1d}jg.cw=2b.92();if(!jg.fG(1B)){jg.dM.io();1d}if( 1f id!==\'1t\'&&1f id!==\'1x\'){jg.dM.iu();1d}if(jg.cw===\'2w\'){jg.bJ=1A;if(jg.E===[]){jg.E=1F 1O(1B)}1l{jg.E[jg.E.1g]=1B}1b 1T=1D(jg.E.1g-1);jg.F[1T]=(1f id===\'1t\')?\'ar\'+1T:id;if(1f jg.bc[1T]===\'1t\'){jg.bc[1T]=jg.Z}if(1f jg.bd[1T]===\'1t\'){jg.bd[1T]=jg.ba}if(1f jg.be[1T]===\'1t\'){jg.be[1T]=jg.bb}}1l{jg.E=1B}};1a.pr=1c(fL,ex){if(jg.bu){1d}1b ji=jg.fK(fL,ex);if(jg.fI(ji)&&ji.1g>0){1b cY=ji.1g;1b jj;1b eu;1b jk;1n(1b cZ=0;cZ<cY;cZ++){if(ji[cZ].1g<3){jk=ji[cZ][0]+\'(\'+ji[cZ][1]+\')\'}1l{jk=ji[cZ][0]+\'(\'+ji[cZ][1]+\', "\'+ji[cZ][2]+\'")\'}6T("1a."+jk)}}};1a.pp=1c(1i){if(1f 1i!==\'1x\'||jg.dJ(1i)===1m){jg.dM.fu();1d}jg.H=1i};1a.ps=1c(dx){if(1f dx!==\'1h\'){jg.dM.iq();1d}jg.I=1H(dx)};1a.pv=1c(dw){if(1f dw!==\'1h\'||(dw<0||dw>1)){jg.dM.iF();1d}jg.J=dw};1a.p3=1c(fk){if(1f fk!==\'1h\'){jg.dM.iO();1d}jg.K=1H(fk)};1a.oA=1c(1h){if(1f 1h!==\'1h\'){jg.dM.ir();1d}jg.L=1H(1h)};1a.oB=1c(ez){if(1f ez!==\'3b\'){jg.dM.ip();1d}jg.Y=ez};1a.oD=1c(2B){if(1f 2B!==\'1x\'){jg.dM.iY();1d}jg.cz=2B};1a.oE=1c(1i){if(1f 1i!==\'1x\'||jg.dJ(1i)===1m){jg.dM.fu();1d}jg.cA=1i};1a.ox=1c(1w){if(1f 1w!==\'1h\'){jg.dM.is();1d}jg.cB=1H(1w)};1a.op=1c(dw){if(1f dw!==\'1h\'||(dw<0||dw>1)){jg.dM.iF();1d}jg.cC=dw};1a.oq=1c(1W){if(1f 1W!==\'1x\'){jg.dM.iZ();1d}1b cY=jg.cu.1g;1n(1b cZ=0;cZ<cY;cZ++){if(jg.cu[cZ]===1W){jg.cD=1W;1d 1A}}jg.dM.ja();1d};1a.om=1c(1i){if(1f 1i!==\'1x\'||jg.dJ(1i)===1m){jg.dM.fu();1d}jg.cE=1i};1a.ov=1c(jl){if(1f jl!==\'3b\'){jg.dM.it();1d}jg.bq=jl};1a.ow=1c(1i){if(1f 1i!==\'1x\'||jg.dJ(1i)===1m){jg.dM.fu();1d}jg.br=1i};1a.ot=1c(dw){if(1f dw!==\'1h\'||(dw<0||dw>1)){jg.dM.iF();1d}jg.bs=dw};1a.oH=1c(1h){if(1f 1h!==\'1h\'){jg.dM.kK();1d}jg.bv=1h};1a.oS=1c(1h){if(1f 1h!==\'1h\'){jg.dM.kK();1d}jg.bw=1h};1a.oT=1c(1h){if(1f 1h!==\'1h\'){jg.dM.kK();1d}jg.bx=1h};1a.oW=1c(1h){if(1f 1h!==\'1h\'){jg.dM.kK();1d}jg.by=1h};1a.oZ=1c(2B){if(!jg.fI(2B)||2B.1g!==2){jg.dM.iw();1d}jg.bz.1G(2B)};1a.p2=1c(2B){if(!jg.fI(2B)||2B. 1g!==2){jg.dM.iw();1d}jg.bA.1G(2B)};1a.oY=1c(1i,id){if(1f 1i!==\'1x\'||jg.dJ(1i)===1m){jg.dM.fu();1d}if(1f id!==\'1t\'&&1f id!==\'1x\'){jg.dM.iu();1d}if(1f id===\'1t\'){if(jg.bc.1g===1){jg.bc[0]=1i}1l{1b cY=jg.F.1g;1n(1b cZ=0;cZ<cY;cZ++){if(1f jg.bc[cZ]!==\'1t\'){jg.bc[cZ]=1i}}}}1l{if(jg.F.1g<2){jg.bc[0]=1i}1l{1n(1b fF in jg.F){if(jg.F[fF]===id){jg.bc[fF]=1i}}}}};1a.oR=1c(dw,id){if(1f dw!==\'1h\'||(dw<0||dw>1)){jg.dM.iF();1d}if(1f id===\'1t\'){if(jg.bd.1g===1){jg.bd[0]=dw}1l{1b cY=jg.F.1g;1n(1b cZ=0;cZ<cY;cZ++){if(1f jg.bc[cZ]!==\'1t\'){jg.bd[cZ]=dw}}}}1l{if(jg.F.1g<2){jg.bd[0]=dw}1l{1b 1T=1m;1n(1b fF in jg.F){if(jg.F[fF]===id){1T=fF;1J}}if(1T!==1m){jg.bd[1T]=dw}}}};1a.oK=1c(1h,id){if(1f 1h!==\'1h\'){jg.dM.iy();1d}1h=1H(1h);if(1f id===\'1t\'){if(jg.be.1g===1){jg.be[0]=1h}1l{1b cY=jg.F.1g;1n(1b cZ=0;cZ<cY;cZ++){if(1f jg.be[cZ]!==\'1t\'){jg.be[cZ]=1h}}}}1l{if(jg.F.1g<2){jg.be[0]=1h}1l{1b 1T=1m;1n(1b fF in jg.F){if(jg.F[fF]===id){1T=fF;1J}}if(1T!==1m){jg.be[1T]=1h}}}};1a.ld=1c(dw){if(1f dw!==\'1h\'||(dw<0||dw>1)){jg.dM.iF();1d}jg.bf=1H(dw)};1a.l9=1c(cU,cV){if(1f cU!==\'1h\'||1f cV!==\'1h\'){jg.dM.iJ();1d}jg.bg=1H(cU);jg.bh=1H(cV)};1a.la=1c(fk){if(1f fk!==\'1h\'){jg.dM.iO();1d}jg.bi=1H(fk)};1a.kX=1c(1i){if(1f 1i!==\'1x\'||jg.dJ(1i)===1m){jg.dM.fu();1d}jg.bj=1i};1a.kY=1c(1w){if(1f 1w!==\'1h\'){jg.dM.is();1d}jg.bk=1H(1w)};1a.kV=1c(dx){if(1f dx!==\'1h\'){jg.dM.iL();1d}jg.bl=1H(dx)};1a.kW=1c(1i){if(1f 1i!==\'1x\'||jg.dJ(1i)===1m){jg.dM.fu();1d}jg.bm=1i};1a.l2=1c(1h){if(1f

151

1h!==\'1h\'){jg.dM.jb();1d}jg.bn=1h};1a.l3=1c(1w){if(1f 1w!==\'1h\'){jg.dM.is();1d}jg.bo=1H(1w)};1a.l1=1c(dx){if(1f dx!==\'1h\'){jg.dM.iL();1d}jg.bp=1H(dx)};1a.lg=1c(3W){if(1f 3W!==\'3b\'){jg.dM.jc();1d}jg.ky=3W};1a.lh=1c(3W){if(1f 3W!==\'3b\'){jg.dM.jc();1d}jg.kz=3W};1a.li=1c(1h){if(1f 1h!==\'1h\'){jg.dM.iH();1d}jg.ce=1H(1h)};1a.ln=1c(1h){if(1f 1h!==\'1h\'){jg.dM.iH();1d}jg.cf=1H(1h)};1a.lk=1c(1h){if(1f 1h!==\'1h\'){jg.dM.iH();1d}jg.cg=1H(1h)};1a.ll=1c(9d){if(1f 9d!==\'1x\'){jg.dM.iQ();1d}jg.kD=9d};1a.k2=1c(1i){if(1f 1i!==\'1x\'||jg.dJ(1i)===1m){jg.dM.fu();1d}jg.ci=1i};1a.kU=1c(1w){if(1f 1w!==\'1h\'){jg.dM.is();1d}jg.cj=1H(1w)};1a.jm=1c(el){if(1f el!==\'1x\'){jg.dM.iR();1d}jg.ck=el};1a.kT=1c(dv){if(!jg.fI(dv)||dv.1g<1||dv.1g>3){jg.dM.kL();1d}jg.cv.1G(dv)};1a.kS=1c(1i){if(1f 1i!==\'1x\'||jg.dJ(1i)===1m){jg.dM.fu();1d}jg.cl=1i};1a.kN=1c(jn){if(1f jn!==\'1x\'){jg.dM.iS();1d}jg.cm=jn};1a.k5=1c(1i){if(1f 1i!==\'1x\'||jg.dJ(1i)===1m){jg.dM.fu();1d}jg.cn=1i};1a.k9=1c(1N){if(1f 1N!==\'1x\'){jg.dM.iT();1d}jg.co=1N};1a.k8=1c(1w){if(1f 1w!==\'1h\'){jg.dM.is();1d}jg.cp=1H(1w)};1a.kM=1c(dw){if(1f dw!==\'1h\'||(dw<0||dw>1)){jg.dM.iF();1d}jg.cr=1H(dw)};1a.k7=1c(jn){if(1f jn!==\'1x\'){jg.dM.iV();1d}jg.cs=jn};1a.k4=1c(dx){if(1f dx!==\'1h\'){jg.dM.iU();1d}jg.cq=1H(dx)};1a.k6=1c(1W){if(1f 1W!==\'1x\'){jg.dM.iW();1d}1b cY=jg.cu.1g;1n(1b cZ=0;cZ<cY;cZ++){if(jg.cu[cZ]===1W){jg.ct=1W;1d 1A}}jg.dM.iX();1d};1a.kR=1c(cU,cV){if(1f cU!==\'1h\'||1f cV!==\'1h\'){jg.dM.iP();1d}jg.fC(cU,cV)}}1c dR(){}dR.en=1c(fF,2y,jo,jp,jq,3i){1b jr=1F 1O(70,0,4L,71,7x,6Z,47,4L,3t,70,71,3t,73,7x,42,47,7A,7B,7B,7C,7C,72,72,73,5n,6Y,6Y,5n,0,7A,6Z,42,4L,71,47,72,70,42,42,3t,7x,4 L,7C,6Y,3t,47,73,6Z,71,5n,72,73,6Y,7A,6Z,70,7A,7B,7B,0,5n,7C,0,7x);1b js=1F 1O(-7m,-7E,7D,7z,3X,3s,-7w,-7I,-7J,-7m,-7H,-7G,7E,3X,3s,-7w,7n,4F,-7I,0,-7G,7D,7z,-7y,4F,-7J,0,7n,7F,-7H,-7y,7F,0,7z,-7w,3X,-7I,-7y,-7H,7D,-7y,-7E,3s,-7m,7z,3s,7D,-7G,7F,7H,3X,-7J,4F,-7I,-7J,4F,7n,0,-7E,7F,-7G,-7w,-7m,7n);1b jt=1F 1O(7u,7o,0,7q,7k,0,7v,7k,7j,7p,7p,4D,7l,7j,5k,7u,4E,3r,7o,4K,7r,5k,7q,7v,7t,7r,4D,7t,3r,7l,4K,4E,7o,4E,7j,7u,4D,7o,7k,0,4K,7j,7l,7k, 7p,4K,0,7q,7t,4D,4E,7l,3r,7v,7r,7p,5k,7t,7u,5k,7v,3r,7q,7r);1b ju=1F 1O(6z,6h,6h,4Y,6x,67,6e,5N,0,7s,7s,6i,6d,0,6g,6e,3Z,3S,6y,6z,4Y,6y,5N,6U,67,3Z,6U,6g,3S,6x,6i,6d,6g,6e,7s,6i,6d,0,0,7s,6U,6g,6 7,3Z,6z,6h,6h,4Y,6i,6d,3Z,3S,6e,5N,6x,67,5N,6U,6y,6z,4Y,6y,3S,6x);1b jv=1F 1O(45,6D,6r,6C,3P,45,6B,6r,6A,3P,6u,6A,6C,6w,6v,6B,3v,6t,6t,0,6N,6s,6s,6u,6w,6N,0,6q,6D,3v,6q,6v,3P,6C,45,3v,6B,6r,6C,6A,6u ,6B,6w,6D,6A,45,3v,6w,6s,6v,6q,6s,6r,0,6t,6q,6v,6u,6N,3P,0,6t,6D,6N);1b jw=1F 1O(6P,6F,6J,6O,6F,4a,6O,6M,6L,6E,6M,6P,6H,6L,4B,6Q,0,6H,68,6J,6K,68,4a,6G,6G,0,6E,6I,6Q,6K,6I,4B,6L,4a,6G,6K,6O,6M,6Q, 6P,6M,6L,4B,6Q,6P,6O,6K,6F,6E,6I,0,6G,4a,6J,6F,6E,6J,6H,68,0,6I,4B,6H,68);1b jx=1F 1O(4J,66,85,0,3V,85,5Y,6b,65,4J,0,5X,3u,4A,66,6a,5W,5Y,63,5W,5X,4S,6b,63,4S,3V,6a,65,69,3u,4A,69,4A,69,4J,85,85,66,66,3u, 63,4A,5W,4J,6b,6a,5Y,6b,6a,5X,65,4S,69,0,3u,65,0,5Y,4S,3V,5X,5W,3V,63);1b jy=1F 1O(6p,3Q,3k,6o,3w,6p,5Z,3w,6j,6l,6o,4I,6f,61,3Q,5Z,6l,6m,6k,6n,4I,6j,6c,6f,6n,0,0,6c,6m,6k,61,3k,61,3k,6f,3Q,5Z,6c,3Q,61,6k,5Z,6 m,6l,6c,3w,3k,6p,0,6o,6j,6m,6l,6k,6p,0,6o,4I,4I,6n,6n,6j,3w,6f);1b jz=1a.jA(fF);1b jB=0,cZ,kG,jC,jD,jE,jF,1q,1s,jG;1b jH,jI,jJ,jK;1b jL,jM;1b cY=2y.1g;1b jN=0;1b jO=jz.1g==32?3:9;if(jO==3){jG=jo?1F 1O(0,32,2):1F 1O(30,-2,-2)}1l{jG=jo?1F 1O(0,32,2,62,30,2,64,96,2):1F 1O(94,62,-2,32,64,2,30,-2,-2)}if(3i==2){2y+=" "}1l if(3i==1){jC=8(cY%8);2y+=1D.4H(jC,jC,jC,jC,jC,jC,jC,jC);if(jC==8){cY+=8}}1l if(!3i){2y+="\\0\\0\\0\\0\\0\\0\\0\\0"}dn="";jP="";if(jp==1){jH=(jq.1V(jB++)<<24)|(jq.1V(jB++)<<16)|(jq.1V(jB++)<<8)|jq.1V(jB++);jJ=(jq.1 V(jB++)<<24)|(jq.1V(jB++)<<16)|(jq.1V(jB++)<<8)|jq.1V(jB++);jB=0}2g(jB<cY){1q=(2y.1V(jB++)<<24)|(2y.1V(jB++)<<16)|(2y.1V(jB++ )<<8)|2y.1V(jB++);1s=(2y.1V(jB++)<<24)|(2y.1V(jB++)<<16)|(2y.1V(jB++)<<8)|2y.1V(jB++);if(jp==1){if(jo){1q^=jH;1s^=jJ}1l{jI=jH;jK=j J;jH=1q;jJ=1s}}jC=((1q>>>4)^1s)&8t;1s^=jC;1q^=(jC<<4);jC=((1q>>>16)^1s)&51;1s^=jC;1q^=(jC<<16);jC=((1s>>>2)^1q)&8j;1q^=jC; 1s^=(jC<<2);jC=((1s>>>8)^1q)&8a;1q^=jC;1s^=(jC<<8);jC=((1q>>>1)^1s)&6X;1s^=jC;1q^=(jC<<1);1q=((1q<<1)|(1q>>>31));1s=((1s <<1)|(1s>>>31));1n(kG=0;kG<jO;kG+=3){jL=jG[kG+1];jM=jG[kG+2];1n(cZ=jG[kG];cZ!=jL;cZ+=jM){jE=1s^jz[cZ];jF=((1s>>>4)|(1s<<2 8))^jz[cZ+1];jC=1q;1q=1s;1s=jC^(js[(jE>>>24)&3p]|ju[(jE>>>16)&3p]|jw[(jE>>>8)&3p]|jy[jE&3p]|jr[(jF>>>24)&3p]|jt[(jF>>>16)&3p]|jv[(j F>>>8)&3p]|jx[jF&3p])}jC=1q;1q=1s;1s=jC}1q=((1q>>>1)|(1q<<31));1s=((1s>>>1)|(1s<<31));jC=((1q>>>1)^1s)&6X;1s^=jC;1q^=(jC< <1);jC=((1s>>>8)^1q)&8a;1q^=jC;1s^=(jC<<8);jC=((1s>>>2)^1q)&8j;1q^=jC;1s^=(jC<<2);jC=((1q>>>16)^1s)&51;1s^=jC;1q^=(jC<<1 6);jC=((1q>>>4)^1s)&8t;1s^=jC;1q^=(jC<<4);if(jp==1){if(jo){jH=1q;jJ=1s}1l{1q^=jI;1s^=jK}}jP+=1D.4H((1q>>>24),((1q>>>16)&4h),((1 q>>>8)&4h),(1q&4h),(1s>>>24),((1s>>>16)&4h),((1s>>>8)&4h),(1s&4h));jN+=8;if(jN==9h){dn+=jP;jP="";jN=0}}1d dn+jP};dR.jA=1c(fF){jQ=1F 1O(0,47,4B,sW,4L,5n,aq,sZ,4K,tu,ts,tq,tz,th,tS,tJ);jR=1F 1O(0,3Z,3X,tC,4A,tG,tF,tQ,45,8r,ta,tx,ti,tj,tp,tl);jS=1F 1O(0,3r,3V,9M,42,ad,aT,aW,0,3r,3V,9M,42,ad,aT,aW);jT=1F 1O(0,4J,4E,tk,3S,tm,tf,tv,4D,tt,5k,t0,t2,sU,sX,tb);jU=1F 1O(0,3k,4a,aM,0,3k,4a,aM,3Q,4I,8w,aL,3Q,4I,8w,aL);jV=1F 1O(0,3t,3s,aO,0,3t,3s,aO,3v,aR,aQ,aP,3v,aR,aQ,aP);jW=1F 1O(0,3w,3P,c7,3u,b8,ao,am,0,3w,3P,c7,3u,b8,ao,am);jX=1F 1O(0,4L,3V,td,4B,aq,t7,tH,4D,tP,tI,tL,tO,tM,tD,tA);jY=1F 1O(0,3k,0,3k,3u,as,3u,as,3v,al,3v,al,af,ae,af,ae);jZ=1F 1O(0,3w,3r,ah,0,3w,3r,ah,3t,ai,aF,aH,3t,ai,aF,aH);ka=1F 1O(0,3s,0,3s,3X,4F,3X,4F,3S,av,3S,av,ay,az,ay,az);kb=1F 1O(0,42,4K,tB,4J,tE,tR,tT,4A,t8,t6,t4,4S,t5,tc,t9);kc=1F 1O(0,3Q,4E,sY,3P,sV,t1,tw,4a,8w,tn,tg,ty,tr,te,t3);kd=1F 1O(0,47,45,aG,0,47,45,aG,3Z,aE,8r,aj,3Z,aE,8r,aj);1b jO=fF.1g>8?3:1;1b jz=1F 1O(32*jO);1b ke=1F 1O(0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0);1b kf,kg,jB=0,kh=0,jC;1n(1b kG=0;kG<jO;kG++){1q=(fF.1V(jB++)<<24)|(fF.1V(jB++)<<16)|(fF.1V(jB++)<<8)|fF.1V(jB++);1s=(fF.1V(jB++)<<24)|(fF.1V(jB++)<<16) |(fF.1V(jB++)<<8)|fF.1V(jB++);jC=((1q>>>4)^1s)&8t;1s^=jC;1q^=(jC<<4);jC=((1s>>>-16)^1q)&51;1q^=jC;1s^=(jC<<16);jC=((1q>>>2)^1s)&8j;1s^=jC;1q^=(jC<<2);jC=((1s>>>-16)^1q)&51;1q^=jC;1s^=(jC<<16);jC=((1q>>>1)^1s)&6X;1s^=jC;1q^=(jC<<1);jC=((1s>>>8)^1q)&8a;1q^=jC;1s^=(jC<<8);jC=((1q>>>1)^1s)&6X;1s^=jC;1q^=(jC<<1 );jC=(1q<<8)|((1s>>>20)&tK);1q=(1s<<24)|((1s<<8)&qK)|((1s>>>8)&qL)|((1s>>>24)&qJ);1s=jC;1n(cZ=0;cZ<ke.1g;cZ++){if(ke[cZ]){1 q=(1q<<2)|(1q>>>26);1s=(1s<<2)|(1s>>>26)}1l{1q=(1q<<1)|(1q>>>27);1s=(1s<<1)|(1s>>>27)}1q&=-2C;1s&=2C;kf=jQ[1q>>>28]|jR[(1q>>>24)&2C]|jS[(1q>>>20)&2C]|jT[(1q>>>16)&2C]|jU[(1q>>>12)&2C]|jV[(1q>>>8)&2C]|jW[(1q>>>4)&2C];k g=jX[1s>>>28]|jY[(1s>>>24)&2C]|jZ[(1s>>>20)&2C]|ka[(1s>>>16)&2C]|kb[(1s>>>12)&2C]|kc[(1s>>>8)&2C]|kd[(1s>>>4)&2C];jC=((k g>>>16)^kf)&51;jz[kh++]=kf^jC;jz[kh++]=kg^(jC<<16)}}1d jz};dR.ki=1c(eG){1b fv="8g";1b kj=1F 1O("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");1n(1b cZ=0;cZ<eG.1g;cZ++){fv+=kj[eG.1V(cZ)>>4]+kj[eG.1V(cZ)&2C]}1d fv};dR.dS=1c(kk){1b fv="";1n(1b cZ=(kk.2L(0,2)=="8g")?2:0;cZ<kk.1g;cZ+=2){fv+=1D.4H(1K(kk.2L(cZ,2),16))}1d fv};if(!2s.3D(\'3y\').3e){(1c(){1b m=1j;1b mr=m.2m;1b ms=m.59;1b mc=m.4R;1b 2a=m.2a;1b 91=m.91;1b Z=10;1b 3O=Z/2;1c 3e(){1d 1a.ap||(1a.ap=1F 7M(1a))}1b 6R=1O.5a.6R;1c c1(f,aK,i1){1b a=6R.b7(2f,2);1d 1c(){1d f.qH(aK,a.8e(6R.b7(2f)))}}1c 9a(s){1d 1D(s).6W(/&/g,\'&qI;\').6W(/"/g,\'&qM;\')}1c 8O(2D){if(!2D.3B[\'2z\']){2D.3B.8Q(\'2z\',\'8f:8p-8o-8b:ch\',\'#2H#8U\')}if(!2D.3B[\'87\']){2D.3B.8Q(\'87\',\'8f:8p-8o8b:b2:b2\',\'#2H#8U\')}if(!2D.qQ[\'b3\']){1b ss=2D.i2();ss.qR.id=\'b3\';ss.qP=\'3y{6V:qN-b4;9O:9P;\'+\'2vg1:1q;1u:qO;1I:qG}\'}}8O(2s);1b 8X={9v:1c(c0){if(/b9/.8S(c8.c9)&&!c6.qx){1b

152

2D=c0||2s;2D.3D(\'3y\');2D.5o(\'qy\',c1(1a.c5,1a,2D))}},c5:1c(2D){1b 8M=2D.8P(\'3y\');1n(1b i=0;i<8M.1g;i++){1a.8N(8M[i])}},8N:1c(el){if(!el.3e){el.3e=3e;8O(el.9p);el.43=\'\';el.5o(\'qw\',b0);el.5o(\'qu\',aU);1b 3L=el.8D;if(3L.1u&&3L.1u.4j){el.1r.1u=3L.1u.74+\'px\'}1l{el.1u=el.76}if(3L.1I&&3L.1I.4j){el.1r.1I=3L.1I.74+\'px\'}1l{el.1I=el.7b}}1d el}};1c b0(e){1b el=e.aV;2F(e.qv){1C\'1u\':el.3e().8V();el.1r.1u=el.8D.1u.74+\'px\';el.4m.1r.1u=el.76+\'px\';1J;1C\'1I\':el.3e().8V();el.1r.1I=el.8D.1I.74+\ 'px\';el.4m.1r.1I=el.7b+\'px\';1J}}1c aU(e){1b el=e.aV;if(el.4m){el.4m.1r.1u=el.76+\'px\';el.4m.1r.1I=el.7b+\'px\'}}8X.9v();1b 8A=[];1n(1b i=0;i<16;i++){1n(1b j=0;j<16;j++){8A[i*16+j]=i.9w(16)+j.9w(16)}}1c 5K(){1d[[1,0,0],[0,1,0],[0,0,1]]}1c 4p(m1,m2){1b 8B=5K();1n(1b x=0;x<3;x++){1n(1b y=0;y<3;y++){1b 7f=0;1n(1b z=0;z<3;z++){7f+=m1[x][z]*m2[z][y]}8B[x][y]=7f}}1d 8B}1c 8m(o1,o2){o2.1X=o1.1X;o2.35=o1.35;o2.3G=o1.3G;o2.1U=o1.1U;o2.3K=o1.3K;o2.9I=o1.9I;o2.9D=o1.9D;o2.9H=o1.9H;o2.9F=o1.9 F;o2.2r=o1.2r;o2.3U=o1.3U;o2.1N=o1.1N;o2.2R=o1.2R;o2.5U=o1.5U;o2.3M=o1.3M;o2.3R=o1.3R;o2.4M=o1.4M}1c 7Z(2G){1b 5t,2P=1;2G=1D(2G);if(2G.2E(0,3)==\'9E\'){1b 1Q=2G.3x(\'(\',3);1b 95=2G.3x(\')\',1Q+1);1b 7e=2G.2E(1Q+1,95).8z(\',\');5t=\'#\';1n(1b i=0;i<3;i++){5t+=8A[1H(7e[i])]}if(7e.1g==4&&2G.2L(3,1)==\'a\'){2P=7e[3]}}1l{5t=2G}1d{1i:5t,2P:2P}}1b 4w={1r:\'8L\',78:\'8L\',2q:\'8L\',1w:10,5d:\'3g-3h\'};1b 7h={};1c j0(2G){if(7h[2G]){1d 7h[2G]}1b el=2s.3D(\'9R\');1b 1r=el.1r;7d{1r.1N=2G}7i(ex){}1d 7h[2G]={1r:1r.4s||4w.1r,78:1r.qz||4w.78,2q:1r.qE||4w.2q,1w:1r.2l||4w.1w,5d:1r.9x||4w.5d}}1c iv(1r,a4){1b 2Y={};1n(1b p in 1r){2Y[p]=1r[p]}1b 4N=a5(a4.d4.2l),2l=a5(1r.1w);if(1f 1r.1w==\'1h\'){2Y.1w=1r.1w}1l if(1r.1w.3x(\'px\')!=1){2Y.1w=2l}1l if(1r.1w.3x(\'em\')!=-1){2Y.1w=4N*2l}1l if(1r.1w.3x(\'%\')!=-1){2Y.1w=(4N/1M)*2l}1l if(1r.1w.3x(\'pt\')!=1){2Y.1w=4N*(4/3)*2l}1l{2Y.1w=4N}2Y.1w*=0.qF;1d 2Y}1c d3(1r){1d 1r.1r+\' \'+1r.78+\' \'+1r.2q+\' \'+1r.1w+\'px \'+1r.5d}1c f7(35){2F(35){1C\'a0\':1d\'qD\';1C\'2m\':1d\'2m\';1C\'ac\':2H:1d\'ac\'}}1c 7M(4r){1a.2j=5K();1a.8k=[];1a.5T=[];1a.2K=[];1a.2r=\'#8E\';1a.1X=\'#8E\';1a.1U=1;1a.3G=\'qA\';1a.35=\'a0\';1a.3K=Z*1;1a.3U=1;1a.1 N=\'qB 3g-3h\';1a.2R=\'1q\';1a.5U=\'g2\';1a.3y=4r;1b el=4r.9p.3D(\'9R\');el.1r.1u=4r.76+\'px\';el.1r.1I=4r.7b+\'px\';el.1r.9O=\'9P\';el.1r.1W=\'39\';4r.4V(el);1a.2W=el;1a.3M=1;1a.3R=1;1a.4 M=1}1b 1P=7M.5a;1P.8V=1c(){if(1a.33){1a.33.qS(1A);1a.33=1k}1a.2W.43=\'\'};1P.2u=1c(){1a.2K=[]};1P.2p=1c(aX,aY){1b p=1a.2o(aX,aY);1a.2K.1G({2b:\'2p\',x:p.x,y:p.y});1a.4q=p.x;1a.4t=p.y};1P.1R=1c(aX,aY){1b p=1a.2o(aX,aY);1a.2K.1G({2b:\'1R\',x:p.x,y:p.y});1a.4q=p.x;1a.4t=p.y};1P.3H=1c(9Z,9U,9V,9W,aX,aY){1b p=1a.2o(aX,aY);1b 34=1a.2o(9Z,9U);1b 3C=1a.2o(9V,9W);3H(1a,34,3C,p)};1c 3H(79,34,3C,p){79.2K.1G({2b:\'3H\',f9:34.x,g0:34.y,g7:3C.x,g6:3C.y,x:p.x,y:p.y});79.4q=p.x;79.4t=p.y}1P.aN=1c(9T,aa,aX,aY){1b cp=1a.2o(9T,aa);1b p=1a.2o(aX,aY);1b 34={x:1a.4q+2.0/3.0*(cp.x-1a.4q),y:1a.4t+2.0/3.0*(cp.y-1a.4t)};1b 3C={x:34.x+(p.x1a.4q)/3.0,y:34.y+(p.y-1a.4t)/3.0};3H(1a,34,3C,p)};1P.4x=1c(aX,aY,3A,8l,8q,8u){3A*=Z;1b j1=8u?\'at\':\'g5\';1b 4d=aX+mc(8l)*3A3O;1b 5x=aY+ms(8l)*3A-3O;1b 5q=aX+mc(8q)*3A-3O;1b 5A=aY+ms(8q)*3A-3O;if(4d==5q&&!8u){4d+=0.r8}1b p=1a.2o(aX,aY);1b 8Y=1a.2o(4d,5x);1b 8Z=1a.2o(5q,5A);1a.2K.1G({2b:j1,x:p.x,y:p.y,4k:3A,4d:8Y.x,5x:8Y.y,5q:8Z.x,5A:8Z.y})};1P.i3=1c(aX,aY,2Z,3f){1a.2p(aX,aY);1a.1R(a X+2Z,aY);1a.1R(aX+2Z,aY+3f);1a.1R(aX,aY+3f);1a.5u()};1P.8T=1c(aX,aY,2Z,3f){1b 5P=1a.2K;1a.2u();1a.2p(aX,aY);1a.1R(aX+2Z,aY);1a.1R(aX+2Z,aY+3f);1a.1R(aX,aY+3f);1a.5u();1a.1Y();1a.2K=5P};1P.8W=1c(aX, aY,2Z,3f){1b 5P=1a.2K;1a.2u();1a.2p(aX,aY);1a.1R(aX+2Z,aY);1a.1R(aX+2Z,aY+3f);1a.1R(aX,aY+3f);1a.5u();1a.44();1a.2K=5P};1P.r9=1c(5C,5 F,5z,5M){1b 2A=1F 4b(\'2A\');2A.56=5C;2A.5e=5F;2A.7O=5z;2A.7L=5M;1d 2A};1P.r7=1c(5C,5F,h4,5z,5M,h9){1b 2A=1F 4b(\'r5\');2A.56=5C;2A.5e=5F;2A.9j=h4;2A.7O=5z;2A.7L=5M;2A.9s=h9;1d 2A};1P.r6=1c(2k,i1){1b dx,dy,dw,dh,sx,sy,sw,sh;1b h5=2k.4C.1u;1b i5=2k.4C.1I;2k.4C.1u=\'2x\';2k.4C.1I=\'2x\';1b w=2k.1u;1b h=2k.1I;2k.4C.1u=h5;2k.4C.1I=i5;if(2f.1g==3){dx=2f[1];dy=2f[2];sx=sy=0;sw=dw=w;sh=dh=h}1l if(2f.1g==5){dx=2f[1];dy=2f[2];dw=2f[3];dh=2f[4];sx=sy=0;sw=w;sh=h}1l if(2f.1g==9){sx=2f[1];sy=2f[2];sw=2f[3];sh=2f[4];dx=2f[5];dy=2f[6];dw=2f[7];dh=2f[8]}1l{h0 d5(\'4O 1h of 2f\')}1b d=1a.2o(dx,dy);1b ra=sw/2;1b h2=sh/2;1b 4f=[];1b W=10;1b H=10;4f.1G(\' <2z:8F\',\' 5f="\',Z*W,\',\',Z*H,\'"\',\' 5g="0,0"\',\' 1r="1u:\',W,\'px;1I:\',H,\'px;1W:39;\');if(1a.2j[0][0]!=1||1a.2j[0][1]||1a.2j[1][1]!=1||1a.2j[1][0]){1b 5p=[];5p.1G(\'re=\',1a.2j[0][0],\',\',\'rf=\',1a.2j[1][0],\',\',\'rd=\',1a.2j[0][1],\',\',\'rb=\',1a.2j[1][1],\',\',\'rc=\',mr(d.x/Z),\',\',\'r4=\',mr(d.y/Z),\'\');1 b 1p=d;1b c2=1a.2o(dx+dw,dy);1b c3=1a.2o(dx,dy+dh);1b c4=1a.2o(dx+dw,dy+dh);1p.x=m.1p(1p.x,c2.x,c3.x,c4.x);1p.y=m.1p(1p.y,c2.y,c3.y,c4.y);4f.1G(\'3i:0 \',mr(1p.x/Z),\'px \',mr(1p.y/Z),\'px 0;5p:qW:qX.e4.qV(\',5p.4U(\'\'),", qT=\'f8\');")}1l{4f.1G(\'2U:\',mr(d.y/Z),\'px;1q:\',mr(d.x/Z),\'px;\')}4f.1G(\' ">\',\'<2z:2k 46="\',2k.46,\'"\',\' 1r="1u:\',Z*dw,\'px;\',\' 1I:\',Z*dh,\'px"\',\' qU="\',sx/w,\'"\',\' qY="\',sy/h,\'"\',\' r2="\',(w-sx-sw)/w,\'"\',\' r3="\',(h-sysh)/h,\'"\',\' />\',\'</2z:8F>\');1a.2W.82(\'r1\',4f.4U(\'\'))};1P.1Y=1c(5R){1b 29=[];1b qZ=1m;1b W=10;1b H=10;29.1G(\'<2z:3J\',\' 83="\',!!5R,\'"\',\' 1r="1W:39;1u:\',W,\'px;1I:\',H,\'px;"\',\' 5g="0,0"\',\' 5f="\',Z*W,\',\',Z*H,\'"\',\' 84="\',!5R,\'"\',\' 2O="\');1b r0=1m;1b 1o={x:1k,y:1k};1b 1p={x:1k,y:1k};1n(1b i=0;i<1a.2K.1g;i++){1b p=1a.2K[i];1b c;2F(p.2b){1C\'2p\':c=p;29.1G(\' m \',mr(p.x),\',\',mr(p.y));1J;1C\'1R\':29.1G(\' l \',mr(p.x),\',\',mr(p.y));1J;1C\'d7\':29.1G(\' x \');p=1k;1J;1C\'3H\':29.1G(\' c \',mr(p.f9),\',\',mr(p.g0),\',\',mr(p.g7),\',\',mr(p.g6),\',\',mr(p.x),\',\',mr(p.y));1J;1C\'at\':1C\'g5\':29.1G(\' \',p.2b,\' \',mr(p.x1a.3M*p.4k),\',\',mr(p.y-1a.3R*p.4k),\' \',mr(p.x+1a.3M*p.4k),\',\',mr(p.y+1a.3R*p.4k),\' \',mr(p.4d),\',\',mr(p.5x),\' \',mr(p.5q),\',\',mr(p.5A));1J}if(p){if(1o.x==1k||p.x<1o.x){1o.x=p.x}if(1p.x==1k||p.x>1p.x){1p.x=p.x}if(1o.y==1k||p.y<1o.y){1o.y=p.y}if(1p .y==1k||p.y>1p.y){1p.y=p.y}}}29.1G(\' ">\');if(!5R){9g(1a,29)}1l{9e(1a,29,1o,1p)}29.1G(\'</2z:3J>\');1a.2W.82(\'9m\',29.4U(\'\'))};1c 9g(1S,29){1b a=7Z(1S.2r);1b 1i=a.1i;1b 2c=a.2P*1S.3U;1b 1U=1S.4M*1S.1U;if(1U<1){2c*=1U}29.1G(\'<2z:1Y\',\' 2c="\',2c,\'"\',\' 9C="\',1S.3G,\'"\',\' 9A="\',1S.3K,\'"\',\' 9u="\',f7(1S.35),\'"\',\' 2q="\',1U,\'px"\',\' 1i="\',1i,\'" />\')}1c 9e(1S,29,1o,1p){1b 1X=1S.1X;1b 4c=1S.3M;1b 4e=1S.3R;1b 1u=1p.x-1o.x;1b 1I=1p.y-1o.y;if(1X 89 4b){1b 3n=0;1b 5i={x:0,y:0};1b 5S=0;1b 8d=1;if(1X.9k==\'2A\'){1b f6=1X.56/4c;1b f4=1X.5e/4e;1b f5=1X.7O/4c;1b do=1X.7L/4e;1b p0=1S.2o(f6,f4);1b p1=1S.2o(f5,do);1b dx=p1.x-p0.x;1b dy=p1.yp0.y;3n=1j.pY(dx,dy)*pZ/1j.2n;if(3n<0){3n+=pX}if(3n<1e-6){3n=0}}1l{1b p0=1S.2o(1X.56,1X.5e);5i={x:(p0.x-1o.x)/1u,y:(p0.y1o.y)/1I};1u/=4c*Z;1I/=4e*Z;1b 8x=m.1p(1u,1I);5S=2*1X.9j/8x;8d=2*1X.9s/8x-5S}1b 3m=1X.98;3m.pV(1c(e6,e8){1d e6.2I-e8.2I});1b 1g=3m.1g;1b i7=3m[0].1i;1b 8h=3m[1g-1].1i;1b g8=3m[0].2P*1S.3U;1b 86=3m[1g-1].2P*1S.3U;1b 5G=[];1n(1b i=0;i<1g;i++){1b 8c=3m[i];5G.1G(8c.2I*8d+5S+\' \'+8c.1i)}29.1G(\'<2z:44 2b="\',1X.9k,\'"\',\' pW="5E" 5i="1M%"\',\' 1i="\',i7,\'"\',\' 8h="\',8h,\'"\',\' 5G="\',5G.4U(\',\'),\'"\',\' 2c="\',86,\'"\',\' 87:86="\',g8,\'"\',\' 3n="\',3n,\'"\',\' q0="\',5i.x,\',\',5i.y,\'" />\')}1l if(1X 89 7P){if(1u&&1I){1b f0=1o.x;1b aZ=-1o.y;29.1G(\'<2z:44\',\' 1W="\',f0/1u*4c*4c,\',\',aZ/1I*4e*4e,\'"\',\' 2b="q4"\',\' 46="\',1X.i0,\'" />\')}}1l{1b a=7Z(1S.1X);1b 1i=a.1i;1b 2c=a.2P*1S.3U;29.1G(\'<2z:44 1i="\',1i,\'" 2c="\',2c,\'" />\')}}1P.44=1c(){1a.1Y(1A)};1P.5u=1c(){1a.2K.1G({2b:\'d7\'})};1P.2o=1c(aX,aY){1b m=1a.2j;1d{x:Z*(aX*m[0][0]+aY*m[1][0]+m[2][0])-3O,y:Z*(aX*m[0][1]+aY*m[1][1]+m[2][1])-3O}};1P.q5=1c(){1b o={};8m(1a,o);1a.5T.1G(o);1a.8k.1G(1a.2j);1a.2j=4p(5K(),1a.2j)};1P.q3=1c(){if(1a.5T.1g){8m(1a.5T.j2(),1a);1a.2j=1a.8k.j2()}};1c

153

j3(m){1d 4y(m[0][0])&&4y(m[0][1])&&4y(m[1][0])&&4y(m[1][1])&&4y(m[2][0])&&4y(m[2][1])}1c 4o(1S,m,g9){if(!j3(m)){1d}1S.2j=m;if(g9){1b h8=m[0][0]*m[1][1]-m[0][1]*m[1][0];1S.4M=91(2a(h8))}}1P.q1=1c(aX,aY){1b m1=[[1,0,0],[0,1,0],[aX,aY,1]];4o(1a,4p(m1,1a.2j),1m)};1P.q2=1c(9l){1b c=mc(9l);1b s=ms(9l);1b m1=[[c,s,0],[s,c,0],[0,0,1]];4o(1a,4p(m1,1a.2j),1m)};1P.4Q=1c(aX,aY){1a.3M*=aX;1a.3R*=aY;1b m1=[[aX,0,0],[0,aY,0],[0,0,1]];4o(1a,4p(m1,1a.2j),1A)};1P.pU=1c(5J,5L,5O,5I,dx,dy){1b m1=[[5J,5L,0],[5O,5I,0],[dx,dy,1]];4o(1a,4p(m1,1a.2j),1A)};1P.pM=1c(5J,5L,5O,5I,dx,dy){1b m=[[5J,5L,0],[5O,5I,0],[dx,dy,1]];4o(1a,m,1A)};1P.9q=1c(2v,x,y,53,1Y){1b m=1a.2j,5Q=5r,1q=0,1s=5Q,2I={x:0,y:0},29=[];1b 4s=iv(j0(1a.1N),1a.2W);1b f2=d3(4s);1b 9i=1a.2W.d4;1b 2R=1a.2R.92();2F(2R){1C\'1q\':1C\'5V\':1C\'1s\':1J;1C\'95\':2R=9i.d1==\'pN\'?\'1s\':\'1q\';1J;1C\'1Q\':2R=9i.d1==\'pL\'?\'1s\':\'1q\';1J;2 H:2R=\'1q\'}2F(1a.5U){1C\'pJ\':1C\'2U\':2I.y=4s.1w/1.75;1J;1C\'pK\':1J;2H:1C 1k:1C\'g2\':1C\'pO\':1C\'pS\':2I.y=4s.1w/2.25;1J}2F(2R){1C\'1s\':1q=5Q;1s=0.g3;1J;1C\'5V\':1q=1s=5Q/2;1J}1b d=1a.2o(x+2I.x,y+2I.y);29.1G(\'<2z:2w pT="\',-1q,\' 0" to="\',1s,\' 0.g3" \',\' 5f="1M 1M" 5g="0 0"\',\' 83="\',!1Y,\'" 84="\',!!1Y,\'" 1r="1W:39;1u:9f;1I:9f;">\');if(1Y){9g(1a,29)}1l{9e(1a,29,{x:1q,y:0},{x:1s,y:4s.1w})}1b e3=m[0][0].2J(3)+\',\'+m[1][0].2J(3)+\',\'+m[0][1].2J(3)+\',\'+m[1][1].2J(3)+\',0,0\';1b d0=mr(d.x/Z)+\',\'+mr(d.y/Z);29.1G(\'<2z:pR on="t" pP="\',e3,\'" \',\' 2I="\',d0,\'" pQ="\',1q,\' 0" />\',\'<2z:2O q6="1A" />\',\'<2z:j4 on="1A" 1x="\',9a(2v),\'" 1r="v-2v-g1:\',2R,\';1N:\',9a(f2),\'" /></2z:2w>\');1a.2W.82(\'9m\',29.4U(\'\'))};1P.qm=1c(2v,x,y,53){1a.9q(2v,x,y,53,1m)};1P.4W=1c(2v,x,y,53){1a.9q(2v,x,y,53,1A)};1P.q n=1c(2v){if(!1a.33){1b s=\'<j8 1r="1W:39;\'+\'2U:-ql;1q:0;3i:0;8n:0;5H:5E;\'+\'qj-2e:qk;"></j8>\';1a.2W.82(\'9m\',s);1a.33=1a.2W.qo}1b 2D=1a.2W.9p;1a.33.43=\'\';1a.33.1r.1N=1a.1N;1a.33.4V(2D.qs(2v));1d{1u:1a.33.qt}};1P.f8=1c(){};1P.qr=1c(){};1P.qp=1c(2k,4T){1d 1F 7P(2k,4T)};1c 4b(d6){1a.9k=d6;1a.56=0;1a.5e=0;1a.9j=0;1a.7O=0;1a.7L=0;1a.9s=0;1a.98=[]}4b.5a.qq=1c(h3,5c){5c=7Z(5c);1a.98.1G({2I:h3,1i:5c. 1i,2P:5c.2P})};1c 7P(2k,4T){i4(2k);2F(4T){1C\'5b\':1C 1k:1C\'\':1a.h7=\'5b\';1J;1C\'5b-x\':1C\'5b-y\':1C\'no5b\':1a.h7=4T;1J;2H:7X(\'e7\')}1a.i0=2k.46;1a.qi=2k.1u;1a.qa=2k.1I}1c 7X(s){h0 1F 7Q(s)}1c i4(4P){if(!4P||4P.qb!=1||4P.3N!=\'q9\'){7X(\'f1\')}if(4P.q7!=\'q8\'){7X(\'e2\')}}1c 7Q(s){1a.4u=1a[s];1a.2y=s+\': qc qg \'+1a.4u}1b p=7Q.5a=1F d5;p.qh=1;p.qf=2;p.qd=3;p.qe=4;p.sj=5;p.sk=6;p.si=7;p.sf=8;p.sg=9;p.sl=10;p.e2=11;p.e7=12;p.sq=13;p.sr=14;p.so=15;p.sm=16;p.f 1=17;f3=8X;7Y=7M;sn=4b;sd=7P;s5=7Q})()}1c e0(){if(2s.3B[\'v\']==1k){1b e=["3J","s6","8F","i9","2O","s4","s2","44","1Y","s3","s7","j4","sb","2w","sc","sa","s8","s9","i3","4x","2k"],s=2s.i2();1n(1b i=0;i<e.1g;i++){s.st("v\\\\:"+e[i],"sM: j6(#2H#8U);")}2s.3B.8Q("v","8f:8p-8o-8b:ch")}if(1f 8C==\'1c\'&&2s.3B[\'v\']!=1k){1d 1A}1l{1d 1m}}1c sN(x,y,4i,7R,4Z,2q,1i,2c,2N){2N=1f(2N)!=\'1t\'?2N:0;1i=1f(1i)!=\'1t\'?1i:\'#ab\';2c=1f(2c)!=\'1t\'?2c:1;id=1f(id)!=\'1t\'?\'id="\'+id+\'"\':\'\';1 b w=1K(4Z),b=1K(4i),h=1K(7R);1d\'<v:3J \'+id+\' 83="f" 84="t" 5g="0,0" 5f="\'+w+\',\'+h+\'" 2O="m 0,\'+b+\' l 0,0,\'+w+\',0,\'+w+\',\'+b+\',0,\'+b+\',0,\'+h+\',\'+w+\',\'+h+\',\'+w+\',\'+b+\' e" 1r="2N:\'+2N+\';1W:39;8n:8H;2U:\'+1j.2m(y)+\'px;1q:\'+1j.2m(x)+\'px;1u:\'+w+\'px;1I:\'+h+\'px;"><v:1Y 1i="\'+1i+\'" 2c="\'+2c+\'" 2q="\'+2q+\'" /></v:3J>\'}1c 8C(1x,x,y,1w,2q,1u,2e,1N,1i,2c,2N,id){1c qC(cX,cY,9Q,9S,aX,aY){1b t=1F 1O(6);t[0]=cX+2.0/3.0*(9QcX);t[1]=cY+2.0/3.0*(9S-cY);t[2]=t[0]+(aX-cX)/3.0;t[3]=t[1]+(aY-cY)/3.0;t[4]=aX;t[5]=aY;1d t}1w=1f(1w)!=\'1t\'?1w:12;2q=1f(2q)!=\'1t\'?2q:1M;1u=1f(1u)!=\'1t\'?1u:1M;2e=1f(2e)!=\'1t\'?2e:1M;1N=1f(1N)!=\'1t\'?1N:"3g3h";1x=1f(1x)!=\'1t\'?1x:\' \';1b a6=1f(x)!=\'1t\'?x:0;1b a1=1f(y)!=\'1t\'?y:0;2N=1f(2N)!=\'1t\'?2N:0;1i=1f(1i)!=\'1t\'?1i:\'#ab\';2c=1f(2c)!=\'1t\'?2c:1;id=1f(id)!=\'1t\'?\'id="\'+id+\'"\':\'\';1b i=0,j=0,f=10,2O="",a,b,z,k,c,p,o,3j=1x.1g,1E=1w/25.0,7N=1j.1p(1j.1o(2q,3F),1)/40,1Z=1j.1p(1j.1o(1u,3F),10)/1M;1b 7K=1j.1p(1j.1o(2e,5r),10)/1M,mx=((1E*16*1Z)*7K)-(1E*16*1Z),lw=(7N*1E);x=0;y=1w;1b 8G=1j.2m(8J(1x,1w,1u,2e,1N)),hh=1j.2m(2h(1w));1b 8K=\'<v:3J \'+id+\' 83="f" 84="t" 5g="0,0" 5f="\'+1K(8G*f)+\',\'+1K(hh*f)+\'"\';1n(i=0;i<3j;i++){c=4G[1N][1x.3E(i)];if(!c){3a}o=0;1n(j=0;j<c.n;j++){if(1f(c.d[o])!="1x"){o++;3a}p=c.d[ o];o++;a=c.d[o];if(p=="m"){2O+=\' m \'+1K((x+a[0]*1E*1Z)*f)+\',\'+1K((y-a[1]*1E)*f);o++}1l if(p=="q"){z=c.d[o2];o++;b=c.d[o];k=qC(z[0],z[1],a[0],a[1],b[0],b[1]);2O+=\' c \'+1K((x+k[0]*1E*1Z)*f)+\',\'+1K((yk[1]*1E)*f)+\',\'+1K((x+k[2]*1E*1Z)*f)+\',\'+1K((y-k[3]*1E)*f)+\',\'+1K((x+k[4]*1E*1Z)*f)+\',\'+1K((y-k[5]*1E)*f);o++}1l if(p=="b"){o++;b=c.d[o];o++;z=c.d[o];2O+=\' c \'+1K((x+a[0]*1E*1Z)*f)+\',\'+1K((y-a[1]*1E)*f)+\',\'+1K((x+a[0]*1E*1Z)*f)+\',\'+1K((ya[1]*1E)*f)+\',\'+1K((x+z[0]*1E*1Z)*f)+\',\'+1K((y-z[1]*1E)*f);o++}1l if(p=="l"){2O+=\' l \'+1K((x+a[0]*1E*1Z)*f)+\',\'+1K((ya[1]*1E)*f);o++;2g(1f(c.d[o])!="1x"&&o<c.d.1g){a=c.d[o];2O+=\' l \'+1K((x+a[0]*1E*1Z)*f)+\',\'+1K((ya[1]*1E)*f);o++}}}x+=((c.w*1Z)*1E)+mx}8K+=\' 2O="\'+2O+\' e" 1r="2N:\'+2N+\';1W:39;8n:8H;2U:\'+1j.2m(a1)+\'px;1q:\'+1j.2m(a6)+\'px;1u:\'+8G+\'px;1I:\'+hh+\'px;"><v:1Y 1i="\'+1i+\'" 2c="\'+2c+\'" 2q="\'+lw+\'" 9A="0" 9u="2m" 9C="2m" /></v:3J>\';1d 8K}1c sL(1w){1d 1w}1c 2h(1w){1w=1f(1w)!=\'1t\'?1w:12;1d 32*(1w/25)}1c 8J(1x,1w,1u,2e,1N){1w=1f(1w)!=\'1t\'?1w:12;1u=1f(1u)!=\'1t\'?1u:1M;2e=1f(2e)!=\'1t\'?2e:1M;1x=1f(1x)!=\'1t\'?1x:\' \';1N=1f(1N)!=\'1t\'?1N:"3g-3h";1b 4v=0,3j=1x.1g,mg=1w/25.0,fw=1j.1p(1j.1o(1u,3F),10)/1M,sp=1j.1p(1j.1o(2e,5r),10)/1M,m=((mg*16*fw)*sp)-(mg*16*fw);1n(1b i=0;i<3j;i++){1b c=4G[1N][1x.3E(i)];if(c)4v+=((c.w*fw)*mg)+m}1d 4v-(m)}1c sJ(1x,1u,1w,5v,2e,1N){1w=1f(1w)!=\'1t\'?1w:12;5v=1f(5v)!=\'1t\'?5v:1M;2e=1f(2e)!=\'1t\'?2e:1M;1x=1f(1x)!=\'1t\'?1x:\' \';1u=1f(1u)!=\'1t\'?1u:1M;1N=1f(1N)!=\'1t\'?1N:"3g-3h";1b 7S=0,4v=0,3j=1x.1g,mg=1w/25.0,fw=1j.1p(1j.1o(5v,3F),10)/1M,sp=1j.1p(1j.1o(2e,5r),10)/1M,m=((mg*16*fw)*sp)-(mg*16*fw);1n(1b i=0;i<3j;i++){1b c=4G[1N][1x.3E(i)];if(c){7S=((c.w*fw)*mg)+m;if((4v+7S-(m))<=1u){4v+=7S}1l{1J}}1l{1J}}1d 1x.2E(0,i)}1c sK(1S,x,y,4i,7R,4Z){1S.8T(x,y+4i,4Z,7R-4i);1S.8T(x,y,4Z,4i)}1c 8i(1x,x,y,1w,2q,1u,2e,1N){1w=1f(1w)!=\'1t\'?1w:12;2q=1f(2q)!=\'1t\'?2q:1M;1u=1f(1u)!=\'1t\'?1u:1M;2e=1f(2e)!=\'1t\'?2e:1M;1N=1f(1N )!=\'1t\'?1N:"3g-3h";x=1f(x)!=\'1t\'?x:0;y=1f(y)!=\'1t\'?y+1w:0+1w;1x=1f(1x)!=\'1t\'?1x:\' \';1b i=0,j=0,a,b,z,c,p,o,3j=1x.1g,1E=1w/25.0,7N=1j.1p(1j.1o(2q,3F),1)/40,1Z=1j.1p(1j.1o(1u,3F),10)/1M;1b 7K=1j.1p(1j.1o(2e,5r),10)/1M,mx=((1E*16*1Z)*7K)(1E*16*1Z),lw=1a.1U,ml=1a.3K,lj=1a.3G,lc=1a.35;1a.1U=(7N*1E);1a.3K=0;1a.3G="2m";1a.35="2m";1n(i=0;i<3j;i++){c=4G[1N][1x.3 E(i)];if(!c){3a}o=0;1a.2u();1n(j=0;j<c.n;j++){if(1f(c.d[o])!="1x"){o++;3a}p=c.d[o];o++;a=c.d[o];if(p=="m"){1a.2p(x+a[0]*1E*1Z,ya[1]*1E);o++}1l if(p=="q"){o++;b=c.d[o];1a.aN(x+a[0]*1E*1Z,y-a[1]*1E,x+b[0]*1E*1Z,y-b[1]*1E);o++}1l if(p=="b"){o++;b=c.d[o];o++;z=c.d[o];1a.3H(x+a[0]*1E*1Z,y-a[1]*1E,x+b[0]*1E*1Z,y-b[1]*1E,x+z[0]*1E*1Z,y-z[1]*1E);o++}1l if(p=="l"){1a.1R(x+a[0]*1E*1Z,y-a[1]*1E);o++;2g(1f(c.d[o])!="1x"&&o<c.d.1g){a=c.d[o];1a.1R(x+a[0]*1E*1Z,ya[1]*1E);o++}}}1a.1Y();x+=((c.w*1Z)*1E)+mx}1a.1U=lw;1a.3K=ml;1a.3G=lj;1a.35=lc}1c b5(1S){if(1f 7Y==\'1t\'){1S.4W=8i}}1c

154

b6(1S){if(1f 1S.4W==\'1c\'){1d 1A}1l{1d 1m}}if(1f 7Y!=\'1t\'){7Y.5a.4W=8i}1b 4G=1F 1O();4G["3g-3h"]={\' \':{w:16,n:1,d:[]},\'!\':{w:10,n:4,d:[\'m\',[5,21],\'l\',[5,7],\'m\',[5,2],\'l\',[4,1],[5,0],[6,1],[5,2]]},\'"\':{w:14,n:4,d:[\'m\',[4,21],\'l\',[4,14],\'m\',[10,2 1],\'l\',[10,14]]},\'#\':{w:21,n:8,d:[\'m\',[11,25],\'l\',[4,-7],\'m\',[17,25],\'l\',[10,7],\'m\',[4,12],\'l\',[18,12],\'m\',[3,6],\'l\',[17,6]]},\'$\':{w:20,n:12,d:[\'m\',[16,18],\'q\',[15,21],[10,21],\'q\',[5,21],[4,17],\'q\',[3,12],[7,11],\'l\',[1 3,10],\'q\',[18,9],[17,4],\'q\',[16,0],[10,0],\'q\',[4,0],[3,4],\'m\',[8,25],\'l\',[6,-4],\'m\',[14,25],\'l\',[12,4]]},\'%\':{w:24,n:12,d:[\'m\',[21,21],\'l\',[3,0],\'m\',[7,21],\'q\',[3,21],[3,17],\'q\',[3,13],[7,13],\'q\',[11,13],[11,17],\'q\',[11,21],[7,21],\'m\',[17, 8],\'q\',[13,8],[13,4],\'q\',[13,0],[17,0],\'q\',[21,0],[21,4],\'q\',[21,8],[17,8]]},\'&\':{w:26,n:14,d:[\'m\',[23,12],\'q\',[23,14],[22,14],\'q\',[20,14],[ 19,11],\'l\',[17,6],\'q\',[15,0],[9,0],\'q\',[3,0],[3,5],\'q\',[3,8],[7,10],\'l\',[12,13],\'q\',[14,15],[14,17],\'q\',[14,21],[11,21],\'q\',[8,21],[8,17],\'q\',[ 8,14],[12,8],\'q\',[17,0],[21,0],\'q\',[23,0],[23,2]]},\'\\\'\':{w:10,n:2,d:[\'m\',[5,19],\'l\',[4,20],[5,21],[6,20],[6,18],[5,16],[4,15]]},\'(\':{w:14,n:3,d :[\'m\',[11,25],\'q\',[4,19],[4,9],\'q\',[4,-1],[11,-7]]},\')\':{w:14,n:3,d:[\'m\',[3,25],\'q\',[10,19],[10,9],\'q\',[10,-1],[3,7]]},\'*\':{w:16,n:6,d:[\'m\',[8,21],\'l\',[8,9],\'m\',[3,18],\'l\',[13,12],\'m\',[13,18],\'l\',[3,12]]},\'+\':{w:26,n:4,d:[\'m\',[13,18],\'l\',[13,0],\'m\',[4,9], \'l\',[22,9]]},\',\':{w:10,n:2,d:[\'m\',[6,1],\'l\',[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},\'\':{w:26,n:2,d:[\'m\',[4,9],\'l\',[22,9]]},\'.\':{w:10,n:2,d:[\'m\',[5,2],\'l\',[4,1],[5,0],[6,1],[5,2]]},\'/\':{w:22,n:2,d:[\'m\',[20,25],\'l\',[2,7]]},\'0\':{w:20,n:7,d:[\'m\',[10,21],\'q\',[3,21],[3,12],\'l\',[3,9],\'q\',[3,0],[10,0],\'q\',[17,0],[17,9],\'l\',[17,12],\'q\',[17,21],[10,21]]},\'1\':{w:20,n :3,d:[\'m\',[6,17],\'q\',[8,18],[11,21],\'l\',[11,0]]},\'2\':{w:20,n:5,d:[\'m\',[17,0],\'l\',[3,0],[13,10],\'q\',[16,13],[16,16],\'q\',[16,21],[10,21],\'q\',[4 ,21],[4,16]]},\'3\':{w:20,n:5,d:[\'m\',[5,21],\'l\',[16,21],[10,14],\'q\',[17,14],[17,7],\'q\',[17,0],[10,0],\'q\',[5,0],[3,4]]},\'4\':{w:20,n:2,d:[\'m\',[13 ,0],\'l\',[13,21],[3,7],[18,7]]},\'5\':{w:20,n:6,d:[\'m\',[15,21],\'l\',[5,21],[4,12],\'q\',[5,14],[10,14],\'q\',[17,14],[17,7],\'q\',[17,0],[10,0],\'q\',[5,0] ,[3,4]]},\'6\':{w:20,n:8,d:[\'m\',[16,18],\'q\',[15,21],[10,21],\'q\',[3,21],[3,12],\'l\',[3,7],\'q\',[3,0],[10,0],\'q\',[17,0],[17,7],\'q\',[17,13],[10,13],\' q\',[3,13],[3,7]]},\'7\':{w:20,n:2,d:[\'m\',[3,21],\'l\',[17,21],[7,0]]},\'8\':{w:20,n:9,d:[\'m\',[10,13],\'q\',[15,13],[15,17],\'q\',[15,21],[10,21],\'q\',[ 5,21],[5,17],\'q\',[5,13],[10,13],\'q\',[3,13],[3,7],\'q\',[3,0],[10,0],\'q\',[17,0],[17,7],\'q\',[17,13],[10,13]]},\'9\':{w:20,n:8,d:[\'m\',[17,14],\'q\',[1 7,8],[10,8],\'q\',[3,8],[3,14],\'q\',[3,21],[10,21],\'q\',[17,21],[17,14],\'l\',[17,9],\'q\',[17,0],[10,0],\'q\',[5,0],[4,3]]},\':\':{w:10,n:4,d:[\'m\',[5,14],\ 'l\',[4,13],[5,12],[6,13],[5,14],\'m\',[5,2],\'l\',[4,1],[5,0],[6,1],[5,2]]},\';\':{w:10,n:4,d:[\'m\',[5,14],\'l\',[4,13],[5,12],[6,13],[5,14],\'m\',[6,1],\'l\',[5 ,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,4]]},\'<\':{w:24,n:2,d:[\'m\',[20,18],\'l\',[4,9],[20,0]]},\'=\':{w:26,n:4,d:[\'m\',[4,12],\'l\',[22,12],\'m\',[4,6],\'l\',[22,6]]},\'>\':{w:24,n:2,d:[\'m\',[4,1 8],\'l\',[20,9],[4,0]]},\'?\':{w:18,n:8,d:[\'m\',[3,16],\'q\',[3,21],[9,21],\'q\',[15,21],[15,16],\'q\',[15,11],[10,11],\'q\',[9,11],[9,10],\'l\',[9,7],\'m\',[9 ,2],\'l\',[8,1],[9,0],[10,1],[9,2]]},\'@\':{w:27,n:17,d:[\'m\',[21,3],\'q\',[20,1],[14,0],\'l\',[13,0],\'q\',[4,1],[3,10],\'l\',[3,11],\'q\',[4,20],[13,21],\'l\',[ 14,21],\'q\',[23,20],[24,11],\'l\',[24,10],\'q\',[24,6],[20,6],\'q\',[17,6],[18,10],\'q\',[18,6],[13,6],\'q\',[8,6],[9,11],\'q\',[10,15],[14,15],\'q\',[19,1 5],[18,10],\'m\',[18,10],\'l\',[19,14]]},\'A\':{w:18,n:6,d:[\'m\',[1,0],\'l\',[9,21],[17,0],\'m\',[4,7],\'l\',[14,7]]},\'B\':{w:21,n:9,d:[\'m\',[4,11],\'l\',[12, 11],\'m\',[13,0],\'l\',[4,0],[4,21],[12,21],\'q\',[17,21],[17,16],\'q\',[17,11],[12,11],\'q\',[18,11],[18,6],\'l\',[18,5],\'q\',[18,0],[13,0]]},\'C\':{w:21,n :7,d:[\'m\',[11,21],\'q\',[17,21],[18,16],\'m\',[18,5],\'q\',[17,0],[11,0],\'q\',[3,0],[3,9],\'l\',[3,12],\'q\',[3,21],[11,21]]},\'D\':{w:21,n:5,d:[\'m\',[11, 0],\'l\',[4,0],[4,21],[11,21],\'q\',[18,21],[18,12],\'l\',[18,9],\'q\',[18,0],[11,0]]},\'E\':{w:19,n:4,d:[\'m\',[17,21],\'l\',[4,21],[4,0],[17,0],\'m\',[4,11], \'l\',[12,11]]},\'F\':{w:18,n:4,d:[\'m\',[17,21],\'l\',[4,21],[4,0],\'m\',[4,11],\'l\',[12,11]]},\'G\':{w:21,n:8,d:[\'m\',[11,21],\'q\',[17,21],[18,16],\'m\',[ 13,8],\'l\',[18,8],[18,5],\'q\',[17,0],[11,0],\'q\',[3,0],[3,9],\'l\',[3,12],\'q\',[3,21],[11,21]]},\'H\':{w:22,n:6,d:[\'m\',[4,21],\'l\',[4,0],\'m\',[18,21],\'l\' ,[18,0],\'m\',[4,11],\'l\',[18,11]]},\'I\':{w:8,n:2,d:[\'m\',[4,21],\'l\',[4,0]]},\'J\':{w:16,n:5,d:[\'m\',[12,21],\'l\',[12,5],\'q\',[12,0],[7,0],\'q\',[2,0],[2,5] ,\'l\',[2,7]]},\'K\':{w:21,n:6,d:[\'m\',[4,21],\'l\',[4,0],\'m\',[18,21],\'l\',[4,7],\'m\',[9,12],\'l\',[18,0]]},\'L\':{w:17,n:2,d:[\'m\',[4,21],\'l\',[4,0],[16,0]]}, \'M\':{w:24,n:2,d:[\'m\',[4,0],\'l\',[4,21],[12,0],[20,21],[20,0]]},\'N\':{w:22,n:2,d:[\'m\',[4,0],\'l\',[4,21],[18,0],[18,21]]},\'O\':{w:22,n:7,d:[\'m\',[ 11,21],\'q\',[19,21],[19,12],\'l\',[19,9],\'q\',[19,0],[11,0],\'q\',[3,0],[3,9],\'l\',[3,12],\'q\',[3,21],[11,21]]},\'P\':{w:21,n:6,d:[\'m\',[4,10],\'l\',[13,10 ],\'q\',[18,10],[18,15],\'l\',[18,16],\'q\',[18,21],[13,21],\'l\',[4,21],[4,0]]},\'Q\':{w:22,n:9,d:[\'m\',[11,21],\'q\',[19,21],[19,12],\'l\',[19,9],\'q\',[19, 0],[11,0],\'q\',[3,0],[3,9],\'l\',[3,12],\'q\',[3,21],[11,21],\'m\',[12,4],\'l\',[18,2]]},\'R\':{w:21,n:8,d:[\'m\',[4,10],\'l\',[13,10],\'q\',[18,10],[18,15],\'l\',[18,16],\'q\',[18,21],[13,21],\'l\',[4,21],[4,0],\'m\',[13,10],\'l\',[18,0]]},\'S\ ':{w:20,n:8,d:[\'m\',[16,18],\'q\',[15,21],[10,21],\'q\',[5,21],[4,17],\'q\',[3,12],[7,11],\'l\',[13,10],\'q\',[18,9],[17,4],\'q\',[16,0],[10,0],\'q\',[4,0],[ 3,4]]},\'T\':{w:16,n:4,d:[\'m\',[8,21],\'l\',[8,0],\'m\',[1,21],\'l\',[15,21]]},\'U\':{w:22,n:5,d:[\'m\',[4,21],\'l\',[4,6],\'q\',[4,0],[11,0],\'q\',[18,0],[18,6] ,\'l\',[18,21]]},\'V\':{w:18,n:2,d:[\'m\',[1,21],\'l\',[9,0],[17,21]]},\'W\':{w:24,n:2,d:[\'m\',[2,21],\'l\',[7,0],[12,21],[17,0],[22,21]]},\'X\':{w:20,n:4, d:[\'m\',[3,21],\'l\',[17,0],\'m\',[17,21],\'l\',[3,0]]},\'Y\':{w:18,n:4,d:[\'m\',[1,21],\'l\',[9,11],[17,21],\'m\',[9,11],\'l\',[9,0]]},\'Z\':{w:20,n:2,d:[\'m\',[ 3,21],\'l\',[17,21],[3,0],[17,0]]},\'[\':{w:14,n:2,d:[\'m\',[11,25],\'l\',[4,25],[4,-7],[11,-7]]},\'\\\\\':{w:14,n:2,d:[\'m\',[0,21],\'l\',[14,3]]},\']\':{w:14,n:2,d:[\'m\',[3,25],\'l\',[10,25],[10,-7],[3,-7]]},\'^\':{w:16,n:2,d:[\'m\',[3,16],\'l\',[8,21],[13,16]]},\'9r\':{w:16,n:2,d:[\'m\',[0,2],\'l\',[16,2]]},\'`\':{w:10,n:2,d:[\'m\',[6,21],\'l\',[5,20],[4,18],[4,16],[5,15],[6,16],[5,17]]},\'a\':{w:19,n:10,d:[\'m\',[15,14],\'l\',[15,0],\'m\',[10,14],\'l\',[9,1 4],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[13,0],[15,2],\'m\',[15,12],\'q\',[13,14],[10,14]]},\'b\':{w:19,n:10,d:[\'m\',[4,21],\'l\',[4,0],\'m\', [10,14],\'l\',[9,14],\'q\',[6,14],[4,12],\'m\',[4,2],\'q\',[6,0],[9,0],\'l\',[10,0],\'q\',[16,0],[16,7],\'q\',[16,14],[10,14]]},\'c\':{w:18,n:10,d:[\'m\',[10,1 4],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[14,0],[15,3],\'m\',[15,11],\'q\',[14,14],[10,14]]},\'d\':{w:19,n:10,d:[\'m\',[15,21],\'l\ ',[15,0],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[13,0],[15,2],\'m\',[15,12],\'q\',[13,14],[10,14]]},\'e\':{w:18,n:8, d:[\'m\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[14,0],[15,3],\'m\',[3,8],\'l\',[15,8],\'q\',[15,14],[9,14]]},\'f\':{w:12,n:5,d:[\'m\',[10, 21],\'q\',[5,21],[5,17],\'l\',[5,0],\'m\',[2,14],\'l\',[9,14]]},\'g\':{w:19,n:12,d:[\'m\',[15,14],\'l\',[15,-2],\'q\',[15,-7],[10,-7],\'q\',[7,-7],[6,6],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[13,0],[15,2],\'m\',[15,12],\'q\',[13,14],[10,14]]},\'h\':{w:19,n:6,d:[\'m \',[4,21],\'l\',[4,0],\'m\',[4,10],\'q\',[6,14],[11,14],\'q\',[15,14],[15,10],\'l\',[15,0]]},\'i\':{w:8,n:4,d:[\'m\',[3,21],\'l\',[4,20],[5,21],[4,22],[3,21],\'m \',[4,14],\'l\',[4,0]]},\'j\':{w:10,n:5,d:[\'m\',[5,21],\'l\',[6,20],[7,21],[6,22],[5,21],\'m\',[6,14],\'l\',[6,-3],\'q\',[6,-8],[1,7]]},\'k\':{w:17,n:6,d:[\'m\',[4,21],\'l\',[4,0],\'m\',[14,14],\'l\',[4,4],\'m\',[8,8],\'l\',[15,0]]},\'l\':{w:8,n:2,d:[\'m\',[4,21],\'l\',[4,0]]},\'m\':{w:26,n:10, d:[\'m\',[4,14],\'l\',[4,0],\'m\',[4,10],\'q\',[6,14],[10,14],\'q\',[13,14],[13,10],\'l\',[13,0],\'m\',[13,10],\'q\',[15,14],[19,14],\'q\',[22,14],[22,10],\'l\' ,[22,0]]},\'n\':{w:19,n:6,d:[\'m\',[4,14],\'l\',[4,0],\'m\',[4,10],\'q\',[6,14],[11,14],\'q\',[15,14],[15,10],\'l\',[15,0]]},\'o\':{w:19,n:7,d:[\'m\',[10,14],\ 'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[16,0],[16,7],\'q\',[16,14],[10,14]]},\'p\':{w:19,n:10,d:[\'m\',[4,14],\'l\',[4,7],\'m\',[10,14],\'l\',[9,14],\'q\',[6,14],[4,12],\'m\',[4,2],\'q\',[6,0],[9,0],\'l\',[10,0],\'q\',[16,0],[16,7],\'q\',[16,14],[10,14]]},\'q\':{w:19,n:10,d:[\'m \',[15,14],\'l\',[15,7],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[13,0],[15,2],\'m\',[15,12],\'q\',[13,14],[10,14]]},\'r\':{w:13,n:4,d:[\'m\ ',[4,14],\'l\',[4,0],\'m\',[4,8],\'q\',[5,14],[12,14]]},\'s\':{w:16,n:7,d:[\'m\',[13,11],\'q\',[13,14],[8,14],\'q\',[3,14],[3,11],\'q\',[3,8],[8,7],\'q\',[13,6], [13,3],\'q\',[13,0],[8,0],\'q\',[3,0],[3,3]]},\'t\':{w:12,n:5,d:[\'m\',[5,21],\'l\',[5,4],\'q\',[5,1],[10,0],\'m\',[2,14],\'l\',[9,14]]},\'u\':{w:19,n:6,d:[\'m\',[4,14],\'l\',[4,4],\'q\',[4,0],[8,0],\'q\',[13,0],[15,4],\'m\',[15,14],\'l\',[15,0]]},\'v\':{w:16,n: 2,d:[\'m\',[2,14],\'l\',[8,0],[14,14]]},\'w\':{w:22,n:2,d:[\'m\',[3,14],\'l\',[7,0],[11,14],[15,0],[19,14]]},\'x\':{w:17,n:4,d:[\'m\',[3,14],\'l\',[14,0],\'m\' ,[14,14],\'l\',[3,0]]},\'y\':{w:16,n:5,d:[\'m\',[2,14],\'l\',[8,0],\'m\',[14,14],\'l\',[8,0],\'q\',[5,-7],[1,7]]},\'z\':{w:17,n:2,d:[\'m\',[3,14],\'l\',[14,14],[3,0],[14,0]]},\'{\':{w:14,n:9,d:[\'m\',[9,25],\'q\',[5,24],[5,20],\'q\',[5,17],[7,16],\'q\',[9,15],[8,12],\

155

'q\',[7,9],[4,9],\'q\',[7,9],[8,6],\'q\',[9,3],[7,2],\'q\',[5,1],[5,-2],\'q\',[5,-6],[9,-7]]},\'|\':{w:8,n:2,d:[\'m\',[4,25],\'l\',[4,7]]},\'}\':{w:14,n:9,d:[\'m\',[5,25],\'q\',[9,24],[9,20],\'q\',[9,17],[7,16],\'q\',[5,15],[6,12],\'q\',[7,9],[10,9],\'q\',[7,9],[6,6],\'q\',[5,3],[7,2],\'q\',[9,1 ],[9,-2],\'q\',[9,-6],[5,7]]},\'~\':{w:24,n:4,d:[\'m\',[3,6],\'q\',[3,12],[10,10],\'l\',[14,8],\'q\',[21,4],[21,10]]},\' \':{w:16,n:1,d:[]},\'¡\':{w:10,n:4,d:[\'m\',[5,10],\'l\',[5,4],\'m\',[5,17],\'l\',[4,16],[5,15],[6,16],[5,17]]},\'¢\':{w:18,n:14,d:[\'m\',[9,14],\'l\',[9,18],\'m\',[9,0],\'l\',[9,4],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[14,0],[15,3],\'m\',[15,11],\'q\',[14,14],[10,14]]},\'£\':{w:18,n:8,d:[\'m \',[4,11],\'l\',[13,11],\'m\',[16,18],\'q\',[15,21],[11,21],\'q\',[5,21],[6,16],\'q\',[7,8],[6,2],\'q\',[5,0],[4,0],\'l\',[16,0]]},\'¤\':{w:19,n:13,d:[\'m\',[15, 3],\'l\',[17,1],\'m\',[15,13],\'l\',[17,15],\'m\',[5,3],\'l\',[3,1],\'m\',[5,13],\'l\',[3,15],\'m\',[10,14],\'q\',[4,14],[4,8],\'q\',[4,2],[10,2],\'q\',[16,2],[16,8] ,\'q\',[16,14],[10,14]]},\'¥\':{w:18,n:8,d:[\'m\',[4,7],\'l\',[14,7],\'m\',[4,11],\'l\',[14,11],\'m\',[1,21],\'l\',[9,11],[17,21],\'m\',[9,11],\'l\',[9,0]]},\'¦\':{ w:8,n:4,d:[\'m\',[4,25],\'l\',[4,12],\'m\',[4,6],\'l\',[4,7]]},\'§\':{w:20,n:12,d:[\'m\',[16,18],\'q\',[16,21],[10,21],\'q\',[4,21],[4,18],\'q\',[4,15],[10,14],\'q\',[16,13],[16,10],\'q\',[16,6],[10,7],\'m\',[10, 14],\'q\',[4,15],[4,11],\'q\',[4,8],[10,7],\'q\',[16,6],[16,3],\'q\',[16,0],[10,0],\'q\',[4,0],[4,3]]},\'¨\':{w:16,n:4,d:[\'m\',[4,25],\'l\',[4,23],\'m\',[12,25] ,\'l\',[12,23]]},\'©\':{w:27,n:15,d:[\'m\',[18,13],\'q\',[17,15],[14,15],\'q\',[9,15],[9,11],\'l\',[9,10],\'q\',[9,6],[14,6],\'q\',[17,6],[18,8],\'m\',[24,10] ,\'q\',[24,0],[14,0],\'l\',[13,0],\'q\',[3,0],[3,10],\'l\',[3,11],\'q\',[3,21],[13,21],\'l\',[14,21],\'q\',[24,21],[24,11],\'l\',[24,10]]},\'sO\':{w:14,n:9,d:[\' m\',[4,12],\'l\',[10,12],\'m\',[10,21],\'l\',[10,15],\'m\',[4,18],\'q\',[4,15],[7,15],\'q\',[10,15],[10,18],\'q\',[10,21],[7,21],\'q\',[4,21],[4,18]]},\'«\':{ w:24,n:4,d:[\'m\',[12,16],\'l\',[3,9],[12,2],\'m\',[21,16],\'l\',[12,9],[21,2]]},\'¬\':{w:22,n:2,d:[\'m\',[4,12],\'l\',[18,12],[18,8]]},\'-\':{w:22,n:2,d:[\' m\',[4,9],\'l\',[18,9]]},\'®\':{w:27,n:17,d:[\'m\',[9,6],\'l\',[9,15],[16,15],\'m\',[9,10],\'l\',[16,10],[18,6],\'m\',[16,10],\'q\',[18,10],[18,12],\'l\',[18,1 3],\'q\',[18,15],[16,15],\'m\',[24,10],\'q\',[24,0],[14,0],\'l\',[13,0],\'q\',[3,0],[3,10],\'l\',[3,11],\'q\',[3,21],[13,21],\'l\',[14,21],\'q\',[24,21],[24,11] ,\'l\',[24,10]]},\'¯\':{w:16,n:2,d:[\'m\',[0,24],\'l\',[16,24]]},\'°\':{w:10,n:5,d:[\'m\',[3,23],\'q\',[3,21],[5,21],\'q\',[7,21],[7,23],\'q\',[7,25],[5,25],\'q\ ',[3,25],[3,23]]},\'±\':{w:22,n:6,d:[\'m\',[11,18],\'l\',[11,6],\'m\',[4,12],\'l\',[18,12],\'m\',[4,2],\'l\',[18,2]]},\'²\':{w:14,n:6,d:[\'m\',[10,11],\'l\',[4,11 ],\'q\',[4,15],[7,15],\'q\',[10,15],[10,18],\'q\',[10,21],[7,21],\'q\',[4,21],[4,18]]},\'³\':{w:14,n:5,d:[\'m\',[4,14],\'q\',[4,11],[7,11],\'q\',[10,11],[10, 14],\'q\',[10,17],[7,17],\'l\',[10,21],[4,21]]},\'´\':{w:19,n:2,d:[\'m\',[9,18],\'l\',[12,20]]},\'sS\':{w:19,n:7,d:[\'m\',[4,14],\'l\',[4,6],\'m\',[4,4],\'q\',[4,0],[8,0],\'q\',[13,0],[15,4],\'m\',[15,14],\'l\',[15,0]]},\'¶\':{w:18,n:5,d:[\'m\',[8,11],\'q\',[3,11],[3,16],\'q\',[3,21],[9,21],\'m\',[ 9,0],\'l\',[9,21],[15,21],[15,0]]},\'·\':{w:10,n:2,d:[\'m\',[5,14],\'l\',[4,13],[5,12],[6,13],[5,14]]},\'¸\':{w:18,n:2,d:[\'m\',[10,0],\'l\',[10,-2],[7,4]]},\'¹\':{w:10,n:2,d:[\'m\',[4,19],\'l\',[6,21],[6,11]]},\'sT\':{w:14,n:7,d:[\'m\',[4,12],\'l\',[10,12],\'m\',[4,18],\'q\',[4,15],[7,15],\'q\',[10,15],[10,1 8],\'q\',[10,21],[7,21],\'q\',[4,21],[4,18]]},\'»\':{w:24,n:4,d:[\'m\',[3,16],\'l\',[12,9],[3,2],\'m\',[12,16],\'l\',[21,9],[12,2]]},\'¼\':{w:24,n:6,d:[\'m\',[ 4,19],\'l\',[6,21],[6,11],\'m\',[16,15],\'l\',[6,5],\'m\',[19,0],\'l\',[19,10],[14,4],[20,4]]},\'½\':{w:24,n:10,d:[\'m\',[4,19],\'l\',[6,21],[6,11],\'m\',[16, 15],\'l\',[6,5],\'m\',[20,0],\'l\',[14,0],\'q\',[14,4],[17,4],\'q\',[20,4],[20,7],\'q\',[20,10],[17,10],\'q\',[14,10],[14,7]]},\'¾\':{w:24,n:10,d:[\'m\',[4,14 ],\'q\',[4,11],[7,11],\'q\',[10,11],[10,14],\'q\',[10,17],[7,17],\'l\',[10,21],[4,21],\'m\',[18,15],\'l\',[8,5],\'m\',[19,0],\'l\',[19,10],[14,4],[20,4]]},\'¿\': {w:18,n:7,d:[\'m\',[9,21],\'l\',[8,20],[9,19],[10,20],[9,21],\'m\',[9,14],\'l\',[9,10],\'q\',[3,10],[3,5],\'q\',[3,0],[9,0],\'q\',[15,0],[15,5]]},\'sR\':{w:18 ,n:6,d:[\'m\',[7,25],\'l\',[10,23],\'m\',[1,0],\'l\',[9,21],[17,0],\'m\',[4,7],\'l\',[14,7]]},\'sP\':{w:18,n:6,d:[\'m\',[8,23],\'l\',[11,25],\'m\',[1,0],\'l\',[9,21 ],[17,0],\'m\',[4,7],\'l\',[14,7]]},\'sQ\':{w:18,n:6,d:[\'m\',[7,23],\'l\',[9,25],[11,23],\'m\',[1,0],\'l\',[9,21],[17,0],\'m\',[4,7],\'l\',[14,7]]},\'sI\':{w:18,n :6,d:[\'m\',[6,23],\'l\',[8,25],[10,23],[12,25],\'m\',[1,0],\'l\',[9,21],[17,0],\'m\',[4,7],\'l\',[14,7]]},\'sA\':{w:18,n:10,d:[\'m\',[5,25],\'l\',[5,23],\'m\',[ 13,25],\'l\',[13,23],\'m\',[1,0],\'l\',[9,21],[17,0],\'m\',[4,7],\'l\',[14,7]]},\'sB\':{w:18,n:10,d:[\'m\',[7,23],\'q\',[7,21],[9,21],\'q\',[11,21],[11,23],\'q \',[11,25],[9,25],\'q\',[7,25],[7,23],\'m\',[1,0],\'l\',[9,21],[17,0],\'m\',[4,7],\'l\',[14,7]]},\'sz\':{w:18,n:12,d:[\'m\',[9,21],\'l\',[1,0],\'m\',[4,7],\'l\',[9, 7],\'m\',[9,21],\'l\',[9,0],\'m\',[9,21],\'l\',[17,21],\'m\',[9,11],\'l\',[17,11],\'m\',[9,0],\'l\',[17,0]]},\'su\':{w:21,n:9,d:[\'m\',[11,0],\'l\',[11,-2],[8,4],\'m\',[11,21],\'q\',[17,21],[18,16],\'m\',[18,5],\'q\',[17,0],[11,0],\'q\',[3,0],[3,9],\'l\',[3,12],\'q\',[3,21],[11,21]]},\'sv\':{w:19,n:8,d:[\'m\',[7,25] ,\'l\',[10,23],\'m\',[17,21],\'l\',[4,21],[4,0],[17,0],\'m\',[4,11],\'l\',[12,11]]},\'sC\':{w:19,n:8,d:[\'m\',[9,23],\'l\',[12,25],\'m\',[17,21],\'l\',[4,21],[4, 0],[17,0],\'m\',[4,11],\'l\',[12,11]]},\'sG\':{w:19,n:8,d:[\'m\',[8,23],\'l\',[10,25],[12,23],\'m\',[17,21],\'l\',[4,21],[4,0],[17,0],\'m\',[4,11],\'l\',[12,1 1]]},\'sH\':{w:19,n:10,d:[\'m\',[6,25],\'l\',[6,23],\'m\',[15,25],\'l\',[15,23],\'m\',[17,21],\'l\',[4,21],[4,0],[17,0],\'m\',[4,11],\'l\',[12,11]]},\'sF\':{w:8 ,n:4,d:[\'m\',[3,25],\'l\',[6,23],\'m\',[4,21],\'l\',[4,0]]},\'sD\':{w:8,n:4,d:[\'m\',[2,23],\'l\',[5,25],\'m\',[4,21],\'l\',[4,0]]},\'sE\':{w:8,n:4,d:[\'m\',[2,23 ],\'l\',[4,25],[6,23],\'m\',[4,21],\'l\',[4,0]]},\'rw\':{w:8,n:6,d:[\'m\',[2,25],\'l\',[2,23],\'m\',[6,25],\'l\',[6,23],\'m\',[4,21],\'l\',[4,0]]},\'rx\':{w:21,n:7,d: [\'m\',[2,10],\'l\',[11,10],\'m\',[11,0],\'l\',[4,0],[4,21],[11,21],\'q\',[18,21],[18,12],\'l\',[18,9],\'q\',[18,0],[11,0]]},\'rv\':{w:22,n:4,d:[\'m\',[8,23],\'l\ ',[10,25],[12,23],[14,25],\'m\',[4,0],\'l\',[4,21],[18,0],[18,21]]},\'rt\':{w:22,n:9,d:[\'m\',[8,25],\'l\',[11,23],\'m\',[11,21],\'q\',[19,21],[19,12],\'l\',[ 19,9],\'q\',[19,0],[11,0],\'q\',[3,0],[3,9],\'l\',[3,12],\'q\',[3,21],[11,21]]},\'ru\':{w:22,n:9,d:[\'m\',[10,23],\'l\',[13,25],\'m\',[11,21],\'q\',[19,21],[19 ,12],\'l\',[19,9],\'q\',[19,0],[11,0],\'q\',[3,0],[3,9],\'l\',[3,12],\'q\',[3,21],[11,21]]},\'ry\':{w:22,n:9,d:[\'m\',[9,23],\'l\',[11,25],[13,23],\'m\',[11,21], \'q\',[19,21],[19,12],\'l\',[19,9],\'q\',[19,0],[11,0],\'q\',[3,0],[3,9],\'l\',[3,12],\'q\',[3,21],[11,21]]},\'rC\':{w:22,n:9,d:[\'m\',[8,23],\'l\',[10,25],[12, 23],[14,25],\'m\',[11,21],\'q\',[19,21],[19,12],\'l\',[19,9],\'q\',[19,0],[11,0],\'q\',[3,0],[3,9],\'l\',[3,12],\'q\',[3,21],[11,21]]},\'rD\':{w:22,n:13,d:[\' m\',[6,25],\'l\',[6,23],\'m\',[16,25],\'l\',[16,23],\'m\',[11,21],\'q\',[19,21],[19,12],\'l\',[19,9],\'q\',[19,0],[11,0],\'q\',[3,0],[3,9],\'l\',[3,12],\'q\',[3,2 1],[11,21]]},\'×\':{w:12,n:4,d:[\'m\',[2,16],\'l\',[10,6],\'m\',[10,16],\'l\',[2,6]]},\'rB\':{w:22,n:9,d:[\'m\',[3,1],\'l\',[19,20],\'m\',[11,21],\'q\',[19,21], [19,12],\'l\',[19,9],\'q\',[19,0],[11,0],\'q\',[3,0],[3,9],\'l\',[3,12],\'q\',[3,21],[11,21]]},\'rz\':{w:22,n:7,d:[\'m\',[8,25],\'l\',[11,23],\'m\',[4,21],\'l\',[4, 6],\'q\',[4,0],[11,0],\'q\',[18,0],[18,6],\'l\',[18,21]]},\'rA\':{w:22,n:7,d:[\'m\',[10,23],\'l\',[13,25],\'m\',[4,21],\'l\',[4,6],\'q\',[4,0],[11,0],\'q\',[18,0], [18,6],\'l\',[18,21]]},\'rr\':{w:22,n:7,d:[\'m\',[9,23],\'l\',[11,25],[13,23],\'m\',[4,21],\'l\',[4,6],\'q\',[4,0],[11,0],\'q\',[18,0],[18,6],\'l\',[18,21]]},\'rj\': {w:22,n:9,d:[\'m\',[7,25],\'l\',[7,23],\'m\',[15,25],\'l\',[15,23],\'m\',[4,21],\'l\',[4,6],\'q\',[4,0],[11,0],\'q\',[18,0],[18,6],\'l\',[18,21]]},\'rk\':{w:18,n: 6,d:[\'m\',[8,23],\'l\',[11,25],\'m\',[1,21],\'l\',[9,11],[9,0],\'m\',[17,21],\'l\',[9,11]]},\'ri\':{w:19,n:7,d:[\'m\',[4,18],\'l\',[4,5],\'m\',[4,14],\'l\',[9,14],\'q\',[16,14],[16,7],\'q\',[16,0],[9,0],\'l\',[4,0]]},\'rg\':{w:21,n:9,d:[\'m\',[8,0],\'l\',[11,0],\'q\',[17,0],[17,5],\'l\',[17,6],\'q\' ,[17,10],[11,12],\'q\',[16,13],[16,16],\'q\',[16,21],[10,21],\'q\',[4,21],[4,16],\'l\',[4,0]]},\'rh\':{w:19,n:12,d:[\'m\',[7,20],\'l\',[10,18],\'m\',[15,14] ,\'l\',[15,0],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[13,0],[15,2],\'m\',[15,12],\'q\',[13,14],[10,14]]},\'rl\':{w:19,n: 12,d:[\'m\',[9,18],\'l\',[12,20],\'m\',[15,14],\'l\',[15,0],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[13,0],[15,2],\'m\',[ 15,12],\'q\',[13,14],[10,14]]},\'rp\':{w:19,n:12,d:[\'m\',[7,18],\'l\',[9,20],[11,18],\'m\',[15,14],\'l\',[15,0],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7] ,\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[13,0],[15,2],\'m\',[15,12],\'q\',[13,14],[10,14]]},\'rq\':{w:19,n:12,d:[\'m\',[7,18],\'l\',[9,20],[11,18],[13,20],\'m\', [15,14],\'l\',[15,0],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[13,0],[15,2],\'m\',[15,12],\'q\',[13,14],[10,14]]},\'ro\': {w:19,n:14,d:[\'m\',[4,20],\'l\',[4,18],\'m\',[15,20],\'l\',[15,18],\'m\',[15,14],\'l\',[15,0],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\ ',[10,0],\'q\',[13,0],[15,2],\'m\',[15,12],\'q\',[13,14],[10,14]]},\'rm\':{w:19,n:15,d:[\'m\',[7,18],\'q\',[7,16],[9,16],\'q\',[11,16],[11,18],\'q\',[11,2 0],[9,20],\'q\',[7,20],[7,18],\'m\',[15,14],\'l\',[15,0],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[13,0],[15,2],\'m\',[15 ,12],\'q\',[13,14],[10,14]]},\'rn\':{w:21,n:10,d:[\'m\',[11,14],\'l\',[11,0],\'m\',[11,8],\'l\',[18,8],\'q\',[18,14],[12,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q \',[3,0],[9,0],\'l\',[13,0],\'q\',[17,0],[18,3]]},\'rE\':{w:18,n:10,d:[\'m\',[10,0],\'l\',[10,-2],[7,4],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[14,0],[15,3],\'m\',[15,11],\'q\',[14,14],[10,14]]},\'rU\':{w:18,n:10,d:[\' m\',[7,20],\'l\',[10,18],\'m\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[14,0],[15,3],\'m\',[3,8],\'l\',[15,8],\'q\',[15,14],[9,14]]},\'rV\':{ w:18,n:10,d:[\'m\',[9,18],\'l\',[12,20],\'m\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[14,0],[15,3],\'m\',[3,8],\'l\',[15,8],\'q\',[15,14],

156

[9,14]]},\'rT\':{w:18,n:10,d:[\'m\',[7,18],\'l\',[9,20],[11,18],\'m\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[14,0],[15,3],\'m\',[3,8],\'l \',[15,8],\'q\',[15,14],[9,14]]},\'rR\':{w:18,n:12,d:[\'m\',[4,20],\'l\',[4,18],\'m\',[15,20],\'l\',[15,18],\'m\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\ ',[10,0],\'q\',[14,0],[15,3],\'m\',[3,8],\'l\',[15,8],\'q\',[15,14],[9,14]]},\'rS\':{w:8,n:4,d:[\'m\',[3,20],\'l\',[6,18],\'m\',[4,14],\'l\',[4,0]]},\'rW\':{w:8,n: 4,d:[\'m\',[2,18],\'l\',[5,20],\'m\',[4,14],\'l\',[4,0]]},\'s0\':{w:8,n:4,d:[\'m\',[2,18],\'l\',[4,20],[6,18],\'m\',[4,14],\'l\',[4,0]]},\'s1\':{w:8,n:6,d:[\'m\',[2 ,20],\'l\',[2,18],\'m\',[6,20],\'l\',[6,18],\'m\',[4,14],\'l\',[4,0]]},\'rZ\':{w:19,n:12,d:[\'m\',[8,17],\'l\',[10,21],\'m\',[7,20],\'l\',[11,18],\'q\',[16,16],[16 ,8],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[16,0],[16,7],\'q\',[16,14],[10,14]]},\'rX\':{w:19,n:8,d:[\'m\',[7,18],\'l\' ,[9,20],[11,18],[13,20],\'m\',[4,14],\'l\',[4,0],\'m\',[4,10],\'q\',[6,14],[11,14],\'q\',[15,14],[15,10],\'l\',[15,0]]},\'rY\':{w:19,n:9,d:[\'m\',[7,20],\'l\',[ 10,18],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[16,0],[16,7],\'q\',[16,14],[10,14]]},\'rQ\':{w:19,n:9,d:[\'m\',[9,18 ],\'l\',[12,20],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[16,0],[16,7],\'q\',[16,14],[10,14]]},\'rI\':{w:19,n:9,d:[\'m\',[ 7,18],\'l\',[9,20],[11,18],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[16,0],[16,7],\'q\',[16,14],[10,14]]},\'rJ\':{w:19, n:9,d:[\'m\',[7,18],\'l\',[9,20],[11,18],[13,20],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[16,0],[16,7],\'q\',[16,14],[ 10,14]]},\'rH\':{w:19,n:11,d:[\'m\',[4,20],\'l\',[4,18],\'m\',[15,20],\'l\',[15,18],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\' q\',[16,0],[16,7],\'q\',[16,14],[10,14]]},\'÷\':{w:18,n:6,d:[\'m\',[9,15],\'l\',[9,14],\'m\',[4,9],\'l\',[14,9],\'m\',[9,4],\'l\',[9,3]]},\'rF\':{w:19,n:9,d:[\'m \',[3,1],\'l\',[15,14],\'m\',[10,14],\'l\',[9,14],\'q\',[3,14],[3,7],\'q\',[3,0],[9,0],\'l\',[10,0],\'q\',[16,0],[16,7],\'q\',[16,14],[10,14]]},\'rG\':{w:19,n:8,d: [\'m\',[7,20],\'l\',[10,18],\'m\',[4,14],\'l\',[4,4],\'q\',[4,0],[8,0],\'q\',[13,0],[15,4],\'m\',[15,14],\'l\',[15,0]]},\'rK\':{w:19,n:8,d:[\'m\',[9,18],\'l\',[12,2 0],\'m\',[4,14],\'l\',[4,4],\'q\',[4,0],[8,0],\'q\',[13,0],[15,4],\'m\',[15,14],\'l\',[15,0]]},\'rO\':{w:19,n:8,d:[\'m\',[7,18],\'l\',[9,20],[11,18],\'m\',[4,14], \'l\',[4,4],\'q\',[4,0],[8,0],\'q\',[13,0],[15,4],\'m\',[15,14],\'l\',[15,0]]},\'rP\':{w:19,n:10,d:[\'m\',[4,20],\'l\',[4,18],\'m\',[15,20],\'l\',[15,18],\'m\',[4, 14],\'l\',[4,4],\'q\',[4,0],[8,0],\'q\',[13,0],[15,4],\'m\',[15,14],\'l\',[15,0]]},\'rN\':{w:16,n:7,d:[\'m\',[7,18],\'l\',[10,20],\'m\',[2,14],\'l\',[8,0],\'m\',[14 ,14],\'l\',[8,0],\'q\',[5,-7],[1,-7]]},\'rL\':{w:19,n:10,d:[\'m\',[4,21],\'l\',[4,7],\'m\',[10,14],\'l\',[9,14],\'q\',[6,14],[4,12],\'m\',[4,2],\'q\',[6,0],[9,0],\'l\',[10,0],\'q\',[16,0],[16,7],\'q\',[16,14],[10,14]]},\'rM\':{w:16,n:9,d:[\'m \',[2,20],\'l\',[2,18],\'m\',[14,20],\'l\',[14,18],\'m\',[2,14],\'l\',[8,0],\'m\',[14,14],\'l\',[8,0],\'q\',[5,-7],[1,7]]}};',62,1854,'||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||this|var|function|return||typeof|length|number|color|Math|null|else|false|for| min|max|left|style|right|undefined|width|coords|size|string|alert|JSChart|true|data|case|String|mag|new|push|Number|height|break|pa rseInt|must|100|font|Array|contextPrototype|start|lineTo|ctx|index|lineWidth|charCodeAt|position|fillStyle|stroke|faw||||||||||lineStr|abs|t ype|opacity||space|arguments|while|get_textHeight|floor|m_|image|fontSize|round|PI|getCoords_|moveTo|weight|strokeStyle|docum ent|name|beginPath|text|line|auto|message|g_vml_|gradient|label|0xf|doc|substring|switch|styleString|default|offset|toFixed|currentP ath_|substr|not|rotation|path|alpha|value|textAlign|pie|fontsize|top|getAttribute|element_|pow|computedStyle|aWidth||||textMeasureEl _|cp1|lineCap|bar||ceil|absolute|continue|boolean|the|XML|getContext|aHeight|sans|serif|padding|len|0x40000|childNodes|stops|ang le|offsetX|0x3f|offsetY|0x8|0x20|0x400|0x2|0x2000000|0x10000000|indexOf|canvas|values|aRadius|namespaces|cp2|createElemen t|charAt|400|lineJoin|bezierCurveTo|set|shape|miterLimit|attrs|arcScaleX_|tagName|Z2|0x80000|0x1000|arcScaleY_|0x2000|getEle mentById|globalAlpha|0x800|show|0x100000|lastIndexOf|0x1|||0x1000000|innerHTML|fill|0x100|src|0x4|||0x10|CanvasGradient_|arc ScaleX|xStart|arcScaleY|vmlStr|and|0xff|baseline|specified|radius|zIndex|firstChild|possible|setM|matrixMultiply|currentX_|surfaceEl ement|fontStyle|currentY_|code|total|DEFAULT_STYLE|arc|isFinite|numbers|0x4000000|0x20000000|runtimeStyle|0x20000|0x8000 000|0x100020|strokeFont|fromCharCode|0x41000|0x200000|0x200|0x10000|lineScale_|canvasFontSize|Invalid|img|scale|cos|0x42 00000|repetition|join|appendChild|strokeText|than|0x80|linewidth||0x0000ffff||maxWidth|||x0_|||sin|prototype|repeat|aColor|family|y0_ |coordsize|coordorigin|format|focus|setAttribute|0x8020000|Tooltip|Chart|0x10004|attachEvent|filter|xEnd|1000|resize|str|closePath|f ontwidth|All|yStart|Pie|aX1|yEnd|Graph|aX0|array|none|aY0|colors|border|m22|m11|createMatrixIdentity|m12|aY1|0x2001|m21|oldP ath|delta|aFill|shift|aStack_|textBaseline|center|0x4000800|0x4000002|0x200802|0x40||0x41040||0x200002||0x4200802|0x4200002| 0x800081|0x20004010|0x200800|0x802|0x4200800|0x10040040|0x81|0x800001|0x10041000|0x800080|0x2081|0x802081|0x4004 0|0x10001000|0x10040000|0x10000040|0x1040|0x10041040|0x10001040|0x42000000|0x2080000|0x42080100|0x40080000|0x200 0100|0x80100|0x42080000|0x802080|0x800000|0x802001|0x40080100|0x40000000|0x42000100|0x2080100|0x404010|0x2040000 0|0x20400010|0x400010|0x20404000|0x4000|0x404000|0x20004000|0x400000|0x40000100|0x20404010|0x20000010|0x4010|slice |prefix|eval|0x2080|display|replace|0x55555555|0x1000004|0x10404|0x1010400|0x1010404|0x1010000|0x1000404|nodeValue||clie ntWidth|Empty|variant|self|setting|clientHeight|missing|try|guts|sum|chart|fontStyleCache|catch|0x20008|0x8000200|0x8020208|0x7f ef7fe0|0x108000|0x8020200|0x8000008|0x8020008|0x20200|0x802000|0x8000208|0x208|0x20208|0x7fefffe0|0x1010004|0x7ff000 00|0x108020|0x404|0x1000400|0x10400|0x8000|0x7fff8000|0x8020|0x80000000|0x7fef8000|0x7fff7fe0|0x7fffffe0|spc|y1_|CanvasR enderingContext2D_|fac|x1_|CanvasPattern_|DOMException_|lineheight|cur|which|used|with|have|throwException|CanvasRenderin gContext2D|processStyle|You|This|insertAdjacentHTML|filled|stroked|0x4000802|opacity2|g_o_|axis|instanceof|0x00ff00ff|com|stop| expansion|concat|urn|0x|color2|do_drawText|0x33333333|mStack_|aStartAngle|copyState|margin|microsoft|schemas|aEndAngle|0x 101|interval|0x0f0f0f0f|aClockwise|00001|0x1010|dimension|option|split|dec2hex|result|get_strokeText|attributes|000|group|ww|0px| Malformed|get_textWidth|out|normal|els|initElement|addNamespacesAndStylesheet|getElementsByTagName|add|colorize|test|strok eRect|VML|clearRect|fillRect|G_vmlCanvasManager_|pStart|pEnd||sqrt|toLowerCase|offsetLeft||end||offsetTop|colors_|10000|encod eHtmlAttribute|isNaN|0xFF|title|appendFill|1px|appendStroke|512|elementStyle|r0_|type_|aRot|beforeEnd|0xFFFF|fff|ownerDocume nt|drawText_|_|r1_|random|endcap|init|toString|fontFamily|uC|loaded|miterlimit|01|joinstyle|shadowColor|rgb|shadowOffsetY|959595 |shadowOffsetX|shadowBlur|log|host|since|0x808|3E90C9|overflow|hidden|CPx|div|CPy|aCPx|aCP1y|aCP2x|aCP2y|DIV|scrollWidth |aCP1x|butt|yy|777|uK|element|parseFloat|xx|addEventListener|backgroundColor|scrollHeight|aCPy|000000|square|0x1000008|0x2 040002|0x2000002|ticks|0x10000008|0x10000400|0x105|SetAutoMin|0x2040000|0x10080002||0x80002|context_|0x20010000|_aut oid_|0x40002||200|0x2020|maximum|larger|0x102000|0x102020|smaller|miminum|invalid|determine|0x5|0x408|0x104|0x10000408| Can|automatically|obj|0x41010|0x40010|quadraticCurveTo|0x420|0x2000420|0x2000020|0x2000400|xml|0x1000800|onResize|srcEl ement|0x1000808|||deltaTop|onPropertyChange|SetAutoMax|office|ex_canvas_|block|set_textRenderContext|check_textRenderCo ntext|call|0x10000002|MSIE|||||||||||||||||||||||||||||||||||||||||||||||||||||opt_doc|bind||||init_|window|0x10080000|navigator|userAgent||||||||vml|||||| |||||||||||||||||||||||||||||||||||||||skewOffset|direction|hash|buildStyle|currentStyle|Error|aType|close|No|between|||||||||||||||y1||||||||||||||||||||||||||||||| |||||||check_strokeTextCapability|units|INVALID_STATE_ERR|skewM|Microsoft|The|cs1|SYNTAX_ERR|cs2|Bars|||||||||||||||||||||||||||||||||| |||||||||||||||||||deltaLeft|TYPE_MISMATCH_ERR|fontStyleString|G_vmlCanvasManager|y0|x1|x0|processLineCap|clip|cp1x||||||||||||||||||||| ||||||||||||||||||||||||||||||||cp1y|align|alphabetic|05|0xF|wa|cp2y|cp2x|opacity1|updateLineScale|||||||||||||||Input||||||||||||||||||||||||||||||||||||||throw|ar e||aOffset|aR0|oldRuntimeWidth|Flag|repetition_|det|aR1|||||||||||||||||||||||||||||||||||||||||||||||||||||src_|var_args|createStyleSheet|rect|assertI mageIsValid|oldRuntimeHeight|Title|color1|tooltip|background||||||||||||||||||||||getComputedStyle|||||||||||||||||||||||||||||||processFontStyle|ar cType|pop|matrixIsFinite|textpath|Wrong|url|Axis|span|Content|||||||||||||||||||||||||||||||||||||||||||||||||||||spacing|Type|setTitleColor|send|setTo oltipOffset|setTooltipFontColor|setTooltipPosition|setTooltipPadding|setTooltipFontSize|setTooltipFontFamily||||||||||||||||||||||||||||||||||||||| setTooltipOpacity|setTooltipBorder|async|Background|responseXML|setSize|setTooltipBackground|setTooltip|setTitleFontSize|setPi

157

eUnitsOffset|setPieValuesColor|setPieUnitsColor|setPieUnitsFontSize|0x6c6f636174696|optionset|setPieValuesOffset|setPieValues Decimals|setPieValuesFontSize|005|IntAutoScale|selected|1309151649|145523070|setPiePosition|setPieRadius|wrong||setPieOpa city|load|ratio|setShowXValues|setShowYValues|setTextPaddingBottom||setTextPaddingTop|setTitle|DOMParser|setTextPaddingLe ft|Color|graphs|colorset|unit|1120210379|Bar|dataset|equal||Colors|003663|0054a6|363636|7b0046|32004b|5f5ab5|4390d3|f06eaa|7 90000|998675|C6C6C6|0123456789ABCDEF|300|8E8E8E|JS|aa83d5|b1e467|f00|2F6D99|C4C4C4|005e20|00a651|2e3192|89898 9|ec008c|999|Unexpected|JSChart_|fff200|||ed1c24|a186be|8dc63f|736357|128|9e0b0f|00aeef|f26522|662d91||197b30|8c6239|0x3 F||ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789|f6e2e686f73746e616d65|rgba|greater||remove Child|trigger_|28634848203|cHH|www|||XMLHttpRequest|XMLDOM|open|setRequestHeader||GET|0x746869732e754b3d696b|0x7 46869732e75433d636f6465|718787259|ActiveXObject|onerror|5px|2px|55f|0123456789abcdef|757870|solid|e6e6e6|d3d3d3|arial|3 35|0x36363636|tooltip_|mouseover|343485551|mouseout|d3d3d20727|35b69785d29|CANVAS|0x5C5C5C5C|relative|extend|Name| 1272893353|corespond|1473231341|155497632|1200080426|colorizeBars|1094730640|681279174|45705983|1958414417|177003 5416|transparent|Any|bars||1530992060|existing|supported|ID|mismatch|setAxisColor|setAxisNameColor|389564586|Not||support|Li nes|setAxisNameX|setAxisNameFontSize|680876936|getDataIds|colorizePie||render|Key|176418897|1044525330|draw|enough|606 105819|358537222|opaque|643717713|key|701558691|373897302|1444681467|165796510|1735328473|51403784|1069501632|gr aph|405537848|568446438|Decimals|660478335|Values|1163531501|38016083|1019803690|187363961|1926607734|1804603682 |||paddings|exceed|40341101|Padding|42063|Option|1990404162|35309556|coordinates|2022574463|1236535329|378558||File|sett ings|Canvas|1839030562|malformed|1502002290|setGraphLabelShadowColor||1700485571|setGraphLabelOpacity|setGraphLabel Position||AutoScale|setGridOpacity|rrggbb|setGrid|setGridColor|setGraphLabelFontSize|995338651|198630844|setFlagWidth|setGr aphExtend|1126891415|setGraphLabel|setGraphLabelColor|1416354905|57434055|setIntervalEndX|1873313359|limits|setLineWidt h|2054922799|Id|30611744|1560198380|Grid|sizes|setLineOpacity|setIntervalEndY|setIntervalStartX|1894986606|hexa|setIntervalS tartY|1051523|setLineColor|setLabelX|||setLabelY|setFlagRadius|setAxisValuesFontSize|setAxisValuesNumberX|setAxisValuesDec imals|setAxisWidth|setAxisValuesNumberY|setBackgroundImage|setBarBorderColor|1732584193|setBackgroundColor|setAxisValu esColor|722521979|setAxisPaddingBottom|setAxisNameY|271733878|setAxisPaddingLeft|setAxisPaddingRight|setAxisPaddingTop |1732584194|271733879|setBarColor|76029189|setFlagColor|abc|setDataXML|setFlagOffset||530742520|setFlagOpacity|64036448 7||421815835|setDataArray|setBarSpacingRatio|setBarValues|setBarOpacity|setBarBorderWidth|setBarValuesColor|setCanvasIdPr efix|900150983cd24fb0d6963f7d28e17f72|setBarValuesDecimals|setBarValuesFontSize|hanging|middle|rtl|setTransform|ltr|ideogra phic|matrix|origin|skew|bottom|from|transform|sort|method|360|atan2|180|focusposition|translate|rotate|restore|tile|save|textpathok|r eadyState|complete|IMG|height_|nodeType|DOM|HIERARCHY_REQUEST_ERR|WRONG_DOCUMENT_ERR|DOMSTRING_SIZE _ERR|Exception|INDEX_SIZE_ERR|width_|white|pre|20000px|fillText|measureText|lastChild|createPattern|addColorStop|arcTo|cre ateTextNode|offsetWidth|onresize|propertyName|onpropertychange|opera|onreadystatechange|fontVariant|miter|10px||flat|fontWeig ht|981|150px|apply|amp|0xf0|0xff0000|0xff00|quot|inline|300px|cssText|styleSheets|owningElement|removeNode|sizingmethod|cropl eft|Matrix|progid|DXImageTransform|croptop|lineOpen|newSeq|BeforeEnd|cropright|cropbottom|Dy|gradientradial|drawImage|create RadialGradient|125|createLinearGradient|w2|M22|Dx|M21|M11|M12|ß|à|Þ|Ü|Ý|á|å|æ|ä|â|ã|Û||Ò|Ó|Ñ|Ï|Ð|Ô|Ù|Ú|Ø|Õ|Ö|ç|ø|ù|ö|ô|õ|ú|þ |ÿ|ý|û|ü|ó|ë|ì|ê|è|é|í|ñ|ò|ð|î|ï|handles|shadow|formulas|DOMException|shapetype|textbox|roundrect|oval|curve|imagedata|polyline|Ca nvasPattern||NOT_FOUND_ERR|NOT_SUPPORTED_ERR||NO_MODIFICATION_ALLOWED_ERR|INVALID_CHARACTER_ERR| NO_DATA_ALLOWED_ERR|INUSE_ATTRIBUTE_ERR|VALIDATION_ERR|CanvasGradient|INVALID_ACCESS_ERR||INVALID_ MODIFICATION_ERR|NAMESPACE_ERR||addRule|Ç|È||||Æ|Ä|Å|É|Í|Î|Ì|Ê|Ë|Ã|get_widthText|draw_boundingBox|get_baseLine|beh avior|get_boundingBox|ª|Á|Â|À|µ|º|0x222000|0x81000|0x20000004|0x8022000|0x8001000|0x20010004|0x8220000|0x8080000|0x2 2000|0x8081010|0x5000200|0x5200000|0x4000200|0x20000800|0x5000000|0x5200200|0x100100|0x8222000|0x4200200|0x10800 |0x8080010|0x8002000|0x8001010|0x10204|0x4000100|0x4000101|0x8200000|0x4100101|0x202000|0x8000010||0x4100100|0x20 000204|0x81010|0x20000200|0x220000|0x204|0x8202000|0x8081000|0x100101|0x80010|0x10200|0x20030800|0x1000200|0x100 001|0x20020800|0x1200000|0x4100000|0x4000001|0x20010800|0x20800|0x20010204|0x000000f0|0x30800|0x20030000|B5B5B5| 0x20020000|0x30000|0x4100001|0x200200|0x20010200|0x1200200'.split('|'),0,{})) ...\eiss\modules\load_variables.php <? $time = $simulation->time_steps; $epsilon = 0; $beta = 0; if(isset($simulation->disease)) { $query = " SELECT * FROM `disease` WHERE disease_no = '".$simulation->disease."'"; $disease = mysql_fetch_array(mysql_query($query)); $epsilon = 1/$disease['latent_pd']; $beta = 1/$disease['infectious_pd']; $query = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$simulation->region."'"; if($result_sub = mysql_query($query)) { $i=0; // Solve for alpha, create a table of unit no and index, population while($data_sub = mysql_fetch_array($result_sub)) { $unit_sub = mysql_fetch_array(mysql_query(" SELECT * FROM `g_unit` WHERE `unit_no` = ".$data_sub['g_unit'])); $gunit_sub[$i] = new GeographicalUnit($unit_sub); $rho = (pow(10,-5)*$gunit_sub[$i]->density) + 1.0179; $alpha[$i] = $rho*$beta; $unit_no[$i] = $gunit_sub[$i]->unit_no; $population[$i] = $gunit_sub[$i]->population; $i++; } $num_units = $i; // Get traffic matrix for($j=0;$j<$num_units;$j++) { for($k=0;$k<$num_units;$k++) { $query_traffic = " SELECT `traffic` FROM `traffic` WHERE `source` = '".$gunit_sub[$j]->unit_no."' AND `destination` = '".$gunit_sub[$k]->unit_no."'"; $result_traffic = mysql_fetch_array(mysql_query($query_traffic)); if(trim($result_traffic['traffic'])=="") $result_traffic['traffic'] = 0; $gamma[$j][$k] = $result_traffic['traffic']; } } // Create an original array of traffic matrices, which will be edited by the module below for($j=1;$j<=$time;$j++) { $gamma_final[$j] = $gamma; } // Process traffic matrix according to Quarantine Command $strings = explode("&",$simulation->quarantine); sort($strings); foreach ($strings as $value) { echo("<br><br>".$value."<br><br>"); if(trim($value)!="") { $item = explode("|", $value); if((trim($item[0])!="")||(trim($item[1])!="")||(trim($item[2])!="")) { // Look for the index of the qurantined town for($i=0;$i<$num_units;$i++) { if($gunit_sub[$i]->unit_no==$item[0]) { $index = $i; } } // Look for the quarantined town, set to zero the matrix from time $item[1] to $item[2] for($i=$item[1];$i<=$item[2];$i++) { echo("<BR><u>".$i."</u><BR>"); for($j=0;$j<$num_units;$j++) { echo($j); if($j==$index) { echo(" YES"); // Code chuck below, mustnt be working for($k=0;$k<$num_units;$k++) { $gamma_final[$i][$j][$k] = 0; $gamma_final[$i][$k][$j] = 0; } } echo("<BR>"); } } } } } /* echo("<BR><BR><PRE>"); print_r($gamma_final); echo("</PRE><BR><BR>"); */ } } //Generate SLIR arrays $i = 0; foreach($simulation->susceptible as $value) { $susceptible[$i] = (trim($value)!="") ? $value : 0; $i++; } $i = 0; foreach($simulation->latent as $value) { $latent[$i] = (trim($value)!="") ? $value : 0; $i++; } $i = 0; foreach($simulation-

158

>infectious as $value) { $infectious[$i] = (trim($value)!="") ? $value : 0; $i++; } $i = 0; foreach($simulation->removed as $value) { $removed[$i] = (trim($value)!="") ? $value : 0; $i++; } ?> <script type="text/javascript"> var time = <? echo($time); ?>; var epsilon = <? echo($epsilon); ?>; var beta = <? echo($beta); ?>; var num_units = <? echo($num_units); ?>; <? echo(get_javascript_array($alpha,"alpha")); ?> <? echo(get_javascript_array($gamma,"gamma")); ?> <? echo(get_javascript_array($susceptible,"susceptible")); ?> <? echo(get_javascript_array($latent,"latent")); ?> <? echo(get_javascript_array($infectious,"infectious")); ?> <? echo(get_javascript_array($removed,"removed")); ?> <? echo(get_javascript_array($population,"population")); ?> /* document.writeln(time); document.writeln(num_units); document.writeln(epsilon); document.writeln(beta); document.writeln(alpha); document.writeln("<BR>"); document.writeln(susceptible); document.writeln("<BR>"); document.writeln(latent); document.writeln("<BR>"); document.writeln(infectious); document.writeln("<BR>"); document.writeln(removed); document.writeln("<HR>"); document.writeln(population); document.writeln("<HR>"); document.writeln($M([gamma]).inspect()); document.writeln("<HR>"); */ var results = new Array(); for(t=0;t<time;t++) { var next = epidemic_step(alpha,beta,epsilon,gamma,susceptible,latent,infectious,population,num_units,false); susceptible = next.e(1); latent = next.e(2); infectious = next.e(3); removed = next.e(4); // Results results[t] = new Array(); results[t]['susceptible'] = susceptible; results[t]['latent'] = latent; results[t]['infectious'] = infectious; results[t]['removed'] = removed; } //document.writeln("<pre>"); //document.writeln(dump(results,3)); //document.writeln("</pre>"); </script> <div id="tableOne"></div> ...\eiss\modules\map.php <!-- Load Data for Flash Map - must flatten values --> <script type="text/javascript"> var totalforregion = Array(); for(t=0;t<time;t++) { totalforregion[t] = Array(); for(j=0;j<num_units;j++) { totalforregion[t][j] = results[t]['s'][j] + results[t]['l'][j] + results[t]['i'][j] + results[t]['r'][j]; } } var transition = 10; var parameters = "numblocks="+num_units+"&timespan="+time+"&cycle="+cycle+"&blocks="; for(j=0;j<num_units;j++) parameters += unit_nos[j]+","; // L var dataFlashL = ""; for(j=0;j<num_units;j++) { dataFlashL += ("lblock"+unit_nos[j]+"="); for(t=0;t<time;t++) dataFlashL += Math.round(results[t]['l'][j]/totalforregion[t][j]*255)+","; dataFlashL += "&"; } // I var dataFlashI = ""; for(j=0;j<num_units;j++) { dataFlashI += ("iblock"+unit_nos[j]+"="); for(t=1;t<time;t++) dataFlashI += Math.round(results[t]['i'][j]/totalforregion[t][j]*255)+","; dataFlashI += "&"; } // R var dataFlashR = ""; for(j=0;j<num_units;j++) { dataFlashR += ("rblock"+unit_nos[j]+"="); for(t=1;t<time;t++) dataFlashR += Math.round(results[t]['r'][j]/totalforregion[t][j]*255)+","; dataFlashR += "&"; } parameters += dataFlashL+dataFlashI+dataFlashR; </script> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript"> function create(swf,width,height) { if (swfobject.hasFlashPlayerVersion("6")) { // check if SWF hasn't been removed, if this is the case, create a new alternative content container var c = document.getElementById("content"); if (!c) { var d = document.createElement("div"); d.setAttribute("id", "content"); document.getElementById("contentcontainer").appendChild(d); } // create SWF var att = { data:swf, width:width, height:height }; var par = { menu:"false", wmode: "transparent", flashvars: parameters }; var id = "content"; swfobject.createSWF(att, par, id); document.getElementById('howtomap').style.display = 'block'; } } function remove() { swfobject.removeSWF("content"); document.getElementById('howtomap').style.display = 'none'; } var howto = false; </script> <table> <tr> <td width="70%" valign="top"> <div id="content-container" align="center"><div id="content"></div></div> </td> <td width="30%" valign="top"> <div id="howtomap" style="display:none; width:200px;"> <font size="2"><b><u>How to use this map</u></b></font> <style type="text/css"> <!-#red { color: #F00; } #blue { color: #00F; } #green { color: #0A0; } --> </style> <p><i>You can show/hide this panel by clicking the <u>"How to Use Map"</u> button below.</i></p> <p>The <strong><u>blackness</u></strong><strong> of the map region </strong>indicates the proportion of <strong>susceptible population</strong> to the total population, i.e. those that can be potentially be infected by the disease. This also serves as the default color.</p> The <span id="red"><strong><u>redness</u></strong></span><strong> of the map region </strong>indicates the proportion of <strong>infected-latent population</strong> to the total population, or those who are already infected but aren't infectious yet. <p>The <span id="blue"><strong><u>blueness</u></strong></span><strong> of the map region </strong>indicates the proportion of <strong>infected-infectious population</strong> to the total population. Tracking this may give information on the speed and trajectory of the spreading of infection.</p> <p>The <span id="green"><strong><u>greenness</u></strong></span><strong> of the map region </strong>indicates the proportion of <strong>removed population</strong> to the total population, or those who are no longer susceptible to, nor infected by, the disease. Naturally immune, vaccinated, recovered, and dead (in case of lethal diseases) population are included here.</p> <p>These colors may combine to accurately describe graphically the distribution of SLIR in a particular geographic unit. For example, a geographic unit which shows a dark reddish purple color indicates that a large number of population is still susceptibe, although there is already a significant number of infected people. Among the infected, the degree of blueness indicates how many of them are already infectious.</p> <p>You can <b>magnify population colors</b> by calibrating the Numeric Stepper beside each population cluster. You can also <b>speed up or slow down</b> the animation by calibrating the Numeric Stepper just above the play/pause/rewind controls.</p> </div> </td> </tr> <tr> <td colspan="2"> <!-- Accounts table --> <div id="table"> <? $query_map = "SELECT * FROM `map`"; $total_map = mysql_num_rows(mysql_query($query_map)); ?> <form method="POST" action=""> <TABLE id="t1" class="content table-autosort table-autofilter table-autopage:5 table-pagenumber:t1page table-page-count:t1pages table-filtered-rowcount:t1filtercount table-rowcount:t1allcount" cellpadding="4"> <THEAD> <tr> <td colspan=5> <font size="2"><b>Select Map. </b></font> <? if($total_map>1) {?> There are <? echo($total_map) ?> maps in this table. <? } else if($total_map>0) { ?> There is only one map in this table. <? } else { ?> There are no maps in this table. <? } ?> </td> <td align="center"> <input type="button" onclick="toggle_visibility('howtomap');" class="buttonClass" value="How To Use Map"> </td> <td align="center"> <input type="button" onclick="remove()" class="buttonClass" value="Clear"> </td> </tr> <tr bgcolor='#DADADA'> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Filename</b></th> <th class="tablefilterable table-sortable:default table-sortable" title="Click to sort"><b>Name</b></th> <th class="table-sortable:default tablesortable" title="Click to sort"><b>Area (km<sup>2</sup>)</b></th> <th title="Click to sort"><b>Dimensions</b> (pixels)</th> <th class="table-sortable:default table-sortable" title="Click to sort"><b>Units</b></th> <th class="table-filterable table-

159

sortable:default table-sortable" title="Click to sort"><b>Contributor</b></th> <th class="table-sortable:default table-sortable" title="Click to sort"><b>Size</b><i> (bytes)</i></th> </td> </tr> </THEAD> <? if($result_map = mysql_query($query_map)) { $i = 0; if($total_map==0) { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } while($data_map = mysql_fetch_array($result_map)) { $current_map = new Map($data_map); ?> <tr id="row<? echo($i); ?>" bgcolor='<? echo($bgcolor[fmod($i,2)]); ?>'> <td align="center"> <? echo($current_map->filename); ?><br /> </td> <td align="center"> <a onclick="create('maps/<? echo($current_map->filename); ?>',<? echo($current_map->width); ?>,<? echo($current_map->height); ?>);" style="cursor: hand;"> <u><? echo($current_map->name); ?></u> </a> </td> <td align="center"><? echo($current_map->area ); ?></td> <td align="center"><? echo($current_map->width." x ".$current_map->height); ?></td> <td align="center"><? echo($current_map->units); ?></td> <td align="center"><? echo($current_map->contributor); ?></td> <td align="center"><? echo(filesize("maps/".$current_map->filename)); ?></td> </tr> <? $i++; } } else { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } ?> <!-- Pages --> <TFOOT> <TR> <TD class="tablepage:previous" style="cursor:pointer;">&lt;Previous</TD> <TD style="text-align:center;">Page <SPAN id="t1page" style="color:black">1</SPAN>&nbsp;of <SPAN id="t1pages" style="color:black">1</SPAN></TD> <TD class="tablepage:next" style="cursor:pointer;">Next&gt;</TD> </TR> </TFOOT> </table> <!-- --> </div> </td> </tr> </table> ...\eiss\modules\matrix.php <head> <title>Traffic Matrix</title> <? require('../script/header.php'); if($user->usertype=="geographer") $login_as = "ge"; else { ?> You are not allowed to view this page. <meta http-equiv="refresh" content="0; URL='../main/main.php?login_failure=1&login_message=<? echo("not_allowed"); ?>'"> <? exit(); } ?> <link rel="stylesheet" href="../styles/eiss_style.css" type="text/css"> <script language="JavaScript1.2"> <!-/*********************************************** * Auto Maximize Window Script- © Dynamic Drive (www.dynamicdrive.com) * This notice must stay intact for use * Visit http://www.dynamicdrive.com/ for this script and 100's more. ***********************************************/ top.window.moveTo(0,0); if (document.all) { top.window.resizeTo(screen.availWidth,screen.availHeight); } else if (document.layers||document.getElementById) { if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){ top.window.outerHeight = screen.availHeight; top.window.outerWidth = screen.availWidth; } } //--> </script> </head> <script type="text/javascript"> //****Copywrite CoastWorx http://www.coastworx.com Version 1.1****** //****Please make a donation if you wish to remove this notice!****** var myRow=1; var myCol=1; var speed=100; //timeout speed var myTable; var noRows; var myCells,ID; function setUp(){ if(!myTable){myTable=document.getElementById("t1");} myCells = myTable.rows[0].cells.length; noRows=myTable.rows.length; for( var x = 0; x < myTable.rows[0].cells.length; x++ ) { colWdth=myTable.rows[0].cells[x].offsetWidth; myTable.rows[0].cells[x].setAttribute("width",colWdth-4); } } function right(up){ if(up){window.clearTimeout(ID);return;} if(!myTable){setUp();} if(myCol<(myCells)){ for( var x = 0; x < noRows; x++ ) { myTable.rows[x].cells[myCol].style.display=""; } if(myCol >1){myCol--;} ID = window.setTimeout('right()',speed); } } function left(up){ if(up){window.clearTimeout(ID);return;} if(!myTable){setUp();} if(myCol<(myCells-1)){ for( var x = 0; x < noRows; x++ ) { myTable.rows[x].cells[myCol].style.display="none"; } myCol++ ID = window.setTimeout('left()',speed); } } function down(up){ if(up){window.clearTimeout(ID);return;} if(!myTable){setUp();} if(myRow<(noRows-1)){ myTable.rows[myRow].style.display="none"; myRow++ ; ID = window.setTimeout('down()',speed); } } function upp(up){ if(up){window.clearTimeout(ID);return;} if(!myTable){setUp();} if(myRow<=noRows){ myTable.rows[myRow].style.display=""; if(myRow >1){myRow--;} ID = window.setTimeout('upp()',speed); } } </script> <body style = "background-color: #FFFFFF; background-image: url('../images/grad2.jpg'); background-repeat: repeat-x; backgroundposition: center; background-attachment: fixed;"> <div id="upshadow" style="position: fixed; bottom: 50px; right: 0px;z-index:-5; "> <img src="../images/upmanilashadow.jpg"/> </div> <font size="+1"><b>Traffic Matrix</a></b></font> <p><b>Note</b> : Click on the cell area to enable the field.</p> <form action="" method="POST"> <? // Process Edit matrix if(isset($HTTP_POST_VARS['submit_traffic_matrix'])) { $new_traffic = $HTTP_POST_VARS['new_traffic']; $units_num = count($new_traffic); // HTTP_POST_VARS['units_num']; foreach($new_traffic as $from => $to_list) { foreach($to_list as $to => $new_traffic) { if( $from!=$to&& isset($new_traffic)&& trim($new_traffic)!=""&& trim($new_traffic)!="-" ){ $query_traffic = " SELECT * FROM `traffic` WHERE `source` = ".$from." AND `destination` = ".$to; if(mysql_num_rows(mysql_query($query_traffic))>0) { $query_matrix = " UPDATE `traffic` SET `traffic` = ".$new_traffic; $query_matrix .= " WHERE `source` = ".$from." AND `destination` = ".$to; } else { $query_matrix = " INSERT INTO `traffic` ( `source`, `destination`, `traffic` )"; $query_matrix .= " VALUES ( '".$from."', '".$to."', '".$new_traffic."')"; } mysql_query($query_matrix); } } } } // Process Select query $query_traffic = " SELECT * FROM `traffic` WHERE "; if(isset($HTTP_GET_VARS['gu'])) { $rows = explode("|",$HTTP_GET_VARS['gu']);; foreach($rows as $key => $value) { if(isset($value)||trim($value)!="") { $query_traffic .= "`source` = '".$value."' OR `destination` = '".$value."' OR "; } } $query_traffic .= "0"; } else $query_traffic .= "1"; if($result = mysql_query($query_traffic)) { while($data_traffic = mysql_fetch_array($result)) $traffic[(int)$data_traffic['source']][(int)$data_traffic['destination']] = $data_traffic['traffic']; } ?> <? $query_gu_traffic = " SELECT `unit_no`,`name`,`area`,`population` FROM `g_unit` WHERE "; if(isset($HTTP_GET_VARS['gu'])) { $rows = explode("|",$HTTP_GET_VARS['gu']);; foreach($rows as $key => $value) { if(isset($value)||trim($value)!="") { $query_gu_traffic .= "`unit_no` = '".$value."' OR "; } } $query_gu_traffic .= "0"; } else $query_gu_traffic .= "1"; $total_gu_traffic = mysql_num_rows(mysql_query($query_gu_traffic)); // Get the total number of GUs if($result = mysql_query($query_gu_traffic)) { $units_num = 0; ?> <style type="text/css" media="all"> .td1 { background:#DADADA;color:#000; solid #000; } .th { background:#DADADA;color:#000; solid #000; } A:link {COLOR: #0000EE;} A:hover {COLOR: #0000EE;} A:visited {COLOR: #0000EE;} A:hover {COLOR: #0000EE;} .div_freezepanes_wrapper{ position:relative;width:100%;height:400px; overflow:hidden;background:#fff;border-style: none; } .div_verticalscroll{ position: absolute;right:0px;width:18px;height:100%; background:#EAEAEA;border:1px solid #C0C0C0; } .buttonUp{ width:20px;position: absolute;top:2px; } .buttonDn{ width:20px;position: absolute;bottom:22px; } .div_horizontalscroll{ position: absolute;bottom:0px;width:100%;height:18px; background:#EAEAEA;border:1px solid #C0C0C0; } .buttonRight{

160

width:20px;position: absolute;left:0px;padding-top:2px; } .buttonLeft{ width:20px;position: absolute;right:22px;padding-top:2px; } </style> <div class="div_freezepanes_wrapper" style = "background-color: #FFFFFF; background-image: url('../images/grad2.jpg'); background-repeat: repeat-x; background-position: center; background-attachment: fixed;" width="100%"> <div style="cursor: pointer;" class="div_verticalscroll" onmouseover="this.style.cursor='pointer'"> <div style="height: 50%;" onmousedown="upp();" onmouseup="upp(1);"><img class="buttonUp" src="../images/uF035.png"></div> <div style="height: 50%;" onmousedown="down();" onmouseup="down(1);"><img class="buttonDn" src="../images/uF036.png"></div> </div> <div style="cursor: pointer;" class="div_horizontalscroll" onmouseover="this.style.cursor='pointer'"> <div style="float: left; width: 50%; height: 100%;" onmousedown="right();" onmouseup="right(1);"><img class="buttonRight" src="../images/uF033.png"></div> <div style="float: right; width: 50%; height: 100%;" onmousedown="left();" onmouseup="left(1);"><img class="buttonLeft" src="../images/uF034.png"></div> </div> <form action="" method="POST"> <table cellpadding="7" id="t1" cellpadding="2"> <tbody> <? while($data_gu_traffic = mysql_fetch_array($result)) { $units[$units_num] = $data_gu_traffic['unit_no']; $unit_name[$units_num] = $data_gu_traffic['name']; $unit_density[$units_num] = $data_gu_traffic['population']/$data_gu_traffic['area']; $unit_pop[$units_num] = $data_gu_traffic['population']; $query_connections = " SELECT `g_unit1` FROM `adjacency` WHERE `g_unit1`= ".$units[$units_num]; $unit_connections[$units_num] = mysql_num_rows(mysql_query($query_connections)); $units_num++; } ?> <input type="hidden" name="units_num" value="<? echo($units_num); ?>"> <tr> <td class="th" bgcolor="#DADADA" style="width: 5px; align='center'">Source/<br>Destination</th> <? for($j=0;$j<$units_num;$j++) { ?> <td class="th" bgcolor="#DADADA" style="width: 5px; align='center'" id="row_m_m<? echo($j); ?>"> <? echo($unit_name[$j]) ?> </td> <? } ?> </tr> <? for($i=0;$i<$units_num;$i++) { ?> <tr onmouseover=" this.style.background='<? echo($highlight);?>'; document.getElementByID('col<? echo($i); ?>').style.background='<? echo($highlight);?>'; " onmouseout=" this.style.background='#EEEEEE'; document.getElementByID('col<? echo($i); ?>').style.background='#DADADA'; " style='background:#EEEEEE'; > <td class="td1" style="background:#DADADA; width: 5px; align='center'" id="col<? echo($i); ?>"> <? echo($unit_name[$i]) ?> </td> <? // Compute for estimated traffic for($j=0;$j<$units_num;$j++) { $query_adj = " SELECT `g_unit1`,`g_unit2` FROM `adjacency` WHERE `g_unit1`= ".$units[$i]." AND `g_unit2`= ".$units[$j]." "; if($result_adj = mysql_query($query_adj)) { if(mysql_num_rows($result_adj)>0) { $traffic_estimated[$units[$i]][$units[$j]] = (($unit_density[$i]/$unit_connections[$i])+($unit_density[$j]/$unit_connections[$j]))/$unit_pop[$i]; } else $traffic_estimated[$units[$i]][$units[$j]] = 0; } if($i!=$j) { ?> <td nowrap="nowrap" style="width: 5px; align='center'" valign="top" onclick=" new_traffic_<? echo($units[$i]); ?>_<? echo($units[$j]); ?>.removeAttribute('disabled'); " > <? $traffic_specific = $traffic[$units[$i]][$units[$j]]; ?> <input type="text" size="3" style="align:center" value="<? if(trim($traffic_specific!="")) echo($traffic_specific); else echo("-"); ?>" name="new_traffic[<? echo($units[$i]); ?>][<? echo($units[$j]); ?>]" id="new_traffic_<? echo($units[$i]); ?>_<? echo($units[$j]); ?>" style="text-align:center" disabled onkeypress="return handleEnter(this, event)" > </td> <? } else { ?> <td ></td> <? } } ?> </tr> <? } ?> </tbody> </table> </div> <script language="javascript" type="text/javascript"> function updateTraffic() { <? foreach($traffic_estimated as $from => $to_list) { foreach($to_list as $to => $value) { if($value!="0") { $variable_name = "document.getElementById('new_traffic_".$from."_".$to."').value=".$value.";"; echo($variable_name); $variable_name = "document.getElementById('new_traffic_".$from."_".$to."').removeAttribute('disabled');"; echo($variable_name); } } } ?> } </script> <br/> <table><tr> <td valign="top"><input type="submit" value="Submit Matrix" name="submit_traffic_matrix" class="buttonClass"></td> <td valign="top"><input type="reset" value="Reset Matrix" name="reset_traffic_matrix" class="buttonClass"></td> <td valign="top"><input type="button" class="buttonClass" onclick="updateTraffic();" name="estimate_traffic" value="Estimate Traffic" style="background-color: #DADADA;"></td> <td valign="top">&nbsp;&nbsp;</td> <td valign="top" width="400"> <b>How do we estimate traffic? </b>Following the study of Dargatz, Volescu, Held, when considering the traffic between adjacent regions, we assume the attraction of a district to be proportional to its population density because it is usually the big cities which appeal commuters. Thus we estimate the strength of the connection between two districts with population densities d<sub>1</sub> and d<sub>2</sub> with number of adjacent regions n<sub>1</sub> and n<sub>2</sub> to d<sub>1</sub> / n<sub>1</sub> + d<sub>2</sub> / n<sub>2</sub>. </td> <td valign="top"><input type="button" class="buttonClass" onclick="window.close();" name="close" value="Close this Window" style="background-color: #DADADA;"></td> </tr> </table> <? } ?> </form> <br/> <? /*print_r($traffic_estimated); foreach($traffic_estimated as $from => $to_list) { foreach($to_list as $to => $value) { $variable_name = "var estimated_traffic_".$from."_".$to." = ".$value.";"; echo($variable_name); } }*/ ?> </body> <? require("../script/footer_function.php"); ?> ...\eiss\modules\pe.php <? require('../script/header.php'); if($user->usertype=="pathologist") $login_as = "pe"; else { ?> <meta httpequiv="refresh" content="0; URL='../main/main.php?login_failure=1&login_message=<? echo("not_allowed"); ?>'"> <? exit(); } ?> <!-- Process queries --> <div id="masterdiv"> <? // Process Add query if(isset($HTTP_POST_VARS['add_submit'])) { if(!isset($HTTP_POST_VARS['add_name'])||trim($HTTP_POST_VARS['add_name'])=="") $add_message = "Please enter a disease name."; else if(!isset($HTTP_POST_VARS['add_latentpd'])||!is_numeric(trim($HTTP_POST_VARS['add_latentpd']))) $add_message = "Please input a number for the latent period."; else if(!isset($HTTP_POST_VARS['add_infectpd'])||!is_numeric(trim($HTTP_POST_VARS['add_infectpd']))) $add_message = "Please input a number for the infectious period."; else { $find_query = " SELECT * FROM `disease` WHERE `name` = '".$HTTP_POST_VARS['add_name']."'"; $found = mysql_num_rows(mysql_query($find_query)); if($found>0) $add_message = "Disease already exists."; else { $query = " INSERT INTO `disease` ( `disease_no`, `name`, `description`, `contributor`, `latent_pd`, `infectious_pd` ) VALUES ( '', '".$HTTP_POST_VARS['add_name']."', '".$HTTP_POST_VARS['add_desc']."', '".$user->username."', '".$HTTP_POST_VARS['add_latentpd']."', '".$HTTP_POST_VARS['add_infectpd']."' ) "; if($result = mysql_query($query)) $add_message = "New disease added."; else $add_message = "Failed to add disease."; } } } // Process Delete query if(isset($HTTP_POST_VARS['delete_submit'])&&isset($HTTP_POST_VARS['row_box'])) { $row_box = $HTTP_POST_VARS['row_box']; foreach($row_box as $key => $value) { if(isset($value)||trim($value)!="") {

161

$find_query = " SELECT * FROM `disease` WHERE disease_no = '".$value."'"; $data_found = mysql_fetch_array(mysql_query($find_query)); $query = " DELETE FROM `disease` WHERE `disease_no` = '$value' LIMIT 1 "; if(mysql_query($query)) $success[$value] = $data_found['name']; else $success[$value] = ""; } } if(count($success)!=count($row_box)) $message_query = "There had been problems with deletion. "; else $message_query = ""; if(count($success)>0) { $message_query .= "The following diseases had been successfully deleted: "; foreach($success as $key => $value) { if(trim($value)!==""); $message_query .= $value."; "; } } else $message_query .= "No diseases had been deleted."; } // Process Edit query if(isset($HTTP_POST_VARS['update_submit'])) { $update_submit = $HTTP_POST_VARS['update_submit']; // Gets the last (or only) key as the entry foreach($update_submit as $key => $value) $disease_updated = $key; if( !isset($HTTP_POST_VARS['new_name'][$disease_updated])|| trim($HTTP_POST_VARS['new_name'][$disease_updated])=="" ) $message_query = "Please enter a disease name."; else if( !isset($HTTP_POST_VARS['new_latentpd'][$disease_updated])|| !is_numeric(trim($HTTP_POST_VARS['new_latentpd'][$disease_updated])) ) $message_query = "Please input a number for the latent period."; else if( !isset($HTTP_POST_VARS['new_infectpd'][$disease_updated])|| !is_numeric(trim($HTTP_POST_VARS['new_infectpd'][$disease_updated])) ) $message_query = "Please input a number for the infectious period."; else { $query = " UPDATE `disease` SET "; $query .= " `name` = '".$HTTP_POST_VARS['new_name'][$disease_updated]."'"; if(isset($HTTP_POST_VARS['new_desc'][$disease_updated])) $query .= ", `description` = '".$HTTP_POST_VARS['new_desc'][$disease_updated]."'"; $query .= ", `latent_pd` = '".$HTTP_POST_VARS['new_latentpd'][$disease_updated]."'"; $query .= ", `infectious_pd` = '".$HTTP_POST_VARS['new_infectpd'][$disease_updated]."'"; $query .= " WHERE `disease_no` = '".$disease_updated."'"; if(mysql_query($query)) $message_query = "Disease update successful."; else $message_query = "Disease update unsuccessful."; } } // Process Select query $query = " SELECT * FROM `disease`"; $query .= " WHERE 1"; require("../script/process_query.php"); $total = mysql_num_rows(mysql_query($query)); // Get the total number of entries regardless of entries per page ?> <!-- Message table --> <div style="color:#CE2029;"> <b><? echo($message_query); ?></b> </div> <!-- Contents --> <table border="0" cellspacing="1" cellpadding="1"> <tr> <td width="70%" valign="top"> <!-- Diseases table --> <div id="table"> <p> <font size="+1"><b>Diseases Table</b></font> <? if(trim($nav>search_str_pe)==""){ ?> <input type="button" class="buttonClass" onclick="SwitchMenu('subSearch')" name="search_show" value="Search Panel"> <? } else { ?> <input type="button" class="buttonClass" onclick="SwitchMenu('subSearch')" name="search_show" value="Search Panel" style="background-color: #DADADA;">&nbsp;<u>with results</u> <? } ?> <input type="button" class="buttonClass" onclick="SwitchMenu('subAdd')" name="add_show" value="Add New Disease"> </p> <form method="POST" action=""> <TABLE id="t1" class="content table-autosort table-autofilter table-autopage:<? if($nav>entries_per_page_pe>0) echo($nav->entries_per_page_pe); else echo("5"); ?> table-page-number:t1page table-pagecount:t1pages table-filtered-rowcount:t1filtercount table-rowcount:t1allcount" cellpadding="4"> <THEAD> <tr> <td colspan=7> <? if($total>1) {?> There are <? echo($total) ?> entries in this table. <? } else if($total>0) { ?> There is only one entry in this table. <? } else { ?> There are no entries in this table. <? } ?> </td> </tr> <tr bgcolor='#DADADA'> <th align=center> <input type="checkbox" name="row" onClick=" if(this.checked) { <? for($i=0;$i<$total;$i++) { ?> row<?echo($i);?>.style.background='<? echo($highlight); ?>' row_box<?echo($i);?>.checked = true; <? } ?> } else { <? for($i=0;$i<$total;$i++) { ?> row<?echo($i);?>.style.background='<? echo($bgcolor[fmod($i,2)]); ?>' row_box<?echo($i);?>.checked = false; <? } ?> } " > </td> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Disease Name</b></th> <th class=""><b>Description</b></th> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Contributor</b></th> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Mean Latent Period</b><br>(in days)</th> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Mean Infectious Period</b><br>(in days)</th> </td> </tr> </THEAD> <script type="text/javascript"> var rowIDs = Array(); var names = Array(); var descriptions = Array(); var contributors = Array(); </script> <? if($result = mysql_query($query)) { $i = 0; if($total==0) { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } while($data = mysql_fetch_array($result)) { $current = new Disease($data); ?> <script type="text/javascript"> rowIDs[<? echo($i); ?>] = "row<? echo($i); ?>"; names[<? echo($i); ?>] = "<? echo($current->name); ?>"; descriptions[<? echo($i); ?>] = "<? echo(trim($current->desc)); ?>"; contributors[<? echo($i); ?>] = "<? echo($current->contributor); ?>"; </script> <tr id="row<? echo($i); ?>" bgcolor='<? echo($bgcolor[fmod($i,2)]); ?>' valign="top"> <td align="center"> <!-- id is for javascript purposes, name for php purposes --> <input type="checkbox" id="row_box<?echo($i);?>" name="row_box[<?echo($i);?>]" value="<? echo($current>disease_no); ?>" onClick=" if(this.checked) { row<?echo($i);?>.style.background='<? echo($highlight); ?>' } else { row<?echo($i);?>.style.background='<? echo($bgcolor[fmod($i,2)]); ?>' } " > </td> <a name="disease<? echo($current->unit_no); ?>"> <td><u><a onclick="SwitchMenu('sub<? echo($i); ?>')" style="cursor: hand;"><? echo($current>name); ?></a></u></td> <td> <div id="desc<? echo($current->disease_no); ?>_a" style="display: block"> <? echo(substr($current->desc,0,100)); ?> <? if(strlen($current->desc)>100) { ?> ... <a href="#disease<? echo($current>unit_no); ?>" onclick="toggle_visibility('desc<? echo($current->disease_no); ?>_a'); toggle_visibility('desc<? echo($current>disease_no); ?>_b');">show</a> <? } ?> </div> <div id="desc<? echo($current->disease_no); ?>_b" style="display: none"> <? echo($current->desc); ?> <a href="#disease<? echo($current->unit_no); ?>" onclick="toggle_visibility('desc<? echo($current->disease_no); ?>_a'); toggle_visibility('desc<? echo($current->disease_no); ?>_b');">hide</a> </div> </td> <td align="center"><? echo($current->contributor); ?></td> <td align="center"><? echo($current->latent_period); ?></td> <td align="center"><? echo($current->infectious_period); ?></td> </tr> <? $i++; } } else { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } ?> <!-- Pages -> <TFOOT> <TR> <TD class="table-page:previous" style="cursor:pointer;">&lt;Previous</TD> <TD style="textalign:center;">Page <SPAN id="t1page" style="color:black">1</SPAN>&nbsp;of <SPAN id="t1pages" style="color:black">1</SPAN></TD> <TD class="table-page:next" style="cursor:pointer;">Next&gt;</TD> </TR> </TFOOT> </table> <!-- --> <br /> <input type="submit" class="buttonClass" name="delete_submit" value="Delete"> </form> <br /> <p> <!-- Pagination Panel --> <table> <tr><td> <!-- Pagination Control --> View <select name="repaginate" onChange="location.href='../script/process_navigation.php?<? echo($parameters);?>&entries_per_page_pe='+this.value+'';" > <option value="5" <? if($nav->entries_per_page_pe==5) echo("selected");?> >5</option> <option value="10" <? if($nav-

162

>entries_per_page_pe==10) echo("selected");?> >10</option> <option value="15" <? if($nav->entries_per_page_pe==15) echo("selected");?> >15</option> <? if(($nav->entries_per_page_pe!=5)&&($nav->entries_per_page_pe!=10)&&($nav>entries_per_page_pe!=15)) { ?> <option value=<? echo($nav->entries_per_page_pe);?> selected> - </option> <? } ?> </select> entries at a time, or type here <input type="text" name="entries_per_page_pe" class="textFieldClass" size="3" onBlur="location.href='../script/process_navigation.php?<? echo($parameters);?>&entries_per_page_pe='+this.value+'';" > &nbsp;the number entries per page and click outside. </td></tr> </table> </p> </div> </td> <td width="30%" valign="top"> <div id="panel"> <!-- Message --> <font color="#CE2029"> <b><? echo($add_message);?></b> </font> <? $panel = 0; $result = mysql_query($query); while($data = mysql_fetch_array($result)) { $current = new Disease($data); ?> <!-- Edit Disease Pane --> <span class="submenu" id="sub<? echo($panel); ?>"> <form method="POST" action=""> <table> <tr> <td colspan="2" valign="top"><b>Edit Disease</b></td> </tr> <tr> <td width="115" valign="top"></td> </tr> <tr> <td valign="top">&nbsp;</td> <td valign="top">&nbsp;</td> </tr> <tr> <td valign="top">Disease Name</td> <td width="168" valign="top"><input name="new_name[<? echo($current>disease_no);?>]" type="text" class="textFieldClass" value="<? echo($current->name);?>" size="25" /></td> </tr> <tr> <td valign="top">Description</td> <td valign="top">&nbsp;</td> </tr> <tr> <td colspan="2" valign="top"><textarea name="new_desc[<? echo($current->disease_no);?>]" cols="50" rows="10" class="textFieldClass"><? echo($current->desc);?></textarea></td> </tr> <tr> <td valign="top">Contributor</td> <td valign="top"><input name="new_contributor[<? echo($current->disease_no);?>]" type="text" disabled="disabled" class="textFieldClass"" value="<? echo($current->contributor);?>" size="25" /></td> </tr> <tr> <td valign="top">Mean Latent Period<br>(in days)</td> <td valign="top"><input name="new_latentpd[<? echo($current->disease_no);?>]" type="text" class="textFieldClass" value="<? echo($current->latent_period);?>" style="text-align:right" size="10" /></td> </tr> <tr> <td valign="top">Mean Infectious Period<br>(in days)</td> <td valign="top"><input name="new_infectpd[<? echo($current->disease_no);?>]" type="text" class="textFieldClass" value="<? echo($current->infectious_period);?>" style="text-align:right" size="10" /></td> </tr> <tr> <td valign="top">&nbsp;</td> </tr> <tr align="left"> <td colspan="2" valign="top"><input type="submit" class="buttonClass" value="Update" name="update_submit[<? echo($current->disease_no);?>]" /> <input type="reset" class="buttonClass" value="Reset" name="update_reset[<? echo($current->disease_no);?>]" /></td> </tr> </table> </form> </span> <!-- --> <? $panel++; } ?> <!-- --> <!-- Add Disease Pane --> <span class="submenu" id="subAdd"> <form method="POST" action=""> <? $repeat = false; if(trim($add_message)!=""&&trim($add_message)!="New disease added.") $repeat = true; ?> <table> <tr> <td colspan="2" valign="top"><b>Add New Disease</b></td></tr> <tr><td colspan="2" valign="top">&nbsp;</td></tr> <tr> <td width="115" valign="top">Disease Name</td> <td width="168" valign="top"><input name="add_name" type="text" class="textFieldClass" id="add_disease" size="25" value="<? if($repeat) echo($HTTP_POST_VARS['add_name']); ?>" /></td> </tr> <tr> <td valign="top">Description</td> <td valign="top">&nbsp;</td> </tr> <tr> <td colspan="2" valign="top"><textarea name="add_desc" cols="50" rows="10" class="textFieldClass" id="add_desc"><? if($repeat) echo($HTTP_POST_VARS['add_desc']); ?></textarea></td> </tr> <tr> <td valign="top">Contributor</td> <td valign="top"><input name="add_contributor" type="text" disabled="disabled" class="textFieldClass" id="add_contributor" value="<? echo($user->username); ?>" size="25" /></td> </tr> <tr> <td valign="top">Mean Latent Period<br>(in days)</td> <td valign="top"><input name="add_latentpd" type="text" class="textFieldClass" style="text-align:right" id="add_latentpd" size="10" value="<? if($repeat) echo($HTTP_POST_VARS['add_latentpd']); ?>" /></td> </tr> <tr> <td valign="top">Mean Infectious Period<br>(in days)</td> <td valign="top"><input name="add_infectpd" type="text" class="textFieldClass" style="textalign:right" id="add_infectpd" size="10" value="<? if($repeat) echo($HTTP_POST_VARS['add_infectpd']); ?>" /></td> </tr> <tr><td colspan="2" valign="top">&nbsp;</td></tr> <tr align="left"> <td colspan="2" valign="top"> <input type="submit" class="buttonClass" value="Add" name="add_submit"> <input type="reset" class="buttonClass" value="Reset" name="add_reset"> </td> </tr> </table> </form> </span> <!-- --> <!-- Search Disease Pane --> <span class="submenu" id="subSearch"> <form method="POST" action="../script/process_navigation.php"> <input type="hidden" name="src" value="pe"/> <table> <tr><td colspan="3"><b>Search Disease</b></td></tr> <tr> <td colspan="2" align="right"> <input type="button" value="Clear Filters" class="buttonClass" style="background-color: #DADADA;" onclick="filterTable('',names,rowIDs);" /> Enable Filter? </td> <td><input type="checkbox" id="enable_filter" checked></td> </tr> <tr> <td width="115">Disease Name</td> <td width="168"> <input name="name_search" id="name_search" type="text" class="textFieldClass" size="25" value="<? echo($name_search_entry); ?>" onclick = "document.getElementById('name_filter').checked = true;"; onkeypress = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('name_search').value,names,rowIDs);" onBlur = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('name_search').value,names,rowIDs);"/> </td> <td><input type="radio" name="filter_pe" id="name_filter" value="name"></td> </tr> <tr> <td>Description</td> <td> <input name="desc_search" id="desc_search" type="text" class="textFieldClass" size="25" value="<? echo($desc_search_entry); ?>" onclick = "document.getElementById('desc_filter').checked = true;"; onkeypress = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('desc_search').value,descriptions,rowIDs);" onBlur = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('desc_search').value,descriptions,rowIDs);" /> </td> <td><input type="radio" name="filter_pe" id="desc_filter" value="desc"></td> </tr> <tr> <td>Contributor</td> <td> <input name="contributor_search" id="contributor_search" type="text" class="textFieldClass" size="25" value="<? echo($contributor_search_entry); ?>" onclick = "document.getElementById('contributor_filter').checked = true;"; onkeypress = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('contributor_search').value,contributors,rowIDs);" onBlur = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('contributor_search').value,contributors,rowIDs);" /> </td> <td><input type="radio" name="filter_pe" id="contributor_filter" value="contributor"></td> </tr> <tr> <td colspan=3>Mean Latent Period (in days, range)</td></tr> <td colspan=3 align="center"><table width="00" border="0" cellspacing="1" cellpadding="1"> <tr> <td align="center"> <select name="latent_lowercond"> <option value="more" <? if($latent_lowerlimit_cond=="more")

163

echo("selected");?>>More than</option> <option value="more_equal" <? if($latent_lowerlimit_cond=="more_equal") echo("selected");?>>More than or equal to</option> <option value="none" <? if($latent_lowerlimit_cond=="none") echo("selected");?>>-</option> </select> </td> <td align="left"><input name="latent_lowerlimit" type="text" size="10" style="text-align:right" value="<? echo($latent_lowerlimit_search); ?>"/></td> </tr> <tr> <td align="center"> <select name="latent_uppercond"> <option value="less" <? if($latent_upperlimit_cond=="less") echo("selected");?>>Less than</option> <option value="less_equal" <? if($latent_upperlimit_cond=="less_equal") echo("selected");?>>Less than or equal to</option> <option value="none" <? if($latent_upperlimit_cond=="none") echo("selected");?>>-</option> </select> </td> <td align="left"><input name="latent_upperlimit" type="text" size="10" style="text-align:right" value="<? echo($latent_upperlimit_search); ?>"/></td> </tr> </table></td> </tr> <tr><td colspan=3>Mean Infectious Period (in days, range)</td></tr> <tr> <td colspan=3 align="center"><table width="00" border="0" cellspacing="1" cellpadding="1"> <tr> <td align="center"> <select name="infect_lowercond"> <option value="more" <? if($infect_lowerlimit_cond=="more") echo("selected");?>>More than</option> <option value="more_equal" <? if($infect_lowerlimit_cond=="more_equal") echo("selected");?>>More than or equal to</option> <option value="none <? if($infect_lowerlimit_cond=="none") echo("selected");?>">-</option> </select> </td> <td align="left"><input name="infect_lowerlimit" type="text" size="10" style="text-align:right" value="<? echo($infect_lowerlimit_search); ?>"/></td> </tr> <tr> <td align="center"> <select name="infect_uppercond"> <option value="less" <? if($infect_upperlimit_cond=="less") echo("selected");?>>Less than</option> <option value="less_equal" <? if($infect_upperlimit_cond=="less_equal") echo("selected");?>>Less than or equal to</option> <option value="none" <? if($infect_upperlimit_cond=="none") echo("selected");?>>-</option> </select> </td> <td align="left"><input name="infect_upperlimit" type="text" size="10" style="text-align:right" value="<? echo($infect_upperlimit_search); ?>"/></td> </tr> </table></td> </tr> <tr><td colspan="3">&nbsp;</td></tr> <tr align="left"> <td colspan="3" > <input type="submit" class="buttonClass" value="Search" name="search_submit" /> <input type="reset" class="buttonClass" value="Reset Entries" name="search_reset2" /> <input type="submit" class="buttonClass" value="Reset Parameters" name="search_reset" style="background-color: #DADADA;"/> </td> </tr> </table> </form> </span> </div> </td> </tr> </table> </div> <? if($repeat) { ?> <script type="text/javascript">eval("SwitchMenu('subAdd')");</script> <? } else { ?> <script type="text/javascript">eval("SwitchMenu('subSearch')");</script> <? } ?> <? require('../script/footer.php'); ?> ...\eiss\modules\select_disease.php <!-- Process queries --> <div id="masterdiv"> <? // Process Select query $query = " SELECT * FROM `disease`"; $query .= " WHERE 1"; require("../script/process_query.php"); $total = mysql_num_rows(mysql_query($query)); // Get the total number of entries regardless of entries per page ?> <!-- Message table --> <div style="color:#CE2029;"> <b><? echo($message_query); ?></b> </div> <!-- Contents --> <table border="0" cellspacing="1" cellpadding="1"> <tr> <td width="70%" valign="top"> <!-- Diseases table --> <div id="table"> <p> <font size="+1"><b>Diseases Table</b></font> <? if(trim($nav->search_str_pe)==""){ ?> <input type="button" class="buttonClass" onclick="SwitchMenu('subSearch')" name="search_show" value="Search Panel"> <? } else { ?> <input type="button" class="buttonClass" onclick="SwitchMenu('subSearch')" name="search_show" value="Search Panel" style="background-color: #DADADA;">&nbsp;<u>with results</u> <? } ?> <input type="submit" class="buttonClass" name="" value="Select Disease" style="background-color: #DADADA"> </p> <form method="POST" action=""> <TABLE id="t1" class="content tableautosort table-autofilter table-autopage:<? if($nav->entries_per_page_eme>0) echo($nav->entries_per_page_eme); else echo("5"); ?> table-page-number:t1page table-page-count:t1pages table-filtered-rowcount:t1filtercount table-rowcount:t1allcount" cellpadding="4"> <THEAD> <tr> <td colspan=7> <? if($total>1) {?> There are <? echo($total) ?> entries in this table. <? } else if($total>0) { ?> There is only one entry in this table. <? } else { ?> There are no entries in this table. <? } ?> </td> </tr> <tr bgcolor='#DADADA'> <th align=center> Select Disease </td> <th class="tablefilterable table-sortable:default table-sortable" title="Click to sort"><b>Disease Name</b></th> <th class=""><b>Description</b></th> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Contributor</b></th> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Mean Latent Period</b><br>(in days)</th> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Mean Infectious Period<br>(in days)</b></th> </td> </tr> </THEAD> <script type="text/javascript"> var rowIDs = Array(); var names = Array(); var descriptions = Array(); var contributors = Array(); </script> <? if($result = mysql_query($query)) { $i = 0; if($total==0) { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } while($data = mysql_fetch_array($result)) { $current = new Disease($data); ?> <script type="text/javascript"> rowIDs[<? echo($i); ?>] = "row<? echo($i); ?>"; names[<? echo($i); ?>] = "<? echo($current->name); ?>"; descriptions[<? echo($i); ?>] = "<? echo(trim($current->desc)); ?>"; contributors[<? echo($i); ?>] = "<? echo($current->contributor); ?>"; </script> <tr id="row<? echo($i); ?>" bgcolor='<? echo($bgcolor[fmod($i,2)]); ?>' valign="top"> <td align="center"> <!-- id is for javascript purposes, name for php purposes --> <input type="radio" name="disease_selected" value="<? echo($current->disease_no); ?>" onClick=" if(this.select) { <? for($j=0;$j<$total;$j++) { ?> row<?echo($j);?>.style.background='#FAFAFA'; <? } ?> row<?echo($i);?>.style.background='<? echo($highlight); ?>'; } " > </td> <a name="disease<? echo($current>disease_no); ?>"> <td><u><? echo($current->name); ?></u></td> <td> <div id="desc<? echo($current->disease_no); ?>_a" style="display: block"> <? echo(substr($current->desc,0,100)); ?> <? if(strlen($current->desc)>100) { ?> ... <a href="#disease<? echo($current->disease_no); ?>" onclick="toggle_visibility('desc<? echo($current->disease_no); ?>_a'); toggle_visibility('desc<? echo($current->disease_no); ?>_b');">show</a> <? } ?> </div> <div id="desc<? echo($current->disease_no); ?>_b" style="display: none"> <? echo($current->desc); ?> <a href="#disease<? echo($current->disease_no); ?>" onclick="toggle_visibility('desc<? echo($current->disease_no); ?>_a'); toggle_visibility('desc<? echo($current->disease_no); ?>_b');">hide</a> </div> </td> <td align="center"><? echo($current->contributor); ?></td> <td align="center"><? echo($current->latent_period); ?></td> <td align="center"><? echo($current>infectious_period); ?></td> </tr> <? $i++; } } else { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } ?> <!-- Pages --> <TFOOT> <TR> <TD class="table-page:previous" style="cursor:pointer;">&lt;Previous</TD> <TD style="text-align:center;">Page <SPAN id="t1page"

164

style="color:black">1</SPAN>&nbsp;of&nbsp; <? if($nav->entries_per_page_eme>0) echo(ceil($i/$nav>entries_per_page_eme)); else echo(ceil($i/5)); ?></TD> <TD class="table-page:next" style="cursor:pointer;">Next&gt;</TD> </TR> </TFOOT> </table> <!-- --> </form> </div> </td> <td width="30%" valign="top"> <div id="panel"> <!-- Search Disease Pane --> <span class="submenu" id="subSearch"> <form method="POST" action="../script/process_navigation.php"> <input type="hidden" name="src" value="eme"/> <table> <tr><td colspan="3"><b>Search Disease</b></td></tr> <tr> <td colspan="2" align="right"> <input type="button" value="Clear Filters" class="buttonClass" style="background-color: #DADADA;" onclick="filterTable('',names,rowIDs);" /> Enable Filter? </td> <td><input type="checkbox" id="enable_filter" checked></td> </tr> <tr> <td width="115">Disease Name</td> <td width="168"> <input name="name_search" id="name_search" type="text" class="textFieldClass" size="25" value="<? echo($name_search_entry); ?>" onclick = "document.getElementById('name_filter').checked = true;"; onkeypress = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('name_search').value,names,rowIDs);" onBlur = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('name_search').value,names,rowIDs);"/> </td> <td><input type="radio" name="filter_pe" id="name_filter" value="name"></td> </tr> <tr> <td>Description</td> <td> <input name="desc_search" id="desc_search" type="text" class="textFieldClass" size="25" value="<? echo($desc_search_entry); ?>" onclick = "document.getElementById('desc_filter').checked = true;"; onkeypress = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('desc_search').value,descriptions,rowIDs);" onBlur = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('desc_search').value,descriptions,rowIDs);" /> </td> <td><input type="radio" name="filter_pe" id="desc_filter" value="desc"></td> </tr> <tr> <td>Contributor</td> <td> <input name="contributor_search" id="contributor_search" type="text" class="textFieldClass" size="25" value="<? echo($contributor_search_entry); ?>" onclick = "document.getElementById('contributor_filter').checked = true;"; onkeypress = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('contributor_search').value,contributors,rowIDs);" onBlur = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('contributor_search').value,contributors,rowIDs);" /> </td> <td><input type="radio" name="filter_pe" id="contributor_filter" value="contributor"></td> </tr> <tr><td colspan=3>Mean Latent Period (in days, range)</td></tr> <td colspan=3 align="center"><table width="00" border="0" cellspacing="1" cellpadding="1"> <tr> <td align="center"> <select name="latent_lowercond"> <option value="more" <? if($latent_lowerlimit_cond=="more") echo("selected");?>>More than</option> <option value="more_equal" <? if($latent_lowerlimit_cond=="more_equal") echo("selected");?>>More than or equal to</option> <option value="none" <? if($latent_lowerlimit_cond=="none") echo("selected");?>>-</option> </select> </td> <td align="left"><input name="latent_lowerlimit" type="text" size="5" value="<? echo($latent_lowerlimit_search); ?>"/></td> </tr> <tr> <td align="center"> <select name="latent_uppercond"> <option value="less" <? if($latent_upperlimit_cond=="less") echo("selected");?>>Less than</option> <option value="less_equal" <? if($latent_upperlimit_cond=="less_equal") echo("selected");?>>Less than or equal to</option> <option value="none" <? if($latent_upperlimit_cond=="none") echo("selected");?>>-</option> </select> </td> <td align="left"><input name="latent_upperlimit" type="text" size="5" value="<? echo($latent_upperlimit_search); ?>"/></td> </tr> </table></td> </tr> <tr><td colspan=3>Mean Infectious Period (in days, range)</td></tr> <tr> <td colspan=3 align="center"><table width="00" border="0" cellspacing="1" cellpadding="1"> <tr> <td align="center"> <select name="infect_lowercond"> <option value="more" <? if($infect_lowerlimit_cond=="more") echo("selected");?>>More than</option> <option value="more_equal" <? if($infect_lowerlimit_cond=="more_equal") echo("selected");?>>More than or equal to</option> <option value="none <? if($infect_lowerlimit_cond=="none") echo("selected");?>">-</option> </select> </td> <td align="left"><input name="infect_lowerlimit" type="text" size="5" value="<? echo($infect_lowerlimit_search); ?>"/></td> </tr> <tr> <td align="center"> <select name="infect_uppercond"> <option value="less" <? if($infect_upperlimit_cond=="less") echo("selected");?>>Less than</option> <option value="less_equal" <? if($infect_upperlimit_cond=="less_equal") echo("selected");?>>Less than or equal to</option> <option value="none" <? if($infect_upperlimit_cond=="none") echo("selected");?>>-</option> </select> </td> <td align="left"><input name="infect_upperlimit" type="text" size="5" value="<? echo($infect_upperlimit_search); ?>"/></td> </tr> </table></td> </tr> <tr><td colspan="3">&nbsp;</td></tr> <tr align="left"> <td colspan="3" > <input type="submit" class="buttonClass" value="Search" name="search_submit" /> <input type="reset" class="buttonClass" value="Reset Entries" name="search_reset2" /> <input type="submit" class="buttonClass" value="Reset Parameters" name="search_reset" style="background-color: #DADADA;"/> </td> </tr> </table> </form> </span> </div> </td> </tr> </table> </div> ...\eiss\modules\ select_regions.php <p> <font size="+1"><b>Regions Table</b></font> <? if(trim($nav->search_str_gie_reg)==""){ ?> <input type="button" class="buttonClass" onclick="SwitchMenu2('sub2Search')" name="search_show" value="Search Panel"> <? } else { ?> <input type="button" class="buttonClass" onclick="SwitchMenu2('sub2Search')" name="search_show" value="Search Panel" style="background-color: #DADADA;">&nbsp;<u>with results</u> <? } ?> <input type="submit" class="buttonClass" name="" value="Select Region" style="background-color: #DADADA"> </p> <!-- Process Regions queries --> <? // Process Select query $query_reg = " SELECT * FROM `region`"; $query_reg .= " WHERE 1"; require("../script/process_query.php"); $total_reg = mysql_num_rows(mysql_query($query_reg)); // Get the total number of entries regardless of entries per page ?> <!-- Message table: Regions --> <div style="color:#CE2029;"> <b><? echo($message_query_reg); ?></b> </div> <!-- Contents: Regions --> <div id="masterdiv2"> <table border="0" cellspacing="1" cellpadding="1"> <tr> <td width="70%" valign="top"> <!-- Regions table --> <div id="table"> <TABLE id="t1" class="content table-autosort table-autofilter table-autopage:<? if($nav->entries_per_page_eme>0) echo($nav->entries_per_page_eme); else echo("5"); ?> table-page-number:t1page tablepage-count:t1pages table-filtered-rowcount:t1filtercount table-rowcount:t1allcount" cellpadding="4"> <THEAD> <tr> <td colspan=7> <? if($total_reg>1) {?> There are <? echo($total_reg) ?> entries in this table. <? } else if($total_reg>0) { ?>

165

There is only one entry in this table. <? } else { ?> There are no entries in this table. <? } ?> </td> </tr> <tr bgcolor='#DADADA'> <th align=center> Select Region </td> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Region Code</b></th> <th class="table-sortable:default table-sortable" title="Click to sort"><b>Region Name</b></th> <th class=""><b>Description</b></th> <th class=""><b>Geographical Units</b></th> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Contributor</b></th> </td> </tr> </THEAD> <script type="text/javascript"> var rowIDs2 = Array(); var codes2 = Array(); var names2 = Array(); var descriptions2 = Array(); var contributors2 = Array(); </script> <? if($result = mysql_query($query_reg)) { $i = 0; if($total_reg==0) { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } while($data = mysql_fetch_array($result)) { $current = new Region($data); ?> <script type="text/javascript"> rowIDs2[<? echo($i); ?>] = "row_<? echo($i); ?>"; codes2[<? echo($i); ?>] = "<? echo($current>code); ?>"; names2[<? echo($i); ?>] = "<? echo($current->name); ?>"; descriptions2[<? echo($i); ?>] = "<? echo(trim($current->desc)); ?>"; contributors2[<? echo($i); ?>] = "<? echo($current->contributor); ?>"; </script> <tr id="row_<? echo($i); ?>" bgcolor='<? echo($bgcolor[fmod($i,2)]); ?>' valign="top"> <td align="center"> <!-- id is for javascript purposes, name for php purposes --> <input type="radio" name="region_selected" value="<? echo($current>region_no); ?>" onClick=" if(this.select) { <? for($j=0;$j<$total_reg;$j++) { ?> row_<?echo($j);?>.style.background='#FAFAFA'; <? } ?> row_<?echo($i);?>.style.background='<? echo($highlight); ?>'; } " > </td> <a name="reg<? echo($current->region_no); ?>"> <td><u><? echo($current->code); ?></u></td> <td><? echo($current->name); ?></td> <td> <div id="reg_desc<? echo($current->region_no); ?>_a" style="display: block"> <? echo(substr($current->desc,0,100)); ?> <? if(strlen($current->desc)>100) { ?> ... <a href="#reg<? echo($current>region_no); ?>" onclick="toggle_visibility('reg_desc<? echo($current->region_no); ?>_a'); toggle_visibility('reg_desc<? echo($current->region_no); ?>_b');">show</a> <? } ?> </div> <div id="reg_desc<? echo($current->region_no); ?>_b" style="display: none"> <? echo($current->desc); ?> <a href="#reg<? echo($current->region_no); ?>" onclick="toggle_visibility('reg_desc<? echo($current->region_no); ?>_a'); toggle_visibility('reg_desc<? echo($current->region_no); ?>_b');">hide</a> </div> <hr> <table> <? $regional_population = 0; $regional_density = 0; $regional_area = 0; $query_sub = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$current->region_no."'"; if($result_sub = mysql_query($query_sub)) { while($data_sub = mysql_fetch_array($result_sub)) { $g_unit = mysql_fetch_array(mysql_query(" SELECT `population`, `area` FROM `g_unit` WHERE `unit_no` = ".$data_sub['g_unit'])); $regional_population += intval($g_unit['population']); $regional_area += intval($g_unit['area']); } if($regional_area!=0) $regional_density = $regional_population/$regional_area; } ?> <tr> <td>Population</td><td>&nbsp;</td> <td><u><? echo(number_format($regional_population)); ?></u></td> </tr> <tr> <td>Population Density (per km²)</td><td>&nbsp;</td> <td><u><? echo(number_format($regional_density)); ?></u></td> </tr> <tr> <td>Area (in km²)</td><td>&nbsp;</td> <td><u><? echo(number_format($regional_area)); ?></u></td> </tr> </table> </td> <td align="center"> <? if(mysql_num_rows(mysql_query(" SELECT `g_unit` FROM `subregion` WHERE `region` = '".$current->region_no."'"))>0) { ?> <u><a onclick="SwitchMenu2('subregion<? echo($i); ?>')" style="cursor: hand;">View</a></u> <? } else {?> No units yet. <? } ?> </td> <td align="center"><? echo($current->contributor); ?></td> </tr> <? $i++; } } else { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } ?> <!-- Pages -> <TFOOT> <TR> <TD class="table-page:previous" style="cursor:pointer;">&lt;Previous</TD> <TD style="textalign:center;">Page <SPAN id="t1page" style="color:black">1</SPAN>&nbsp;of&nbsp; <? if($nav->entries_per_page_eme>0) echo(ceil($i/$nav->entries_per_page_eme)); else echo(ceil($i/5)); ?></TD> <TD class="table-page:next" style="cursor:pointer;">Next&gt;</TD> </TR> </TFOOT> </table> <!-- --> </div> </td> <td width="30%" valign="top"> <div id="panel"> <!-- Search Region Pane --> <span class="submenu" id="sub2Search"> <form method="POST" action="../script/process_navigation.php"> <input type="hidden" name="src" value="eme"/> <table> <tr><td colspan="3"><b>Search Region</b></td></tr> <tr> <td colspan="2" align="right"> <input type="button" value="Clear Filters" class="buttonClass" style="background-color: #DADADA;" onclick="filterTable('',codes2,rowIDs2);" /> Enable Filter? </td> <td><input type="checkbox" id="enable_filter2" checked></td> </tr> <tr> <td width="115">Region Code</td> <td width="168"> <input name="code_search_reg" id="code_search_reg" type="text" class="textFieldClass" size="25" value="<? echo($code_search_reg_entry); ?>" onclick = "document.getElementById('code_filter2').checked = true;"; onkeypress = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('code_search_reg').value,codes2,rowIDs2);" onBlur = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('code_search_reg').value,codes2,rowIDs2);"/> </td> <td><input type="radio" name="filter_reg" id="code_filter2" value="code"></td> </tr> <tr> <td width="115">Region Name</td> <td width="168"> <input name="name_search_reg" id="name_search_reg" type="text" class="textFieldClass" size="25" value="<? echo($name_search_reg_entry); ?>" onclick = "document.getElementById('name_filter2').checked = true;"; onkeypress = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('name_search_reg').value,names2,rowIDs2);" onBlur = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('name_search_reg').value,names2,rowIDs2);"/> </td> <td><input type="radio" name="filter_reg" id="name_filter2" value="name"></td> </tr> <tr> <td>Description</td> <td> <input name="desc_search_reg" id="desc_search_reg" type="text" class="textFieldClass" size="25" value="<? echo($desc_search_reg_entry); ?>" onclick = "document.getElementById('desc_filter2').checked = true;"; onkeypress = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('desc_search_reg').value,descriptions2,rowIDs2);" onBlur = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('desc_search_reg').value,descriptions2,rowIDs2);" /> </td> <td><input type="radio" name="filter_reg" id="desc_filter2" value="description"></td> </tr> <tr> <td>Contributor</td> <td> <input name="contributor_search_reg" id="contributor_search_reg" type="text" class="textFieldClass" size="25" value="<? echo($contributor_search_reg_entry); ?>" onclick = "document.getElementById('contributor_filter2').checked = true;"; onkeypress = "if(document.getElementById('enable_filter2').checked)

166

filterTable(document.getElementById('contributor_search_reg').value,contributors2,rowIDs2);" onBlur = "if(document.getElementById('enable_filter2').checked) filterTable(document.getElementById('contributor_search_reg').value,contributors2,rowIDs2);" /> </td> <td><input type="radio" name="filter_reg" id="contributor_filter2" value="contributor"></td> </tr> <tr><td colspan="3">&nbsp;</td></tr> <tr align="left"> <td colspan="3" > <input type="submit" class="buttonClass" value="Search" name="search_reg_submit" /> <input type="reset" class="buttonClass" value="Reset Entries" name="search_reg_reset2" /> <input type="submit" class="buttonClass" value="Reset Parameters" name="search_reg_reset" style="background-color: #DADADA;"/> </td> </tr> </table> </form> </span> </div> <!-- View Subregions Pane --> <? $panel = 0; $result = mysql_query($query_reg); while($data = mysql_fetch_array($result)) { $current = new Region($data); ?> <span class="submenu" id="subregion<? echo($panel); ?>"> <input type="hidden" name="src" value="eme"/> <table> <tr><td colspan="2"><b>Geographical Units included in <? echo($current->name); ?></b></td></tr> <tr><td colspan="2">&nbsp;</td></tr> <tr><td colspan="2"> <table> <? $panel_sub = 0; $query_sub = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$current->region_no."'"; if($result_sub = mysql_query($query_sub)) { while($data_sub = mysql_fetch_array($result_sub)) { $g_sub = mysql_fetch_array(mysql_query(" SELECT * FROM `g_unit` WHERE `unit_no` = ".$data_sub['g_unit'])); $current_sub = new GeographicalUnit($g_sub); ?> <!-- GU Description --> <tr><td> <a name="#<? echo($current->region_no); ?>"> <div id="GUdesc<? echo($panel_sub."-".$current->region_no); ?>_a" style="display: block"> <a href="#<? echo($current>region_no); ?>" onclick="toggle_visibility('GUdesc<? echo($panel_sub."-".$current->region_no); ?>_a'); toggle_visibility('GUdesc<? echo($panel_sub."-".$current->region_no); ?>_b');"><? echo($current_sub->name);?>&nbsp;+&nbsp;</a> </div> <div id="GUdesc<? echo($panel_sub."-".$current->region_no); ?>_b" style="display: none"> <a href="#<? echo($current>region_no); ?>" onclick="toggle_visibility('GUdesc<? echo($panel_sub."-".$current->region_no); ?>_a'); toggle_visibility('GUdesc<? echo($panel_sub."-".$current->region_no); ?>_b');"><u><? echo($current_sub->name);?></u>&nbsp;-&nbsp;</a> <table bgcolor="#F0F0F0"> <tr> <td valign="top"><b><i>Description</i></b></td> <td valign="top">&nbsp;</td> </tr> <tr> <td colspan="2" valign="top"><? echo($current_sub->desc);?></td> </tr> <tr> <td valign="top"><b><i>Contributor</i></b></td> <td valign="top"><? echo($current_sub->contributor);?></td> </tr> <tr> <td valign="top"><b><i>Population</i></b></td> <td valign="top"><? echo(number_format($current_sub>population));?></td> </tr> <tr> <td valign="top"><b><i>Population Density (per km²)</i></b></td> <td valign="top"><? echo(round($current_sub->population/$current_sub->area));?></td> </tr> <tr> <td valign="top"><b><i>Area </i></b></td> <td valign="top"><? echo(number_format($current_sub->area));?></td> </tr> <tr> <td valign="top"><b><i>Adjacent Units</i></b></td> <td valign="top"> <? $query_sub2 = " SELECT `g_unit2` FROM `adjacency` WHERE `g_unit1` = '".$current_sub->unit_no."'"; if($result_sub2 = mysql_query($query_sub2)) { while($data_sub2 = mysql_fetch_array($result_sub2)) { $query_now = " SELECT `name` FROM `g_unit` WHERE `unit_no` = ".$data_sub2['g_unit2']; $name_sub2 = mysql_fetch_array(mysql_query($query_now)); ?> <? echo($name_sub2['name']); ?><br> <? } } else echo("None."); ?> </td> </tr> </table> </div> </td></tr> <!-- --> <? $panel_sub++; } } else echo("None."); ?> </table> </td></tr> </table> </span> </div> <? $panel++; } ?> </td> </tr> </table> </div> ...\eiss\modules\slir.php <script type="text/javascript"> function submitSLIR() { <? $query = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$region->region_no."'"; $total_subreg = mysql_num_rows(mysql_query($query)); if($result = mysql_query($query)) { $i = 0; while($data = mysql_fetch_array($result)) { $unit = mysql_fetch_array(mysql_query(" SELECT * FROM `g_unit` WHERE `unit_no` = ".$data['g_unit'])); $gunit[$i] = new GeographicalUnit($unit); $i++; } } ?> <!-- Disable all fields first to reduce fields to pass --> <? for($j=0;$j<$i;$j++) { ?> document.getElementById('latent<? echo($gunit[$j]->unit_no); ?>').disabled=true; document.getElementById('infectious<? echo($gunit[$j]->unit_no); ?>').disabled=true; document.getElementById('removed<? echo($gunit[$j]->unit_no); ?>').disabled=true; <? } ?> <!-- Remove Commas on Fields -> <? for($j=0;$j<$i;$j++) { ?> var no = '<? echo($gunit[$j]->unit_no); ?>'; document.getElementById('susceptible'+no).value = removeCommas(document.getElementById('susceptible'+no).value); document.getElementById('latent'+no).value = removeCommas(document.getElementById('latent'+no).value); document.getElementById('infectious'+no).value = removeCommas(document.getElementById('infectious'+no).value); document.getElementById('removed'+no).value = removeCommas(document.getElementById('removed'+no).value); <? } ?> <!-Enable first field to initiate arrays --> var no = '<? echo($gunit[0]->unit_no); ?>'; document.getElementById('susceptible'+no).removeAttribute('disabled'); document.getElementById('latent'+no).removeAttribute('disabled'); document.getElementById('infectious'+no).removeAttribute('disabled'); document.getElementById('removed'+no).removeAttribute('disabled'); <!-- Enable the rest of the fields if non-empty --> <? for($j=1;$j<$i;$j++) { ?> var no = '<? echo($gunit[$j]->unit_no); ?>'; if(document.getElementById('susceptible'+no).value!=0) document.getElementById('susceptible'+no).removeAttribute('disabled'); if(document.getElementById('latent'+no).value!=0) document.getElementById('latent'+no).removeAttribute('disabled'); if(document.getElementById('infectious'+no).value!=0) document.getElementById('infectious'+no).removeAttribute('disabled'); if(document.getElementById('removed'+no).value!=0) document.getElementById('removed'+no).removeAttribute('disabled'); <? } ?> } </script> <p> <font size="+1"><b>SLIR Table</b></font> <? if( isset($simulation->susceptible)|| isset($simulation->latent)|| isset($simulation->infectious)|| isset($simulation->removed) ) { ?> <input type="submit" class="buttonClass" name="reset_SLIR" value="Reset Values" style="background-color: #DADADA;"/> <? } else { ?> <input type="submit" class="buttonClass" value="Submit SLIR Table" style="background-color: #DADADA;" onClick="submitSLIR()"/> <? } ?> </p> <table style="border-style: solid; border-color: #DADADA; border-width: 1px; background-color: #FFFFFF;"> <tr> <td valign="top" > <? if( !isset($simulation->susceptible)&& !isset($simulation->latent)&& !isset($simulation>infectious)&& !isset($simulation->removed) ) { ?> <div align="center"> <script type="text/javascript">var flag = 'subset';</script> <? if(isset($slirmessage)&&trim($slirmessage)!="") { ?> <div style="color:#CE2029;"> <b><?

167

echo($slirmessage); ?></b> </div> <? } ?> <b>Filter by Geographical Unit</b> <input type="text" id="keyword_submit" onkeypress=" filterTable(document.getElementById('keyword_submit').value,GUNames,GUIDs); return handleEnter(this, event)" onBlur=" filterTable(document.getElementById('keyword_submit').value,GUNames,GUIDs); return handleEnter(this, event)"/> <!--<input type="button" value="Submit" class="buttonClass" onclick="filterTable(document.getElementById('keyword_submit').value,GUNames,GUIDs);" />--> <input type="button" value="Reset Filter" class="buttonClass" onclick="filterTable('',GUNames,GUIDs);document.getElementById('keyword_submit').value=''" /> </div> <table cellpadding="5"> <tr> <td align="center"><b>Geographical Unit</b></td> <td align="center"><b>Total Population</b></td> <td align="center"><b>Susceptible</b></td> <td align="center"><b>Infected (Latent)</b></td> <td align="center"><b>Infected (Infectious)</b></td> <td align="center"><b>Removed</b></td> </tr> <script type="text/javascript"> var GUNames = Array(); var GUIDs = Array(); </script> <? $query = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$region->region_no."'"; $total_subreg = mysql_num_rows(mysql_query($query)); if($result = mysql_query($query)) { $i = 0; while($data = mysql_fetch_array($result)) { $unit = mysql_fetch_array(mysql_query(" SELECT * FROM `g_unit` WHERE `unit_no` = ".$data['g_unit'])); $gunit[$i] = new GeographicalUnit($unit); ?> <tr id="row_<? echo($i); ?>" bgcolor='<? echo($bgcolor[fmod($i,2)]); ?>'> <td><? echo($gunit[$i]->name); ?></td> <script type="text/javascript"> GUNames[<? echo($i); ?>] = "<? echo($gunit[$i]->name); ?>"; GUIDs[<? echo($i); ?>] = "row_<? echo($i); ?>" </script> <td align="right"><? echo(number_format($gunit[$i]>population)); ?></td> <td> <input type="text" size="10" style="text-align:right" disabled name="susceptible[<? echo($gunit[$i]->unit_no); ?>]" id="susceptible<? echo($gunit[$i]->unit_no); ?>" value="<? echo(number_format($gunit[$i]->population)); ?>" onkeypress="return handleEnter(this, event)" /> </td> <td> <input type="text" size="10" style="text-align:right" name="latent[<? echo($gunit[$i]->unit_no); ?>]" id="latent<? echo($gunit[$i]->unit_no); ?>" onClick=" if(this.select) { <? for($j=0;$j<$total_subreg;$j++) { ?> row_<?echo($j);?>.style.background='<? echo($bgcolor[fmod($j,2)]); ?>'; <? } ?> row_<?echo($i);?>.style.background='<? echo($highlight); ?>'; } " onChange=" var newsusceptible = <? echo($gunit[$i]->population); ?> - removeCommas(document.getElementById('latent<? echo($gunit[$i]->unit_no); ?>').value) removeCommas(document.getElementById('infectious<? echo($gunit[$i]->unit_no); ?>').value) removeCommas(document.getElementById('removed<? echo($gunit[$i]->unit_no); ?>').value); document.getElementById('susceptible<? echo($gunit[$i]->unit_no); ?>').value=addCommas(newsusceptible); " onkeypress="return handleEnter(this, event)" /> </td> <td> <input type="text" size="10" style="text-align:right" name="infectious[<? echo($gunit[$i]->unit_no); ?>]" id="infectious<? echo($gunit[$i]->unit_no); ?>" onClick=" if(this.select) { <? for($j=0;$j<$total_subreg;$j++) { ?> row_<?echo($j);?>.style.background='<? echo($bgcolor[fmod($j,2)]); ?>'; <? } ?> row_<?echo($i);?>.style.background='<? echo($highlight); ?>'; } " onChange=" var newsusceptible = <? echo($gunit[$i]->population); ?> - removeCommas(document.getElementById('latent<? echo($gunit[$i]->unit_no); ?>').value) removeCommas(document.getElementById('infectious<? echo($gunit[$i]->unit_no); ?>').value) removeCommas(document.getElementById('removed<? echo($gunit[$i]->unit_no); ?>').value); document.getElementById('susceptible<? echo($gunit[$i]->unit_no); ?>').value=addCommas(newsusceptible); " onkeypress="return handleEnter(this, event)" /> </td> <td> <input type="text" size="10" style="text-align:right" name="removed[<? echo($gunit[$i]->unit_no); ?>]" id="removed<? echo($gunit[$i]->unit_no); ?>" onClick=" if(this.select) { <? for($j=0;$j<$total_subreg;$j++) { ?> row_<?echo($j);?>.style.background='<? echo($bgcolor[fmod($j,2)]); ?>'; <? } ?> row_<?echo($i);?>.style.background='<? echo($highlight); ?>'; } " onChange=" var newsusceptible = <? echo($gunit[$i]->population); ?> - removeCommas(document.getElementById('latent<? echo($gunit[$i]->unit_no); ?>').value) removeCommas(document.getElementById('infectious<? echo($gunit[$i]->unit_no); ?>').value) removeCommas(document.getElementById('removed<? echo($gunit[$i]->unit_no); ?>').value); document.getElementById('susceptible<? echo($gunit[$i]->unit_no); ?>').value=addCommas(newsusceptible); " onkeypress="return handleEnter(this, event)" /> </td> </tr> <? $i++; } } ?> <tr> <td></td> <td></td> <td colspan="4" align=center> <input type="submit" class="buttonClass" value="Submit" style="background-color: #DADADA;" onClick = "submitSLIR()" /> </td> </tr> </table> <? } else { ?> <table cellpadding="5"> <tr> <td align="center"><b>Geographical Unit</b></td> <td align="center"><b>Total Population</b></td> <td align="center"><b>Susceptible</b></td> <td align="center"> <div><b>Infected</b></div> <div><b>(Latent)</b></div> </td> <td align="center"> <div><b>Infected</b></div> <div><b>(Infectious)</b></div> </td> <td align="center"><b>Removed</b></td> </tr> <? $query = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$region->region_no."'"; $total_subreg = mysql_num_rows(mysql_query($query)); if($result = mysql_query($query)) { $i = 0; $bgcolor[0] = "#FAFAFA"; $bgcolor[1] = "#F0F0F0"; while($data = mysql_fetch_array($result)) { $unit = mysql_fetch_array(mysql_query(" SELECT * FROM `g_unit` WHERE `unit_no` = ".$data['g_unit'])); $gunit[$i] = new GeographicalUnit($unit); ?> <tr id="row_<? echo($i); ?>" bgcolor='<? echo($bgcolor[fmod($i,2)]); ?>'> <td><? echo($gunit[$i]->name); ?></td> <td align="right"><? echo(number_format($gunit[$i]->population)); ?></td> <td align="right"><? echo(number_format($simulation>susceptible[$gunit[$i]->unit_no])); ?></td> <td align="right"><? echo(number_format($simulation->latent[$gunit[$i]->unit_no])); ?></td> <td align="right"><? echo(number_format($simulation->infectious[$gunit[$i]->unit_no])); ?></td> <td align="right"><? echo(number_format($simulation->removed[$gunit[$i]->unit_no])); ?></td> </tr> <? $i++; } } ?> </table> <? } ?> </td> </tr> </table> ...\eiss\modules\swfobject.php /* SWFObject v2.2 <http://code.google.com/p/swfobject/> is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> */ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwaveflash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=fal se,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y)

168

:/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(type of t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0 ]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zAZ]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac} }(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState= ="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch( X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout( arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);ret urn}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expres sInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class" )){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")} }P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&M Mdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.re adyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4 ){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(t rue))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classi d"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeo ut(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]> X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function

169

w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},get ObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}i f(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M. pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:f unction(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}(); ...\eiss\modules\sysad.php <? require('../script/header.php'); if($user->usertype=="sysad") $login_as = "sysad"; else { ?> <meta httpequiv="refresh" content="0; URL='../main/main.php?login_failure=1&login_message=<? echo("not_allowed"); ?>'"> <? exit(); } ?> <script type="text/javascript">eval("SwitchMenu('subSearch')");</script> <!-- Process queries --> <div id="masterdiv"> <? // Process Add query if(isset($HTTP_POST_VARS['add_submit'])) { if(!isset($HTTP_POST_VARS['add_username'])||trim($HTTP_POST_VARS['add_username'])=="") $add_message = "Please enter a username."; else if(!isset($HTTP_POST_VARS['add_password'])||trim($HTTP_POST_VARS['add_password'])=="") $add_message = "Please enter a password."; else if(!isset($HTTP_POST_VARS['add_cpassword'])||trim($HTTP_POST_VARS['add_cpassword'])=="") $add_message = "Please confirm your password."; else if(trim($HTTP_POST_VARS['add_password'])!=trim($HTTP_POST_VARS['add_cpassword'])) $add_message = "You failed to confirm your password correctly."; else if(!isEmail($HTTP_POST_VARS['add_email'])) $add_message = "Please enter a correct email."; else { $find_query = " SELECT * FROM `accounts` WHERE `username` = '".$HTTP_POST_VARS['add_username']."'"; $found = mysql_num_rows(mysql_query($find_query)); if($found>0) $add_message = "Username already exists."; else { $query = " INSERT INTO `accounts` ( `username`, `password`, `title`, `first_name`, `middle_name`, `last_name`, `gender`, `email`, `usertype` ) VALUES ( '".$HTTP_POST_VARS['add_username']."', PASSWORD('".$HTTP_POST_VARS['add_password']."'), '".$HTTP_POST_VARS['add_title']."', '".$HTTP_POST_VARS['add_fname']."', '".$HTTP_POST_VARS['add_mname']."', '".$HTTP_POST_VARS['add_lname']."', '".$HTTP_POST_VARS['add_gender']."', '".$HTTP_POST_VARS['add_email']."', '".$HTTP_POST_VARS['usertype']."' )"; if($result = mysql_query($query)) $add_message = "New user added."; else $add_message = "Failed to add user."; } } } // Process Delete query if(isset($HTTP_POST_VARS['delete_submit'])&&isset($HTTP_POST_VARS['row_box'])) { $row_box = $HTTP_POST_VARS['row_box']; foreach($row_box as $key => $value) { if(isset($value)||trim($value)!="") { $query =" DELETE FROM `accounts` WHERE `username` = '$value' LIMIT 1 "; if(mysql_query($query)) $success[$value] = true; } } if(count($success)!=count($row_box)) $message_query = "There had been problems with deletion. "; else $message_query = ""; if(count($success)>0) { $message_query .= "The following users had been successfully deleted: "; foreach($success as $key => $value) { if($value) $message_query .= $key."; "; } } else $message_query .= "No users had been deleted."; } // Process Edit query if(isset($HTTP_POST_VARS['update_submit'])) { $update_submit = $HTTP_POST_VARS['update_submit']; // Gets the last (or only) key as the entry foreach($update_submit as $key => $value) $username_updated = $key; $query = " UPDATE `accounts` SET "; if(isset($HTTP_POST_VARS['new_title'][$username_updated])) $query .= " `title` = '".$HTTP_POST_VARS['new_title'][$username_updated]."'"; if(isset($HTTP_POST_VARS['new_lname'][$username_updated])) $query .= ", `last_name` = '".$HTTP_POST_VARS['new_lname'][$username_updated]."'"; if(isset($HTTP_POST_VARS['new_fname'][$username_updated])) $query .= ", `first_name` = '".$HTTP_POST_VARS['new_fname'][$username_updated]."'"; if(isset($HTTP_POST_VARS['new_mname'][$username_updated])) $query .= ", `middle_name` = '".$HTTP_POST_VARS['new_mname'][$username_updated]."'"; if(isset($HTTP_POST_VARS['new_email'][$username_updated])) $query .= ", `email` = '".$HTTP_POST_VARS['new_email'][$username_updated]."'"; if(isset($HTTP_POST_VARS['new_gender'][$username_updated])) $query .= ", `gender` = '".$HTTP_POST_VARS['new_gender'][$username_updated]."'"; if(isset($HTTP_POST_VARS['new_usertype'][$username_updated])) $query .= ", `usertype` = '".$HTTP_POST_VARS['new_usertype'][$username_updated]."'"; $query .= " WHERE `username` = '".$username_updated."'"; if(mysql_query($query)) $message_query = "Account update successful."; else $message_query = "Account update unsuccessful."; } // Process Select query $query = " SELECT * FROM `accounts`"; $query .= " WHERE 1"; require("../script/process_query.php"); $total = mysql_num_rows(mysql_query($query)); // Get the total number of entries regardless of entries per page ?> <!-- Message table --> <div style="color:#CE2029;"> <b><? echo($message_query); ?></b> </div> <!-- Contents --> <table border="0" cellspacing="1" cellpadding="1"> <tr> <td width="70%" valign="top">

170

<!-- Accounts table --> <div id="table"> <p> <font size="+1"><b>Accounts Table</b></font> <? if(trim($nav>search_str_sysad)==""){ ?> <input type="button" class="buttonClass" onclick="SwitchMenu('subSearch')" name="search_show" value="Search Panel"> <? } else { ?> <input type="button" class="buttonClass" onclick="SwitchMenu('subSearch')" name="search_show" value="Search Panel" style="background-color: #DADADA;">&nbsp;<u>with results</u> <? } ?> <input type="button" class="buttonClass" onclick="SwitchMenu('subAdd')" name="add_show" value="Add New Account"> </p> <form method="POST" action=""> <TABLE id="t1" class="content table-autosort table-autofilter table-autopage:<? if($nav>entries_per_page_sysad>0) echo($nav->entries_per_page_sysad); else echo("5"); ?> table-page-number:t1page tablepage-count:t1pages table-filtered-rowcount:t1filtercount table-rowcount:t1allcount" cellpadding="4"> <THEAD> <tr> <td colspan=7> <? if($total>1) {?> There are <? echo($total) ?> entries in this table. <? } else if($total>0) { ?> There is only one entry in this table. <? } else { ?> There are no entries in this table. <? } ?> </td> </tr> <tr bgcolor='#DADADA'> <th align=center> <input type="checkbox" name="row" onClick=" if(this.checked) { <? for($i=0;$i<$total;$i++) { ?> row<?echo($i);?>.style.background='<? echo($highlight); ?>' row_box<?echo($i);?>.checked = true; <? } ?> } else { <? for($i=0;$i<$total;$i++) { ?> row<?echo($i);?>.style.background='<? echo($bgcolor[fmod($i,2)]); ?>' row_box<?echo($i);?>.checked = false; <? } ?> } " > </td> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Username</b></th> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Last Name</b></th> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>First Name</b></th> <th class="table-filterable table-sortable:default table-sortable" title="Click to sort"><b>Middle Name</b></th> <th class="tablefilterable table-sortable:default table-sortable" title="Click to sort"><b>E-mail</b></th> </td> </tr> </THEAD> <script type="text/javascript"> var rowIDs = Array(); var usernames = Array(); var last_names = Array(); var first_names = Array(); var middle_names = Array(); var emails = Array(); </script> <? if($result = mysql_query($query)) { $i = 0; if($total==0) { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } while($data = mysql_fetch_array($result)) { $current = new Account($data); ?> <tr id="row<? echo($i); ?>" bgcolor='<? echo($bgcolor[fmod($i,2)]); ?>'> <script type="text/javascript"> rowIDs[<? echo($i); ?>] = "row<? echo($i); ?>"; usernames[<? echo($i); ?>] = "<? echo($current->username); ?>"; last_names[<? echo($i); ?>] = "<? echo($current->last_name); ?>"; first_names[<? echo($i); ?>] = "<? echo($current->first_name); ?>"; middle_names[<? echo($i); ?>] = "<? echo($current->middle_name); ?>"; emails[<? echo($i); ?>] = "<? echo($current->email); ?>"; </script> <td align="center"> <!-- id is for javascript purposes, name for php purposes --> <input type="checkbox" id="row_box<?echo($i);?>" name="row_box[<?echo($i);?>]" value="<? echo($current->username); ?>" onClick=" if(this.checked) { row<?echo($i);?>.style.background='<? echo($highlight); ?>' } else { row<?echo($i);?>.style.background='<? echo($bgcolor[fmod($i,2)]); ?>' } " > </td> <td><u><a onclick="SwitchMenu('sub<? echo($i); ?>')" style="cursor: hand;"><? echo($current->username); ?></a></u></td> <td><? echo($current->last_name); ?></td> <td><? echo($current>first_name); ?></td> <td><? echo($current->middle_name); ?></td> <td><? echo($current->email); ?></td> </tr> <? $i++; } } else { ?> <tr> <td colspan="6" bgcolor='#FAFAFA'> <center><i>There are no entries.</i></center> </td> </tr> <? } ?> <!-- Pages --> <TFOOT style="color:black"> <TR> <TD class="table-page:previous" style="cursor:pointer;">&lt;Previous</TD> <TD style="text-align:center;">Page <SPAN id="t1page" style="color:black">1</SPAN>&nbsp;of <SPAN id="t1pages" style="color:black">1</SPAN></TD> <TD class="tablepage:next" style="cursor:pointer;">Next&gt;</TD> </TR> </TFOOT> </table> <!-- --> <br /> <input type="submit" class="buttonClass" name="delete_submit" value="Delete"> </form> <br /> <p> <!-- Pagination Panel --> <table> <tr><td> <!-- Pagination Control --> View <select name="repaginate" onChange="location.href='../script/process_navigation.php?<? echo($parameters);?>&entries_per_page_sysad='+this.value+'';" > <option value="5" <? if($nav->entries_per_page_sysad==5) echo("selected");?> >5</option> <option value="10" <? if($nav>entries_per_page_sysad==10) echo("selected");?> >10</option> <option value="15" <? if($nav>entries_per_page_sysad==15) echo("selected");?> >15</option> <? if(($nav->entries_per_page_sysad!=5)&&($nav>entries_per_page_sysad!=10)&&($nav->entries_per_page_sysad!=15)) { ?> <option value=<? echo($nav>entries_per_page_sysad);?> selected> - </option> <? } ?> </select> entries at a time, or type here <input type="text" name="entries_per_page_sysad" class="textFieldClass" size="3" onBlur="location.href='../script/process_navigation.php?<? echo($parameters);?>&entries_per_page_sysad='+this.value+'';" > &nbsp;the number entries per page and click outside. </td></tr> </table> </p> </div> </td> <td width="30%" valign="top"> <div id="panel"> <font color="#CE2029"> <b><? echo($add_message);?></b> </font> <? $panel = 0; $result = mysql_query($query); while($data = mysql_fetch_array($result)) { $current = new Account($data); ?> <!-- Edit Account Pane --> <span class="submenu" id="sub<? echo($panel); ?>"> <form method="POST" action=""> <table> <tr><td colspan="2"><b>Edit Account</b></td></tr> <tr><td width="115">&nbsp;</td></tr> <tr> <td>Username</td> <td width="168"><input type="text" class="textFieldClass" size=25 value="<? echo($current->username);?>" disabled></td> </tr> <tr> <td>Title</td> <td><input type="text" class="textFieldClass" size=25 name="new_title[<? echo($current->username);?>]" value="<? echo($current->title);?>"></td> </tr> <tr> <td>Last Name</td> <td><input type="text" class="textFieldClass" size=25 name="new_lname[<? echo($current->username);?>]" value="<? echo($current>last_name);?>"></td> </tr> <tr> <td>First Name</td> <td><input type="text" class="textFieldClass" size=25 name="new_fname[<? echo($current->username);?>]" value="<? echo($current->first_name);?>"></td> </tr> <tr> <td>Middle Name</td> <td><input type="text" class="textFieldClass" size=25 name="new_mname[<? echo($current>username);?>]" value="<? echo($current->middle_name);?>"></td> </tr> <tr> <td>Email</td> <td><input type="text" class="textFieldClass" size=25 name="new_email[<? echo($current->username);?>]" value="<? echo($current->email);?>"></td> </tr> <tr> <td>Gender</td> <td>&nbsp; <select name="new_gender[<? echo($current->username);?>]"> <option value="male" <? if($current->gender=="male") echo("selected");?> >Male</option> <option value="female" <? if($current>gender=="female") echo("selected");?> >Female</option> </select> </td> </tr> <tr><td>&nbsp;</td></tr> <td colspan="2"> <b>Privileges</b> <table> <tr><td><input type="radio" name="new_usertype[<? echo($current>username);?>]" <? if($current->usertype=="sysad") echo("checked")?> value="sysad"></td><td>System Administrator</td></tr> <tr><td><input type="radio" name="new_usertype[<? echo($current->username);?>]" <? if($current->usertype=="epidemiologist") echo("checked")?> value="epidemiologist"></td><td>Epidemiologist</td></tr> <tr><td><input type="radio" name="new_usertype[<? echo($current->username);?>]" <? if($current->usertype=="geographer") echo("checked")?>

171

value="geographer"></td><td>Geographer</td></tr> <tr><td><input type="radio" name="new_usertype[<? echo($current>username);?>]" <? if($current->usertype=="pathologist") echo("checked")?> value="pathologist"></td><td>Pathologist</td></tr> </table> </td> </tr> <tr><td>&nbsp;</td></tr> <tr align="left"> <td colspan="2"> <input type="submit" class="buttonClass" value="Update" name="update_submit[<? echo($current->username);?>]"> <input type="reset" class="buttonClass" value="Reset" name="update_reset[<? echo($current->username);?>]"> </td> </tr> </table> </form> </span> <!-- --> <? $panel++; } ?> <!-- --> <!-- Add Account Pane --> <span class="submenu" id="subAdd"> <form method="POST" action=""> <? $repeat = false; if(trim($add_message)!=""&&trim($add_message)!="New user added.") $repeat = true; ?> <table> <tr><td colspan="2"><b>Add New Account</b></td></tr> <tr><td colspan="2">&nbsp;</td></tr> <tr> <td width="115">Username</td> <td width="168"><input type="text" class="textFieldClass" size=25 name="add_username" value="<? if($repeat) echo($HTTP_POST_VARS['add_username']); ?>"></td> </tr> <tr> <td>Password</td> <td><input type="password" class="textFieldClass" size=25 name="add_password"></td> </tr> <tr> <td>Confirm Password</td> <td><input type="password" class="textFieldClass" size=25 name="add_cpassword"></td> </tr> <tr> <td>Title</td> <td><input type="text" class="textFieldClass" size=25 name="add_title" value="<? if($repeat) echo($HTTP_POST_VARS['add_title']); ?>"></td> </tr> <tr> <td>Last Name</td> <td><input type="text" class="textFieldClass" size=25 name="add_lname" value="<? if($repeat) echo($HTTP_POST_VARS['add_lname']); ?>"></td> </tr> <tr> <td>First Name</td> <td><input type="text" class="textFieldClass" size=25 name="add_fname" value="<? if($repeat) echo($HTTP_POST_VARS['add_fname']); ?>"></td> </tr> <tr> <td>Middle Name</td> <td><input type="text" class="textFieldClass" size=25 name="add_mname" value="<? if($repeat) echo($HTTP_POST_VARS['add_mname']); ?>"></td> </tr> <tr> <td>Email</td> <td><input type="text" class="textFieldClass" size=25 name="add_email" value="<? if($repeat) echo($HTTP_POST_VARS['add_email']); ?>"></td> </tr> <tr> <td>Gender</td> <td>&nbsp; <select name="add_gender"> <option value="male" <? if($repeat&&$HTTP_POST_VARS['add_gender']=="male") echo("selected"); ?>>Male</option> <option value="female" <? if($repeat&&$HTTP_POST_VARS['add_gender']=="male") echo("selected"); ?>>Female</option> </select> </td> </tr> <tr> <tr><td colspan="2">&nbsp;</td></tr> <td colspan="2"> <b>Privileges</b> <table> <tr><td><input type="radio" name="usertype" value="sysad"></td><td>System Administrator</td></tr> <tr><td><input type="radio" name="usertype" value="epidemiologist"></td><td>Epidemiologist</td></tr> <tr><td><input type="radio" name="usertype" value="geographer"></td><td>Geographer</td></tr> <tr><td><input type="radio" name="usertype" value="pathologist"></td><td>Pathologist</td></tr> </table> </td> </tr> <tr><td colspan="2">&nbsp;</td></tr> <tr align="left"> <td colspan="2"> <input type="submit" class="buttonClass" value="Add" name="add_submit"> <input type="reset" class="buttonClass" value="Reset" name="add_reset"> </td> </tr> </table> </form> </span> <!-- --> <!-- Search Account Pane --> <span class="submenu" id="subSearch"> <form method="POST" action="../script/process_navigation.php"> <input type="hidden" name="src" value="sysad"/> <table> <tr><td colspan="3"><b>Search Account</b></td></tr> <tr> <td colspan="2" align="right"> <input type="button" value="Clear Filters" class="buttonClass" style="background-color: #DADADA;" onclick="filterTable('',usernames,rowIDs);" /> Enable Filter? </td> <td><input type="checkbox" id="enable_filter" checked></td> </tr> <tr> <td width="115">Username</td> <td width="168"> <input type="text" class="textFieldClass" name="username_search" id="username_search" value="<? echo($username_search_entry); ?>" size="25" onclick = "document.getElementById('username_filter').checked = true;"; onkeypress = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('username_search').value,usernames,rowIDs);" onBlur = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('username_search').value,usernames,rowIDs);" /> </td> <td><input type="radio" name="filter_sysad" id="username_filter" value="username"></td> </tr> <tr> <td>Last Name</td> <td> <input type="text" class="textFieldClass" name="lname_search" id="lname_search" value="<? echo($lname_search_entry); ?>" size="25" onclick = "document.getElementById('lname_filter').checked = true;"; onkeypress = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('lname_search').value,last_names,rowIDs);" onBlur = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('lname_search').value,last_names,rowIDs);" /> </td> <td><input type="radio" name="filter_sysad" id="lname_filter" value="lname"></td> </tr> <tr> <td>First Name</td> <td> <input type="text" class="textFieldClass" name="fname_search" id="fname_search" value="<? echo($fname_search_entry); ?>" size="25" onclick = "document.getElementById('fname_filter').checked = true;"; onkeypress = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('fname_search').value,first_names,rowIDs);" onBlur = " if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('fname_search').value,first_names,rowIDs);" /> </td> <td><input type="radio" name="filter_sysad" id="fname_filter" value="fname"></td> </tr> <tr> <td>Middle Name</td> <td> <input type="text" class="textFieldClass" name="mname_search" id="mname_search" value="<? echo($mname_search_entry); ?>" size="25" onclick = "document.getElementById('mname_filter').checked = true;"; onkeypress = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('mname_search').value,middle_names,rowIDs);" onBlur = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('mname_search').value,middle_names,rowIDs);"/> </td> <td><input type="radio" name="filter_sysad" id="mname_filter" value="mname"></td> </tr> <tr> <td>Email</td> <td> <input type="text" class="textFieldClass" name="email_search" id="email_search" value="<? echo($email_search_entry); ?>" size="25" onclick = "document.getElementById('email_filter').checked = true;"; onkeypress = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('email_search').value,emails,rowIDs);" onBlur = "if(document.getElementById('enable_filter').checked) filterTable(document.getElementById('email_search').value,emails,rowIDs);"/> </td> <td><input type="radio" name="filter_sysad" id="email_filter" value="email"></td> </tr> <tr> <td>Gender</td> <td>&nbsp; <select

172

name="gender_search"> <option value="-" <? if($gender_search_entry!="male"&&$gender_search_entry!="female") echo("selected"); ?>>-</option> <option value="male" <? if($gender_search_entry=="male") echo("selected"); ?>>Male</option> <option value="female"<? if($gender_search_entry=="female") echo("selected"); ?>>Female</option> </select> </td> </tr> <tr> <tr><td colspan="3">&nbsp;</td></tr> <td colspan="3" > <b>Privileges</b> <br /> <table> <tr><td><input type="radio" name="accounts_search" value="sysad" <? if($usertype_search_entry=="sysad") echo("checked"); ?>></td><td>System Administrator</td></tr> <tr><td><input type="radio" name="accounts_search" value="epidemiologist" <? if($usertype_search_entry=="epidemiologist") echo("checked"); ?>></td><td>Epidemiologist</td></tr> <tr><td><input type="radio" name="accounts_search" value="geographer" <? if($usertype_search_entry=="geographer") echo("checked"); ?>></td><td>Geographer</td></tr> <tr><td><input type="radio" name="accounts_search" value="pathologist" <? if($usertype_search_entry=="pathologist") echo("checked"); ?>></td><td>Pathologist</td></tr> </table> </td> </tr> <tr><td colspan="3">&nbsp;</td></tr> <tr align="left"> <td colspan="3" > <input type="submit" class="buttonClass" value="Search" name="search_submit" /> <input type="reset" class="buttonClass" value="Reset Entries" name="search_reset2" /> <input type="submit" class="buttonClass" value="Reset Parameters" name="search_reset" style="background-color: #DADADA;"/> </td> </tr> </table> </form> </span> </div> </td> </tr> </table> </div> <? if($repeat) { ?> <script type="text/javascript">eval("SwitchMenu('subAdd')");</script> <? } else { ?> <script type="text/javascript">eval("SwitchMenu('subSearch')");</script> <? } ?> <? require('../script/footer.php'); ?>

173

...\eiss\pivottable\
...\eiss\pivottable\data_vortex.php // ------------------------------------------------------------------- // Datatype constants // ------------------------------------------------------------------Datatype.STRING = new Datatype("string"); Datatype.NUMBER = new Datatype("number"); Datatype.PERCENT = new Datatype("percent"); Datatype.MONEY = new Datatype("money"); // ------------------------------------------------------------------- // new Datatype() // public constructor // ------------------------------------------------------------------- function Datatype(name) { this.name = name; } // ------------------------------------------------------------------- // new Metric() // public constructor // ------------------------------------------------------------------ function Metric(name, datatype) { // Properties this.name = name; this.datatype = datatype; } // ------------------------------------------------------------------- // new Axis() // public constructor // ------------------------------------------------------------------ function Axis(name) { // Properties this.name = name; this.bucketList = new Array(); this.totalBucket = null; } // ------------------------------------------------------------------- // Axis.makeNewBucket() // public method // ------------------------------------------------------------------ Axis.prototype.makeNewBucket = function (name, total) { var newBucket = new Bucket(name, this, total); this.bucketList.push(newBucket); newBucket.axisIndex = (this.bucketList.length - 1); return newBucket; } // ------------------------------------------------------------------- // Axis.getBucketFromName() // public method // ------------------------------------------------------------------ Axis.prototype.getBucketFromName = function (name) { for (var i=0; i<this.bucketList.length; i++) { if (this.bucketList[i].name == name) { return this.bucketList[i]; } } return null; } // ------------------------------------------------------------------ // new Bucket() // public constructor // ------------------------------------------------------------------ function Bucket(name, axis, total) { // Properties this.name = name; this.axis = axis; this.axisIndex = null; this.total = (total ? true : false ); } // ------------------------------------------------------------------- // new DataVortex() // public constructor // ------------------------------------------------------------------ function DataVortex(axisList) { // Public Properties this.axisList = axisList; // Array of Axis objects this.metricList = new Array(); // Array of Metric objects this.nestedArraysOfData = new Array(); // ndimensional Array of Arrays of Arrays // Private Properties var self = this; // ------------------------------------------------------------------// DataVortex.setValueAt() // // Given a value and a list of offsets -- like [8, 12, 3, 44] or [9, 22] // sets the corresponding data vortex cell to the new value -- for example: // this.nestedArraysOfData[8][12][3][44] = value; // or // this.nestedArraysOfData[9][22] = value; // ------------------------------------------------------------------- function setValueAt(value, listOfArrayOffsets) { if (listOfArrayOffsets == null || listOfArrayOffsets.length == 0) { self.nestedArraysOfData = value; return; } if (self.nestedArraysOfData == null) self.nestedArraysOfData = new Array(); var currentArray = self.nestedArraysOfData; var numOffsets = listOfArrayOffsets.length; for (var i = 0; i < (numOffsets - 1); i++) { var currentOffset = listOfArrayOffsets[i]; if (currentArray[currentOffset] == null) currentArray[currentOffset] = new Array(); currentArray = currentArray[currentOffset]; } var lastOffset = listOfArrayOffsets[(listOfArrayOffsets.length - 1)]; currentArray[lastOffset] = value; } // ------------------------------------------------------------------ // DataVortex.getValueAt() // // Given a list of offsets -- like [8, 12, 3, 44] or [9, 22] // gets the value of the corresponding data vortex cell -- for example: // this.nestedArraysOfData[8][12][3][44] = value; // or // this.nestedArraysOfData[9][22] = value; // ------------------------------------------------------------------- this.getValueAt = function (listOfArrayOffsets) { if ((listOfArrayOffsets == null) || (listOfArrayOffsets.length == 0) || (listOfArrayOffsets.length != this.axisList.length)) { return null; } for (var i = 0; i < this.axisList.length; i++) { if (listOfArrayOffsets[i] == null) return null; } var cellValue = null; var currentObject = self.nestedArraysOfData; for (var i = 0; i < self.axisList.length; i++) { currentObject = currentObject[listOfArrayOffsets[i]]; } cellValue = currentObject; return cellValue; }; // ------------------------------------------------------------------ // DataVortex.setValue() // ------------------------------------------------------------------- this.setValue = function (metric, value, bucketList) { // var indexOfMetric = this.getMetricIndexFromMetric(metric); var listOfArrayOffsets = new Array(); for (var i = 0; i < self.axisList.length; i++) { var axisInQuestion = self.axisList[i]; var indexAlongThisAxis = 0; for (var j = 0; j < bucketList.length; j++) { if (axisInQuestion == bucketList[j].axis) { indexAlongThisAxis = bucketList[j].axisIndex; break; } } listOfArrayOffsets[i] = indexAlongThisAxis; } setValueAt(value, listOfArrayOffsets); }; } ...\eiss\pivottable\epidemic_data.php function makeEpidemicDataVortex(num_time,cycle,num_regions,regions,data) { var metricAccounts = new Metric("", Datatype.string); //var metricAccounts = new Metric("Population", Datatype.string); // Axes var axisCompartment = new Axis("Compartment"); var axisTime = new Axis("Time"); var axisRegion = new Axis("Region"); // Compartment buckets var bucketCompartmentS = axisCompartment.makeNewBucket("Susceptible"); var bucketCompartmentL = axisCompartment.makeNewBucket("Latent"); var bucketCompartmentI = axisCompartment.makeNewBucket("Infectious"); var bucketCompartmentR = axisCompartment.makeNewBucket("Removed"); var bucketCompartmentTotal = axisCompartment.makeNewBucket("Total"); // Time buckets for(var i=1;i<=num_time;i++) { eval("var bucketTime"+i+" = axisTime.makeNewBucket(\"Day "+addCommas(i*cycle)+"\");"); } // Region buckets for(var i=1;i<=num_regions;i++) { eval("var bucketRegion"+i+" = axisRegion.makeNewBucket(\""+regions[i]+"\");"); } var bucketRegionTotal = axisRegion.makeNewBucket("Total"); var epidemicDataVortex = new DataVortex([axisCompartment, axisTime, axisRegion]); epidemicDataVortex.metricList.push(metricAccounts); var susceptible_time = 0; var latent_time = 0; var infectious_time = 0; var removed_time = 0; for(var i=1;i<=num_time;i++) { // bucketCompartmentS var susceptible_region = 0; for(var j=1;j<=num_regions;j++) { susceptible_region += data[i-1]['s'][j-1]; eval("epidemicDataVortex.setValue(metricAccounts, \""+addCommas(Math.round(data[i-1]['s'][j-1]))+"\", [bucketCompartmentS, bucketTime"+i+", bucketRegion"+j+"])"); } eval("epidemicDataVortex.setValue(metricAccounts, \""+addCommas(Math.round(susceptible_region))+"\", [bucketCompartmentS, bucketTime"+i+", bucketRegionTotal])"); // bucketCompartmentL var latent_region = 0; for(var j=1;j<=num_regions;j++) { latent_region += data[i-1]['l'][j-1]; eval("epidemicDataVortex.setValue(metricAccounts, \""+addCommas(Math.round(data[i-1]['l'][j1]))+"\", [bucketCompartmentL, bucketTime"+i+", bucketRegion"+j+"])"); } eval("epidemicDataVortex.setValue(metricAccounts, \""+addCommas(Math.round(latent_region))+"\", [bucketCompartmentL, bucketTime"+i+", bucketRegionTotal])"); // bucketCompartmentI var infectious_region = 0; for(var j=1;j<=num_regions;j++) { infectious_region += data[i-1]['i'][j-1]; eval("epidemicDataVortex.setValue(metricAccounts, \""+addCommas(Math.round(data[i-1]['i'][j-1]))+"\", [bucketCompartmentI,

174

bucketTime"+i+", bucketRegion"+j+"])"); } eval("epidemicDataVortex.setValue(metricAccounts, \""+addCommas(Math.round(infectious_region))+"\", [bucketCompartmentI, bucketTime"+i+", bucketRegionTotal])"); // bucketCompartmentR var removed_region = 0; for(var j=1;j<=num_regions;j++) { removed_region += data[i-1]['r'][j-1]; eval("epidemicDataVortex.setValue(metricAccounts, \""+addCommas(Math.round(data[i-1]['r'][j-1]))+"\", [bucketCompartmentR, bucketTime"+i+", bucketRegion"+j+"])"); } eval("epidemicDataVortex.setValue(metricAccounts, \""+addCommas(Math.round(removed_region))+"\", [bucketCompartmentR, bucketTime"+i+", bucketRegionTotal])"); // bucketCompartmentTotal for(var j=1;j<=num_regions;j++) { total = data[i-1]['s'][j-1]+data[i-1]['l'][j-1]+data[i-1]['i'][j-1]+data[i1]['r'][j-1]; eval("epidemicDataVortex.setValue(metricAccounts, \""+addCommas(Math.round(total))+"\", [bucketCompartmentTotal, bucketTime"+i+", bucketRegion"+j+"])"); } total = susceptible_region + latent_region + infectious_region + removed_region; eval("epidemicDataVortex.setValue(metricAccounts, \""+addCommas(Math.round(total))+"\", [bucketCompartmentTotal, bucketTime"+i+", bucketRegionTotal])"); } return epidemicDataVortex; } // ------------------------------------------------------------------ // activatePivotTable() // // Calls all the functions that do initialization when the page is // first loaded. // ------------------------------------------------------------------- function activatePivotTable() { var epidemicVortex = makeEpidemicDataVortex(time,cycle,num_units,units,results); var epidemicPivot = new PivotTable("tableOne", epidemicVortex, [epidemicVortex.axisList[2], epidemicVortex.axisList[0]], [epidemicVortex.axisList[1]]); epidemicPivot.display(); } ...\eiss\pivottable\pivot_table.css .pivotTable { font-size: x-small; background: #DFDFDF; font: 8pt/16pt verdana; color: black; margin: 5px 10px 5px 10px; } .pivotTable th { font-family: Verdana, Geneva, Arial, helvetica, sans-serif; background: #F0F0F0; font-size: 10px; } .pivotTable td { font-family: Verdana, Geneva, Arial, helvetica, sans-serif; font-size: 10px; } .pivotTable tr { background: white; } .even { background: #FFFFFF; padding: 2px 2px 2px 10px; text-align: right; } .odd { background: #FAFAFA; padding: 2px 2px 2px 10px; text-align: right; } .pivotTable tr:hover { background: #FFE4AE !important; } .pivotTable td:hover { background: #FFE4AE !important; } .layoutButton { width: 80%; height: 80%; color: black; background: #DADADA; font: Verdana; border: 1px solid; padding:0 .1em; cursor:pointer; } .moveAxisButton{ color: black; font: Verdana; background: #FAFAFA; border: 1px solid; padding:0 .1em; cursor:pointer; } .outerBar { width: 400px; padding: 0px; text-align: left; } .innerBar { background: rgb(0%, 100%, 0%); border: none; text-align: right; color: white; } a, a:link, a:visited, a:active { font-weight: normal; text-decoration: none; border-bottom: 1px dotted; } a:hover { font-weight: normal; text-decoration: none; border-bottom: 1px solid; } ...\eiss\pivottable\pivot_table.js /***************************************************************************** pivot_table.js ****************************************************************************** Written in 2004 by Brian Douglas Skinner <brian.skinner@gumption.org> Copyright rights relinquished under the Creative Commons Public Domain Dedication: http://creativecommons.org/licenses/publicdomain/ You can copy freely from this file. This work may be freely reproduced, distributed, transmitted, used, modified, built upon, or otherwise exploited by anyone for any purpose. This work is provided on an "AS IS" basis, without warranties or conditions of any kind, either express or implied, including, without limitation, any warranties or conditions of title, non-infringement, merchantability, or fitness for a particular purpose. You are solely responsible for determining the appropriateness of using or distributing the work and assume all risks associated with use of this work, including but not limited to the risks and costs of errors, compliance with applicable laws, damage to or loss of data or equipment, and unavailability or interruption of operations. In no event shall the authors or contributors have any liability for any direct, indirect, incidental, special, exemplary, or consequential damages, however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence), arising in any way out of or in connection with the use or distribution of the work. *****************************************************************************/ // ------------------------------------------------------------------ // PivotTable class constants // ------------------------------------------------------------------PivotTable.LAYOUT_BUTTON_ID_PREFIX = "layoutButtonIn"; PivotTable.SELECT_MENU_ID_PREFIX = "selectMenuIn"; PivotTable.MOVE_AXIS_BUTTON_ID_PREFIX = "moveAxisButtonIn"; // ------------------------------------------------------------------- // PivotTable class properties // ------------------------------------------------------------------- PivotTable.listOfPivotTables = new Array(); // ------------------------------------------------------------------- // new PivotTable() // public constructor // ------------------------------------------------------------------ function PivotTable(divId, dataVortex, rowAxes, columnAxes) { // Properties this.divId = divId; this.layoutButtonId = PivotTable.LAYOUT_BUTTON_ID_PREFIX + this.divId; this.dataVortex = dataVortex; this.rowAxes = rowAxes; this.columnAxes = columnAxes; this.showLayoutControls = false; // If we weren't told which of the axes should be rows and which should be columns, // then just make something up. Have the first half of the axes be rows, and the // second half be columns. if (this.rowAxes == null && this.columnAxes == null) { alert("(rowAxes == null || columnAxes == null)"); var numRows = Math.floor(dimensionOfPivotTable/2); var numColumns = Math.ceil(dimensionOfPivotTable/2); this.rowAxes = new Array(); this.columnAxes = new Array(); for (var row = 0; row < numRows; row++) { this.rowAxes.push(this.dataVortex.axisList[row]); } for (var column = 0; column < numColumns; column++) { this.columnAxes.push(this.dataVortex.axisList[column + numRows]); } } else { if (this.rowAxes == null) this.rowAxes = new Array(); if (this.columnAxes == null) this.columnAxes = new Array(); } PivotTable.listOfPivotTables[this.layoutButtonId] = this; } // ------------------------------------------------------------------- // PivotTable.display() // public method // ------------------------------------------------------------------ PivotTable.prototype.display = function () { var tableDiv = document.getElementById(this.divId); var arrayOfStrings = new Array(); var dimensionOfPivotTable = this.dataVortex.axisList.length; // add HTML to start table arrayOfStrings.push("<h2>" + this.dataVortex.metricList[0].name + "</h2>"); arrayOfStrings.push("<table class=\"pivotTable\">"); arrayOfStrings.push("<tbody>"); // Start the top row of column headers arrayOfStrings.push("<tr>"); // Create the special upper-left cell var rowspanValue = Math.max(this.columnAxes.length, 1); var colspanValue = Math.max(this.rowAxes.length, 1); arrayOfStrings.push("<th rowspan=\"" + rowspanValue + "\" colspan=\"" + colspanValue + "\">"); arrayOfStrings.push("<input type=\"button\" class=\"layoutButton\" id=\"" + this.layoutButtonId + "\" name=\"layout\" value=\"Change Layout\"></input>"); arrayOfStrings.push("</th>"); // Create all the column headers if (this.columnAxes.length == 0) { if (this.showLayoutControls) { arrayOfStrings.push("<th>"); // arrayOfStrings.push(this.getAxisSelectionMenuHTML(null, null)); //

175

arrayOfStrings.push("<br/>" + this.getMoveAxisButtonHTML(null, null)); arrayOfStrings.push("</th>"); } arrayOfStrings.push("<th>" + "value" + "</th>"); } else { for (var column = 0; column < this.columnAxes.length; column++) { if (column > 0) { arrayOfStrings.push("<tr>"); } // if we're in layout mode, then create layout controls for this column axis if (this.showLayoutControls) { arrayOfStrings.push("<th>"); arrayOfStrings.push(this.getAxisSelectionMenuHTML(null, column)); arrayOfStrings.push("<br/>" + this.getMoveAxisButtonHTML(null, column)); arrayOfStrings.push("</th>"); } // create header cells for this row of column headers var numRepeats = 1; for (var i = 0; i < column; i++) { numRepeats = this.columnAxes[i].bucketList.length * numRepeats; } for (var repeat = 0; repeat < numRepeats; repeat++) { for (var x = 0; x < this.columnAxes[column].bucketList.length; x++) { var numberOfSpannedColumnsForEachHeaderColumn = 1; for (var i = (column + 1); i < this.columnAxes.length; i++) { numberOfSpannedColumnsForEachHeaderColumn = this.columnAxes[i].bucketList.length * numberOfSpannedColumnsForEachHeaderColumn; } arrayOfStrings.push("<th colspan=\"" + numberOfSpannedColumnsForEachHeaderColumn + "\">" + this.columnAxes[column].bucketList[x].name + "</th>"); } } arrayOfStrings.push("</tr>"); } } // If we're in layout mode, then create a special row with layout controls // for all the row axes. if (this.showLayoutControls) { arrayOfStrings.push("<tr>"); if (this.rowAxes.length == 0) { arrayOfStrings.push("<th>"); // arrayOfStrings.push(this.getAxisSelectionMenuHTML(null, null)); // arrayOfStrings.push("<br/>" + this.getMoveAxisButtonHTML(null, null)); arrayOfStrings.push("</th>"); } else { for (var row = 0; row < this.rowAxes.length; row++) { arrayOfStrings.push("<th>"); arrayOfStrings.push(this.getAxisSelectionMenuHTML(row, null)); arrayOfStrings.push("<br/>" + this.getMoveAxisButtonHTML(row, null)); arrayOfStrings.push("</th>"); } } arrayOfStrings.push("<th></th>"); var numberOfColumnCellsSpanned = 1; for (var i = 0; i < this.columnAxes.length; i++) { numberOfColumnCellsSpanned = this.columnAxes[i].bucketList.length * numberOfColumnCellsSpanned; } arrayOfStrings.push("<th colspan=\"" + numberOfColumnCellsSpanned + "\"></th>"); arrayOfStrings.push("</tr>"); } // Create all the data rows var pti = new Array(this.dataVortex.axisList.length); for (var i = 0; i < this.dataVortex.axisList.length; i++) { pti[i] = null; } var offsetOfRow = new Array(); for (var i = 0; i < this.rowAxes.length; i++) { offsetOfRow[i] = getIndexOfElementInArray(this.rowAxes[i], this.dataVortex.axisList); } var offsetOfColumn = new Array(); for (var i = 0; i < this.columnAxes.length; i++) { offsetOfColumn[i] = getIndexOfElementInArray(this.columnAxes[i], this.dataVortex.axisList); } this.addRowsToArrayOfStrings(arrayOfStrings, offsetOfRow, offsetOfColumn, pti, 0, false, true); // add HTML to close table arrayOfStrings.push("</tbody>"); arrayOfStrings.push("</table>"); // take all the HTML and put it in the document // elementMainArea.appendChild(outerDiv); var finalString = arrayOfStrings.join(""); tableDiv.innerHTML = finalString; // add event handlers for the newly created UI elements layoutButton = document.getElementById(this.layoutButtonId); layoutButton.onclick = clickOnLayoutButton; return; } // ------------------------------------------------------------------- // getIndexOfElementInArray() // // Given an element and an array that contains the element, returns // an integer i such that: (array[i] == element) // ------------------------------------------------------------------- function getIndexOfElementInArray(element, array, addIfAbsent) { for (var i = 0; i < array.length; i++) { if (element == array[i]) { return i; } } if (addIfAbsent) { array.push(element); return (array.length - 1); } return null; } // ------------------------------------------------------------------- // PivotTable.addRowsToArrayOfStrings() // ------------------------------------------------------------------PivotTable.prototype.addRowsToArrayOfStrings = function (arrayOfStrings, offsetOfRow, offsetOfColumn, pti, rowAxisIndex, inside, evenNotOdd) { if (!rowAxisIndex) rowAxisIndex = 0; if (this.rowAxes.length == 0) { arrayOfStrings.push("<tr>"); arrayOfStrings.push("<th>" + "value" + "</th>"); if (this.showLayoutControls) { arrayOfStrings.push("<th></th>"); } this.addCellsToArrayOfStrings(arrayOfStrings, offsetOfColumn, pti, 0, evenNotOdd); arrayOfStrings.push("</tr>"); } else { for (var z = 0; z < this.rowAxes[rowAxisIndex].bucketList.length; z++) { pti[offsetOfRow[rowAxisIndex]] = z; if (!inside || z > 0) arrayOfStrings.push("<tr>"); var numberOfRowsToSpan = 1; for (var i = (rowAxisIndex + 1); i < this.rowAxes.length; i++) { numberOfRowsToSpan = this.rowAxes[i].bucketList.length * numberOfRowsToSpan; } arrayOfStrings.push("<th rowspan=\"" + numberOfRowsToSpan + "\">" + this.rowAxes[rowAxisIndex].bucketList[z].name + "</th>"); var nestedRowIndex = rowAxisIndex + 1; if (nestedRowIndex < this.rowAxes.length) { evenNotOdd = !evenNotOdd; this.addRowsToArrayOfStrings(arrayOfStrings, offsetOfRow, offsetOfColumn, pti, nestedRowIndex, true, evenNotOdd); } else { if (this.showLayoutControls) { arrayOfStrings.push("<th></th>"); } this.addCellsToArrayOfStrings(arrayOfStrings, offsetOfColumn, pti, 0, evenNotOdd); arrayOfStrings.push("</tr>"); } } } } // ------------------------------------------------------------------- // PivotTable.addCellsToArrayOfStrings() // ------------------------------------------------------------------PivotTable.prototype.addCellsToArrayOfStrings = function (arrayOfStrings, offsetOfColumn, pti, columnIndex, evenNotOdd) { if (!columnIndex) columnIndex = 0; if (this.columnAxes.length == 0) { if (this.dataVortex.metricList[0].datatype == Datatype.MONEY) { // FIX-ME -- display this as a bar chart var cellValueFloat = this.dataVortex.getValueAt(pti); var cellValueString = this.getFormatedCellValue(cellValueFloat); var maxValue = 800.00; // FIX-ME! var width = (cellValueFloat / maxValue) * 100; // 100 Percent var evenOddColor = evenNotOdd ? "rgb(40%,60%,40%)" : "rgb(40%,40%,60%)"; arrayOfStrings.push("<td class=\"outerBar\"><input disabled type=\"text\" class=\"innerBar\" value=\"" + cellValueString + "\" size=\"1\" style=\"width: " + width + "%; background: " + evenOddColor + "\"></input></td>"); } else { var cellValue = this.dataVortex.getValueAt(pti); cellValue = this.getFormatedCellValue(cellValue); var evenOddText = evenNotOdd ? "even" : "odd"; arrayOfStrings.push("<td class=\"" + evenOddText + "\">" + cellValue + "</td>"); } } else { for (var x = 0; x < this.columnAxes[columnIndex].bucketList.length; x++) { pti[offsetOfColumn[columnIndex]] = x; nestedColumnIndex = columnIndex + 1; if (nestedColumnIndex < this.columnAxes.length) { evenNotOdd = !evenNotOdd; this.addCellsToArrayOfStrings(arrayOfStrings, offsetOfColumn, pti, nestedColumnIndex, evenNotOdd); } else { var cellValue = this.dataVortex.getValueAt(pti); cellValue = this.getFormatedCellValue(cellValue); var evenOddText = evenNotOdd ? "even" : "odd"; arrayOfStrings.push("<td class=\"" + evenOddText + "\">" + cellValue + "</td>"); } } } } // ------------------------------------------------------------------ // PivotTable.getFormatedCellValue() // ------------------------------------------------------------------PivotTable.prototype.getFormatedCellValue = function (cellValue) { var returnValue = cellValue; switch (this.dataVortex.metricList[0].datatype) { case (Datatype.MONEY): var number = cellValue; var negative = (number < 0); number = Math.abs(number); number = parseInt((number + .005) * 100); // parseInt((number + .005) * 100); number = number / 100; returnValue = new String(number); if (returnValue.indexOf(".") < 0) { returnValue += ".00"; } if (returnValue.indexOf(".") == (returnValue.length - 2)) { returnValue += "0"; } if (negative) returnValue = "(" + returnValue + ")"; returnValue = "$" + returnValue; break; default: returnValue = cellValue; break; } return returnValue; } // ------------------------------------------------------------------ // PivotTable.getAxisSelectionMenuHTML() // // Creates an HTML <select><option> list. // ------------------------------------------------------------------- PivotTable.prototype.getAxisSelectionMenuHTML = function

176

(rowNumber, columnNumber) { var selectedAxis = null; if (rowNumber != null) selectedAxis = this.rowAxes[rowNumber]; if (columnNumber != null) selectedAxis = this.columnAxes[columnNumber]; var selectionMenuId = PivotTable.SELECT_MENU_ID_PREFIX + this.divId + "_" + rowNumber + "_" + columnNumber; var returnString = "<select id=\"" + selectionMenuId + "\" name=\"" + selectionMenuId + "\" row=\"" + rowNumber + "\" column=\"" + columnNumber + "\">"; var selectedText; for (var i = 0; i < this.dataVortex.axisList.length; i++ ) { var axisOption = this.dataVortex.axisList[i]; selectedText = (axisOption == selectedAxis) ? "selected" : ""; returnString += "<option " + selectedText + " value=\"" + axisOption.name + "\" onclick=\"clickOnAxisSelectionMenu(event)\">" + axisOption.name + "</option>:"; } // selectedText = (selectedAxis == null) ? "selected" : ""; // returnString += "<option " + selectedText + " value=\"" + "none" + "\" onclick=\"clickOnAxisSelectionMenu(event)\">" + "none" + "</option>:"; returnString += "</select>"; PivotTable.listOfPivotTables[selectionMenuId] = this; return returnString; } // ------------------------------------------------------------------ // PivotTable.getMoveAxisButtonHTML() // // Creates an HTML <select><option> list. // ------------------------------------------------------------------ PivotTable.prototype.getMoveAxisButtonHTML = function (rowNumber, columnNumber) { var selectedAxis = null; var buttonLabel = null; if (rowNumber != null) { selectedAxis = this.rowAxes[rowNumber]; buttonLabel = "row > column"; } if (columnNumber != null) { selectedAxis = this.columnAxes[columnNumber]; buttonLabel = "column > row"; } var buttonId = PivotTable.MOVE_AXIS_BUTTON_ID_PREFIX + this.divId + "_" + rowNumber + "_" + columnNumber; var returnString = "<input type=\"button\" class=\"moveAxisButton\" id=\"" + buttonId + "\" name=\"" + buttonId + "\" row=\"" + rowNumber + "\" column=\"" + columnNumber + "\" value=\"" + buttonLabel + "\" onclick=\"clickOnMoveAxisButton(event)\"></input>"; PivotTable.listOfPivotTables[buttonId] = this; return returnString; } // ------------------------------------------------------------------- // Called when the user clicks on the big "Change Layout" button. // ------------------------------------------------------------------- function clickOnLayoutButton(eventObject) { var pivotTable = PivotTable.listOfPivotTables[this.id]; pivotTable.showLayoutControls = (pivotTable.showLayoutControls ? false : true); pivotTable.display(); } // ------------------------------------------------------------------- // Called when the user clicks on any of the move-axis buttons. // ------------------------------------------------------------------- function clickOnMoveAxisButton(eventObject) { if (!eventObject) var eventObject = window.event; var button = getTargetFromEvent(eventObject); var pivotTable = PivotTable.listOfPivotTables[button.id]; var rowNumber = null; var columnNumber = null; var rowText = button.getAttribute("row"); var columnText = button.getAttribute("column"); if (rowText != "null") rowNumber = parseInt(rowText); if (columnText != "null") columnNumber = parseInt(columnText); var axisBeingMoved = null; if (rowNumber != null) { axisBeingMoved = pivotTable.rowAxes[rowNumber]; pivotTable.rowAxes = copyArrayButRemoveElementAtOffset(pivotTable.rowAxes, rowNumber); pivotTable.columnAxes.push(axisBeingMoved); } if (columnNumber != null) { axisBeingMoved = pivotTable.columnAxes[columnNumber]; pivotTable.columnAxes = copyArrayButRemoveElementAtOffset(pivotTable.columnAxes, columnNumber); pivotTable.rowAxes.push(axisBeingMoved); } pivotTable.display(); } // ------------------------------------------------------------------- // Called when the user clicks on any of the axis-pivot option-select // controls. // ------------------------------------------------------------------- function clickOnAxisSelectionMenu(eventObject) { if (!eventObject) var eventObject = window.event; var htmlElement = getTargetFromEvent(eventObject); var pivotTable = PivotTable.listOfPivotTables[htmlElement.parentNode.id]; var rowNumber = null; var columnNumber = null; var rowText = htmlElement.parentNode.getAttribute("row"); var columnText = htmlElement.parentNode.getAttribute("column"); if (rowText != "null") rowNumber = parseInt(rowText); if (columnText != "null") columnNumber = parseInt(columnText); var displacedAxis = null; if (rowNumber != null) displacedAxis = pivotTable.rowAxes[rowNumber]; if (columnNumber != null) displacedAxis = pivotTable.columnAxes[columnNumber]; var newChoiceName = htmlElement.value; var newChoiceAxis = pivotTable.getAxisFromName(newChoiceName); if (newChoiceAxis != null) { for (i = 0; i < pivotTable.rowAxes.length; i++) { if (pivotTable.rowAxes[i] == newChoiceAxis) { pivotTable.rowAxes[i] = displacedAxis; } } for (i = 0; i < pivotTable.columnAxes.length; i++) { if (pivotTable.columnAxes[i] == newChoiceAxis) { pivotTable.columnAxes[i] = displacedAxis; } } if (rowNumber != null) pivotTable.rowAxes[rowNumber] = newChoiceAxis; if (columnNumber != null) pivotTable.columnAxes[columnNumber] = newChoiceAxis; } else { alert("FIX ME"); } if (rowNumber == null && columnNumber == null) { alert("FIX ME"); } pivotTable.display(); } // ------------------------------------------------------------------ // PivotTable.getAxisFromName() // public method // ------------------------------------------------------------------ PivotTable.prototype.getAxisFromName = function (name) { for (var i = 0; i < this.dataVortex.axisList.length; i++) { if (this.dataVortex.axisList[i].name == name) { return this.dataVortex.axisList[i]; } } return null; } // =================================================================== // RE-USABLE HELPER FUNCTIONS // | // | // V // ------------------------------------------------------------------- // Given an _array_ and the _offset_ of one element in the array, // return a new array which has all the same elements, except for the // element that was at _offset_. // // For example: // copyArrayButRemoveElementAtOffset(["aa", "bb", "cc", "dd"], 2) // will return a new array ["aa", "bb", "dd"] // ------------------------------------------------------------------ function copyArrayButRemoveElementAtOffset(array, offset) { if ((array.length > 0) && (offset >= 0) && (array.length > offset)) { var newArray = new Array(array.length - 1); for (var i = 0; i < offset; i++) { newArray[i] = array[i] } for (var j = offset; j < (array.length - 1); j++) { newArray[j] = array[j + 1]; } return newArray; } return array; } // ------------------------------------------------------------------- // Given an event object, returns the HTML element that was the // target of the event. Should work for IE, Mozilla, and _some_ other // browsers. // ------------------------------------------------------------------ function getTargetFromEvent(eventObject) { var target = null; if (eventObject.target) { target = eventObject.target; } else { if (eventObject.srcElement) { target = eventObject.srcElement; } } if (target && target.nodeType == 3) { // defeat Safari bug target = target.parentNode; } return target; }

177

...\eiss\script
...\eiss\script\change_login_as.php <? require('../script/header_function.php'); loadingMessage(); $new = $HTTP_GET_VARS['new_login_as']; if($new=="eme") $_SESSION['login_as'] = "eme"; else if($new=="gie") $_SESSION['login_as'] = "gie"; else if($new=="pe") $_SESSION['login_as'] = "pe"; else if($new=="sysad") $_SESSION['login_as'] = "sysad"; $date = $_SESSION['login_moment']; $url_orig = explode("?",$_SERVER['HTTP_REFERER']); $url = $url_orig[0]; unset($_SESSION['nav']); // unsets navigation session ?> <? require('../script/footer_function.php'); ?> <? require('../script/go_back.php'); ?> <!--<meta http-equiv="refresh" content="0; URL=<? echo($url); ?>">--> ...\eiss\script\checklogin.js <!-- function checklogin ( form ) { // modified from http://www.thesitewizard.com/archive/validation.shtml var counter=0, mesg = ""; if (form.username.value == "") { mesg = mesg + "\nUsername should not be blank."; counter++; } if (form.password.value == "") { mesg = mesg + "\nPassword should not be blank."; counter++; } if (counter > 0) { alert( mesg ); return false ; } return true ; } //--> ...\eiss\script\checkpassword.js <!-- function alphanumeric(alphane) { // modified from http://www.hscripts.com/scripts/JavaScript/alphanumeric-check.php var numaric = alphane, incount=0; for(var j=0; j<numaric.length; j++) { var alphaa = numaric.charAt(j); var hh = alphaa.charCodeAt(0); if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123)) { } else { // alert("Your Alpha Numeric Test Failed"); // alert("false: " + alphane); return ++incount; } } // alert("Your Alpha Numeric Test Passed"); // alert("true:" + alphane); return 0; } function checkpassword ( form ) { // modified from http://www.thesitewizard.com/archive/validation.shtml var counter=0, mesg = "", alpha=0; if (form.old_password.value == "") { mesg = mesg + "\nFill in the old password field."; counter++; } if ((form.new_password.value == "") || (form.confirm_password.value == "")) { mesg = mesg + "\nCheck the new password fields."; counter++; } if (form.new_password.value != form.confirm_password.value) { mesg = mesg + "\nNew password fields should be the same."; counter++; } if ((form.new_password.value == form.old_password.value) || (form.confirm_password.value == form.old_password.value)) { mesg = mesg + "\nOld and new passwords should not be the same."; counter++; } alpha += alphanumeric(form.old_password.value); alpha += alphanumeric(form.new_password.value); alpha += alphanumeric(form.confirm_password.value); if (alpha > 0) { mesg = mesg + "\nUse alphanumeric characters only."; counter++; } if ((form.old_password.value.length > 10) || (form.new_password.value.length > 10) || (form.confirm_password.value.length > 10) || (form.old_password.value.length < 4) || (form.new_password.value.length < 4) || (form.confirm_password.value.length < 4)) { mesg = mesg + "\nPasswords should be 4 up to 10 chars only."; counter++; } if (counter > 0) { alert( mesg ); return false ; } return true ; } //-->

...\eiss\script\classes.php <? // // Class structure for table `account` // class Account { var $username; var $title; var $first_name; var $middle_name; var $last_name; var $gender; var $stud_num; var $email; var $is_sysad; var $is_pe; var $is_eme; var $is_gie; function Account ($data) { $this->username = $data['username']; $this->title = $data['title']; $this->first_name = $data['first_name']; $this->middle_name = $data['middle_name']; $this->last_name = $data['last_name']; $this->gender = $data['gender']; $this->stud_num = $data['stud_num']; $this->email = $data['email']; $this->usertype = $data['usertype']; } function fullname() { if(isset($this->title)||(trim($this->title)=="")) $fullname = $this->title." "; else $fullname = ""; $fullname .= $this->first_name." "; if(isset($this->middle_name)&&(trim($this->middle_name)!="")) { $middle_name = $this->middle_name; $middle_initial = $middle_name[0]."."; } $fullname .= " ".$middle_initial." "; $fullname .= $this->last_name; echo($fullname); } } // -------------------------------------------------------- // // Class structure for table `disease` // class Disease { var $disease_no; var $name; var $desc; var $contributor; var $latent_period; var $infectious_period; function Disease ($data) { $this->disease_no = $data['disease_no']; $this->name = $data['name']; $this->desc = $data['description']; $this->contributor = $data['contributor']; $this->latent_period = $data['latent_pd']; $this>infectious_period = $data['infectious_pd']; } } // -------------------------------------------------------- // // Class structure for table `g_unit` // class GeographicalUnit { var $unit_no; var $name; var $desc; var $contributor; var $population; var $area; function GeographicalUnit ($data) { $this->unit_no = $data['unit_no']; $this->name = $data['name']; $this>desc = $data['description']; $this->contributor = $data['contributor']; $this->population = $data['population']; $this->area = $data['area']; } } // -------------------------------------------------------- // // Class structure for table `region` // class Region { var $region_no; var $code; var $name; var $desc; var $contributor; function Region ($data) { $this->region_no = $data['region_no']; $this->code = $data['code']; $this->name = $data['name']; $this->desc = $data['description']; $this>contributor = $data['contributor']; } } // -------------------------------------------------------- // // Class structure for table `subregion` // class Subregion { var $region_no; var $unit_no; function Subregion ($data) { $this->region_no = $data['region_no']; $this->unit_no = $data['unit_no']; } } // -------------------------------------------------------- // // Class structure for table `map` // class Map { var $filename; var $name; var $width; var $height; var $area; var $units; var $contributor; function Map ($data) { $this->filename = $data['filename']; $this->name = $data['name']; $this->width = $data['width']; $this>height = $data['height']; $this->area = $data['area']; $this->units = $data['units']; $this->contributor = $data['contributor']; } } // -------------------------------------------------------- // // Class structure for Navigation purposes // class Navigation { var

178

$current_id; var $search_str_sysad; var $search_str_pe; var $search_str_gie_gu; var $search_str_gie_reg; var $search_str_eme; var $entries_per_page_sysad; var $entries_per_page_pe; var $entries_per_page_gie; var $entries_per_page_eme; } // -------------------------------------------------------// // Class structure for Epidemic Simulation purposes // class Simulation { var $region; var $disease; var $susceptible; var $latent; var $infectious; var $stochastic; var $removed; var $time_steps; var $time_unit; var $quarantine; var $vaccinate; var $map; } // ------------------------------------------------------?> ...\eiss\script\close_database.php <?php @mysql_close($connection); ...\eiss\script\epidemic.js /* Parameter description alpha is the rate of an individual's contacts per day beta is the reciprocal of the average infectious period epsilon is the reciprocal of the average latent period gamma is the connectivity / traffic matrix s_init is the array of initial values for susceptibles for locations 1 to n l_init is the array of initial values for latent people for locations 1 to n j_init is the array of initial values for infectious people for locations 1 to n N is the array of subregion population n the number of subregions of region at study (i.e. size of all _init and N) stochastic - if true, then gaussian white noise will be randomized, else, it is just one */ function epidemic_step(alpha,beta,epsilon,gamma,s_init,l_init,j_init,N,n,stochastic) { // Initialize arrays of populations in time zero (represented as fractions of the population) var s = Array(n); var l = Array(n); var j = Array(n); var r = Array(n); for (var i=0; i<n; i++) { s[i] = s_init[i]/N[i]; l[i] = l_init[i]/N[i]; j[i] = j_init[i]/N[i]; r[i] = 1-s[i]-l[i]-j[i]; // derived initial removed population } // Step 1 var mu = Array(n); var upsilon = Array(n); var psi = Array(n); var eta = Array(n); var kappa = Array(n); var rho = Array(n); var zeta = Array(n); var lambda = Array(n); var tau = Array(n); for (var i=0; i<n; i++) { mu[i] = alpha[i] * s[i] * j[i]; upsilon[i] = beta * j[i]; psi[i] = epsilon * l[i]; eta[i] =0; for (var k=0;k<n;k++) { eta[k] += gamma[i][k]*s[i]; } kappa[i] =0; for (var k=0;j<n;j++) { kappa[i] += gamma[i][k]*l[i]; } rho[i] =0; for (var k=0;k<n;k++) { rho[i] += gamma[i][k]*j[i]; } zeta[i] =0; for (var k=0;k<n;k++) { zeta[i] += gamma[k][i]*s[k]; } lambda[i] =0; for (var k=0;k<n;k++) { lambda[i] += gamma[k][i]*l[k]; } tau[i] =0; for (var k=0;k<n;k++) { tau[i] += gamma[k][i]*j[k]; } } // m_ is the factor (reciprocal of square root) array var m_ = Array(n); for (var i=0; i<n; i++) { m_[i] = 1/Math.sqrt(N[i]); } if(stochastic==true) { // Step 2 var x = Array(n); var y = Array(n); for (var i=0; i<n; i++) { x[i] = m_[i]*(eta[i]+kappa[i]+rho[i]); y[i] = m_[i]*(zeta[i]+lambda[i]+tau[i]); } // Step 3 var P4_1 = (Matrix.Diagonal(x.slice(0,n-1))).map(function(e) { return e*e; }); var P4_2 = (Matrix.Ones(n-1,n-1)).multiply(x[n-1]*x[n-1]); var P4 = P4_1.add(P4_2); var P5_1 = (Matrix.Diagonal(y.slice(0,n-1))).map(function(e) { return e*e; }); var P5_2 = (Matrix.Ones(n1,n-1)).multiply(y[n-1]*y[n-1]); var P5 = P5_1.add(P5_2); // Step 4 - Generate Pi4, and Pi5. var Pi4 = (P4.cholesky()).multiply(Matrix.RandomNormal(n-1,1)); var Pi4 = (Pi4.transpose()).augment($M([0])); // can't augment in an nx1 matrix, must transpose var Pi4 = Pi4.transpose(); var Pi5 = (P5.cholesky()).multiply(Matrix.RandomNormal(n-1,1)); var Pi5 = (Pi5.transpose()).augment($M([0])); var Pi5 = Pi5.transpose(); // Step 5 M = (Matrix.I(n)).add(((Matrix.Ones(n,n)).multiply(1/n)).map(function(x) { return -x; })) u = M.multiply(Pi4); v = M.multiply(Pi5); // Step 6 - xi is the Gaussian White noise factor arrays var xi = Matrix.RandomNormal(n,3); var E4 = Array(n); var E5 = Array(n); for (var i=0; i<n; i++) { E4[i] = u.e(i+1,1)/x[i]; E5[i] = v.e(i+1,1)/y[i]; } xi.augment($M(E4)); xi.augment($M(E5)); } else var xi = Matrix.Ones(n,5); // Step 7 var s_fac, l_fac, j_fac, r_fac; var ds = Array(n); var dl = Array(n); var dj = Array(n); var dr = Array(n); for (var i=0; i<n; i++) { s_fac = Math.sqrt(mu[i])*xi.e(i+1,1) + Math.sqrt(eta[i])*xi.e(i+1,2) - Math.sqrt(zeta[i])*xi.e(i+1,5); ds[i] = -mu[i]-eta[i]+zeta[i]+m_[i]*s_fac; l_fac = Math.sqrt(mu[i])*xi.e(i+1,1) + Math.sqrt(psi[i])*xi.e(i+1,3) + Math.sqrt(kappa[i])*xi.e(i+1,4) - Math.sqrt(lambda[i])*xi.e(i+1,5); dl[i] = mu[i]-psi[i]-kappa[i]+lambda[i]+m_[i]*l_fac; j_fac = -Math.sqrt(psi[i])*xi.e(i+1,1) + Math.sqrt(upsilon[i])*xi.e(i+1,2) + Math.sqrt(rho[i])*xi.e(i+1,4) - Math.sqrt(tau[i])*xi.e(i+1,5); dj[i] = psi[i]-upsilon[i]-rho[i]+tau[i]+m_[i]*j_fac; r_fac = Math.sqrt(upsilon[i])*xi.e(i+1,2); dr[i] = upsilon[i]-m_[i]*r_fac; } var s_ = Array(); var l_ = Array(); var j_ = Array(); var r_ = Array(); // Step 8 for (var i=0; i<n; i++) { s_[i] = s[i]+ds[i]; l_[i] = l[i]+dl[i]; j_[i] = j[i]+dj[i]; r_[i] = r[i]+dr[i]; } // Step 9 for (var i=0; i<n; i++) { if((s_[i]<0)||isNaN(s_[i])) s_[i] = 0; if((l_[i]<0)||isNaN(l_[i])) l_[i] = 0; if((j_[i]<0)||isNaN(j_[i])) j_[i] = 0; if((r_[i]<0)||isNaN(r_[i])) r_[i] = 0; } // Step 10 for (var i=0; i<n; i++) { factor = 1 / (s_[i]+l_[i]+j_[i]+r_[i]); s_[i] = s_[i] * factor; l_[i] = l_[i] * factor; j_[i] = j_[i] * factor; r_[i] = r_[i] * factor; } // Optional Step - Rescale for (var i=0; i<n; i++) { s_[i] = N[i] * s_[i]; l_[i] = N[i] * l_[i]; j_[i] = N[i] * j_[i]; r_[i] = N[i] * r_[i]; } // Additional check // Comment: Susceptible cannot increase, Removed cannot decrease for (var i=0; i<n; i++) { // Excess susceptible must be transferred to latent //if(1==0) { if(s_[i]>s_init[i]) { var s_diff = s_[i] - s_init[i]; l_[i] += s_diff; s_[i] = s_init[i]; } // Removed deficit must be filled up from infectious if(r_[i]<r[i]*N[i]) { var r_diff = r[i]*N[i] - r_[i]; if(j_[i]-r_diff>=0) j_[i] -= r_diff; else if(l_[i]-r_diff>=0) l_[i] -= r_diff; else if(s_[i]-r_diff>=0) s_[i] -= r_diff; r_[i] = r[i]*N[i]; } } return $V([s_,l_,j_,r_]); } ...\eiss\script\expandable.php <style type="text/css"><!-- .menutitle{ cursor:pointer; margin-bottom: 5px; background-color:#ECECFF; color:#000000; width:140px; padding:2px; text-align:center; font-weight:bold; /*/*/border:1px solid #000000;/* */ } .submenu{ marginbottom: 0.5em; } --></style> <script type="text/javascript"> if (document.getElementById){ document.write('<style type="text/css">\n') document.write('.submenu{display: none;}\n') document.write('</style>\n') } function SwitchMenu(obj){ if(document.getElementById){ var el = document.getElementById(obj); var ar = document.getElementById("masterdiv").getElementsByTagName("span"); if(el.style.display != "block"){ for (var i=0; i<ar.length; i++){ if (ar[i].className=="submenu") ar[i].style.display = "none"; } el.style.display = "block"; }else{ el.style.display = "none"; } } } function SwitchMenu2(obj){ if(document.getElementById){ var el = document.getElementById(obj); var ar = document.getElementById("masterdiv2").getElementsByTagName("span"); if(el.style.display != "block"){ for (var i=0; i<ar.length; i++){ if (ar[i].className=="submenu") ar[i].style.display = "none"; } el.style.display = "block"; }else{ el.style.display = "none"; } } } function SwitchMenu3(obj){ if(document.getElementById){ var el = document.getElementById(obj); var ar = document.getElementById("masterdiv3").getElementsByTagName("span"); if(el.style.display != "block"){ for (var i=0; ?>

179

i<ar.length; i++){ if (ar[i].className=="submenu") el.style.display = "none"; } } } </script> ...\eiss\script\footer.php

ar[i].style.display = "none";

}

el.style.display = "block";

}else{

<style type="text/css"> <!-- span { color: #DADADA; } --> </style> <br><br><br> <? if(isset($user)||$pagename!="main.php") { if($pagename!="main.php") { ?> <div id="white" style="width: 100%; height: 10px; position: fixed; bottom: 40px; left: 0px; z-index:0; background-color:#FFFFFF"><br> </div> <? } } ?> <style type="text/css"> .mainlink A:link { color:#FFFFFF; font-weight: bold; text-decoration: none; } .mainlink A:visited { color:#FFFFFF; font-weight: bold; text-decoration: none; } .mainlink A:active { color:#FFFFFF; font-weight: bold; text-decoration: none; } .mainlink A:hover { color: <? if($pagename=="main.php") echo('#000000'); else echo('#FFC40F'); ?> ; font-weight: bold; text-decoration: none; } </style> <? if($pagename!="main.php") {?> <div id="logo" style="width: 100; height: 40px; position: fixed; bottom: 0px; right: 70px; z-index:1;"> <span class="mainlink"> <a href="http://upm.edu.ph">University of the Philippines Manila</a>. EISS <img src="../images/copyleft-inverse.gif" width="15" height="15" /> 2009. Version <? displayVersion() ?>. </span> </div> <div id="logo" style="width: 100; height: 40px; position: fixed; bottom: 0px; right: 0px; z-index:1;"> <img src="../images/eissicon.gif" width="75" height="39" alt="EISS. Predict. Prevent. Restore."/> </div> <? } else { ?> <div id="logo" style="width: 100; height: 38px; position: fixed; bottom: 0px; right: 0px; z-index:1;"> <span class="mainlink"> <a href="http://upm.edu.ph">University of the Philippines Manila</a> </span> </div> <? } ?> <div id="footer" style="width: 100%; height: 40px; position: fixed; bottom: 0px; left: 0px; z-index:0; background-color: <? if($pagename=="main.php") echo('#FFC40F'); else echo('#333'); ?>; "> <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr> <td width="100%" valign="top" style="font-size: 11; padding: 5px; font-family:verdana"> <span class="mainlink"> <a href="../main/main.php">[ home ] </a> <a href="../main/about.php">[ about EISS <? displayVersion() ?> ] </a> <a href="../main/slir.php">[ what is SLIR? ] </a> <a href="../main/math.php">[ the math ] </a> <a href="../main/system.php">[ system features ] </a> <a href="../main/developer.php">[ the developer ] </a> </span> </td> </tr></table> </div> <? require("footer_function.php"); ?> </body> </html> ...\eiss\script\ footer_function.php <? require('close_database.php'); unset($user); ?> </body>

...\eiss\script\go_back.php <? // Resolve caller if(isset($_SERVER['HTTP_REFERER'])&&trim($_SERVER['HTTP_REFERER'])!="") { $url_orig = explode("?",$_SERVER['HTTP_REFERER']); $url = $url_orig[0]; ?> <meta http-equiv="refresh" content="0; URL='<? echo($url."?".$parameters)?>'"> <? } else if($HTTP_POST_VARS['src']=="sysad") {?> <meta http-equiv="refresh" content="0; URL='../modules/sysad.php<? echo($url."?".$parameters)?>'"> <? } else if($HTTP_POST_VARS['src']=="pe") {?> <meta httpequiv="refresh" content="0; URL='../modules/pe.php<? echo($url."?".$parameters)?>'"> <? } else if($HTTP_POST_VARS['src']=="gie") {?> <meta http-equiv="refresh" content="0; URL='../modules/gie.php<? echo($url."?".$parameters)?>'"> <? } else if($HTTP_POST_VARS['src']=="eme") {?> <meta http-equiv="refresh" content="0; URL='../modules/eme.php<? echo($url."?".$parameters)?>'"> <? } else {?> <body onload="history.go(-1);"> <? } ?> ...\eiss\script\header.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-88591"> <title>EISS - Predict. Prevent. Restore.</title> <link rel="icon" type="image/gif" href="../images/eissicon.gif"> <link rel="stylesheet" href="../styles/eiss_style.css" type="text/css"> <? require("header_function.php") ?> <!-- For table function --> <SCRIPT type="text/javascript" src="../table/table.js"></SCRIPT> <LINK rel="stylesheet" type="text/css" href="../table/table.css" media="all"> <!-- --> <!-- Toggle Visibility --> <script type="text/javascript"> function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } </script> <!-- --> <!-- Form scripts --> <script type="text/javascript" src="checkpassword.js"></script> <script type="text/javascript" src="checklogin.js"></script> <!-- --> <!-- For number format --> <script type="text/javascript"> function addCommas(nStr) { nStr += ''; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1 + x2; } function removeCommas(nStr) { var strings = nStr.split(','); return strings.join(''); } </script> <!-- For Dumping Data (checking) --> <script type="text/javascript"> /** * Function : dump() * Arguments: The data - array,hash(associative array),object * The level - OPTIONAL * Returns : The textual representation of the array. * This function was inspired by the print_r function of PHP. * This will accept some data as the argument and return a * text that will be a more readable version of the * array/hash/object that is given. * Docs: http://www.openjs.com/scripts/others/dump_function_php_print_r.php */ function dump(arr,level) { var dumped_text = ""; if(!level) level = 0; //The padding given at the beginning of the line. var level_padding = ""; for(var j=0;j<level+1;j++) level_padding += " "; if(typeof(arr) == 'object') { //Array/Hashes/Objects for(var item in arr) { var value = arr[item]; if(typeof(value) == 'object') { //If it is an array, dumped_text += level_padding + "'" + item + "' ...\n"; dumped_text += dump(value,level+1); } else { dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n"; } } } else { //Stings/Chars/Numbers etc. dumped_text = "===>"+arr+"<===("+typeof(arr)+")"; } return dumped_text; } </script> <script type="text/javascript"> /*********************************************** * Disable "Enter" key in Form script- By Nurul Fadilah(nurul@REMOVETHISvolmedia.com) * This notice must stay intact for use * Visit http://www.dynamicdrive.com/ for full source code ***********************************************/ function handleEnter (field, event) { var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if (keyCode == 13) { var i; for (i = 0; i < field.form.elements.length; i++) if (field == field.form.elements[i]) break; i = (i + 1) % field.form.elements.length; field.form.elements[i].focus(); return false; } else return true; } </script> <!-- A simple code I wrote to filter tables (author: James Miraflor) --> <script type="text/javascript"> function filterTable(keyword,arrayoftext,arrayofID) { var resultstext =

180

''; for(var i in arrayoftext) { var current = arrayoftext[i].toUpperCase(); if(current.match(keyword.toUpperCase())!=null) resultstext += i+','; } results = resultstext.split(','); for(var i in arrayoftext) { var found = false; for(j=0;j<results.length1;j++) if(i==results[j]) found = true; if(found) document.getElementById(arrayofID[i]).style.display = ''; else document.getElementById(arrayofID[i]).style.display = 'none'; } } </script> <!-- For Trimming Text (checking) --> <script type="text/javascript"> function trim(str, chars) { return ltrim(rtrim(str, chars), chars); } function ltrim(str, chars) { chars = chars || "\\s"; return str.replace(new RegExp("^[" + chars + "]+", "g"), ""); } function rtrim(str, chars) { chars = chars || "\\s"; return str.replace(new RegExp("[" + chars + "]+$", "g"), ""); } </script> <!-- For Popup --> <script type="text/javascript"> function popUp(URL) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=1024,height=768,left = 0,top = 0');"); } </script> <!-- For mathematical function --> <SCRIPT type="text/javascript" src="../script/math.js"></SCRIPT> <!-- For epidemic function --> <SCRIPT type="text/javascript" src="../script/epidemic.js"></SCRIPT> <? if($page_is_eme) { ?> <? require("process_epidemic.php") ?> <!-- For pivot table --> <link rel="stylesheet" type="text/css" href="../pivottable/pivot_table.css" /> <script type="text/javascript" src="../pivottable/pivot_table.js"></script> <script type="text/javascript" src="../pivottable/data_vortex.js"></script> <script type="text/javascript" src="../pivottable/epidemic_data.js"></script> <? } ?> <!-- --> <!-- For JSChart --> <script type="text/javascript" src="jscharts.js"></script> </head> <body onload=" <? if( isset($simulation->disease)&& isset($simulation>region)&& isset($simulation->susceptible)&& isset($simulation->latent)&& isset($simulation->infectious)&& isset($simulation->removed)&& $page_is_eme ){ echo("activatePivotTable();"); echo("SwitchMenu('defaultView');"); } ?> " bgcolor="#FFFFFF"; id = 0; <? if($pagename=="main.php") { ?> style = "background-color: #FFFFFF; background-image: url('../images/grad.jpg'); background-repeat: repeat-x; background-position: center; background-attachment: fixed;" <? } else if(($pagename=="sysad.php")||($pagename=="gie.php")||($pagename=="pe.php")){?> style = "backgroundcolor: #FFFFFF; background-image: url('../images/grad2.jpg'); background-repeat: repeat-x; background-position: center; background-attachment: fixed;" <? } ?> > <? require("user_panel.php") ?> <!-- For expandable function --> <? require('expandable.php'); ?> <!-- --> ...\eiss\script\ header_function.php <? ini_set('session.use_trans_sid', 0); ini_set('session.use_cookies', 1); @session_start(); require('utility_functions.php'); require('print_functions.php'); require('classes.php'); if(isset($_SESSION['user'])) $user = unserialize($_SESSION['user']); require('open_database.php'); require('process_parameters.php'); $pagename = substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1); // Retrieves navigation session if(isset($_SESSION['nav'])) $nav = unserialize($_SESSION['nav']); // Constants $bgcolor[0] = "#FAFAFA"; $bgcolor[1] = "#F0F0F0"; //$highlight = "#D0E2F9"; $highlight = "#FFE4AE"; ?> ...\eiss\script\index.php <? header("Location: ../index.php"); ?> ...\eiss\script\login.php <? require('../script/header_function.php'); loadingmessage(); $login_failure = false; if(isset($_SESSION['username'])) { $message = "already_set"; $login_failure = true; } else if((!isset($HTTP_POST_VARS['login_username']))||(trim($HTTP_POST_VARS['login_username'])=="")) { $message = "no_username"; $login_failure = true; } else if((!isset($HTTP_POST_VARS['login_password']))||(trim($HTTP_POST_VARS['login_password'])=="")) { $message = "no_password"; $login_failure = true; } else { $username = $HTTP_POST_VARS['login_username']; $password = $HTTP_POST_VARS['login_password']; $query = " SELECT * FROM `accounts` WHERE `username` = '$username' AND `password` = PASSWORD('$password') LIMIT 1 "; if($result = mysql_query($query)) { if(mysql_num_rows($result)<=0) { $message = "invalid"; $login_failure = true; } else { /* This will fetch all the user information from the database into an object. Thus, until the user logouts, his priveleges will not be changed. */ $user = new Account(mysql_fetch_array($result)); $_SESSION['user'] = serialize($user); $_SESSION['login_moment'] = getDate(); } } else { $message = "db_failure"; $login_failure = true; } } if($login_failure) $parameters .= "login_failure=".$login_failure."&login_message=".$message; else { $parameters .= ""; } ?> <? require('../script/footer_function.php'); ?> <? require('../script/go_back.php'); ?> ...\eiss\script\logout.php <? require('../script/header_function.php'); loadingmessage(); session_unset(); require('../script/footer_function.php'); ?> <? require('../script/go_back.php'); ?> ...\eiss\script\math.js // === Sylvester === // Vector and Matrix mathematics modules for JavaScript // Copyright (c) 2007 James Coglan // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT session_destroy(); ?> <?

181

HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. function Vector() {} Vector.prototype = { // Returns element i of the vector e: function(i) { return (i < 1 || i > this.elements.length) ? null : this.elements[i-1]; }, // Returns the number of elements the vector has dimensions: function() { return this.elements.length; }, // Returns the sum of the elements of the vector sum: function() { var n = this.elements.length, k = n, i, s = 0; do { i = k - n; s+=this.elements[i]; } while (--n); return s; }, // Returns the modulus ('length') of the vector modulus: function() { return Math.sqrt(this.dot(this)); }, // Returns true iff the vector is equal to the argument eql: function(vector) { var n = this.elements.length; var V = vector.elements || vector; if (n != V.length) { return false; } do { if (Math.abs(this.elements[n-1] - V[n-1]) > Sylvester.precision) { return false; } } while (--n); return true; }, // Returns a copy of the vector dup: function() { return Vector.create(this.elements); }, // Maps the vector to another vector according to the given function map: function(fn) { var elements = []; this.each(function(x, i) { elements.push(fn(x, i)); }); return Vector.create(elements); }, // Calls the iterator for each element of the vector in turn each: function(fn) { var n = this.elements.length, k = n, i; do { i = k - n; fn(this.elements[i], i+1); } while (--n); }, // Returns a new vector created by normalizing the receiver toUnitVector: function() { var r = this.modulus(); if (r === 0) { return this.dup(); } return this.map(function(x) { return x/r; }); }, // Returns the angle between the vector and the argument (also a vector) angleFrom: function(vector) { var V = vector.elements || vector; var n = this.elements.length, k = n, i; if (n != V.length) { return null; } var dot = 0, mod1 = 0, mod2 = 0; // Work things out in parallel to save time this.each(function(x, i) { dot += x * V[i-1]; mod1 += x * x; mod2 += V[i-1] * V[i-1]; }); mod1 = Math.sqrt(mod1); mod2 = Math.sqrt(mod2); if (mod1*mod2 === 0) { return null; } var theta = dot / (mod1*mod2); if (theta < -1) { theta = -1; } if (theta > 1) { theta = 1; } return Math.acos(theta); }, // Returns true iff the vector is parallel to the argument isParallelTo: function(vector) { var angle = this.angleFrom(vector); return (angle === null) ? null : (angle <= Sylvester.precision); }, // Returns true iff the vector is antiparallel to the argument isAntiparallelTo: function(vector) { var angle = this.angleFrom(vector); return (angle === null) ? null : (Math.abs(angle Math.PI) <= Sylvester.precision); }, // Returns true iff the vector is perpendicular to the argument isPerpendicularTo: function(vector) { var dot = this.dot(vector); return (dot === null) ? null : (Math.abs(dot) <= Sylvester.precision); }, // Returns the result of adding the argument to the vector add: function(vector) { var V = vector.elements || vector; if (this.elements.length != V.length) { return null; } return this.map(function(x, i) { return x + V[i-1]; }); }, // Returns the result of subtracting the argument from the vector subtract: function(vector) { var V = vector.elements || vector; if (this.elements.length != V.length) { return null; } return this.map(function(x, i) { return x - V[i-1]; }); }, // Returns the result of multiplying the elements of the vector by the argument multiply: function(k) { return this.map(function(x) { return x*k; }); }, x: function(k) { return this.multiply(k); }, // Returns the scalar product of the vector with the argument // Both vectors must have equal dimensionality dot: function(vector) { var V = vector.elements || vector; var i, product = 0, n = this.elements.length; if (n != V.length) { return null; } do { product += this.elements[n-1] * V[n-1]; } while (--n); return product; }, // Returns the vector product of the vector with the argument // Both vectors must have dimensionality 3 cross: function(vector) { var B = vector.elements || vector; if (this.elements.length != 3 || B.length != 3) { return null; } var A = this.elements; return Vector.create([ (A[1] * B[2]) - (A[2] * B[1]), (A[2] * B[0]) - (A[0] * B[2]), (A[0] * B[1]) - (A[1] * B[0]) ]); }, // Returns the (absolute) largest element of the vector max: function() { var m = 0, n = this.elements.length, k = n, i; do { i = k - n; if (Math.abs(this.elements[i]) > Math.abs(m)) { m = this.elements[i]; } } while (--n); return m; }, // Returns the index of the first match found indexOf: function(x) { var index = null, n = this.elements.length, k = n, i; do { i = k - n; if (index === null && this.elements[i] == x) { index = i + 1; } } while (--n); return index; }, // Returns a diagonal matrix with the vector's elements as its diagonal elements toDiagonalMatrix: function() { return Matrix.Diagonal(this.elements); }, // Returns the result of rounding the elements of the vector round: function() { return this.map(function(x) { return Math.round(x); }); }, // Returns a copy of the vector with elements set to the given value if they // differ from it by less than Sylvester.precision snapTo: function(x) { return this.map(function(y) { return (Math.abs(y - x) <= Sylvester.precision) ? x : y; }); }, // Returns a string representation of the vector inspect: function() { return '[' + this.elements.join(', ') + ']'; }, // Set vector's elements from an array setElements: function(els) { this.elements = (els.elements || els).slice(); return this; } }; // Constructor function Vector.create = function(elements) { var V = new Vector(); return V.setElements(elements); }; // i, j, k unit vectors Vector.i = Vector.create([1,0,0]); Vector.j = Vector.create([0,1,0]); Vector.k = Vector.create([0,0,1]); // Random vector of size n Vector.Random = function(n) { var elements = []; do { elements.push(Math.random()); } while (--n); return Vector.create(elements); }; // Normally Distributed Random vector of size n Vector.RandomNormal = function(n) { var elements = []; do { var rand; rand = (2*Math.random()-1)*(2*Math.random()-1)*(2*Math.random()-1); elements.push(rand); } while (--n); return Vector.create(elements); }; // Vector filled with zeros Vector.Zero = function(n) { var elements = []; do { elements.push(0); } while (--n); return Vector.create(elements); }; // Vector filled with ones Vector.Ones = function(n) { var elements = []; do { elements.push(1); } while (--n); return Vector.create(elements); }; function Matrix() {} Matrix.prototype = { // Returns element (i,j) of the matrix e: function(i,j) { if (i < 1 || i > this.elements.length || j < 1 || j > this.elements[0].length) { return null; } return this.elements[i-1][j-1]; }, // Returns row k of the matrix as a vector row: function(i) { if (i > this.elements.length) { return null; } return Vector.create(this.elements[i-1]); }, // Returns sum of row k of the matrix as a vector sumrow: function(i) { if (i > this.elements.length) { return null; } return (Vector.create(this.elements[i-1])).sum(); }, // Returns column k of the matrix as a vector col: function(j) { if (j > this.elements[0].length) { return null; } var col = [], n = this.elements.length, k = n, i; do { i = k - n; col.push(this.elements[i][j1]); } while (--n); return Vector.create(col); }, // Returns column k of the matrix as a vector sumcol: function(j) { if (j > this.elements[0].length) { return null; } var col = [], n = this.elements.length, k = n, i; do { i = k - n; col.push(this.elements[i][j1]); } while (--n); return (Vector.create(col)).sum(); }, // Returns the number of rows/columns the matrix has dimensions: function() { return {rows: this.elements.length, cols: this.elements[0].length}; }, // Returns the number of rows in the matrix rows: function() { return this.elements.length; }, // Returns the number of columns in the matrix cols: function() { return this.elements[0].length; }, // Returns true iff the matrix is equal to the argument. You can supply // a vector as the argument, in which case the receiver must be a // one-column matrix equal to the vector. eql: function(matrix) { var M = matrix.elements || matrix; if (typeof(M[0][0]) == 'undefined') { M = Matrix.create(M).elements; } if (this.elements.length != M.length || this.elements[0].length != M[0].length) { return false; } var ni = this.elements.length, ki = ni, i, nj, kj = this.elements[0].length, j; do { i = ki - ni; nj = kj; do { j = kj - nj; if (Math.abs(this.elements[i][j] - M[i][j]) > Sylvester.precision) { return false; } } while (--nj); } while (--ni); return true; }, // Returns a copy of the matrix dup: function() { return Matrix.create(this.elements); }, //

182

Maps the matrix to another matrix (of the same dimensions) according to the given function map: function(fn) { var els = [], ni = this.elements.length, ki = ni, i, nj, kj = this.elements[0].length, j; do { i = ki - ni; nj = kj; els[i] = []; do { j = kj - nj; els[i][j] = fn(this.elements[i][j], i + 1, j + 1); } while (--nj); } while (--ni); return Matrix.create(els); }, // Returns true iff the argument has the same dimensions as the matrix isSameSizeAs: function(matrix) { var M = matrix.elements || matrix; if (typeof(M[0][0]) == 'undefined') { M = Matrix.create(M).elements; } return (this.elements.length == M.length && this.elements[0].length == M[0].length); }, // Returns the result of adding the argument to the matrix add: function(matrix) { var M = matrix.elements || matrix; if (typeof(M[0][0]) == 'undefined') { M = Matrix.create(M).elements; } if (!this.isSameSizeAs(M)) { return null; } return this.map(function(x, i, j) { return x + M[i-1][j-1]; }); }, // Returns the result of subtracting the argument from the matrix subtract: function(matrix) { var M = matrix.elements || matrix; if (typeof(M[0][0]) == 'undefined') { M = Matrix.create(M).elements; } if (!this.isSameSizeAs(M)) { return null; } return this.map(function(x, i, j) { return x - M[i-1][j-1]; }); }, // Returns true iff the matrix can multiply the argument from the left canMultiplyFromLeft: function(matrix) { var M = matrix.elements || matrix; if (typeof(M[0][0]) == 'undefined') { M = Matrix.create(M).elements; } // this.columns should equal matrix.rows return (this.elements[0].length == M.length); }, // Returns the result of multiplying the matrix from the right by the argument. // If the argument is a scalar then just multiply all the elements. If the argument is // a vector, a vector is returned, which saves you having to remember calling // col(1) on the result. multiply: function(matrix) { if (!matrix.elements) { return this.map(function(x) { return x * matrix; }); } var returnVector = matrix.modulus ? true : false; var M = matrix.elements || matrix; if (typeof(M[0][0]) == 'undefined') { M = Matrix.create(M).elements; } if (!this.canMultiplyFromLeft(M)) { return null; } var ni = this.elements.length, ki = ni, i, nj, kj = M[0].length, j; var cols = this.elements[0].length, elements = [], sum, nc, c; do { i = ki - ni; elements[i] = []; nj = kj; do { j = kj - nj; sum = 0; nc = cols; do { c = cols - nc; sum += this.elements[i][c] * M[c][j]; } while (--nc); elements[i][j] = sum; } while (--nj); } while (--ni); var M = Matrix.create(elements); return returnVector ? M.col(1) : M; }, x: function(matrix) { return this.multiply(matrix); }, // Returns a submatrix taken from the matrix // Argument order is: start row, start col, nrows, ncols // Element selection wraps if the required index is outside the matrix's bounds, so you could // use this to perform row/column cycling or copy-augmenting. minor: function(a, b, c, d) { var elements = [], ni = c, i, nj, j; var rows = this.elements.length, cols = this.elements[0].length; do { i = c - ni; elements[i] = []; nj = d; do { j = d - nj; elements[i][j] = this.elements[(a+i-1)%rows][(b+j-1)%cols]; } while (--nj); } while (--ni); return Matrix.create(elements); }, // Returns the transpose of the matrix transpose: function() { var rows = this.elements.length, cols = this.elements[0].length; var elements = [], ni = cols, i, nj, j; do { i = cols - ni; elements[i] = []; nj = rows; do { j = rows - nj; elements[i][j] = this.elements[j][i]; } while (--nj); } while (--ni); return Matrix.create(elements); }, // Cholesky Decomposition for Matrices cholesky: function() { var elements = new Array(n), a = this.elements, n = this.elements.length; for (var i=0; i<n; i++) { elements[i] = new Array(n); for (var j=0;j<n;j++) elements[i][j] = 0; } for(var k=0; k<n-1; k++) { elements[k][k] = Math.sqrt(a[k][k]); for (var s=k+1; s<n; s++) { elements[s][k] = a[s][k]/elements[k][k]; } for (var j=k+1; j<n; j++) { for (var i=j; i<n; i++) a[i][j] = a[i][j] - elements[i][k]*elements[j][k]; } } elements[n-1][n-1] = Math.sqrt(a[n-1][n-1]); return Matrix.create(elements); }, // Returns true iff the matrix is square isSquare: function() { return (this.elements.length == this.elements[0].length); }, // Returns the (absolute) largest element of the matrix max: function() { var m = 0, ni = this.elements.length, ki = ni, i, nj, kj = this.elements[0].length, j; do { i = ki - ni; nj = kj; do { j = kj - nj; if (Math.abs(this.elements[i][j]) > Math.abs(m)) { m = this.elements[i][j]; } } while (--nj); } while (--ni); return m; }, // Returns the indeces of the first match found by reading row-by-row from left to right indexOf: function(x) { var index = null, ni = this.elements.length, ki = ni, i, nj, kj = this.elements[0].length, j; do { i = ki - ni; nj = kj; do { j = kj - nj; if (this.elements[i][j] == x) { return {i: i+1, j: j+1}; } } while (--nj); } while (--ni); return null; }, // If the matrix is square, returns the diagonal elements as a vector. // Otherwise, returns null. diagonal: function() { if (!this.isSquare) { return null; } var els = [], n = this.elements.length, k = n, i; do { i = k - n; els.push(this.elements[i][i]); } while (--n); return Vector.create(els); }, // Make the matrix upper (right) triangular by Gaussian elimination. // This method only adds multiples of rows to other rows. No rows are // scaled up or switched, and the determinant is preserved. toRightTriangular: function() { var M = this.dup(), els; var n = this.elements.length, k = n, i, np, kp = this.elements[0].length, p; do { i = k - n; if (M.elements[i][i] == 0) { for (j = i + 1; j < k; j++) { if (M.elements[j][i] != 0) { els = []; np = kp; do { p = kp - np; els.push(M.elements[i][p] + M.elements[j][p]); } while (--np); M.elements[i] = els; break; } } } if (M.elements[i][i] != 0) { for (j = i + 1; j < k; j++) { var multiplier = M.elements[j][i] / M.elements[i][i]; els = []; np = kp; do { p = kp - np; // Elements with column numbers up to an including the number // of the row that we're subtracting can safely be set straight to // zero, since that's the point of this routine and it avoids having // to loop over and correct rounding errors later els.push(p <= i ? 0 : M.elements[j][p] - M.elements[i][p] * multiplier); } while (--np); M.elements[j] = els; } } } while (--n); return M; }, toUpperTriangular: function() { return this.toRightTriangular(); }, // Returns the determinant for square matrices determinant: function() { if (!this.isSquare()) { return null; } var M = this.toRightTriangular(); var det = M.elements[0][0], n = M.elements.length - 1, k = n, i; do { i = k - n + 1; det = det * M.elements[i][i]; } while (--n); return det; }, det: function() { return this.determinant(); }, // Returns true iff the matrix is singular isSingular: function() { return (this.isSquare() && this.determinant() === 0); }, // Returns the trace for square matrices trace: function() { if (!this.isSquare()) { return null; } var tr = this.elements[0][0], n = this.elements.length 1, k = n, i; do { i = k - n + 1; tr += this.elements[i][i]; } while (--n); return tr; }, tr: function() { return this.trace(); }, // Returns the rank of the matrix rank: function() { var M = this.toRightTriangular(), rank = 0; var ni = this.elements.length, ki = ni, i, nj, kj = this.elements[0].length, j; do { i = ki - ni; nj = kj; do { j = kj - nj; if (Math.abs(M.elements[i][j]) > Sylvester.precision) { rank++; break; } } while (--nj); } while (--ni); return rank; }, rk: function() { return this.rank(); }, // Returns the result of attaching the given argument to the right-hand side of the matrix augment: function(matrix) { var M = matrix.elements || matrix; if (typeof(M[0][0]) == 'undefined') { M = Matrix.create(M).elements; } var T = this.dup(), cols = T.elements[0].length; var ni = T.elements.length, ki = ni, i, nj, kj = M[0].length, j; if (ni != M.length) { return null; } do { i = ki - ni; nj = kj; do { j = kj - nj; T.elements[i][cols + j] = M[i][j]; } while (--nj); } while (--ni); return T; }, // Returns the inverse (if one exists) using Gauss-Jordan inverse: function() { if (!this.isSquare() || this.isSingular()) { return null; } var ni = this.elements.length, ki = ni, i, j; var M = this.augment(Matrix.I(ni)).toRightTriangular(); var np, kp = M.elements[0].length, p, // els, divisor; var inverse_elements = [], new_element; // Matrix is non-singular so there will be no zeros on the diagonal Cycle through rows from last to first do { i = ni - 1; // First, normalise diagonal elements to 1 els = []; np = kp; inverse_elements[i] = []; divisor = M.elements[i][i]; do { p = kp - np; new_element = M.elements[i][p] / divisor; els.push(new_element); // Shuffle of the current row of the right hand side into the results // array as it will not be modified by later runs through this loop if (p >= ki) { inverse_elements[i].push(new_element); } } while (--np); M.elements[i] = els; // Then,

183

subtract this row from those above it to // give the identity matrix on the left hand side for (j = 0; j < i; j++) { els = []; np = kp; do { p = kp - np; els.push(M.elements[j][p] - M.elements[i][p] * M.elements[j][i]); } while (--np); M.elements[j] = els; } } while (-ni); return Matrix.create(inverse_elements); }, inv: function() { return this.inverse(); }, // Returns the result of rounding all the elements round: function() { return this.map(function(x) { return Math.round(x); }); }, // Returns a copy of the matrix with elements set to the given value if they // differ from it by less than Sylvester.precision snapTo: function(x) { return this.map(function(p) { return (Math.abs(p - x) <= Sylvester.precision) ? x : p; }); }, // Returns a string representation of the matrix inspect: function() { var matrix_rows = []; var n = this.elements.length, k = n, i; do { i = k - n; matrix_rows.push(Vector.create(this.elements[i]).inspect()); } while (--n); return matrix_rows.join('\n'); }, // Set the matrix's elements from an array. If the argument passed // is a vector, the resulting matrix will be a single column. setElements: function(els) { var i, elements = els.elements || els; if (typeof(elements[0][0]) != 'undefined') { var ni = elements.length, ki = ni, nj, kj, j; this.elements = []; do { i = ki - ni; nj = elements[i].length; kj = nj; this.elements[i] = []; do { j = kj - nj; this.elements[i][j] = elements[i][j]; } while (--nj); } while(--ni); return this; } var n = elements.length, k = n; this.elements = []; do { i = k n; this.elements.push([elements[i]]); } while (--n); return this; } }; // Constructor function Matrix.create = function(elements) { var M = new Matrix(); return M.setElements(elements); }; // Identity matrix of size n Matrix.I = function(n) { var els = [], k = n, i, nj, j; do { i = k - n; els[i] = []; nj = k; do { j = k - nj; els[i][j] = (i == j) ? 1 : 0; } while (-nj); } while (--n); return Matrix.create(els); }; // Diagonal matrix - all off-diagonal elements are zero Matrix.Diagonal = function(elements) { var n = elements.length, k = n, i; var M = Matrix.I(n); do { i = k - n; M.elements[i][i] = elements[i]; } while (--n); return M; }; // Random matrix of n rows, m columns Matrix.Random = function(n, m) { return Matrix.Zero(n, m).map( function() { return Math.random(); } ); }; // Normally Distributed Random matrix of n rows, m columns Matrix.RandomNormal = function(n, m) { return Matrix.Zero(n, m).map( function() { var rand; rand = (2*Math.random()1)*(2*Math.random()-1)*(2*Math.random()-1); return rand; } ); }; // Matrix filled with zeros Matrix.Zero = function(n, m) { var els = [], ni = n, i, nj, j; do { i = n - ni; els[i] = []; nj = m; do { j = m - nj; els[i][j] = 0; } while (--nj); } while (-ni); return Matrix.create(els); }; // Matrix filled with ones Matrix.Ones = function(n, m) { var els = [], ni = n, i, nj, j; do { i = n - ni; els[i] = []; nj = m; do { j = m - nj; els[i][j] = 1; } while (--nj); } while (--ni); return Matrix.create(els); }; // Utility functions var $V = Vector.create; var $M = Matrix.create; ...\eiss\script\open_database.php <?php $dbhost='localhost'; $dbuser=''; $dbpassword=''; or die ('Error connecting to database'); $dbname='eiss_db'; $dbname database'); ?> ...\eiss\script\print_functions.php <? function errorMessage($message) { echo(" <center> $message </center> "); } function loadingMessage() { ?> <p style="font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10px;color: #FF0000;font-weight: bold;">Loading...</p> <p style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; font-weight: bold;">Please wait while the page is being processed.</p> <p style="font-size: 10px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"> You will return to the page you have been after this process. Please stand by. </p> <p style="fontsize: 10px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"> <u>Epidemiologic Information and Simulation System (EISS)</u><br> James Matthew B. Miraflor<br> BS Computer Science<br> 2002-17119 </p> <? } ?> ...\eiss\script\privileges.php <style type="text/css"> .privilegelink A:link { color:#000000; font-weight: bold; text-decoration: none; font-size: 10; } .privilegelink A:visited { color:#000000; font-weight: bold; text-decoration: none; font-size: 10; } .privilegelink A:active { color:#000000; fontweight: bold; text-decoration: none; font-size: 10; } .privilegelink A:hover { color:#BBBBBB; font-weight: bold; text-decoration: none; font-size: 10; } </style> <span class="privilegelink"> <? // Checks if am Epidemiology Management Expert is logged-in ?> <? if($user->usertype=="epidemiologist") { ?> <a href="../modules/eme.php?<? echo($parameters); ?>"> [ Simulation ] </a> &nbsp; <a href="../modules/gie2.php?<? echo($parameters); ?>"> [ Manage your Regions ] </a> &nbsp; <? } ?> <? // Checks if a Pathology Expert is logged-in ?> <? if($user->usertype=="pathologist") { ?> <a href="../modules/pe.php?<? echo($parameters); ?>"> [ Manage Diseases ] </a> &nbsp; <? } ?> <? // Checks if a Geographic Information Expert is loggedin ?> <? if($user->usertype=="geographer") { ?> <a href="../modules/gie.php?<? echo($parameters); ?>"> [ Manage Geographic Units, Regions, and Maps ] </a> &nbsp; <? } ?> <? // Checks if a System Administrator is logged-in ?> <? if($user->usertype=="sysad") { ?> <a href="../modules/sysad.php?<? echo($parameters); ?>"> [ Manage Accounts ] </a> &nbsp; <? } ?> </span> ...\eiss\script\process_epidemic.php <? /* Loads simulation session */ if(isset($_SESSION['simulation'])) { $simulation = unserialize($_SESSION['simulation']); } else $simulation = new Simulation(); ?> <? // Processes commands if(isset($simulation->disease)) { // Get cycle if($simulation->time_unit=="Day") $cycle = 1; else if($simulation->time_unit=="Week") $cycle = 7; else if($simulation>time_unit=="Month") $cycle = 30; else if($simulation->time_unit=="Quarter") $cycle = 90; else if($simulation>time_unit=="Semester") $cycle = 180; else if($simulation->time_unit=="Year") $cycle = 365; else if($simulation>time_unit=="n-day Cycle") { $cycle = $HTTP_POST_VARS['daysinacycle']; $simulation->time_unit = $cycle."-day Cycle"; } } if(isset($HTTP_POST_VARS['disease_selected'])) $simulation->disease = $HTTP_POST_VARS['disease_selected']; if($HTTP_POST_VARS['reset_disease']) { unset($simulation->disease); unset($simulation->time_steps); unset($simulation>time_unit); } if(isset($HTTP_POST_VARS['region_selected'])) $simulation->region = $HTTP_POST_VARS['region_selected']; if($HTTP_POST_VARS['reset_region']) unset($simulation->region); if($HTTP_POST_VARS['reset_region']||$HTTP_POST_VARS['reset_SLIR']) { unset($simulation->susceptible); $connection = @mysql_connect($dbhost, $dbuser, $dbpassword) @mysql_select_db($dbname) or die ('Error: Cannot access

184

unset($simulation->latent); unset($simulation->infectious); unset($simulation->removed); unset($simulation->time_steps); unset($simulation->time_unit); unset($simulation->quarantine); unset($simulation->vaccinate); } $noninteger = false; $negative = false; if(isset($HTTP_POST_VARS['susceptible'])) { $simulation->susceptible = $HTTP_POST_VARS['susceptible']; foreach($simulation->susceptible as $value) { if(!is_numeric(trim($value))&&trim($value)!="") $noninteger = true; else if(trim($value)<0) $negative = true; } } if(isset($HTTP_POST_VARS['latent'])) { $simulation->latent = $HTTP_POST_VARS['latent']; foreach($simulation->latent as $value) { if(!is_numeric(trim($value))&&trim($value)!="") $noninteger = true; else if(trim($value)<0) $negative = true; } } if(isset($HTTP_POST_VARS['infectious'])) { $simulation->infectious = $HTTP_POST_VARS['infectious']; foreach($simulation>infectious as $value) { if(!is_numeric(trim($value))&&trim($value)!="") $noninteger = true; else if(trim($value)<0) $negative = true; } } if(isset($HTTP_POST_VARS['removed'])) { $simulation->removed = $HTTP_POST_VARS['removed']; foreach($simulation->removed as $value) { if(!is_numeric(trim($value))&&trim($value)!="") $noninteger = true; else if(trim($value)<0) $negative = true; } } if(($noninteger)||($negative)) { unset($simulation->susceptible); unset($simulation>latent); unset($simulation->infectious); unset($simulation->removed); if($noninteger) $slirmessage .= " Non-numeric value inputed on one of the fields."; if($negative) $slirmessage .= " Negative value inputed on one of the fields."; } if(isset($HTTP_POST_VARS['time_steps'])&&is_numeric(trim($HTTP_POST_VARS['time_steps']))) $simulation->time_steps = $HTTP_POST_VARS['time_steps']; if(isset($HTTP_POST_VARS['time_unit'])&&isset($HTTP_POST_VARS['time_steps'])) $simulation->time_unit = $HTTP_POST_VARS['time_unit']; if($HTTP_POST_VARS['reset_time']) { unset($simulation>time_steps); unset($simulation->time_unit); unset($simulation->quarantine); unset($simulation->vaccinate); } if(isset($HTTP_POST_VARS['submit_stochastic'])) { if($HTTP_POST_VARS['stochastic']=="on") $simulation->stochastic = true; else $simulation->stochastic = false; } // Quarantine processing if( ( isset($HTTP_POST_VARS['quarantine'])&& trim($HTTP_POST_VARS['q_time_from'])!=""&& trim($HTTP_POST_VARS['q_time_to'])!="" )|| ( isset($HTTP_POST_VARS['quarantine_days'])&& trim($HTTP_POST_VARS['q_day_time_from'])!=""&& trim($HTTP_POST_VARS['q_day_time_to'])!="" ) ) { unset($HTTP_GET_VARS['delete_quarantine']); $q_message = ""; if(isset($HTTP_POST_VARS['quarantine'])) { $time_from = $cycle*$HTTP_POST_VARS['q_time_from']; $time_to = $cycle*$HTTP_POST_VARS['q_time_to']; } else if(isset($HTTP_POST_VARS['quarantine_days'])) { $time_from = $HTTP_POST_VARS['q_day_time_from']; $time_to = $HTTP_POST_VARS['q_day_time_to']; } if($time_from>$cycle*$simulation->time_steps||$time_to>$cycle*$simulation->time_steps) $q_message = "Quarantine implementation cannot exceed time frame."; else if($time_from>$time_to) $q_message = "Lifting the quarantine cannot be earlier than setting up the quarantine."; else { // Check if there is quarantine overlaps $strings = explode("&",$simulation>quarantine); foreach ($strings as $value) { if(trim($value)!="") { $item = explode("|", $value); if( (trim($item[0])==trim($HTTP_POST_VARS['q_location']))&& (trim($item[1])!="")&&trim($item[2]!="") ){ if( (($time_from>=$item[1])&&($time_from<=$item[2]))|| (($time_to>=$item[1])&&($time_to<=$item[2])) ) $q_message = "Quarantine period cannot overlap."; } } } if(trim($q_message)=="") $simulation->quarantine .= $HTTP_POST_VARS['q_location']."|".$time_from."|".$time_to."&"; } } if(isset($HTTP_POST_VARS['reset_quarantine'])) unset($simulation->quarantine); if(isset($HTTP_GET_VARS['delete_quarantine'])) { $strings = explode($HTTP_GET_VARS['delete_quarantine']."&",$simulation->quarantine); $simulation->quarantine = $strings[0].$strings[1]; } // Vaccination processing if( ( isset($HTTP_POST_VARS['vaccinate'])&& trim($HTTP_POST_VARS['v_time_from'])!=""&& trim($HTTP_POST_VARS['v_time_to'])!=""&& is_numeric(trim($HTTP_POST_VARS['v_rate'])) )|| ( isset($HTTP_POST_VARS['vaccinate_days'])&& trim($HTTP_POST_VARS['v_day_time_from'])!=""&& trim($HTTP_POST_VARS['v_day_time_to'])!=""&& is_numeric(trim($HTTP_POST_VARS['v_rate'])) ) ) { unset($HTTP_GET_VARS['delete_vaccinate']); $v_message = ""; if(isset($HTTP_POST_VARS['vaccinate'])) { $time_from = $cycle*$HTTP_POST_VARS['v_time_from']; $time_to = $cycle*$HTTP_POST_VARS['v_time_to']; } else if(isset($HTTP_POST_VARS['vaccinate_days'])) { $time_from = $HTTP_POST_VARS['v_day_time_from']; $time_to = $HTTP_POST_VARS['v_day_time_to']; } if($time_from>$cycle*$simulation->time_steps||$time_to>$cycle*$simulation->time_steps) $v_message = "Vaccination cannot exceed time frame."; else if($time_from>$time_to) $v_message = "Stopping/pausing vaccination cannot be earlier than beginning it."; else { // Check if there is vaccinate overlaps $strings = explode("&",$simulation->vaccinate); foreach ($strings as $value) { if(trim($value)!="") { $item = explode("|", $value); if( (trim($item[0])==trim($HTTP_POST_VARS['v_location']))&& (trim($item[1])!="")&&trim($item[2]!="") ){ if( (($time_from>=$item[1])&&($time_from<=$item[2]))|| (($time_to>=$item[1])&&($time_to<=$item[2])) ) $v_message = "Vaccinate period cannot overlap."; } } } if(trim($v_message)=="") $simulation->vaccinate .= $HTTP_POST_VARS['v_location']."|".$time_from."|".$time_to."|".$HTTP_POST_VARS['v_rate']."&"; } } if(isset($HTTP_POST_VARS['reset_vaccinate'])) unset($simulation->vaccinate); if(isset($HTTP_GET_VARS['delete_vaccinate'])) { $strings = explode($HTTP_GET_VARS['delete_vaccinate']."&",$simulation->vaccinate); $simulation->vaccinate = $strings[0].$strings[1]; } ?> <? // Processes epidemic algorithm $time = $simulation->time_steps; $epsilon = 0; $beta = 0; if(isset($simulation->disease)) { $query = " SELECT * FROM `disease` WHERE disease_no = '".$simulation->disease."'"; $disease = mysql_fetch_array(mysql_query($query)); $epsilon = 1/$disease['latent_pd']; $beta = 1/$disease['infectious_pd']; $query = " SELECT `g_unit` FROM `subregion` WHERE `region` = '".$simulation->region."'"; if($result_sub = mysql_query($query)) { $i=0; // Solve for alpha, create a table of unit no and index, population while($data_sub = mysql_fetch_array($result_sub)) { $unit_sub = mysql_fetch_array(mysql_query(" SELECT * FROM `g_unit` WHERE `unit_no` = ".$data_sub['g_unit'])); $gunit_sub[$i] = new GeographicalUnit($unit_sub); $rho = (pow(10,-5)*$gunit_sub[$i]->density) + 1.0179; $alpha[$i] = $rho*$beta; $unit_no[$i] = $gunit_sub[$i]->unit_no; $population[$i] = $gunit_sub[$i]->population; $i++; } $num_units = $i; // Get traffic matrix for($j=0;$j<$num_units;$j++) { for($k=0;$k<$num_units;$k++) { $query_traffic = " SELECT `traffic` FROM `traffic` WHERE `source` = '".$gunit_sub[$j]->unit_no."' AND `destination` = '".$gunit_sub[$k]->unit_no."'"; $result_traffic = mysql_fetch_array(mysql_query($query_traffic)); if(trim($result_traffic['traffic'])=="") $result_traffic['traffic'] = 0; $gamma[$j][$k] = $result_traffic['traffic']; } } // Get cycle if(isset($simulation->disease)) { if($simulation->time_unit=="Day") $cycle = 1; else if($simulation>time_unit=="Week") $cycle = 7; else if($simulation->time_unit=="Month") $cycle = 30; else if($simulation>time_unit=="Quarter") $cycle = 90; else if($simulation->time_unit=="Semester") $cycle = 180; else if($simulation>time_unit=="Year") $cycle = 365; else if($simulation->time_unit=="n-day Cycle") { $cycle =

185

$HTTP_POST_VARS['daysinacycle']; $simulation->time_unit = $cycle."-day Cycle"; } } } } // If SLIR is filled if( isset($simulation->disease)&& isset($simulation->region)&& ( isset($simulation->susceptible)|| isset($simulation>latent)|| isset($simulation->infectious)|| isset($simulation->removed) ) ) { //Set SLIR arrays $result = mysql_query(" SELECT `g_unit` FROM `subregion` WHERE `region` = '".$simulation->region."'"); $total = mysql_num_rows($result); for($i=0;$i<$total;$i++) { $susceptible[$i] = 0; $latent[$i] = 0; $infectious[$i] = 0; $removed[$i] = 0; } //Generate SLIR arrays if(isset($simulation->susceptible)) { $i = 0; foreach($simulation>susceptible as $value) { $susceptible[$i] = (trim($value)!="") ? $value : 0; $i++; } } if(isset($simulation->latent)) { $i = 0; foreach($simulation->latent as $value) { $latent[$i] = (trim($value)!="") ? $value : 0; $i++; } } if(isset($simulation->infectious)) { $i = 0; foreach($simulation->infectious as $value) { $infectious[$i] = (trim($value)!="") ? $value : 0; $i++; } } if(isset($simulation->removed)) { $i = 0; foreach($simulation->removed as $value) { $removed[$i] = (trim($value)!="") ? $value : 0; $i++; } } ?> <script type="text/javascript"> var time = <? echo($time); ?>; var epsilon = <? echo($epsilon); ?>; var beta = <? echo($beta); ?>; var num_units = <? echo($num_units); ?>; var cycle = <? echo($cycle); ?>; var stochastic = <? if(!isset($simulation>stochastic)||trim($simulation->stochastic)=="") echo("false"); else echo($simulation->stochastic); ?>; var quarantine = "<? echo($simulation->quarantine); ?>"; var vaccinate = "<? echo($simulation->vaccinate); ?>"; <? echo(get_javascript_array($alpha,"alpha")); ?> <? echo(get_javascript_array($gamma,"gamma")); ?> <? echo(get_javascript_array($susceptible,"susceptible")); ?> <? echo(get_javascript_array($latent,"latent")); ?> <? echo(get_javascript_array($infectious,"infectious")); ?> <? echo(get_javascript_array($removed,"removed")); ?> <? echo(get_javascript_array($population,"population")); ?> // Create an array of Unit Indices var unit_nos = Array(); <? for($i=0;$i<$num_units;$i++) echo("unit_nos[".$i."] = ".$gunit_sub[$i]->unit_no.";"); ?> var units = new Array(); <? foreach($gunit_sub as $key => $value) echo("units[".($key+1)."] = \"".$value->name."\";"); ?> // Create an original array of traffic matrices, which will be edited by the module below var gamma_final = Array(); for(var j=1;j<=time*cycle;j++) { gamma_final[j] = gamma; } // Process traffic matrix according to Quarantine Command strings = quarantine.split("&"); for (var key in strings) { //sort(strings); if(trim(strings[key])!="") { item = strings[key].split("|"); if((trim(item[0])!="")||(trim(item[1])!="")||(trim(item[2])!="")) { // Look for the index of the qurantined town for(i=0;i<num_units;i++) { if(unit_nos[i]==item[0]) index = i; } // Look for the quarantined town, set to zero the matrix from time item[1] to item[2] for(i=item[1];i<=item[2];i++) { for(j=0;j<num_units;j++) { if(j==index) { for(k=0;k<num_units;k++) { gamma_final[i][j][k] = 0; gamma_final[i][k][j] = 0; } } } } } } } // Create an original array of vaccination matrices, which will be edited by the module below var vaccination = Array(); for(var i=0;i<=time*cycle;i++) { vaccination[i] = Array(); for(j=0;j<num_units;j++) vaccination[i][j] = 0; } // Process vaccination matrix according to Vaccinate Command strings = vaccinate.split("&"); for (var key in strings) { //sort(strings); if(trim(strings[key])!="") { item = strings[key].split("|"); if((trim(item[0])!="")||(trim(item[1])!="")||(trim(item[2])!="")||(trim(item[3])!="")) { // Look for the index of the vaccinated town for(i=0;i<num_units;i++) { if(unit_nos[i]==item[0]) index = i; } // Look for the vaccinated town, set to item[3] the matrix from time item[1] to item[2] for(i=item[1]-1;i<item[2];i++) { for(j=0;j<num_units;j++) { if(j==index) vaccination[i][j] = item[3]; } } } } } var results = new Array(); var step = 0; for(t=0;t<=time*cycle;t++) { var next = epidemic_step(alpha,beta,epsilon,gamma_final[t+1],susceptible,latent,infectious,population,num_units,stochastic); susceptible = next.e(1); latent = next.e(2); infectious = next.e(3); removed = next.e(4); // Vaccinate for(j=0;j<num_units;j++) { if(susceptible[j]-parseFloat(vaccination[t][j])<=0) { removed[j] += susceptible[j]; susceptible[j] = 0; } else { susceptible[j] -= parseFloat(vaccination[t][j]); removed[j] += parseFloat(vaccination[t][j]); } } if(t % cycle==0) { results[step] = new Array(); results[step]['s'] = susceptible; results[step]['l'] = latent; results[step]['i'] = infectious; results[step]['r'] = removed; step++; } } </script> <? } ?> ...\eiss\script\ process_navigation.php <? require('../script/header.php'); ?> <? loadingMessage(); if(isset($_SESSION['nav'])) $nav = unserialize($_SESSION['nav']); else $nav = new Navigation(); /* Generates search string */ $search_string = ""; // For System Administrator if($HTTP_POST_VARS['src']=="sysad") { if(isset($HTTP_POST_VARS['search_submit'])) { $search_string .= "&username|".$HTTP_POST_VARS['username_search']."&"; $search_string .= "&lname|".$HTTP_POST_VARS['lname_search']."&"; $search_string .= "&fname|".$HTTP_POST_VARS['fname_search']."&"; $search_string .= "&mname|".$HTTP_POST_VARS['mname_search']."&"; $search_string .= "&email|".$HTTP_POST_VARS['email_search']."&"; if($HTTP_POST_VARS['gender_search']=="male"||$HTTP_POST_VARS['gender_search']=="female") $search_string .= "&gender|".$HTTP_POST_VARS['gender_search']."&"; if($HTTP_POST_VARS['accounts_search']=="sysad") $search_string .= "&usertype|sysad&"; else if($HTTP_POST_VARS['accounts_search']=="epidemiologist") $search_string .= "&usertype|epidemiologist&"; else if($HTTP_POST_VARS['accounts_search']=="geographer") $search_string .= "&usertype|geographer&"; else if($HTTP_POST_VARS['accounts_search']=="pathologist") $search_string .= "&usertype|pathologist&"; $nav->search_str_sysad = $search_string; } else if(isset($HTTP_POST_VARS['search_reset'])) $nav->search_str_sysad = ""; // For Pathology Expert } else if($HTTP_POST_VARS['src']=="pe") { if(isset($HTTP_POST_VARS['search_submit'])) { $search_string .= "&name|".$HTTP_POST_VARS['name_search']."&"; $search_string .= "&desc|".$HTTP_POST_VARS['desc_search']."&"; $search_string .= "&contributor|".$HTTP_POST_VARS['contributor_search']."&"; if($HTTP_POST_VARS['latent_lowercond']!="none"&&is_numeric(trim($HTTP_POST_VARS['latent_lowerlimit']))) { $search_string .= "latent_lowerlimit|"; if($HTTP_POST_VARS['latent_lowercond']=="more") $search_string .= ">|".$HTTP_POST_VARS['latent_lowerlimit']."&"; else $search_string .= ">=|".$HTTP_POST_VARS['latent_lowerlimit']."&"; } if($HTTP_POST_VARS['latent_uppercond']!="none"&&is_numeric(trim($HTTP_POST_VARS['latent_upperlimit']))) { $search_string .= "latent_upperlimit|"; if($HTTP_POST_VARS['latent_uppercond']=="less") $search_string .= } "<|".$HTTP_POST_VARS['latent_upperlimit']."&"; else $search_string .= "<=|".$HTTP_POST_VARS['latent_upperlimit']."&"; if($HTTP_POST_VARS['infect_lowercond']!="none"&&is_numeric(trim($HTTP_POST_VARS['infect_lowerlimit']))) { $search_string .= "infect_lowerlimit|"; if($HTTP_POST_VARS['infect_lowercond']=="more") $search_string .=

186

">|".$HTTP_POST_VARS['infect_lowerlimit']."&"; else $search_string .= ">=|".$HTTP_POST_VARS['infect_lowerlimit']."&"; } if($HTTP_POST_VARS['infect_uppercond']!="none"&&is_numeric(trim($HTTP_POST_VARS['infect_upperlimit']))) { $search_string .= "infect_upperlimit|"; if($HTTP_POST_VARS['infect_uppercond']=="less") $search_string .= "<|".$HTTP_POST_VARS['infect_upperlimit']."&"; else $search_string .= "<=|".$HTTP_POST_VARS['infect_upperlimit']."&"; } $nav->search_str_pe = $search_string; } else if(isset($HTTP_POST_VARS['search_reset'])) $nav->search_str_pe = ""; // For Geographical Information Expert } else if($HTTP_POST_VARS['src']=="gie") { if(isset($HTTP_POST_VARS['search_gu_submit'])) { $search_string .= "&name|".$HTTP_POST_VARS['name_search']."&"; $search_string .= "&desc|".$HTTP_POST_VARS['desc_search']."&"; $search_string .= "&contributor|".$HTTP_POST_VARS['contributor_search']."&"; if($HTTP_POST_VARS['population_lowercond']!="none"&&is_numeric(trim($HTTP_POST_VARS['population_lowerlimit']))) { $search_string .= "population_lowerlimit|"; if($HTTP_POST_VARS['population_lowercond']=="more") $search_string .= ">|".$HTTP_POST_VARS['population_lowerlimit']."&"; else $search_string .= ">=|".$HTTP_POST_VARS['population_lowerlimit']."&"; } if($HTTP_POST_VARS['population_uppercond']!="none"&&is_numeric(trim($HTTP_POST_VARS['population_upperlimit']))) { $search_string .= "population_upperlimit|"; if($HTTP_POST_VARS['population_uppercond']=="less") $search_string .= "<|".$HTTP_POST_VARS['population_upperlimit']."&"; else $search_string .= "<=|".$HTTP_POST_VARS['population_upperlimit']."&"; } if($HTTP_POST_VARS['density_lowercond']!="none"&&is_numeric(trim($HTTP_POST_VARS['density_lowerlimit']))) { $search_string .= "density_lowerlimit|"; if($HTTP_POST_VARS['density_lowercond']=="more") $search_string .= ">|".$HTTP_POST_VARS['density_lowerlimit']."&"; else $search_string .= ">=|".$HTTP_POST_VARS['density_lowerlimit']."&"; } if($HTTP_POST_VARS['density_uppercond']!="none"&&is_numeric(trim($HTTP_POST_VARS['density_upperlimit']))) { $search_string .= "density_upperlimit|"; if($HTTP_POST_VARS['density_uppercond']=="less") $search_string .= "<|".$HTTP_POST_VARS['density_upperlimit']."&"; else $search_string .= "<=|".$HTTP_POST_VARS['density_upperlimit']."&"; } if($HTTP_POST_VARS['area_lowercond']!="none"&&is_numeric(trim($HTTP_POST_VARS['area_lowerlimit']))) { $search_string .= "area_lowerlimit|"; if($HTTP_POST_VARS['area_lowercond']=="more") $search_string .= ">|".$HTTP_POST_VARS['area_lowerlimit']."&"; else $search_string .= ">=|".$HTTP_POST_VARS['area_lowerlimit']."&"; } if($HTTP_POST_VARS['area_uppercond']!="none"&&is_numeric(trim($HTTP_POST_VARS['area_upperlimit']))) { $search_string .= "area_upperlimit|"; if($HTTP_POST_VARS['area_uppercond']=="less") $search_string .= "<|".$HTTP_POST_VARS['area_upperlimit']."&"; else $search_string .= "<=|".$HTTP_POST_VARS['area_upperlimit']."&"; } $nav->search_str_gie_gu = $search_string; } else if(isset($HTTP_POST_VARS['search_gu_reset'])) $nav->search_str_gie_gu = ""; else if(isset($HTTP_POST_VARS['search_reg_submit'])) { $search_string .= "&code|".$HTTP_POST_VARS['code_search_reg']."&"; $search_string .= "&name|".$HTTP_POST_VARS['name_search_reg']."&"; $search_string .= "&desc|".$HTTP_POST_VARS['desc_search_reg']."&"; $search_string .= "&contributor|".$HTTP_POST_VARS['contributor_search_reg']."&"; $nav->search_str_gie_reg = $search_string; } else if(isset($HTTP_POST_VARS['search_reg_reset'])) $nav->search_str_gie_reg = ""; // For Epidemiology Management Expert } else if($HTTP_POST_VARS['src']=="eme") { if(isset($HTTP_POST_VARS['search_submit'])) { $search_string .= "&name|".$HTTP_POST_VARS['name_search']."&"; $search_string .= "&desc|".$HTTP_POST_VARS['desc_search']."&"; $search_string .= "&contributor|".$HTTP_POST_VARS['contributor_search']."&"; if($HTTP_POST_VARS['latent_lowercond']!="none"&&is_numeric(trim($HTTP_POST_VARS['latent_lowerlimit']))) { $search_string .= "latent_lowerlimit|"; if($HTTP_POST_VARS['latent_lowercond']=="more") $search_string .= ">|".$HTTP_POST_VARS['latent_lowerlimit']."&"; else $search_string .= ">=|".$HTTP_POST_VARS['latent_lowerlimit']."&"; } if($HTTP_POST_VARS['latent_uppercond']!="none"&&is_numeric(trim($HTTP_POST_VARS['latent_upperlimit']))) { $search_string .= "latent_upperlimit|"; if($HTTP_POST_VARS['latent_uppercond']=="less") $search_string .= "<|".$HTTP_POST_VARS['latent_upperlimit']."&"; else $search_string .= "<=|".$HTTP_POST_VARS['latent_upperlimit']."&"; } if($HTTP_POST_VARS['infect_lowercond']!="none"&&is_numeric(trim($HTTP_POST_VARS['infect_lowerlimit']))) { $search_string .= "infect_lowerlimit|"; if($HTTP_POST_VARS['infect_lowercond']=="more") $search_string .= ">|".$HTTP_POST_VARS['infect_lowerlimit']."&"; else $search_string .= ">=|".$HTTP_POST_VARS['infect_lowerlimit']."&"; } if($HTTP_POST_VARS['infect_uppercond']!="none"&&is_numeric(trim($HTTP_POST_VARS['infect_upperlimit']))) { $search_string .= "infect_upperlimit|"; if($HTTP_POST_VARS['infect_uppercond']=="less") $search_string .= "<|".$HTTP_POST_VARS['infect_upperlimit']."&"; else $search_string .= "<=|".$HTTP_POST_VARS['infect_upperlimit']."&"; } $nav->search_str_pe = $search_string; } else if(isset($HTTP_POST_VARS['search_reset'])) $nav->search_str_pe = ""; else if(isset($HTTP_POST_VARS['search_reg_submit'])) { $search_string .= "&code|".$HTTP_POST_VARS['code_search_reg']."&"; $search_string .= "&name|".$HTTP_POST_VARS['name_search_reg']."&"; $search_string .= "&desc|".$HTTP_POST_VARS['desc_search_reg']."&"; $search_string .= "&contributor|".$HTTP_POST_VARS['contributor_search_reg']."&"; $nav->search_str_gie_reg = $search_string; } else if(isset($HTTP_POST_VARS['search_reg_reset'])) $nav->search_str_gie_reg = ""; } /* Pagination */ if(isset($HTTP_GET_VARS['entries_per_page_sysad'])&&trim($HTTP_GET_VARS['entries_per_page_sysad'])!="") $nav>entries_per_page_sysad = $HTTP_GET_VARS['entries_per_page_sysad']; else $nav->entries_per_page_sysad = 5; if(isset($HTTP_GET_VARS['entries_per_page_pe'])&&trim($HTTP_GET_VARS['entries_per_page_pe'])!="") $nav>entries_per_page_pe = $HTTP_GET_VARS['entries_per_page_pe']; else $nav->entries_per_page_pe = 5; if(isset($HTTP_GET_VARS['entries_per_page_gie'])&&trim($HTTP_GET_VARS['entries_per_page_gie'])!="") $nav>entries_per_page_gie = $HTTP_GET_VARS['entries_per_page_gie']; else $nav->entries_per_page_gie = 5; if(isset($HTTP_GET_VARS['entries_per_page_eme'])&&trim($HTTP_GET_VARS['entries_per_page_eme'])!="") $nav>entries_per_page_eme = $HTTP_GET_VARS['entries_per_page_eme']; else $nav->entries_per_page_eme = 5; /* Saves to session */ if(isset($_SESSION['nav'])) unset($_SESSION['nav']); $_SESSION['nav'] = serialize($nav); ?> <? require('../script/footer.php'); ?> <? require('../script/go_back.php'); ?>

187

...\eiss\script\ process_parameters.php <? // Resolve parameters $parameters = ""; foreach($_GET as $key => $value) { if(trim($value)!="") { if($key!="login_failure"&&$key!="login_message"&&$key!="delete_quarantine"&&$key!="delete_vaccinate") { "$key=$value&"; //if($key=="PHPSESSID") $sess_set = true; //else $parameters .= "$key=$value&"; if(isset($_POST['PHPSESSID'])&&!$sess_set) { $sess_set = true; $parameters .= "PHPSESSID=".$_POST['PHPSESSID']."&"; } ?> ...\eiss\script\ process_query.php <? if(isset($_SESSION['nav'])) { // Search if($login_as=="sysad") { if(isset($nav->search_str_sysad)) { $search_string_raw = explode("&",$nav->search_str_sysad); for($i=0;$i<count($search_string_raw);$i++) { if((isset($search_string_raw[$i]))&&(trim($search_string_raw[$i])!="")) { $search_elem = explode("|",$search_string_raw[$i]); $search_in = $search_elem[0]; $search_for = $search_elem[1]; if(trim($search_for)!="") { $regexp = true; // For accounts if($search_in=="username") { $query .= " AND `username`"; $username_search_entry = $search_for; } else if($search_in=="lname") { $query .= " AND `last_name`"; $lname_search_entry = $search_for; } else if($search_in=="fname") { $query .= " AND `first_name`"; $fname_search_entry = $search_for; } else if($search_in=="mname") { $query .= " AND `middle_name`"; $mname_search_entry = $search_for; } else if($search_in=="email") { $query .= " AND `email`"; $email_search_entry = $search_for; } else if($search_in=="gender") { $query .= " AND `gender`"; $gender_search_entry = $search_for; } else if($search_in=="usertype") { $query .= " AND `usertype`"; $usertype_search_entry = $search_for; } // Regular Expression minus exceptions if($regexp) $query .= " REGEXP '".$search_for."'"; } } } } } else if ($login_as=="pe") { if(isset($nav->search_str_pe)) { $search_string_raw = explode("&",$nav->search_str_pe); for($i=0;$i<count($search_string_raw);$i++) { if((isset($search_string_raw[$i]))&&(trim($search_string_raw[$i])!="")) { $search_elem = explode("|",$search_string_raw[$i]); $search_in = $search_elem[0]; $search_for = $search_elem[1]; $extra = $search_elem[2]; if(trim($search_for)!="") { $regexp = true; // For diseases if($search_in=="name") { $query .= " AND `name`"; $name_search_entry = $search_for; } else if($search_in=="desc") { $query .= " AND `description`"; $desc_search_entry = $search_for; } else if($search_in=="contributor") { $query .= " AND `contributor`"; $contributor_search_entry = $search_for; } // latent and infectious else if($search_in=="latent_lowerlimit") { $query .= " AND `latent_pd`".$search_for.$extra; $latent_lowerlimit_search = $extra; if($search_for==">") $latent_lowerlimit_cond = "more"; else if($search_for==">=") $latent_lowerlimit_cond = "more_equal"; else $latent_lowerlimit_cond = "none"; $regexp = false; } else if($search_in=="latent_upperlimit") { $query .= " AND `latent_pd`".$search_for.$extra; $latent_upperlimit_search = $extra; if($search_for=="<") $latent_upperlimit_cond = "less"; else if($search_for=="<=") $latent_upperlimit_cond = "less_equal"; else $latent_upperlimit_cond = "none"; $regexp = false; } else if($search_in=="infect_lowerlimit") { $query .= " AND `infect_pd`".$search_for.$extra; $infect_lowerlimit_search = $extra; if($search_for==">") $infect_lowerlimit_cond = "more"; else if($search_for==">=") $infect_lowerlimit_cond = "more_equal"; else $infect_lowerlimit_cond = "none"; $regexp = false; } else if($search_in=="infect_upperlimit") { $query .= " AND `infect_pd`".$search_for.$extra; $infect_upperlimit_search = $extra; if($search_for=="<") $infect_upperlimit_cond = "less"; else if($search_for=="<=") $infect_upperlimit_cond = "less_equal"; else $infect_upperlimit_cond = "none"; $regexp = false; } // Regular Expression minus exceptions if($regexp) $query .= " REGEXP '".$search_for."'"; } } } } } else if ($login_as=="gie") { if(isset($nav->search_str_gie_gu)) { $search_string_raw = explode("&",$nav->search_str_gie_gu); for($i=0;$i<count($search_string_raw);$i++) { if((isset($search_string_raw[$i]))&&(trim($search_string_raw[$i])!="")) { $search_elem = explode("|",$search_string_raw[$i]); $search_in = $search_elem[0]; $search_for = $search_elem[1]; $extra = $search_elem[2]; if(trim($search_for)!="") { $regexp = true; // For geographical units if($search_in=="name") { $query_gu .= " AND `name`"; $name_search_entry = $search_for; } else if($search_in=="desc") { $query_gu .= " AND `description`"; $desc_search_entry = $search_for; } else if($search_in=="contributor") { $query_gu .= " AND `contributor`"; $contributor_search_entry = $search_for; } // population, population density, and area else if($search_in=="population_lowerlimit") { $query_gu .= " AND `population`".$search_for.$extra; $population_lowerlimit_search = $extra; if($search_for==">") $population_lowerlimit_cond = "more"; else if($search_for==">=") $population_lowerlimit_cond = "more_equal"; else $population_lowerlimit_cond = "none"; $regexp = false; } else if($search_in=="population_upperlimit") { $query_gu .= " AND `population`".$search_for.$extra; $population_upperlimit_search = $extra; if($search_for=="<") $population_upperlimit_cond = "less"; else if($search_for=="<=") $population_upperlimit_cond = "less_equal"; else $population_upperlimit_cond = "none"; $regexp = false; } else if($search_in=="density_lowerlimit") { $query_gu .= " AND (`population`/`area`)".$search_for.$extra; $density_lowerlimit_search = $extra; if($search_for==">") $density_lowerlimit_cond = "more"; else if($search_for==">=") $density_lowerlimit_cond = "more_equal"; else $density_lowerlimit_cond = "none"; $regexp = false; } else if($search_in=="density_upperlimit") { $query_gu .= " AND (`population`/`area`)".$search_for.$extra; $density_upperlimit_search = $extra; if($search_for=="<") $density_upperlimit_cond = "less"; else if($search_for=="<=") $density_upperlimit_cond = "less_equal"; else $density_upperlimit_cond = "none"; $regexp = false; } else if($search_in=="area_lowerlimit") { $query_gu .= " AND `area`".$search_for.$extra; $area_lowerlimit_search = $extra; if($search_for==">") $area_lowerlimit_cond = "more"; else if($search_for==">=") $area_lowerlimit_cond = "more_equal"; else $area_lowerlimit_cond = "none"; $regexp = false; } else if($search_in=="area_upperlimit") { $query_gu .= " AND `area`".$search_for.$extra; $area_upperlimit_search = $extra; if($search_for=="<") $area_upperlimit_cond = "less"; else if($search_for=="<=") $area_upperlimit_cond = "less_equal"; else $area_upperlimit_cond = "none"; $regexp = false; } // Regular Expression minus exceptions if($regexp) $query_gu .= " REGEXP '".$search_for."'"; } } } } if(isset($nav->search_str_gie_reg)) { $search_string_raw = explode("&",$nav->search_str_gie_reg); for($i=0;$i<count($search_string_raw);$i++) { if((isset($search_string_raw[$i]))&&(trim($search_string_raw[$i])!="")) { $parameters .= } }

}

188

$search_elem = explode("|",$search_string_raw[$i]); $search_in = $search_elem[0]; $search_for = $search_elem[1]; $extra = $search_elem[2]; if(trim($search_for)!="") { $regexp = true; // For regions if($search_in=="code") { $query_reg .= " AND `code`"; $code_search_reg_entry = $search_for; } else if($search_in=="name") { $query_reg .= " AND `name`"; $name_search_reg_entry = $search_for; } else if($search_in=="desc") { $query_reg .= " AND `description`"; $desc_search_reg_entry = $search_for; } else if($search_in=="contributor") { $query_reg .= " AND `contributor`"; $contributor_search_reg_entry = $search_for; } // Regular Expression minus exceptions if($regexp) $query_reg .= " REGEXP '".$search_for."'"; } } } } } else if ($login_as=="eme") { if(isset($nav->search_str_gie_reg)) { $search_string_raw = explode("&",$nav->search_str_gie_reg); for($i=0;$i<count($search_string_raw);$i++) { if((isset($search_string_raw[$i]))&&(trim($search_string_raw[$i])!="")) { $search_elem = explode("|",$search_string_raw[$i]); $search_in = $search_elem[0]; $search_for = $search_elem[1]; $extra = $search_elem[2]; if(trim($search_for)!="") { $regexp = true; // For regions if($search_in=="code") { $query_reg .= " AND `code`"; $code_search_reg_entry = $search_for; } else if($search_in=="name") { $query_reg .= " AND `name`"; $name_search_reg_entry = $search_for; } else if($search_in=="desc") { $query_reg .= " AND `description`"; $desc_search_reg_entry = $search_for; } else if($search_in=="contributor") { $query_reg .= " AND `contributor`"; $contributor_search_reg_entry = $search_for; } // Regular Expression minus exceptions if($regexp) $query_reg .= " REGEXP '".$search_for."'"; } } } } if(isset($nav->search_str_pe)) { $search_string_raw = explode("&",$nav->search_str_pe); for($i=0;$i<count($search_string_raw);$i++) { if((isset($search_string_raw[$i]))&&(trim($search_string_raw[$i])!="")) { $search_elem = explode("|",$search_string_raw[$i]); $search_in = $search_elem[0]; $search_for = $search_elem[1]; $extra = $search_elem[2]; if(trim($search_for)!="") { $regexp = true; // For diseases if($search_in=="name") { $query .= " AND `name`"; $name_search_entry = $search_for; } else if($search_in=="desc") { $query .= " AND `description`"; $desc_search_entry = $search_for; } else if($search_in=="contributor") { $query .= " AND `contributor`"; $contributor_search_entry = $search_for; } // latent and infectious else if($search_in=="latent_lowerlimit") { $query .= " AND `latent_pd`".$search_for.$extra; $latent_lowerlimit_search = $extra; if($search_for==">") $latent_lowerlimit_cond = "more"; else if($search_for==">=") $latent_lowerlimit_cond = "more_equal"; else $latent_lowerlimit_cond = "none"; $regexp = false; } else if($search_in=="latent_upperlimit") { $query .= " AND `latent_pd`".$search_for.$extra; $latent_upperlimit_search = $extra; if($search_for=="<") $latent_upperlimit_cond = "less"; else if($search_for=="<=") $latent_upperlimit_cond = "less_equal"; else $latent_upperlimit_cond = "none"; $regexp = false; } else if($search_in=="infect_lowerlimit") { $query .= " AND `infect_pd`".$search_for.$extra; $infect_lowerlimit_search = $extra; if($search_for==">") $infect_lowerlimit_cond = "more"; else if($search_for==">=") $infect_lowerlimit_cond = "more_equal"; else $infect_lowerlimit_cond = "none"; $regexp = false; } else if($search_in=="infect_upperlimit") { $query .= " AND `infect_pd`".$search_for.$extra; $infect_upperlimit_search = $extra; if($search_for=="<") $infect_upperlimit_cond = "less"; else if($search_for=="<=") $infect_upperlimit_cond = "less_equal"; else $infect_upperlimit_cond = "none"; $regexp = false; } // Regular Expression minus exceptions if($regexp) $query .= " REGEXP '".$search_for."'"; } } } } } } // Pagination if(isset($nav>entries_per_page)) $entries_per_page = $nav->entries_per_page; else $entries_per_page = 5; if($entries_per_page==0) $entries_per_page = 5; ?> ...\eiss\script\user_panel.php <div id="userpanel" style="width: 100%; position: fixed; top: 0px; left: 0px; z-index:0; background-color: <? if($pagename!="main.php") echo('#DADADA'); /* else echo('#FFFFFF'); */ ?>; "><br><br><br> </div> <? // Process Edit query if(isset($HTTP_POST_VARS['update_own'])) { $query = " UPDATE `accounts` SET "; if(isset($HTTP_POST_VARS['edit_title'])) $query .= " `title` = '".$HTTP_POST_VARS['edit_title']."', "; if(isset($HTTP_POST_VARS['edit_lname'])) $query .= " `last_name` = '".$HTTP_POST_VARS['edit_lname']."', "; if(isset($HTTP_POST_VARS['edit_fname'])) $query .= " `first_name` = '".$HTTP_POST_VARS['edit_fname']."', "; if(isset($HTTP_POST_VARS['edit_mname'])) $query .= " `middle_name` = '".$HTTP_POST_VARS['edit_mname']."', "; if(isset($HTTP_POST_VARS['edit_email'])) $query .= " `email` = '".$HTTP_POST_VARS['edit_email']."',"; if(isset($HTTP_POST_VARS['edit_gender'])) $query .= " `gender` = '".$HTTP_POST_VARS['edit_gender']."',"; // Update privileges if($user->is_sysad=="yes") $query .= " `is_sysad` = 'yes',"; else $query .= " `is_sysad` = 'no',"; if($user>is_eme=="yes") $query .= " `is_eme` = 'yes',"; else $query .= " `is_eme` = 'no',"; if($user->is_gie=="yes") $query .= " `is_gie` = 'yes',"; else $query .= " `is_gie` = 'no',"; if($user->is_pe=="yes") $query .= " `is_pe` = 'yes'"; else $query .= " `is_pe` = 'no'"; $query .= " WHERE `username` = '".$user->username."'"; if(mysql_query($query)) $message_edit = "Account update successful."; else $message_edit = "Account update unsuccessful."; } // Process Change password query if(isset($HTTP_POST_VARS['update_password'])) { if( isset($HTTP_POST_VARS['old_password'])&&trim($HTTP_POST_VARS['old_password'])!=""&& isset($HTTP_POST_VARS['new_password'])&&trim($HTTP_POST_VARS['new_password'])!=""&& isset($HTTP_POST_VARS['confirm_password'])&&trim($HTTP_POST_VARS['confirm_password'])!="" ){ // Check if old password is correct $password = $HTTP_POST_VARS['old_password']; $query = " SELECT * FROM `accounts` WHERE `username` = '$user->username' AND `password` = PASSWORD('$password') LIMIT 1 "; if($result = mysql_query($query)) { if(mysql_num_rows($result)>0) { // Check if new password is confirmed if($HTTP_POST_VARS['new_password']==$HTTP_POST_VARS['confirm_password']) { // Change password $password = $HTTP_POST_VARS['new_password']; $query = " UPDATE `accounts` SET `password` = PASSWORD('$password') WHERE `username` = '$user->username' "; if($result = mysql_query($query)) { $message_edit = "Password change successful."; } else $message_edit = "Database error. Please try again."; } else $message_edit = "New password fields doesn't match."; } else $message_edit = "You supplied the wrong password."; } else $message_edit = "Database error. Please try again."; } else $message_edit = "Please fill-in all fields."; } if(isset($user)) { ?> <div id="masterdiv3"> <table border="0" align="center"> <tr> <td colspan=6 align=center> <div id="loginpanel" style="position: fixed; top: 12px; right: 5px; align:right; z-index:2;"> <font size="2"><b>Hello <? echo($user->title); ?> <? echo($user->first_name); ?>!</b></font>&nbsp; Logged-in as : <b><? echo($user->username); ?></b> <a

189

onclick="SwitchMenu3('subEditAccount1')" style="cursor: hand;">[ Edit your Profile ]</a> <a onclick="SwitchMenu3('subEditAccount2')" style="cursor: hand;">[ Edit your Password ]</a> <a href="../script/logout.php?<? echo($parameters); ?>">[ Log-out ]</a> <!-- Message if edited one's own profile --> <? if(isset($message_edit)) { ?> <font color="red"><? echo($message_edit)?></font><br><? } ?> <!-- Allows for editing one's own profile --> <span class="submenu" id="subEditAccount1"> <form method="POST" action="#"> <table bgcolor="<? if($pagename!="main.php") echo('#DADADA'); /* else echo('#FAFAFA'); */ ?>"> <tr><td>Title</td><td><input type="text" class="textFieldClass" size=25 name="edit_title" value="<? echo($user->title);?>"></td></tr> <tr><td>Last Name</td><td><input type="text" class="textFieldClass" size=25 name="edit_lname" value="<? echo($user->last_name);?>"></td></tr> <tr><td>First Name</td><td><input type="text" class="textFieldClass" size=25 name="edit_fname" value="<? echo($user>first_name);?>"></td></tr> <tr><td>Middle Name</td><td><input type="text" class="textFieldClass" size=25 name="edit_mname" value="<? echo($user->middle_name);?>"></td></tr> <tr><td>Email</td><td><input type="text" class="textFieldClass" size=25 name="edit_email" value="<? echo($user->email);?>"></td></tr> <tr><td>Gender</td><td>&nbsp; <select name="edit_gender" style="font-family:verdana;font-size:10;"> <option value="male" <? if($user->gender=="male") echo("selected");?> >Male</option> <option value="female" <? if($user>gender=="female") echo("selected");?> >Female</option> </select> </td></tr> </tr> <tr><td>&nbsp;</td></tr> <tr align="left"> <td colspan=2> <input type="submit" class="buttonClass" value="Update" name="update_own"> <input type="reset" class="buttonClass" value="Reset" name=""> </td> </tr> </table> </form> </span> <!-Allows for editing one's own password --> <span class="submenu" id="subEditAccount2"> <form method="POST" onsubmit="return checkpassword (this);"> <table bgcolor="<? if($pagename!="main.php") echo('#DADADA'); /* else echo('#FAFAFA'); */ ?>"> <tr> <td>Old Password</td> <td><input type="password" class="textFieldClass" size=25 name="old_password"></td> </tr> <tr> <td>New Password</td> <td><input type="password" class="textFieldClass" size=25 name="new_password"></td> </tr> <tr> <td>Confirm Password</td> <td><input type="password" class="textFieldClass" size=25 name="confirm_password"></td> </tr> <tr><td>&nbsp;</td></tr> <tr align="left"> <td colspan=2> <input type="submit" class="buttonClass" value="Update" name="update_password"> <input type="reset" class="buttonClass" value="Reset" name=""> </td> </tr> </table> </form> </span> <!-- --> </div> </td> </tr> </table> <div id="privilege" style="width: 50%; position: fixed; top: 12px; left: 12px; z-index:2;"> <? require("privileges.php") ?> </div> <? } else { ?> <div style="width: 50%; position: fixed; top: 12px; right: 6px; align:right zindex:2;"> <table border="0" align="right"> <tr> <form action="../script/login.php?<? echo($parameters); ?>" method="POST"> <td>Username</td> <td><input name="login_username" type="text" class="textfieldClass" size="15" maxlength="30"></td> <td></td> <td>Password</td> <td><input name="login_password" type="password" class="textfieldClass" size="15" maxlength="30"></td> <td><input name="Submit" type="submit" class="buttonClass" name="login_submit" value="Log-in"></td> </form> </tr> <? if(isset($HTTP_GET_VARS['login_message'])&&isset($HTTP_GET_VARS['login_failure'])&&($HTTP_GET_VARS['login_failure']==t rue)) { ?> <tr> <td colspan="7" align=center> <font color="red"> <? $message = $HTTP_GET_VARS['login_message']; if($message=="no_username") $output = "Please input a username."; else if($message=="no_password") $output = "Please input a password."; else if($message=="invalid") $output = "Invalid login."; else if($message=="db_failure") $output = "Database inaccessible at the moment. Please try again later."; else if($message=="already_set") $output = "Someone is currently logged-in."; else if($message=="not_allowed") $output = "You are not allowed to view that page."; echo($output); ?> </font> </td> </tr> <? } ?> </table> </div> <? } ?> </div> <? if($pagename!="main.php") { ?> <div id="upshadow" style="position: fixed; bottom: 50px; right: 0px;z-index:-5; "> <img src="../images/upmanilashadow.png"/> </div> <!--<div id="logo" style="width: 30%; position: absolute; top: 110px; left: 30px; zindex:-1;"> <img src="../images/eissiconshadow.gif"/> </div>--> <? } ?> <br><br> ...\eiss\script\utility_functions.php <? /* Get the HTTP Object function getHTTPObject(){ if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP"); else if (window.XMLHttpRequest) return new XMLHttpRequest(); else { alert("Your browser does not support AJAX."); return null; } }*/ /** * Converts a PHP array to a JavaScript array * * Takes a PHP array, and returns a string formated as a JavaScript array * that exactly matches the PHP array. * * @param array $phpArray The PHP array * @param string $jsArrayName The name for the JavaScript array * @return string */ function get_javascript_array($phpArray, $jsArrayName) { /* This produces the same result as the "&$html = ''" * in the function declaration was intended to, without * a parse error. */ static $html = ''; $html .= $jsArrayName . " = new Array(); \r\n "; foreach ($phpArray as $key => $value) { $outKey = (is_int($key)) ? '[' . $key . ']' : "['" . $key . "']"; if (is_array($value)) { /* Since $html is now a static variable, we no longer * need to pass it into the recursive calls. */ get_javascript_array($value, $jsArrayName . $outKey); continue; } $html .= $jsArrayName . $outKey . " = "; if (is_string($value)) $html .= "'" . $value . "'; \r\n "; else if ($value === false) $html .= "false; \r\n"; else if ($value === NULL) $html .= "null; \r\n"; else if ($value === true) $html .= "true; \r\n"; else $html .= $value . "; \r\n"; } return $html; } // Transform local data into global function transform_global($data) { foreach($data as $key => $value) { global $$key; $$key = $value; } } function filled_out($form_vars) { foreach($form_vars as $key => $value) { if(!isset($key)||($value=="")) return false; } return true; } /* * Function getClock returns a javascript code that generates the current date and time. * The date and time generator works only on Javascript enabled browsers. */ function getClock(){ ?> <p id="clock" align="right" class="panel"> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday") var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December") function getthedate(){ var mydate=new Date() var year=mydate.getYear() if (year < 1000) year+=1900 var day=mydate.getDay() var month=mydate.getMonth() var daym=mydate.getDate() if (daym<10) daym="0"+daym var hours=mydate.getHours() var minutes=mydate.getMinutes() var seconds=mydate.getSeconds() var dn="AM" if (hours>=12) dn="PM" if (hours>12){ hours=hours-12 } { d = new Date(); Time24H = new Date(); Time24H.setTime(d.getTime() + (d.getTimezoneOffset()*60000) + 3600000); InternetTime = Math.round((Time24H.getHours()*60+Time24H.getMinutes()) / 1.44); if (InternetTime < 10) InternetTime = '00'+InternetTime;

190

else if (InternetTime < 100) InternetTime = '0'+InternetTime; } if (hours==0) hours=12 if (minutes<=9) minutes="0"+minutes if (seconds<=9) seconds="0"+seconds //change font size here var cdate=dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn+"" if (document.all) document.all.clock.innerHTML=cdate else if (document.getElementById) document.getElementById("clock").innerHTML=cdate else document.write(cdate) } if (!document.all&&!document.getElementById) getthedate() function goforit(){ if (document.all||document.getElementById) setInterval("getthedate()",1000) } window.onload=goforit // End --> </script> <? } /* To avoid filename collisions, we have employed a 'filename' calculation procedure where you can append the date and time to the filename. This way, collisions will be avoided. Also works for folders. */ function hashFilename($filename) { $file = strtok($filename,"."); // gets everything before the ".", or the extension $ext = strtok(""); // gets the rest $date = date("mdYHis"); $hashfile = $file."-".$date; if(strcmp($filename,$file.".")!=0) { // checks if the real filename has a "." in the end if($ext) $hashfile = $hashfile.".".$ext; // if not, append extension if there is any } else $hashfile = $hashfile."."; return $hashfile; } /* End Filename collision procedures */ function displayVersion() { if($handle = @fopen("../script/version.txt", "r")) { if($contents = fread($handle, filesize("../script/version.txt"))) { fclose($handle); echo($contents); } } } function isEmail($email) { if(isset($email)&&trim($email)!=""){ if (eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[az]{2,3})$", $email)) return true; else return false; } else return false; } ?> ...\eiss\script\version.txt 1.0

...\eiss\styles\
...\eiss\styles\eiss_styles.css body { font-family: Verdana, Geneva, Arial, helvetica, sans-serif; font-size: 10px; color: black; } form { margin: 0; padding: 0; } hr {height: 1px; border: solid #333; border-width: 1px 0 0} input { font-family: Verdana, Geneva, Arial, helvetica, sans-serif; font-size: 10px; margin: 0px 0px 0px 10px; } .buttonClass { color: black; background: white; font: Verdana; border: 1px solid; padding:0 .1em; cursor:pointer; } .textfieldClass { font: Verdana; font-style: normal; text-decoration: none; border: 1px solid #000000; letter-spacing: normal; word-spacing: normal; } A:link { color:#FFA500; text-decoration: none; } A:visited { color:#555; bold; text-decoration: none; } A:active { color:#000; bold; text-decoration: none; } A:hover { color:#000; font-weight: bold; text-decoration: none; } textarea { font-family: Verdana, Geneva, Arial, helvetica, sansserif; font-size: 10px; } select { font-family: Verdana, Geneva, Arial, helvetica, sans-serif; font-size:10px; } /* Table */ table.general{ font: 8pt/16pt verdana; color: black; margin: 5px 10px 5px 10px; } td { font-family: Verdana, Geneva, Arial, helvetica, sans-serif; font-size: 10px; color: black; } th { font-family: Verdana, Geneva, Arial, helvetica, sans-serif; font-size: 12px; } TFOOT { color: black; } ...\eiss\styles\index.php <? header("Location: ../index.php"); ?>

191

...\eiss\table\
...\eiss\table\table.css table.content th { background-color:#999; color:#FFFFFF; } /* Striping */ table.content tr.alternate { backgroundcolor:#ffffcc; } /* Sorting */ table.content th.table-sortable { cursor:pointer; background-image:url("sortable.gif"); background-position:center left; background-repeat:no-repeat; padding-left:12px; } table.content th.table-sorted-asc { background-image:url("sorted_up.gif"); background-position:center left; background-repeat:no-repeat; } table.content th.tablesorted-desc { background-image:url("sorted_down.gif"); background-position:center left; background-repeat:no-repeat; } table.content th.table-filtered { background-image:url("filter.gif"); background-position:center left; background-repeat:no-repeat; } table.content select.table-autofilter { font-size:smaller; } /* Examples which stray from the default */ table.altstripe tr.alternate2 { background-color:#ccffff; } ...\eiss\table\table.js /** * Copyright (c)2005-2008 Matt Kruse (javascripttoolbox.com) * * Dual licensed under the MIT and GPL licenses. * This basically means you can use this code however you want for * free, but don't claim to have written it yourself! * Donations always accepted: http://www.JavascriptToolbox.com/donate/ * * Please do not link to the .js files on javascripttoolbox.com from * your site. Copy the files locally to your server instead. * */ /** * Table.js * Functions for interactive Tables * * Copyright (c) 2007 Matt Kruse (javascripttoolbox.com) * Dual licensed under the MIT and GPL licenses. * * @version 0.981 * * @history 0.981 2007-03-19 Added Sort.numeric_comma, additional date parsing formats * @history 0.980 2007-03-18 Release new BETA release pending some testing. Todo: Additional docs, examples, plus jQuery plugin. * @history 0.959 2007-03-05 Added more "auto" functionality, couple bug fixes * @history 0.958 2007-02-28 Added auto functionality based on class names * @history 0.957 2007-02-21 Speed increases, more code cleanup, added Auto Sort functionality * @history 0.956 2007-02-16 Cleaned up the code and added Auto Filter functionality. * @history 0.950 2006-11-15 First BETA release. * * @todo Add more date format parsers * @todo Add style classes to colgroup tags after sorting/filtering in case the user wants to highlight the whole column * @todo Correct for colspans in data rows (this may slow it down) * @todo Fix for IE losing form control values after sort? */ /** * Sort Functions */ var Sort = (function(){ var sort = {}; // Default alpha-numeric sort // ------------------------- sort.alphanumeric = function(a,b) { return (a==b)?0:(a<b)?-1:1; }; sort['default'] = sort.alphanumeric; // IE chokes on sort.default // This conversion is generalized to work for either a decimal separator of , or . sort.numeric_converter = function(separator) { return function(val) { if (typeof(val)=="string") { val = parseFloat(val.replace(/^[^\d\.]*([\d., ]+).*/g,"$1").replace(new RegExp("[^\\\d"+separator+"]","g"),'').replace(/,/,'.')) || 0; } return val || 0; }; }; // Numeric Sort // ------------ sort.numeric = function(a,b) { return sort.numeric.convert(a)-sort.numeric.convert(b); }; sort.numeric.convert = sort.numeric_converter("."); // Numeric Sort - comma decimal separator // -------------------------------------- sort.numeric_comma = function(a,b) { return sort.numeric_comma.convert(a)-sort.numeric_comma.convert(b); }; sort.numeric_comma.convert = sort.numeric_converter(","); // Case-insensitive Sort // --------------------- sort.ignorecase = function(a,b) { return sort.alphanumeric(sort.ignorecase.convert(a),sort.ignorecase.convert(b)); }; sort.ignorecase.convert = function(val) { if (val==null) { return ""; } return (""+val).toLowerCase(); }; // Currency Sort // ------------- sort.currency = sort.numeric; // Just treat it as numeric! sort.currency_comma = sort.numeric_comma; // Date sort // --------- sort.date = function(a,b) { return sort.numeric(sort.date.convert(a),sort.date.convert(b)); }; // Convert 2-digit years to 4 sort.date.fixYear=function(yr) { yr = +yr; if (yr<50) { yr += 2000; } else if (yr<100) { yr += 1900; } return yr; }; sort.date.formats = [ // YY[YY]-MM-DD { re:/(\d{2,4})-(\d{1,2})-(\d{1,2})/ , f:function(x){ return (new Date(sort.date.fixYear(x[1]),+x[2],+x[3])).getTime(); } } // MM/DD/YY[YY] or MM-DD-YY[YY] ,{ re:/(\d{1,2})[\/-](\d{1,2})[\/-](\d{2,4})/ , f:function(x){ return (new Date(sort.date.fixYear(x[3]),+x[1],+x[2])).getTime(); } } // Any catch-all format that new Date() can handle. This is not reliable except for long formats, for example: 31 Jan 2000 01:23:45 GMT ,{ re:/(.*\d{4}.*\d+:\d+\d+.*)/, f:function(x){ var d=new Date(x[1]); if(d){return d.getTime();} } } ]; sort.date.convert = function(val) { var m,v, f = sort.date.formats; for (var i=0,L=f.length; i<L; i++) { if (m=val.match(f[i].re)) { v=f[i].f(m); if (typeof(v)!="undefined") { return v; } } } return 9999999999999; // So non-parsed dates will be last, not first }; return sort; })(); /** * The main Table namespace */ var Table = (function(){ /** * Determine if a reference is defined */ function def(o) {return (typeof o!="undefined");}; /** * Determine if an object or class string contains a given class. */ function hasClass(o,name) { return new RegExp("(^|\\s)"+name+"(\\s|$)").test(o.className); }; /** * Add a class to an object */ function addClass(o,name) { var c = o.className || ""; if (def(c) && !hasClass(o,name)) { o.className += (c?" ":"") + name; } }; /** * Remove a class from an object */ function removeClass(o,name) { var c = o.className || ""; o.className = c.replace(new RegExp("(^|\\s)"+name+"(\\s|$)"),"$1"); }; /** * For classes that match a given substring, return the rest */ function classValue(o,prefix) { var c = o.className; if (c.match(new RegExp("(^|\\s)"+prefix+"([^ ]+)"))) { return RegExp.$2; } return null; }; /** * Return true if an object is hidden. * This uses the "russian doll" technique to unwrap itself to the most efficient * function after the first pass. This avoids repeated feature detection that * would always fall into the same block of code. */ function isHidden(o) { if (window.getComputedStyle) { var cs = window.getComputedStyle; return (isHidden = function(o) { return 'none'==cs(o,null).getPropertyValue('display'); })(o); } else if (window.currentStyle) { return(isHidden = function(o) { return 'none'==o.currentStyle['display']; })(o); } return (isHidden = function(o) { return 'none'==o.style['display']; })(o); }; /** * Get a parent element by tag name, or the original element if it is of the tag type */ function getParent(o,a,b) { if (o!=null && o.nodeName) { if (o.nodeName==a || (b && o.nodeName==b)) { return o; } while (o=o.parentNode) { if (o.nodeName && (o.nodeName==a || (b && o.nodeName==b))) { return o; } } } return null; }; /** * Utility function to copy properties from one object to another */ function copy(o1,o2) { for (var i=2;i<arguments.length; i++) { var a = arguments[i]; if (def(o1[a])) { o2[a] = o1[a]; } } } // The table object itself var table = { //Class names used in the code AutoStripeClassName:"table-autostripe", StripeClassNamePrefix:"tablestripeclass:", AutoSortClassName:"table-autosort", AutoSortColumnPrefix:"table-autosort:", AutoSortTitle:"Click to sort", SortedAscendingClassName:"table-sorted-asc", SortedDescendingClassName:"table-sorted-desc", SortableClassName:"table-

192

sortable", SortableColumnPrefix:"table-sortable:", NoSortClassName:"table-nosort", AutoFilterClassName:"table-autofilter", FilteredClassName:"table-filtered", FilterableClassName:"table-filterable", FilteredRowcountPrefix:"table-filtered-rowcount:", RowcountPrefix:"table-rowcount:", FilterAllLabel:"Filter: All", AutoPageSizePrefix:"table-autopage:", AutoPageJumpPrefix:"table-page:", PageNumberPrefix:"table-page-number:", PageCountPrefix:"table-page-count:" }; /** * A place to store misc table information, rather than in the table objects themselves */ table.tabledata = {}; /** * Resolve a table given an element reference, and make sure it has a unique ID */ table.uniqueId=1; table.resolve = function(o,args) { if (o!=null && o.nodeName && o.nodeName!="TABLE") { o = getParent(o,"TABLE"); } if (o==null) { return null; } if (!o.id) { var id = null; do { var id = "TABLE_"+(table.uniqueId++); } while (document.getElementById(id)!=null); o.id = id; } this.tabledata[o.id] = this.tabledata[o.id] || {}; if (args) { copy(args,this.tabledata[o.id],"stripeclass","ignorehiddenrows","useinnertext","sorttype","col","desc","page","pagesize"); } return o; }; /** * Run a function against each cell in a table header or footer, usually * to add or remove css classes based on sorting, filtering, etc. */ table.processTableCells = function(t, type, func, arg) { t = this.resolve(t); if (t==null) { return; } if (type!="TFOOT") { this.processCells(t.tHead, func, arg); } if (type!="THEAD") { this.processCells(t.tFoot, func, arg); } }; /** * Internal method used to process an arbitrary collection of cells. * Referenced by processTableCells. * It's done this way to avoid getElementsByTagName() which would also return nested table cells. */ table.processCells = function(section,func,arg) { if (section!=null) { if (section.rows && section.rows.length && section.rows.length>0) { var rows = section.rows; for (var j=0,L2=rows.length; j<L2; j++) { var row = rows[j]; if (row.cells && row.cells.length && row.cells.length>0) { var cells = row.cells; for (var k=0,L3=cells.length; k<L3; k++) { var cellsK = cells[k]; func.call(this,cellsK,arg); } } } } } }; /** * Get the cellIndex value for a cell. This is only needed because of a Safari * bug that causes cellIndex to exist but always be 0. * Rather than feature-detecting each time it is called, the function will * re-write itself the first time it is called. */ table.getCellIndex = function(td) { var tr = td.parentNode; var cells = tr.cells; if (cells && cells.length) { if (cells.length>1 && cells[cells.length-1].cellIndex>0) { // Define the new function, overwrite the one we're running now, and then run the new one (this.getCellIndex = function(td) { return td.cellIndex; })(td); } // Safari will always go through this slower block every time. Oh well. for (var i=0,L=cells.length; i<L; i++) { if (tr.cells[i]==td) { return i; } } } return 0; }; /** * A map of node names and how to convert them into their "value" for sorting, filtering, etc. * These are put here so it is extensible. */ table.nodeValue = { 'INPUT':function(node) { if (def(node.value) && node.type && ((node.type!="checkbox" && node.type!="radio") || node.checked)) { return node.value; } return ""; }, 'SELECT':function(node) { if (node.selectedIndex>=0 && node.options) { // Sort select elements by the visible text return node.options[node.selectedIndex].text; } return ""; }, 'IMG':function(node) { return node.name || ""; } }; /** * Get the text value of a cell. Only use innerText if explicitly told to, because * otherwise we want to be able to handle sorting on inputs and other types */ table.getCellValue = function(td,useInnerText) { if (useInnerText && def(td.innerText)) { return td.innerText; } if (!td.childNodes) { return ""; } var childNodes=td.childNodes; var ret = ""; for (var i=0,L=childNodes.length; i<L; i++) { var node = childNodes[i]; var type = node.nodeType; // In order to get realistic sort results, we need to treat some elements in a special way. // These behaviors are defined in the nodeValue() object, keyed by node name if (type==1) { var nname = node.nodeName; if (this.nodeValue[nname]) { ret += this.nodeValue[nname](node); } else { ret += this.getCellValue(node); } } else if (type==3) { if (def(node.innerText)) { ret += node.innerText; } else if (def(node.nodeValue)) { ret += node.nodeValue; } } } return ret; }; /** * Consider colspan and rowspan values in table header cells to calculate the actual cellIndex * of a given cell. This is necessary because if the first cell in row 0 has a rowspan of 2, * then the first cell in row 1 will have a cellIndex of 0 rather than 1, even though it really * starts in the second column rather than the first. * See: http://www.javascripttoolbox.com/temp/table_cellindex.html */ table.tableHeaderIndexes = {}; table.getActualCellIndex = function(tableCellObj) { if (!def(tableCellObj.cellIndex)) { return null; } var tableObj = getParent(tableCellObj,"TABLE"); var cellCoordinates = tableCellObj.parentNode.rowIndex+"-"+this.getCellIndex(tableCellObj); // If it has already been computed, return the answer from the lookup table if (def(this.tableHeaderIndexes[tableObj.id])) { return this.tableHeaderIndexes[tableObj.id][cellCoordinates]; } var matrix = []; this.tableHeaderIndexes[tableObj.id] = {}; var thead = getParent(tableCellObj,"THEAD"); var trs = thead.getElementsByTagName('TR'); // Loop thru every tr and every cell in the tr, building up a 2-d array "grid" that gets // populated with an "x" for each space that a cell takes up. If the first cell is colspan // 2, it will fill in values [0] and [1] in the first array, so that the second cell will // find the first empty cell in the first row (which will be [2]) and know that this is // where it sits, rather than its internal .cellIndex value of [1]. for (var i=0; i<trs.length; i++) { var cells = trs[i].cells; for (var j=0; j<cells.length; j++) { var c = cells[j]; var rowIndex = c.parentNode.rowIndex; var cellId = rowIndex+"-"+this.getCellIndex(c); var rowSpan = c.rowSpan || 1; var colSpan = c.colSpan || 1; var firstAvailCol; if(!def(matrix[rowIndex])) { matrix[rowIndex] = []; } var m = matrix[rowIndex]; // Find first available column in the first row for (var k=0; k<m.length+1; k++) { if (!def(m[k])) { firstAvailCol = k; break; } } this.tableHeaderIndexes[tableObj.id][cellId] = firstAvailCol; for (var k=rowIndex; k<rowIndex+rowSpan; k++) { if(!def(matrix[k])) { matrix[k] = []; } var matrixrow = matrix[k]; for (var l=firstAvailCol; l<firstAvailCol+colSpan; l++) { matrixrow[l] = "x"; } } } } // Store the map so future lookups are fast. return this.tableHeaderIndexes[tableObj.id][cellCoordinates]; }; /** * Sort all rows in each TBODY (tbodies are sorted independent of each other) */ table.sort = function(o,args) { var t, tdata, sortconvert=null; // Allow for a simple passing of sort type as second parameter if (typeof(args)=="function") { args={sorttype:args}; } args = args || {}; // If no col is specified, deduce it from the object sent in if (!def(args.col)) { args.col = this.getActualCellIndex(o) || 0; } // If no sort type is specified, default to the default sort args.sorttype = args.sorttype || Sort['default']; // Resolve the table t = this.resolve(o,args); tdata = this.tabledata[t.id]; // If we are sorting on the same column as last time, flip the sort direction if (def(tdata.lastcol) && tdata.lastcol==tdata.col && def(tdata.lastdesc)) { tdata.desc = !tdata.lastdesc; } else { tdata.desc = !!args.desc; } // Store the last sorted column so clicking again will reverse the sort order tdata.lastcol=tdata.col; tdata.lastdesc=!!tdata.desc; // If a sort conversion function exists, pre-convert cell values and then use a plain alphanumeric sort var sorttype = tdata.sorttype; if (typeof(sorttype.convert)=="function") { sortconvert=tdata.sorttype.convert; sorttype=Sort.alphanumeric; } // Loop through all THEADs and remove sorted class names, then re-add them for the col // that is being sorted this.processTableCells(t,"THEAD", function(cell) { if (hasClass(cell,this.SortableClassName)) { removeClass(cell,this.SortedAscendingClassName); removeClass(cell,this.SortedDescendingClassName); // If the computed colIndex of the cell equals the sorted colIndex, flag it as sorted if (tdata.col==table.getActualCellIndex(cell) &&

193

(classValue(cell,table.SortableClassName))) { addClass(cell,tdata.desc?this.SortedAscendingClassName:this.SortedDescendingClassName); } } } ); // Sort each tbody independently var bodies = t.tBodies; if (bodies==null || bodies.length==0) { return; } // Define a new sort function to be called to consider descending or not var newSortFunc = (tdata.desc)? function(a,b){return sorttype(b[0],a[0]);} :function(a,b){return sorttype(a[0],b[0]);}; var useinnertext=!!tdata.useinnertext; var col = tdata.col; for (var i=0,L=bodies.length; i<L; i++) { var tb = bodies[i], tbrows = tb.rows, rows = []; // Allow tbodies to request that they not be sorted if(!hasClass(tb,table.NoSortClassName)) { // Create a separate array which will store the converted values and refs to the // actual rows. This is the array that will be sorted. var cRow, cRowIndex=0; if (cRow=tbrows[cRowIndex]){ // Funky loop style because it's considerably faster in IE do { if (rowCells = cRow.cells) { var cellValue = (col<rowCells.length)?this.getCellValue(rowCells[col],useinnertext):null; if (sortconvert) cellValue = sortconvert(cellValue); rows[cRowIndex] = [cellValue,tbrows[cRowIndex]]; } } while (cRow=tbrows[++cRowIndex]) } // Do the actual sorting rows.sort(newSortFunc); // Move the rows to the correctly sorted order. Appending an existing DOM object just moves it! cRowIndex=0; var displayedCount=0; var f=[removeClass,addClass]; if (cRow=rows[cRowIndex]){ do { tb.appendChild(cRow[1]); } while (cRow=rows[++cRowIndex]) } } } // If paging is enabled on the table, then we need to re-page because the order of rows has changed! if (tdata.pagesize) { this.page(t); // This will internally do the striping } else { // Re-stripe if a class name was supplied if (tdata.stripeclass) { this.stripe(t,tdata.stripeclass,!!tdata.ignorehiddenrows); } } }; /** * Apply a filter to rows in a table and hide those that do not match. */ table.filter = function(o,filters,args) { var cell; args = args || {}; var t = this.resolve(o,args); var tdata = this.tabledata[t.id]; // If new filters were passed in, apply them to the table's list of filters if (!filters) { // If a null or blank value was sent in for 'filters' then that means reset the table to no filters tdata.filters = null; } else { // Allow for passing a select list in as the filter, since this is common design if (filters.nodeName=="SELECT" && filters.type=="select-one" && filters.selectedIndex>-1) { filters={ 'filter':filters.options[filters.selectedIndex].value }; } // Also allow for a regular input if (filters.nodeName=="INPUT" && filters.type=="text") { filters={ 'filter':"/^"+filters.value+"/" }; } // Force filters to be an array if (typeof(filters)=="object" && !filters.length) { filters = [filters]; } // Convert regular expression strings to RegExp objects and function strings to function objects for (var i=0,L=filters.length; i<L; i++) { var filter = filters[i]; if (typeof(filter.filter)=="string") { // If a filter string is like "/expr/" then turn it into a Regex if (filter.filter.match(/^\/(.*)\/$/)) { filter.filter = new RegExp(RegExp.$1); filter.filter.regex=true; } // If filter string is like "function (x) { ... }" then turn it into a function else if (filter.filter.match(/^function\s*\(([^\)]*)\)\s*\{(.*)}\s*$/)) { filter.filter = Function(RegExp.$1,RegExp.$2); } } // If some non-table object was passed in rather than a 'col' value, resolve it // and assign it's column index to the filter if it doesn't have one. This way, // passing in a cell reference or a select object etc instead of a table object // will automatically set the correct column to filter. if (filter && !def(filter.col) && (cell=getParent(o,"TD","TH"))) { filter.col = this.getCellIndex(cell); } // Apply the passed-in filters to the existing list of filters for the table, removing those that have a filter of null or "" if ((!filter || !filter.filter) && tdata.filters) { delete tdata.filters[filter.col]; } else { tdata.filters = tdata.filters || {}; tdata.filters[filter.col] = filter.filter; } } // If no more filters are left, then make sure to empty out the filters object for (var j in tdata.filters) { var keep = true; } if (!keep) { tdata.filters = null; } } // Everything's been setup, so now scrape the table rows return table.scrape(o); }; /** * "Page" a table by showing only a subset of the rows */ table.page = function(t,page,args) { args = args || {}; if (def(page)) { args.page = page; } return table.scrape(t,args); }; /** * Jump forward or back any number of pages */ table.pageJump = function(t,count,args) { t = this.resolve(t,args); return this.page(t,(table.tabledata[t.id].page||0)+count,args); }; /** * Go to the next page of a paged table */ table.pageNext = function(t,args) { return this.pageJump(t,1,args); }; /** * Go to the previous page of a paged table */ table.pagePrevious = function(t,args) { return this.pageJump(t,-1,args); }; /** * Scrape a table to either hide or show each row based on filters and paging */ table.scrape = function(o,args) { var col,cell,filterList,filterReset=false,filter; var page,pagesize,pagestart,pageend; var unfilteredrows=[],unfilteredrowcount=0,totalrows=0; var t,tdata,row,hideRow; args = args || {}; // Resolve the table object t = this.resolve(o,args); tdata = this.tabledata[t.id]; // Setup for Paging var page = tdata.page; if (def(page)) { // Don't let the page go before the beginning if (page<0) { tdata.page=page=0; } pagesize = tdata.pagesize || 25; // 25=arbitrary default pagestart = page*pagesize+1; pageend = pagestart + pagesize - 1; } // Scrape each row of each tbody var bodies = t.tBodies; if (bodies==null || bodies.length==0) { return; } for (var i=0,L=bodies.length; i<L; i++) { var tb = bodies[i]; for (var j=0,L2=tb.rows.length; j<L2; j++) { row = tb.rows[j]; hideRow = false; // Test if filters will hide the row if (tdata.filters && row.cells) { var cells = row.cells; var cellsLength = cells.length; // Test each filter for (col in tdata.filters) { if (!hideRow) { filter = tdata.filters[col]; if (filter && col<cellsLength) { var val = this.getCellValue(cells[col]); if (filter.regex && val.search) { hideRow=(val.search(filter)<0); } else if (typeof(filter)=="function") { hideRow=!filter(val,cells[col]); } else { hideRow = (val!=filter); } } } } } // Keep track of the total rows scanned and the total runs _not_ filtered out totalrows++; if (!hideRow) { unfilteredrowcount++; if (def(page)) { // Temporarily keep an array of unfiltered rows in case the page we're on goes past // the last page and we need to back up. Don't want to filter again! unfilteredrows.push(row); if (unfilteredrowcount<pagestart || unfilteredrowcount>pageend) { hideRow = true; } } } row.style.display = hideRow?"none":""; } } if (def(page)) { // Check to see if filtering has put us past the requested page index. If it has, // then go back to the last page and show it. if (pagestart>=unfilteredrowcount) { pagestart = unfilteredrowcount-(unfilteredrowcount%pagesize); tdata.page = page = pagestart/pagesize; for (var i=pagestart,L=unfilteredrows.length; i<L; i++) { unfilteredrows[i].style.display=""; } } } // Loop through all THEADs and add/remove filtered class names this.processTableCells(t,"THEAD", function(c) { ((tdata.filters && def(tdata.filters[table.getCellIndex(c)]) && hasClass(c,table.FilterableClassName))?addClass:removeClass)(c,table.FilteredClassName); } ); // Stripe the table if necessary if (tdata.stripeclass) { this.stripe(t); } // Calculate some values to be returned for info and updating purposes var pagecount = Math.floor(unfilteredrowcount/pagesize)+1; if (def(page)) { // Update the page number/total containers if they exist if (tdata.container_number) { tdata.container_number.innerHTML = page+1; } if (tdata.container_count) { tdata.container_count.innerHTML = pagecount; } } // Update the row count containers if they exist if (tdata.container_filtered_count) { tdata.container_filtered_count.innerHTML = unfilteredrowcount; } if (tdata.container_all_count) { tdata.container_all_count.innerHTML = totalrows; } return { 'data':tdata, 'unfilteredcount':unfilteredrowcount, 'total':totalrows, 'pagecount':pagecount, 'page':page, 'pagesize':pagesize }; }; /** *

194

Shade alternate rows, aka Stripe the table. */ table.stripe = function(t,className,args) { args = args || {}; args.stripeclass = className; t = this.resolve(t,args); var tdata = this.tabledata[t.id]; var bodies = t.tBodies; if (bodies==null || bodies.length==0) { return; } className = tdata.stripeclass; // Cache a shorter, quicker reference to either the remove or add class methods var f=[removeClass,addClass]; for (var i=0,L=bodies.length; i<L; i++) { var tb = bodies[i], tbrows = tb.rows, cRowIndex=0, cRow, displayedCount=0; if (cRow=tbrows[cRowIndex]){ // The ignorehiddenrows test is pulled out of the loop for a slight speed increase. // Makes a bigger difference in FF than in IE. // In this case, speed always wins over brevity! if (tdata.ignoreHiddenRows) { do { f[displayedCount++%2](cRow,className); } while (cRow=tbrows[++cRowIndex]) } else { do { if (!isHidden(cRow)) { f[displayedCount++%2](cRow,className); } } while (cRow=tbrows[++cRowIndex]) } } } }; /** * Build up a list of unique values in a table column */ table.getUniqueColValues = function(t,col) { var values={}, bodies = this.resolve(t).tBodies; for (var i=0,L=bodies.length; i<L; i++) { var tbody = bodies[i]; for (var r=0,L2=tbody.rows.length; r<L2; r++) { values[this.getCellValue(tbody.rows[r].cells[col])] = true; } } var valArray = []; for (var val in values) { valArray.push(val); } return valArray.sort(); }; /** * Scan the document on load and add sorting, filtering, paging etc ability automatically * based on existence of class names on the table and cells. */ table.auto = function(args) { var cells = [], tables = document.getElementsByTagName("TABLE"); var val,tdata; if (tables!=null) { for (var i=0,L=tables.length; i<L; i++) { var t = table.resolve(tables[i]); tdata = table.tabledata[t.id]; if (val=classValue(t,table.StripeClassNamePrefix)) { tdata.stripeclass=val; } // Do auto-filter if necessary if (hasClass(t,table.AutoFilterClassName)) { table.autofilter(t); } // Do auto-page if necessary if (val = classValue(t,table.AutoPageSizePrefix)) { table.autopage(t,{'pagesize':+val}); } // Do auto-sort if necessary if ((val = classValue(t,table.AutoSortColumnPrefix)) || (hasClass(t,table.AutoSortClassName))) { table.autosort(t,{'col':(val==null)?null:+val}); } // Do auto-stripe if necessary if (tdata.stripeclass && hasClass(t,table.AutoStripeClassName)) { table.stripe(t); } } } }; /** * Add sorting functionality to a table header cell */ table.autosort = function(t,args) { t = this.resolve(t,args); var tdata = this.tabledata[t.id]; this.processTableCells(t, "THEAD", function(c) { var type = classValue(c,table.SortableColumnPrefix); if (type!=null) { type = type || "default"; c.title =c.title || table.AutoSortTitle; addClass(c,table.SortableClassName); c.onclick = Function("","Table.sort(this,{'sorttype':Sort['"+type+"']})"); // If we are going to auto sort on a column, we need to keep track of what kind of sort it will be if (args.col!=null) { if (args.col==table.getActualCellIndex(c)) { tdata.sorttype=Sort['"+type+"']; } } } } ); if (args.col!=null) { table.sort(t,args); } }; /** * Add paging functionality to a table */ table.autopage = function(t,args) { t = this.resolve(t,args); var tdata = this.tabledata[t.id]; if (tdata.pagesize) { this.processTableCells(t, "THEAD,TFOOT", function(c) { var type = classValue(c,table.AutoPageJumpPrefix); if (type=="next") { type = 1; } else if (type=="previous") { type = -1; } if (type!=null) { c.onclick = Function("","Table.pageJump(this,"+type+")"); } } ); if (val = classValue(t,table.PageNumberPrefix)) { tdata.container_number = document.getElementById(val); } if (val = classValue(t,table.PageCountPrefix)) { tdata.container_count = document.getElementById(val); } return table.page(t,0,args); } }; /** * A util function to cancel bubbling of clicks on filter dropdowns */ table.cancelBubble = function(e) { e = e || window.event; if (typeof(e.stopPropagation)=="function") { e.stopPropagation(); } if (def(e.cancelBubble)) { e.cancelBubble = true; } }; /** * Auto-filter a table */ table.autofilter = function(t,args) { args = args || {}; t = this.resolve(t,args); var tdata = this.tabledata[t.id],val; table.processTableCells(t, "THEAD", function(cell) { if (hasClass(cell,table.FilterableClassName)) { var cellIndex = table.getCellIndex(cell); var colValues = table.getUniqueColValues(t,cellIndex); if (colValues.length>0) { if (typeof(args.insert)=="function") { func.insert(cell,colValues); } else { var sel = '<select onchange="Table.filter(this,this)" onclick="Table.cancelBubble(event)" class="'+table.AutoFilterClassName+'"><option value="">'+table.FilterAllLabel+'</option>'; for (var i=0; i<colValues.length; i++) { sel += '<option value="'+colValues[i]+'">'+colValues[i]+'</option>'; } sel += '</select>'; cell.innerHTML += "<br>"+sel; } } } }); if (val = classValue(t,table.FilteredRowcountPrefix)) { tdata.container_filtered_count = document.getElementById(val); } if (val = classValue(t,table.RowcountPrefix)) { tdata.container_all_count = document.getElementById(val); } }; /** * Attach the auto event so it happens on load. * use jQuery's ready() function if available */ if (typeof(jQuery)!="undefined") { jQuery(table.auto); } else if (window.addEventListener) { window.addEventListener( "load", table.auto, false ); } else if (window.attachEvent) { window.attachEvent( "onload", table.auto ); } return table; })();

195

SQL Dump
# phpMyAdmin MySQL-Dump # version 2.3.2 # http://www.phpmyadmin.net/ (download page) # # Host: localhost # Generation Time: Oct 19, 2009 at 01:15 PM # Server version: 4.00.00 # PHP Version: 4.2.3 # Database : `eiss_db` # ------------------------------------------------------# # Table structure for table `accounts` # DROP TABLE IF EXISTS `accounts`; CREATE TABLE `accounts` ( `username` varchar(100) NOT NULL default '', `password` varchar(100) NOT NULL default '', `title` varchar(100) NOT NULL default '', `first_name` varchar(100) NOT NULL default '', `middle_name` varchar(100) NOT NULL default '', `last_name` varchar(100) NOT NULL default '', `gender` enum('male','female') NOT NULL default 'male', `email` varchar(100) NOT NULL default '', `usertype` enum('sysad','pathologist','epidemiologist','geographer') NOT NULL default 'sysad', PRIMARY KEY (`username`) ) TYPE=MyISAM; # # Dumping data for table `accounts` # INSERT INTO `accounts` (`username`, `password`, `title`, `first_name`, `middle_name`, `last_name`, `gender`, `email`, `usertype`) VALUES ('admin', '43e9a4ab75570f5b', 'Mr.', 'James Matthew', 'Tutor', 'Miraflor', 'male', 'james@yahoo.com', 'sysad'), ('melba', '69d3bf4b0afb6107', 'Ms.', 'Melba', 'Verra', 'Tutor', 'female', 'emeraldian16@yahoo.com', 'epidemiologist'), ('magboo', '2e9d6f930b4943c9', 'Dr.', 'Vincent Peter', '', 'Magboo', 'male', 'petermagboo@yahoo.com', 'epidemiologist'), ('yano', '28afc45d74d12aa5', 'Gen.', 'Alexander', '', 'Yano', 'male', 'alex@afp.gov.ph', 'geographer'), ('dayrit', '4acddcdf26f6bb77', 'Sec.', 'Manuel', 'Reyes', 'Dayrit', 'male', 'dayrit@doh.gov.ph', 'pathologist'), ('bello', '019a92040c5fa717', 'Rep.', 'Walden', '', 'Bello', 'male', 'walden@fdc.ph', 'geographer'); # ------------------------------------------------------# # Table structure for table `adjacency` # DROP TABLE IF EXISTS `adjacency`; CREATE TABLE `adjacency` ( `g_unit1` int(11) NOT NULL default '0', `g_unit2` int(11) NOT NULL default '0', PRIMARY KEY (`g_unit1`,`g_unit2`) ) TYPE=MyISAM; # # Dumping data for table `adjacency` # INSERT INTO `adjacency` (`g_unit1`, `g_unit2`) VALUES (13, 20), (13, 22), (13, 100), (14, 16), (14, 18), (14, 21), (14, 26), (14, 29), (14, 42), (15, 17), (15, 18), (15, 23), (15, 24), (15, 25), (15, 28), (16, 14), (16, 21), (16, 29), (16, 44), (17, 15), (17, 18), (17, 24), (17, 26), (17, 27), (18, 14), (18, 15), (18, 17), (18, 21), (18, 23), (18, 26), (18, 27), (19, 24), (19, 26), (19, 55), (19, 58), (20, 13), (20, 22), (20, 28), (20, 93), (20, 100), (20, 103), (21, 14), (21, 16), (21, 18), (21, 44), (22, 13), (22, 20), (22, 23), (22, 28), (23, 15), (23, 18), (23, 22), (23, 28), (24, 15), (24, 17), (24, 19), (24, 25), (24, 26), (24, 28), (24, 58), (25, 15), (25, 24), (25, 28), (26, 14), (26, 17), (26, 18), (26, 19), (26, 24), (26, 27), (26, 29), (26, 50), (26, 63), (26, 64), (27, 17), (27, 18), (27, 26), (28, 15), (28, 20), (28, 22), (28, 23), (28, 24), (28, 25), (28, 58), (28, 66), (29, 14), (29, 16), (29, 26), (29, 42), (29, 44), (30, 35), (30, 37), (30, 43), (30, 45), (30, 52), (30, 53), (31, 33), (31, 34), (31, 38), (31, 45), (31, 47), (31, 53), (32, 35), (32, 47), (32, 48), (32, 52), (33, 31), (33, 34), (33, 41), (33, 42), (33, 53), (34, 31), (34, 33), (34, 38), (34, 40), (34, 42), (34, 44), (35, 30), (35, 32), (35, 45), (35, 47), (35, 52), (36, 39), (36, 40), (36, 46), (36, 47), (36, 48), (37, 30), (37, 43), (37, 49), (37, 51), (37, 52), (38, 31), (38, 34), (38, 40), (38, 47), (39, 36), (39, 46), (40, 34), (40, 36), (40, 38), (40, 46), (40, 47), (41, 33), (41, 42), (41, 50), (41, 53), (42, 14), (42, 29), (42, 33), (42, 34), (42, 41), (42, 44), (43, 30), (43, 37), (43, 50), (43, 53), (43, 63), (44, 16), (44, 21), (44, 29), (44, 34), (44, 42), (45, 30), (45, 31), (45, 35), (45, 47), (45, 53), (46, 36), (46, 39), (46, 40), (47, 31), (47, 32), (47, 35), (47, 36), (47, 38), (47, 40), (47, 45), (47, 48), (48, 32), (48, 36), (48, 47), (49, 37), (49, 51), (49, 52), (50, 26), (50, 41), (50, 43), (50, 53), (50, 63), (51, 37), (51, 49), (52, 30), (52, 32), (52, 35), (52, 37), (52, 49), (53, 30), (53, 31), (53, 33), (53, 41), (53, 43), (53, 45), (53, 50), (54, 55), (54, 57), (54, 66), (54, 67), (55, 19), (55, 54), (55, 58), (55, 63), (55, 64), (55, 65), (55, 66), (55, 67), (56, 61), (56, 65), (57, 54), (57, 59), (57, 61), (57, 67), (58, 19), (58, 24), (58, 28), (58, 55), (58, 64), (58, 66), (59, 57), (59, 61), (60, 62), (60, 89), (61, 56), (61, 57), (61, 59), (61, 65), (61, 67), (62, 60), (62, 65), (62, 89), (62, 95), (63, 26), (63, 43), (63, 50), (63, 55), (63, 64), (64, 26), (64, 55), (64, 58), (64, 63), (65, 55), (65, 56), (65, 61), (65, 62), (65, 67), (65, 95), (66, 28), (66, 54), (66, 55), (66, 58), (67, 54), (67, 55), (67, 57), (67, 61), (67, 65), (68, 74), (68, 80), (68, 115), (68, 116), (69, 71), (69, 75), (69, 92), (70, 73), (70, 74), (70, 115), (71, 69), (71, 72), (71, 75), (72, 71), (72, 75), (72, 80), (73, 70), (73, 93), (73, 101), (73, 115), (73, 120), (74, 68), (74, 70), (74, 115), (75, 69), (75, 71), (75, 72), (75, 86), (75, 92), (75, 97), (76, 81), (76, 82), (76, 88), (77, 83), (77, 95), (77, 96), (78, 82), (78, 87), (79, 84), (79, 85), (79, 86), (80, 68), (80, 72), (81, 76), (81, 84), (81, 85), (81, 88), (82, 76), (82, 78), (82, 88), (82, 94), (83, 62), (83, 77), (83, 95), (84, 79), (84, 81), (84, 85), (84, 86), (84, 88), (84, 91), (84, 94), (85, 79), (85, 81), (85, 84), (85, 88), (86, 75), (86, 79), (86, 84), (86, 91), (86, 92), (86, 94), (86, 97), (87, 78), (87, 89), (88, 76), (88, 81), (88, 82), (88, 84), (88, 85), (88, 94), (89, 60), (89, 62), (89, 83), (89, 87), (89, 90), (90, 83), (90, 89), (90, 96), (91, 84), (91, 86), (91, 94), (91, 97), (92, 69), (92, 75), (92, 86), (93, 20), (93, 73), (93, 103), (93, 120), (94, 82), (94, 84), (94, 86), (94, 88), (94, 91), (95, 62), (95, 65), (95, 77), (95, 83), (96, 77), (96, 90), (97, 75), (97, 86), (97, 91), (98, 104), (98, 107), (98, 109), (98, 110), (98, 111), (99, 105), (99, 107), (99, 115), (99, 116), (99, 119), (100, 13), (100, 20), (100, 103), (100, 106), (100, 108), (101, 73), (101, 115), (101, 120), (102, 113), (103, 20), (103, 93), (103, 100), (103, 105), (103, 106), (103, 115), (103, 120), (104, 98), (104, 109), (104, 110), (105, 99), (105, 103), (105, 106), (105, 113), (105, 114), (105, 115), (105, 117), (105, 119), (106, 100), (106, 103), (106, 105), (106, 108), (106, 113), (106, 114), (107, 98), (107, 99), (107, 110), (107, 111), (107, 112), (107, 116), (107, 119), (108, 100), (108, 106), (108, 113), (109, 98), (109, 104), (109, 110), (110, 98), (110, 104), (110, 107), (110, 109), (110, 112), (110, 118), (111, 98), (111, 107), (111, 116), (112, 107), (112, 110), (112, 117), (112, 118), (112, 119), (113, 102), (113, 105), (113, 106), (113, 108), (113, 114), (114, 105), (114, 106), (114, 113), (114, 117), (115, 68), (115, 70), (115, 73), (115, 74), (115, 99), (115, 101), (115, 103), (115, 105), (115, 116), (115, 120), (116, 68), (116, 99), (116, 107), (116, 111), (116, 115), (117, 105), (117, 112), (117, 114), (117, 119), (118, 110), (118, 112), (119, 99), (119, 105), (119, 107), (119, 112), (119, 117), (120, 73), (120, 93), (120, 101), (120, 103), (120, 115); # ------------------------------------------------------# # Table structure for table `disease` # DROP TABLE IF EXISTS `disease`; CREATE TABLE `disease` ( `disease_no` int(11) NOT NULL auto_increment, `name` varchar(100) NOT NULL default '', `description` longtext, `contributor` varchar(100) NOT NULL default '', `latent_pd` double default NULL, `infectious_pd` double default NULL, PRIMARY KEY (`disease_no`) ) TYPE=MyISAM; # # Dumping data for table `disease` # INSERT INTO `disease` (`disease_no`, `name`, `description`, `contributor`, `latent_pd`, `infectious_pd`) VALUES (1, 'Influenza', 'Influenza, also known as flu, contagious infection primarily of the respiratory tract. Influenza is sometimes referred to as grippe. Influenza is caused by a virus transmitted from one person to another in droplets coughed or sneezed into the air. It is characterized by coldlike symptoms plus chills, fever, headaches, muscle aches, and fatigue. Most people recover completely in about a week. But some people are vulnerable to complications such as bronchitis and pneumonia. This group includes children with asthma, people with heart or lung disease, and the elderly. In the United States, people age 65 and older account for about 90 percent of influenza-

196

associated deaths.\r\n', 'admin', '5', '7'), (2, 'Ebola', 'Ebola Virus, common name for several strains of virus, three of which are known to cause hemorrhagic fever in humans, which is characterized by massive bleeding and destruction of internal tissues. The Ebola virus belongs to the family Filoviridae. The viruses are long rods, 800 to 1,000 nanometers (nm) long (1 nm equals onebillionth of a meter, or 4 x 10-8 in), but particles as long as 14,000 nm have been seen. Each virus consists of a coiled strand of ribonucleic acid (RNA) contained in an envelope derived from the host cell membrane that is covered with spikes. The virus is named for the Ebola River in the Democratic Republic of the Congo (DRC, formerly Zaire), Africa, where the virus was first identified.\r\n', 'admin', '4', '10'), (3, 'Legionnaires’ Disease', 'Legionnaires’ Disease, severe form of pneumonia, characterized by headache, chest pain, lung congestion, and high fever. The name is derived from an outbreak at an American Legion convention in a Philadelphia hotel in July 1976. The United States Centers for Disease Control and Prevention (CDC) later succeeded in identifying the causative agent as a previously unknown rod-shaped bacterium (Legionella pneumophila). Other local outbreaks were then linked to the disease. An estimated 8,000 to 18,000 people contract Legionnaires\' disease in the United States each year, and about 5 to 30 percent of affected people die. The bacterium is most commonly transmitted through contaminated water sources; it is not readily transmitted from person to person. Treatment with the antibiotic erythromycin is effective.\r\n', 'admin', '4', '7'), (6, 'Pneumococcus', 'Before the advent of antibiotics, the most common cause of death in adults was lobar pneumonia, an acute infection caused by the pneumococcus, a bacterium formally known as Streptococcus pneumoniae. The pneumococcus usually attacks an entire lobe or portion of a lobe of the lung; in double pneumonia, it attacks both lungs. Pneumococcal lobar pneumonia often occurs in winter, after an acute, viral upper respiratory infection. Usual symptoms include a shaking chill followed by a fever of about 40° C (about 104° F), pain in the chest on breathing, a cough, and blood-streaked sputum.', 'admin', '9', '16'); # -------------------------------------------------------# # Table structure for table `g_unit` # DROP TABLE IF EXISTS `g_unit`; CREATE TABLE `g_unit` ( `unit_no` int(11) NOT NULL auto_increment, `name` varchar(100) default NULL, `description` longtext, `contributor` varchar(100) NOT NULL default '', `population` double default NULL, `area` double default NULL, PRIMARY KEY (`unit_no`) ) TYPE=MyISAM; # # Dumping data for table `g_unit` # INSERT INTO `g_unit` (`unit_no`, `name`, `description`, `contributor`, `population`, `area`) VALUES (13, 'Las Piñas', 'It is bounded on the north and northeast by the Parañaque City; on the east and southeast by Muntinlupa City; on the south by the Municipality of Imus, Cavite; on the southwest and west by the Municipality of Bacoor, Cavite; and on the northwest by the scenic Manila Bay. Half of its land area is residential and the remaining half is used for commercial, industrial and institutional purposes. The present physiography of Las Piñas City consists of three zones: Manila Bay, coastal margin and Guadalupe Plateau. The city is bisected by the Alabang–Zapote Road, previously known as Real Street ("Real" is a Spanish word for Royal). It forms part of the Maharlika Highway which spans the whole country. The Alabang–Zapote Road connects the South Luzon Expressway which passes through Muntinlupa City in the east to the Coastal Road along Manila Bay.', 'admin', '532330', '41.54'), (14, 'Caloocan', 'Caloocan is divided into two separate areas. Southern Caloocan City lies directly north of the City of Manila and is bounded by Malabon City and Valenzuela City to the north and west, Navotas to the west, and Quezon City to the east. Northern Caloocan City is the northernmost territory of Metro Manila; it lies east of Valenzuela City, north of Quezon City, and south of San Jose del Monte City in the province of Bulacan.', 'admin', '1378856', '53.33'), (15, 'Makati', 'Makati is bounded on the north by the Pasig River, facing Mandaluyong City, on the northeast by Pasig City, on the southeast by the municipality of Pateros and Taguig City, on the northwest by the City of Manila, and on the southwest by Pasay City. Makati has a total land area of 27.36 square kilometers; it constitutes 4.3% of Metro Manila\'s total land area.', 'admin', '510383', '27.36'), (16, 'Malabon', 'Located just north of Manila, the city has a population of approximately 340,000. It is primarily a residential and industrial town and is one of the most densely populated cities in the metropolis. It has a total land area of 15.714 square kilometers.\r\n\r\nMalabon is part of the sub-region of Metro Manila informally called CAMANAVA. CAMANAVA consists of Caloocan City, Malabon City, Navotas City, and Valenzuela City. Caloocan lies to the south and east, Navotas to the west, and Valenzuela to the north. Malabon also borders the town of Obando in the province of Bulacan to the northwest.', 'admin', '363681', '19.76'), (17, 'Mandaluyong', 'Mandaluyong City is located right at the center of Metro Manila. Among the many attractions in the city is the western half of the Ortigas Center, one of the major centers of business and commerce in the metropolis (the eastern half is in Pasig City). Found within the Mandaluyong portion of the Ortigas Center is the main headquarters of the Asian Development Bank, Banco De Oro and the headquarters of San Miguel Corporation, Southeast Asia\'s largest food and beverage company. One of the most prominent pharmaceutical laboratories and factories, the UniLab, is located here.', 'admin', '305576', '21.26'), (18, 'Manila', 'Manila is the capital of the Philippines and one of the 17 cities and municipalities that make up Metro Manila. Located on the eastern shores of Manila Bay just west of the National Capital Region in western side of Luzon, it is one of the central hubs of a thriving metropolitan area home to over 14 million people. Manila, occupying a total land area of 38.55 square kilometers, is the second most populous city in the Philippines, with more than 1.6 million inhabitants. Only nearby Quezon City, the country\'s former capital, is more populous. The metropolitan area is the second most populous in Southeast Asia. Manila lies about 950 kilometers southeast of Hong Kong, 2,400 kilometers northeast of Singapore and more than 2,100 kilometers northeast of Kuala Lumpur. The Pasig River bisects the city in the middle. Almost all of the city sits on top of centuries of prehistoric alluvial deposits built by the waters of the Pasig River and on some land reclaimed from Manila Bay.', 'admin', '1660714', '38.55'), (19, 'Marikina', 'Marikina, known as the Shoe Capital of the Philippines, was formerly the capital of the province of Manila during the declaration of Philippine Independence. Located on the island of Luzon, Marikina is one of the cities and a Metropolitan municipality that make up the Metropolitan Manila Area, the National Capital Region of the Philippines. It also belongs to Eastern Manila District of Metro Manila\'s four districts.\r\nMarikina City is located along the eastern border of Metro Manila; it is bordered on the west by Quezon City, to the south by Pasig City and Cainta, Rizal, to the east by Antipolo City (the capital of Rizal province), and to the north by San Mateo (also in Rizal). It is approximately 21 km. away from Manila.', 'admin', '424610', '21.5'), (20, 'Muntinlupa', 'Muntinlupa is the southernmost city in Philippine National Capital Region. It is bordered on the north by Taguig City; to the northwest by Parañaque City; by Las Piñas City to the west; to the southwest by the municipality of Bacoor, Cavite; by the municipality of San Pedro, Laguna; and by Laguna de Bay to the east, the largest lake in the country. It is classified as a Highly Urbanized City with a population of more than 400,000 and is given the nickname "Emerald City of the Philippines" by the tourism establishment. Muntinlupa was once notoriously known as the location of the national insular penitentiary, the New Bilibid Prison, where the country\'s most dangerous criminals were incarcerated. Consequently, Muntinlupa or "Munti" became synonymous with the national penitentiary although it has largely shaken-off this negative image to become one of the most progressive cities in the country. Muntinlupa is also home to some of the best commercial establishments in the metropolis and is the location of Ayala Alabang Village, one of the country\'s biggest and most expensive residential communities, where many of the wealthy and famous live. Among the village\'s well-known residents include former Philippine President Fidel V. Ramos, actor Aga Muhlach and his wife, actress/host Charlene Gonzalez and the prince

197

of Brunei.', 'admin', '452943', '46.7'), (21, 'Navotas', 'Navotas is a coastal town in the northwest part of Metro Manila. It is a narrow strip of land with an aggregated shoreline of approximately 4.5 km. In the north, Navotas shares a common border with the town of Obando, Bulacan, along Sukol Creek. Along the eastern border runs the Binuangan River, the Daang Cawayan River, the Dampalit River, the Batasan River, the Navotas River, the Bangculasi Channel, the Malabon Channel and the Estero de Maypajo.', 'admin', '245344', '10.77'), (22, 'Parañaque', 'Parañaque is one of the cities and municipalities that make up Metro Manila in the Philippines. It is bordered on the north by Pasay City, by Taguig City to the northeast, Muntinlupa City to the southeast, by Las Piñas City to the southwest, and by Manila Bay to the west.', 'admin', '552660', '47.69'), (23, 'Pasay', 'In terms of area, Pasay City is the third smallest political subdivision in the National Capital Region. It is adjacent to the City of Manila and is bounded to the south by Parañaque, to the northeast by Makati and Taguig and to the west by Manila Bay. The city is located at latitude 14° 32\' and longitude 121° 00\'. The City has a total land area of 18.50 square kilometers of which 5.5050 square kilometer is the City proper, 9.5 square kilometers is being occupied by the Civil Aeronautics Administration (CAA) complex, which include the Ninoy Aquino International Airport (NAIA) and the Villamor Air Base and the rest of the reclamation area with 4.00 square kilometers. Thus, among the local government in the region, Pasay has the greater area devoted to utilities covering 51.35% of its total land area or 9.50 square kilometers. The City is known for its entertainment - business-restaurants, coffee shops, and clubs, particularly those located along Roxas Boulevard, facing Manila Bay. A large part of Metro Manila\'s "tourist belt" is located in the City. Pasay is composed of seven (7) districts, divided into twenty (20) Zones, with a total of 201 Barangays. Zone 19, Covering Barangays 178 and 191, is the largest among the zones with an area of 5.10 square kilometers. Zone 1, on the other hand, is the smallest covering Barangays 1 to 3 and 14 to 17 with an area of 100,000 square meters (0.1 km².).', 'admin', '403064', '19'), (24, 'Pasig', 'Pasig is one of the cities and municipalities that make up Metro Manila in the Philippines. It used to be the capital of the province of Rizal before Metro Manila was formed. Located along the eastern border of Metro Manila, Pasig is bordered on the west by Quezon City and Mandaluyong City; to the north by Marikina City; to the south by Makati City, Pateros, and Taguig City; and to the east by the municipality of Cainta in the province of Rizal. Pasig is a primarily residential and industrial city but increasingly becoming a growing commercial area. Being the former capital of Rizal, the provincial capitol is still located in Pasig, in the outskirt of Shaw Boulevard.', 'admin', '617301', '31'), (25, 'Pateros', 'Pateros is the only municipality in Metro Manila in the Philippines. This small town is famous for its duck-raising industry and especially for producing balut, a Filipino delicacy that is boiled duck egg. Pateros is bordered by Pasig City to the north, Makati City to the west, and Taguig City to the south. Pateros is the only municipality and the smallest, both in population and in land area, in Metro Manila, but it is the second most densely populated at around 27 thousand people per square kilometer after Manila.\r\n', 'admin', '61940', '2.1'), (26, 'Quezon City', 'Quezon City is the former capital (1948-1976) and the most populous city in the Philippines. Located on the island of Luzon, Quezon City (popularly known to Filipinos as simply QC) is one of the cities and municipalities that make up Metro Manila, the National Capital Region. The city was named after Manuel L. Quezon, the former president of the Commonwealth of the Philippines who founded the city and developed it to replace Manila as the country\'s capital. Quezon City is not located in and should not be confused with Quezon province, which was also named after the president. Having been the former capital, many government offices are located in the city, including the Batasang Pambansa, the seat of the House of Representatives, which is the lower chamber in the Philippine Congress. The main campuses of two noteworthy universities, the Ateneo de Manila University and the country\'s National University--the University of the Philippines, Diliman-- are located in the city.', 'admin', '2679450', '166.2'), (27, 'San Juan', 'San Juan is a city in Metro Manila in the Philippines. Before the creation of Metro Manila, it was part of Rizal Province. Currently Metro Manila\'s smallest city in terms of area, San Juan is one of the smallest among the cities and municipalities in the metropolis, second only to Pateros. This was the site of the first battle of the Katipunan, the Filipino revolutionary organization, against the Spanish colonizers. The city is named after St. John the Baptist, who is also the city\'s patron saint.', 'admin', '124187', '7.77'), (28, 'Taguig', 'Taguig is a city in Metro Manila in the Philippines. From a thriving fishing community along the shores of Laguna de Bay, it is now an important residential, commercial and industrial center. The recent construction of the C-5 highway and the acquisition of the Fort Bonifacio development area has paved the way for the cityhood of the municipality. Taguig City lies on the western shore of Laguna de Bay and is bordered by Muntinlupa City to the south, Parañaque City to the southwest, Pasay City to the west, Cainta and Taytay on the northeast and Makati City, Pateros, and Pasig City to the north. Taguig River, a tributary of the Pasig River cuts through the northern half of the municipality and Napindan River, also a tributary of the Pasig forms the common border of Taguig with Pasig City. The city ranked first among Philippine cities in the Ease of Doing Business Index, conducted by the World Bank\'s International Finance Corporation.', 'admin', '613343', '47.88'), (29, 'Valenzuela', 'Valenzuela is one of the cities and municipalities in the Philippines that make up Metro Manila. The city has approximately 500,000 residents including and is primarily an industrial and residential suburb of Manila. The North Luzon Expressway passes through the city and out of Metro Manila into the province of Bulacan. Valenzuela has a land area of approximately 45 square kilometers. It is bordered by Quezon City and northern Caloocan City to the east, by Malabon City and southern Caloocan City to the south, by Obando in Bulacan to the west, and Meycauayan City, also in Bulacan, to the north. Since becoming a city in 1998, Valenzuela’s economy has flourished and its population has swelled significantly.', 'admin', '568928', '44.59'), (30, 'Angat', 'Angat is a 2nd class municipality. One of the oldest church in the country, estimated to be 400 years old, the Santa Monica de Angat Church, is here. The church displays a marvelous baroque architecture with its interior replicating the famous Sistine Chapel. ', 'admin', '53117', '65.25'), (31, 'Balagtas', 'Balagtas (formerly Bigaa) is a 1st class urban municipality. The town is shaped like a pentagon, bounded by four towns; on the South by Bocaue, on the North by Plaridel on the East by Pandi, on the West by the towns of Bulacan and Guiguinto. The McArthur Highway bisects the municipality of Balagtas as this national road cuts northward to the Ilocos region. At the southern approach of the town from Manila is a modern, first class concrete bridge that crosses the Balagtas River. The river, navigable by banca and motor boats, empties into Manila bay after snaking through the town of Bulacan to the West which provides Balagtas\' townsfolk with fish, shrimp, and other fresh water food.', 'admin', '62684', '32.05'), (32, 'Baliuag', 'Baliwag is a 1st class urban municipality. With the continuous expansion of Metro Manila, the municipality is now included in Manila built up area which reaches San Ildefonso in its Northernmost part. Baliuag is also a transportation hub. Public transportation to Pampanga to the west, and Nueva Ecija to the north, is easily accessible.', 'admin', '136982', '45.05'), (33, 'Bocaue', 'Bocaue is a 1st-class urban municipality. The town is bounded on the north by the municipalities of Balagtas and a portion of the municipality of Santa Maria; by the municipalities of Marilao and Obando on the south; a larger portion of Santa Maria on the east; a portion of the municipality of Bulacan on the extreme southwestern side; and a portion of Balagtas on the western side. There are three (3) crossings in town that are heavily congested during rush hours, namely Lolomboy, Wakas and Bocaue Crossing. Bocaue is about 27 kilometers north of Manila and has its own exit on the North Luzon Expressway.', 'admin', '105817', '31.87'), (34, 'Bulakan', 'Bulacan or Bulakan is a 2nd class urban municipality. The Municipality of Bulakan lies in

198

the southwestern part of the province of Bulacan and is surrounded by a number of proximate municipalities. It is bounded on the North by the Municipality of Guiguinto, on the South by the Manila Bay, on the East by the Municipality of Bocaue, on the West by the City of Malolos, on the Northeast by the Municipality of Balagtas and on the Southeast by the Municipality of Obando. It ranks tenth (10th) in terms of land area among other municipalities in the province.', 'admin', '72289', '72.9'), (35, 'Bustos', 'Bustos is a 3rd class municipality. With the continuous expansion of Metro Manila, the city is now included in Manila built up area which reaches San Ildefonso in its Northernmost part. It is home to the Bulacan State University - Bustos Campus (BulSU Bustos), the biggest satellite campus in the university.', 'admin', '60681', '69.99'), (36, 'Calumpit', 'Calumpit is a 1st class urban municipality. Fifty-four (54) kilometers north of Manila, lies the Municipality of Calumpit bounded on the north and west by Apalit and Macabebe, Pampanga, respectively; southwest, southeast and east by Hagonoy, Malolos, and Pulilan, Bulacan respectively. As of 1995, Calumpit had a relatively big labor force of 24,095 persons or 66% of population consisting of people ages 20-59. ', 'admin', '98017', '56.25'), (37, 'Doña Remedios Trinidad', 'Doña Remedios Trinidad is a 1st class rural municipality. The largest municipality in Bulacan, it is partially embracing two major portions of the Angat Watershed reservation. Bulacan forest reserve, Biak-na-Bato National Park and 327.3 km² of alienable and disposable public land.', 'admin', '19086', '932.98'), (38, 'Guiguinto', 'Guiguinto is one of the fast growing municipalities in the province of Bulacan. From a predominating agricultural economy, it gradually urbanized and developed. It is now a 1st class urban municipality in the province of Bulacan, Philippines. It is now conurbated with Metro Manilla. ', 'admin', '89225', '27.5'), (39, 'Hagonoy', 'Hagonoy is a 1st class municipality. The Ina ng Laging Saklolo Parish - The First Parish of Ina ng Laging Saklolo in the Province of Bulacan - is located in Hangga, San Pedro, Hagonoy, Bulacan.', 'admin', '126329', '103.1'), (40, 'Malolos', 'City of Malolos , is a 4th class urban component city in the Philippines. Malolos is considered as the 115th city in the country. The City is 45 kilometers north of Manila, it is one of the major suburbs conurbated to the Metropolitan Manila, situated southwestern part of Bulacan, located in the Central Luzon Region (Region 3) in the island of Luzon and part of the Metro Luzon Urban Beltway Super Region. Bordering Malolos are the municipalities of Bulakan, Bulacan (the former capital of the province) to the southeast, Guiguinto to the east, Plaridel to the north, Calumpit to the northwest, and Paombong to the west. Malolos also lies on the north-eastern shore of Manila Bay. It is also one of the centers of education in Central Luzon region, it has several universities like the government-funded Bulacan State University, and privately owned Centro Escolar University and University of Regina Carmeli. Malolos also houses the most populous high school in Central Luzon, Marcelo H. del Pilar National High School.', 'admin', '223069', '67.3'), (41, 'Marilao', 'Marilao is a first class urban municipality. In 2007, The City of Meycauayan and the town of Marilao in Bulacan province share a slot in the list of the world’s 30 most polluted places in the developing world drawn up by a private New York-based institute.', 'admin', '160452', '33.74'), (42, 'Meycauayan', 'The City of Meycauayan or Meycauayan is an unclassified[1][not in citation given] urban city. The city is located about 19 km north of Manila and about 22 km south of Malolos City, the provincial capital city. It is bounded by the town of Marilao to the north, Valenzuela City to the south, Caloocan City (North) to the east, and the town of Obando to the west. It encompasses an aggregate area of 22.1 square kilometres, representing 1.17% of the total land area of the province of Bulacan.', 'admin', '196569', '32.1'), (43, 'Norzagaray', 'Norzagaray is a 1st class municipality. On December 12, 2007, Bulacan and the Metropolitan Waterworks and Sewerage System (MWSS) signed an agreement for the development of a P11-billion bulk water supply project. Ayala-owned Manila Water Co. Inc. will implement the project. MWSS and Manila Water will provide a financial package of an infrastructure grant, a P10-million development assistance and a P10-million royalty fee to the towns of Norzagaray and Doña Remedios Trinidad, which will host the water supply project. On January 19, 2008, an 18-hectare waste disposal facility, a new sanitary landfill that would also be a tourist attraction opened in Norzagaray.', 'admin', '105470', '288.52'), (44, 'Obando', 'Obando is a 2nd class municipality. Obando is locked by two cities from Metro Manila namely Valenzuela City in the east, Navotas and Malabon City in the south, Bulacan in the north, and the waters of Manila Bay in the west. There is a problem with river pollution caused by the Tanza, Navotas dumpsite. ', 'admin', '56258', '52.1'), (45, 'Pandi', 'Pandi is a 3rd class urban municipality. Pandi is historically known for the Real de Kakarong de Sili Shrine, the site where the bloodiest revolution in Bulacan took place, where more than 3,000 Katipunero revolutionaries died.', 'admin', '60637', '31.2'), (46, 'Paombong', 'Paombong is a 3rd class municipality. Paombong is famous for its vinegar, extracted from the sap of sasa (nipa).', 'admin', '53510', '46.34'), (47, 'Plaridel', 'Plaridel is a 1st class urban municipality. With the continuous expansion of Metro Manila, the city is now included in Manila built up area which reaches San Ildefonso in its Northernmost part.', 'admin', '99817', '32.44'), (48, 'Pulilan', 'Plaridel is a 1st class urban municipality. With the continuous expansion of Metro Manila, the city is now included in Manila built up area which reaches San Ildefonso in its Northernmost part. It is bounded on the north by Apalit in Pampanga; on the east by Baliuag; on the south by Plaridel; and on the west by Calumpit. The Angat river cutting its way through the eastern edge of Baliuag, and the southern fringes of Pulilan down to the tributary of Manila Bay southwest of Calumpit, serves as the boundary with Plaridel.', 'admin', '85008', '39.89'), (49, 'San Ildefonso', 'San Ildefonso is a 1st class municipality. With the continuous expansion of Metro Manila, the municipality is now included in Manila built up area which reaches San Ildefonso in its Northernmost part.', 'admin', '93438', '128.71'), (50, 'San Jose Del Monte', 'City of San Jose del Monte (CSJDM) is a 1st class urban component city bordered by Caloocan City and Quezon City, both in Metro Manila, in the south; by Rodriguez, Rizal in the east; Santa Maria and Marilao, both of Bulacan, in the west and Norzagaray, Bulacan in the north. According to the 2007 census, it has a population of 439,090 inhabitants marking the 18th Most Populated City in the Philippines.', 'admin', '439090', '165.1'), (51, 'San Miguel', 'San Miguel is a 1st class, partially urban municipality located in the 3rd district of the province of Bulacan. The town is around 65 km. north of Metro Manila, the business center of the country. If one uses public transportation to get to the town, one could take the buses that ply the Cagayan Valley Road route. Some of these buses are Baliwag Transit, ES Transport, and Five Star Transport. The buses reach the town in around 2 hours.', 'admin', '138839', '231.4'), (52, 'San Rafael', 'San Rafael is a 2nd class municipality. With the continuous expansion of Metro Manila, the municipality is now included in Manila built up area which reaches San Ildefonso in its Northernmost part.', 'admin', '85284', '152.43'), (53, 'Santa Maria', 'Santa Maria or Sta. Maria, is a 1st class urban municipality lying 32 kilometers northeast of Manila and located at the eastern portion of Bulacan. The town is bounded on the north by the municipalities of Angat and Pandi; portion of San Jose del Monte City on the south; Norzagaray and other portions of San Jose del Monte on the east; and the municipalities of Marilao and Bocaue on the western side. Santa Maria is 18 kilometers away from Malolos City, the provincial capital, and 38 kilometers from City of San Fernando, Pampanga, the regional center of Central Luzon.', 'admin', '205258', '89.88'), (54, 'Angono', 'Angono is a 1st class urban municipality. With the continuous expansion of Metro Manila, the municipality is now included in Manila built up area which reaches Cardona in its Westernmost part.', 'admin', '97209', '26.22'), (55, 'Antipolo City', 'The City of Antipolo is a 1st class component city. It was made the capital of Rizal when the former capital, Pasig City became part of Metro Manila. Antipolo City is located in the central part of Rizal Province. It is approximately 26 kilometers east of Manila and conurbated with the NCR. It is bounded to the north by the municipalities of San

199

Mateo and Rodriguez; to the northeast by the municipality of Gen. Nakar in neighboring Quezon Province; to the southeast by the municipality of Tanay; to the south by municipalities of Angono, Taytay and Teresa; and to the west by the municipality of Cainta and the city of Marikina in Metro Manila.', 'admin', '633971', '306.1'), (56, 'Baras', 'Baras is a 4th class municipality in the province of Rizal, Philippines. According to the 2007 census, it has a population of 31,524 people. Baras is politically subdivided into 10 barangays (9 urban, 1 rural).', 'admin', '31524', '84.93'), (57, 'Binangonan', 'Binangonan is an urban municipality. A thriving fish port and fishing industry is found in Binangonan, having a long coast line facing the Laguna de Bay. The plant of Rizal Cement and Grandspan are in Binangonan as well.', 'admin', '238931', '66.34'), (58, 'Cainta', 'The Municipality of Cainta is a first-class urban municipality in the province of Rizal, Philippines. One of the oldest (originally founded in August 15, 1571), and the town with the second smallest land area of 26.81 km² next to Angono with 26.22 km². Cainta serves as a gateway to the rest of Rizal province from Metro Manila. It is one of Rizal\'s most urbanized towns because of its proximity to Manila. ', 'admin', '289833', '26.81'), (59, 'Cardona', 'Cardona is a 3rd class urban municipality. Cardona is politically subdivided into 18 barangays. With the continuous expansion of Metro Manila, the municipality is now included in Manila built up area which reaches Cardona in its Easternmost part.', 'admin', '44942', '28.56'), (60, 'Jalajala', 'Jalajala is a 5th class municipality. It is on the largest lake in the Philippines Laguna de Bay. Jalajala is a peninsula located 75 km southeast of Manila. The Municipality of Jalajala is one of the lakeshore towns along Laguna de Bay. It lies on the eastern part of the Province of Rizal and has a land area of 4,930.000 hectares representing 3.77% of the total land area of the province . Jalajala’s political boundary on the north is the Panguil River, wherein it shares the boundary with the town of Pakil in Laguna. On its southern, eastern, and western boundaries lies the Laguna de Bay.', 'admin', '28738', '44.12'), (61, 'Morong', 'Morong is a poor 3rd class municipality. It was later renamed San Guillermo. It borders the towns of Binangonan, Angono and Teresa. San Guillermo is a farming community with a population of 6,522 and 1,377 total dwellings. While majority in the barrio depend on farming as a livelihood, many others are engaged in businesses like garment industry, poultry and piggery.', 'admin', '50538', '37.58'), (62, 'Pililla', 'Pililla is a 2nd class urban municipality. Pililla is just few kilometers away from Tanay, Rizal. It is surrounded by farms, small mountains, planes and trees. Its nearby provinces are Laguna and Quezon.', 'admin', '58525', '69.95'), (63, 'Rodriguez (Montalban)', 'Rodriguez, Rizal is a municipality in the province of Rizal, Philippines. It is the northernmost town in the province and comes after San Mateo, Quezon City coming from Metro Manila. The town is located on the slopes of the Sierra Madre mountain range and features many resorts.', 'admin', '223594', '172.85'), (64, 'San Mateo', 'San Mateo, Rizal is a first class urban municipality. It is part of the Metro Luzon Urban Beltway. Metro Luzon is composed of Region 3, Region 4-A (CALABARZON) and the nearby National Capital Region (NCR). Metro Luzon is one of four Super Regions in the Philippines. ', 'admin', '184860', '55.09'), (65, 'Tanay', 'Tanay is a 1st class municipality. It is located 57 kilometers east of Manila, although a typical commute between Manila and Tanay will take between one to three hours depending upon traffic conditions. It contains portions of the Sierra Madre Mountains and is bordered by Antipolo City in the northeast, Baras, Morong and Teresa in the west, General Nakar (Quezon Province) in the east, and Pililla, Santa Maria (Laguna province) as well as the lake Laguna de Bay in the south.', 'admin', '94460', '200'), (66, 'Taytay', 'Taytay is an urban municipality in the province of Rizal, Philippines. It is one of the 14 municipalities of the Province of Rizal. It belongs to the First District together with Angono, Antipolo, Binangonan and Cainta. Conurbated with NCR, it is bounded by Cainta on the north, Pasig City and Taguig City on the west, Antipolo City in the East and Angono on the South.', 'admin', '262485', '38.8'), (67, 'Teresa', 'Teresa is a 4th class urban municipality in the province of Rizal situated in the slopes of the Sierra Madre Mountains and is landlocked on four corners by Antipolo City on the north, Angono on the west, Tanay, on the east, and Morong, on the south.', 'admin', '44436', '18.61'), (68, 'Calamba City', 'Calamba City is a first class city. Situated only 54 kilometers south of Manila, about an hour by chartered bus, Calamba City is a popular tourist destination with its hot spring resorts. With the continuous expansion of Metro Manila, the city is now included in Manila built up area which reaches Lipa City in its southernmost part. Calamba lies at the northern slopes of Mount Makiling, a dormant volcano. The southern terminus of the South Luzon Expressway is in Calamba and this geographic position makes the city a gateway to the southern provinces of Luzon. The highway at the end of the South Luzon Expressway leads east to the other towns of Laguna and south towards the provinces of Batangas and Quezon. Calamba City is bordered by Cabuyao to the north, Los Baños to the east, by the province of Batangas to the south, specifically the municipalities of Santo Tomas and Talisay, and by the province of Cavite to the west, with Tagaytay City and Silang. Laguna de Bay the country\'s largest lake, forms the city\'s northwest border.', 'admin', '360281', '144.8'), (69, 'San Pablo City', 'The City of San Pablo, a first class city in the province of Laguna, is one of the country\'s oldest cities. Despite the fact that the city was partly touched by economic development, San Pablo City boasts itself as a potential eco-tourism destination in the province. However, given its human and land resources, various BPO companies are seriously looking at developing the city into the ICT hub of Southern Luzon.', 'admin', '237259', '197.6'), (70, 'Santa Rosa City', 'The City of Santa Rosa is a first class city in the province of Laguna. It is also known as "The Investment Capital of South Luzon" since 1994. The city lies 38 kilometers south of Manila via the South Luzon Expressway, making it a suburban residential community of Metro Manila. Until a few years ago, Santa Rosa was mainly known for the Coca-Cola and Toyota manufacturing plants in its industrial estates. More recently it has also become famous for being the site of Enchanted Kingdom, a local theme park, as well as several housing developments. Santa Rosa is also the exit travellers take along the South Luzon Expressway to go to Tagaytay and Taal Volcano. This city contains the 3rd largest complex in Laguna, Paseo de Santa Rosa.', 'admin', '266943', '39.1'), (71, 'Alaminos', 'Alaminos is a 3rd class municipality in the province of Laguna. It has a land area of 21.11 square miles (54.7 km2) and is situated 48.5 miles (78.1 km) southeast of Manila. Located at northeast of Sto. Tomas in Batangas Province, south of Calauan and Bay, and west of San Pablo City.Alaminos is politically subdivided into 15 barangays.', 'admin', '40380', '54.7'), (72, 'Bay', 'Bay is a 3rd class municipality. Bay is one of the oldest towns in Laguna province, and was the province\'s first capital. Its original territory covered the areas that are now known as Los Baños and Calauan (in addition to its current territory).', 'admin', '50756', '46.9'), (73, 'Biñan', 'Biñán is a municipality in the province of Laguna, Philippines. Accessible from Metro Manila via the South Luzon Expressway, Biñan has become both a suburban residential community of Metro Manila and a location for some of the Philippines\' largest industrial estates and export processing zones. Biñan is the second town of Laguna from Metro Manila next to San Pedro. The town is one of three comprising the first district of Laguna.', 'admin', '262735', '43.5'), (74, 'Cabuyao', 'The Municipality of Cabuyao is a First Class urbanized municipality. It lies for about 43 kilometers southeast of Metro Manila and is located at the western portion of Laguna. It is bordered by the Laguna de Bay, the country\'s largest lake, to the north, Calamba City to the east, some portion of Silang, Cavite to the south and by the Santa Rosa City to the west. Cabuyao is approximately 54 kilometers away from Santa Cruz, the provincial capital, and 9 kilometers from the city proper of Calamba City, the chartered city and regional center of CALABARZON region. Cabuyao is currently the fastest-growing municipality in Laguna, as evidenced with a large populace of migrants working in the town\'s industrial estates. Nestlé Philippines, Asia Brewery, Inc. and

200

Malayan Colleges Laguna are located in Cabuyao.', 'admin', '205376', '67.5'), (75, 'Calauan', 'Calauan is a 2nd class municipality. The town got its name from the term kalawang, which means rust. Calauan is known for the Pineapple Festival, which is celebrated every May. The Hidden Valley Springs, a popular hot spring resort, although its entrance is situated in the adjacent town of Alaminos, is actually within Calauan\'s boundaries. In 1993, the town became the focus of media attention when Antonio Sánchez, who was currently serving as mayor at the time, got involved into a double murder case involving two UPLB students. Sánchez and several other men were given a life sentence.', 'admin', '54248', '66.4'), (76, 'Cavinti', 'Cavinti is a 4th class municipality. It is situated in the foothills of Sierra Madre mountain range, and part of the 4th congressional district of Laguna. The town\'s name came from the Tagalog expression, "kabit sa binti". The Aetas, the early dwellers of the land, performed a wedding ritual in which the groom chases his bride to the riverbank. The groom will try to capture his bride by her legs ("binti"), with the witnesses shouting, "Kabit sa binti, kabit sa binti!" This phrase later became "Kabinti"; hence the name.', 'admin', '20469', '70.4'), (77, 'Famy', 'Famy is a 5th class municipality. Famy lies in the northeastern part of the province of Laguna and is bounded by the town of Real, Quezon, in the east, in the north by Santa Maria, in the west by Mabitac and Sta. Maria, and in the south by Siniloan and Mabitac. Formerly a barrio of Siniloan in 1910, its name was taken from the family name of the President Emilio Aguinaldo\'s mother.', 'admin', '13577', '8.54'), (78, 'Kalayaan', 'Kalayaan is a 5th class urban municipality. Kalayaan is rectangular in shape, with a hilly terrain on most of its eastern side, while relatively flat on its western side. Its highest elevations are from 400 to 418 meters. These are found in Sitio Santo Angel, Malaking Pulo, and Cabuhayan in Barangay San Juan, and Sitio Lamao in Barangay San Antonio. Approximately three fourths of the total land area are with terrain 300 meters above sea level. Its lowest points are from 5 to 20 meters along the western sections of Barangays San Juan and Longos towards Laguna de Bay.', 'admin', '21203', '46.6'), (79, 'Liliw', 'Liliw is a 4th class municipality. It is one of the highland towns forming the southern extremity of the province. It is bounded on the northwest by Sta. Cruz; northeast by Magdalena; on the east by Majayjay; on the west by Nagcarlan; and on the south by Dolores, Quezon. Liliw is perhaps best known for its cold water spring resorts, native homemade sweets and a sizeable shoe industry that rivals that of Marikina City.', 'admin', '32727', '56.8065'), (80, 'Los Baños', 'Los Baños is a 1st class urban municipality. It is bordered on the south and southwest by Mount Makiling, on the north by Laguna de Bay, on the northwest by Calamba City and on the east by the town of Bay. The town is located 63 kilometers southeast of Manila and is accessible via the South Luzon Expressway. Los Baños also hosts the University of the Philippines, University of the Philippines, Open University, along with other foreign and local and international research centers, such as the International Rice Research Institute, the ASEAN Center for Biodiversity, the Philippine Rice Research Institute, Philippine Carabao Center at UPLB, and SEAMEO-SEARCA, making the town a temporary home for tens of thousands of undergraduate and graduate students, researchers and expatriates.', 'admin', '98631', '56.5'), (81, 'Luisiana', 'Luisiana is a 5th class municipality. Luisiana occupies 6,379 hectares in a plateau 1,400 feet atop Sierra Madre mountain bounded by the towns of Majayjay in the west, Cavinti, Laguna in the north, Sampaloc and Mauban, Quezon in the east, and Lucban, Quezon in the south.', 'admin', '19255', '63.79'), (82, 'Lumban', 'Lumban is a 4th class municipality. Lumban has an area of 96.8 square kilometers, the fourth largest in Laguna. Lumban is the home of Lake Caliraya, a man-made lake often visited by nature lovers and sports people. Lumban is politically subdivided into 16 inhabited barangays and 2 uninhabited barangays.', 'admin', '28443', '96.8'), (83, 'Mabitac', 'Mabitac is a 5th class municipality. Mabitac is situated on the eastern side of the province of Laguna, 54.68 miles from Manila using Rizal Province on a winding road, and 76.43 miles using the South Luzon Express, Calamba and Santa Cruz, Laguna. It has a total land area 3.912 sq. miles. Mabitac is politically subdivided into 15 barangays.', 'admin', '17608', '19.4'), (84, 'Magdalena', 'Magdalena is a fifth class municipality that is situated at the foot of Mount Banahaw. Magdalena is politically subdivided into 24 barangays.', 'admin', '20204', '34.4'), (85, 'Majayjay', 'Majayjay is a 4th class municipality located at the foot of Mt. Banahaw, and stands 1,000 feet above sea level. One hundred twenty kilometers south of Manila, it is bounded by the municipality of Majayjay on the north, by Lucban in Quezon province on the south, by Luisiana on the east, and by Liliw on the west. Majayjay is politically subdivided into 40 barangays.', 'admin', '23681', '69.6'), (86, 'Nagcarlan', 'Nagcarlan is a 3rd class municipality that is 21 kilometers northeast of San Pablo City, or 99 kilometers south of Manila, Philippines. It\'s 229.0 meters above sealevel. The municipality of Nagcarlan is located 103 kilometers from Manila through San Pablo. It can also be reached via Sta. Cruz, the capital town of Laguna. It is bounded on the north by the municipalities of Victoria, Pila and Liliw; on the east by municipality of Liliw; on the south by the municipalities of Rizal,Calauan and San Pablo. Nagcarlan town proper or poblacion is accessible to all types of land vehicles plying from Sta. Cruz, Laguna and San Pablo City, and fairly accessible from Calauan and Lucban roads as well.', 'admin', '57070', '78.1'), (87, 'Paete', 'Paete is a 4th-class urban municipality. The 2000 census registers the town with a population of 23,011 in 5,101 households. Paete (pronounced Pi-té, long i, short guttural ê) is a lakeside town located at the northeastern part of Laguna, along the shores of picturesque Laguna de Bay. It was founded in 1580 by Spanish friars Juan de Placencia and Diego de Oropesa of the Franciscan Order. It is believed that the earliest inhabitants were of Malay lineage, coming all the way from Borneo in their swift and sturdy boats called "Balangay". The town is made famous by craftsmen highly skilled in woodcarving and its embellishment.', 'admin', '24696', '32.4'), (88, 'Pagsanjan', 'Pagsanjan (pronounced \'Pag-sang-han\') is a 2nd class municipality. According to the 2000 census, it has a population of 32,622 people in 7,274 households. It is situated about 92 kilometers south of Manila. The main tourist spot of Pagsanjan is the Pagsanjan Falls or (Magdapio Falls). A particular highlight is the boatride, which passes through 14 rapids maneuvered by boatmen between rocks and boulders, leading to the main falls.', 'admin', '35944', '26.4'), (89, 'Pakil', 'Pakil is a 5th class urban municipality. According to the 2000 census, it has a population of 18,021 people in 3,698 households. Pakil is politically subdivided into 13 barangays.', 'admin', '20242', '13'), (90, 'Pangil', 'Pangil is a 5th class municipality in the province of Laguna, Philippines. According to the 2000 census, it has a population of 20,698 people in 4,160 households. Pangil is politically subdivided into 8 barangays.', 'admin', '23421', '23'), (91, 'Pila', 'Pila is a 4th class urban municipality. According to the 2000 census, it has a population of 37,427 people in 7,750 households. Pila has a total land area of 31.2 km². The town of Pila is site for some well-preserved houses dating back to the Spanish period as well as the old Saint Anthony of Padua Parish Church, the first Antonine church in the Philippines. This also served as a location for the reality show, The Amazing Race Asia 2.', 'admin', '44227', '31.2'), (92, 'Rizal', 'Rizal is a 5th class landlocked municipality located 15.53 miles from the provincial capital Santa Cruz and is bounded on the north by municipality of Calauan, on the east by Nagcarlan, on the west by San Pablo City, and on the south by Dolores, Quezon. According to the 2000 census, it has a population of 13,006 people in 2,770 households. This municipality was named after José Rizal, the country\'s national hero. Rizal is politically subdivided into 11 barangays.', 'admin', '15459', '27.9'), (93, 'San Pedro', 'San Pedro is a first class urban municipality. San Pedro is Laguna\'s gateway to Metro Manila since it lies on the boundary with Muntinlupa City, Metro Manila\'s southernmost city. This position makes San Pedro a popular suburban residential community, where many residents commute daily for work in Metro Manila. Aside from being a primarily suburban community, San Pedro also hosts a large number of factories. Among them include Kimberly-Clark,

201

Alaska Milk Corporation and General Milling Corporation. With a total land surface area of 22.6km2, San Pedro is the smallest town of the first district of Laguna and the 3rd smallest in the entire province. However, it is the town with the highest population density in the province due to its ranking as the 2nd most populous town after Calamba City.', 'admin', '281808', '26.2'), (94, 'Santa Cruz', 'Santa Cruz is a 1st class urban municipality. It is also the capital town of the province of Laguna. Santa Cruz is situated on the banks of the river bearing its name which course its way along the eastern part of the famous Laguna de Bay. The town is bounded by the Bay on the north, by Lumban and Pagsanjan towns in the east, Pagsanjan and Magdalena towns in the south, and Pila and Liliw towns in the west. It is approximately 87 kilometers from Manila via Calamba and 105 km via Pililla, in the province of Rizal. It is accessible by land from the nearby 28 municipalities and by water through Laguna de Bay from Manila and some Rizal towns. Santa Cruz is considered as the service and commercial center on the eastern part of the province.', 'admin', '101914', '38.6'), (95, 'Santa Maria', 'Santa Maria is a 4th class municipality. Santa Maria is the 3rd largest town in Laguna in terms of land area, after San Pablo City and Calamba City. It is surrounded by the towns of Tanay (Rizal) on the northwest; Mabitac on the southwest, Famy on the southeast (both in Laguna); and Real (Quezon) on the northeast. It is the northernmost town in Laguna. Bounded by the provinces of Rizal and Quezon from the western portion up to the northern tip down north eastern part, the town has a mountainous terrain. With the MARILAQUE Sub-Regional Plan (Manila-Rizal-Laguna-Quezon), the municipality functions as link between the highly industrialized capital and the marine life-rich Quezon province. A 43 kilometer road network, the Marcos Highway, physically connects to the eyed site for the International Port. Silangan Railway Express 2000 (MARILAQUE Railway) is another infrastructure project proposed for implementation under the BOT Scheme.', 'admin', '26267', '126'), (96, 'Siniloan', 'Siniloan is a 2nd class municipality. Siniloan lies between the plains of Sierra Madre Mountain and the Laguna de Bay, it is about 84 kilometers from Manila, passing Manila East Road or Marcos Highway, and about 113 kilometers via the South Luzon Expressway passing the town of Santa Cruz, the capital of the province. Siniloan is also a center of education, commerce and transportation, serving towns in eastern Laguna and some towns from the provinces of Quezon and Rizal. The municipality has active business and trade activities.', 'admin', '34877', '41.1'), (97, 'Victoria', 'Victoria is a 4th class municipality in the province of Laguna, Philippines. It is southeast of Laguna de Bay, 90 km south of Manila and bordered by the Municipality of Calauan to the southwest, Nagcarlan to the southeast and Pila to the northeast. The municipality has a total land area of 22.83 square kilometres which is 1.30% of the total land area of the province of Laguna. Victoria was a barrio of Pila until November 15, 1949 when President Elpidio Quirino signed into effect EO 282 segregating this barrio and 8 others into an independent community. Its name was adopted from President Quirino\'s daughter Victoria.', 'admin', '33829', '22.831'), (98, 'Alfonso', 'Alfonso is a 3rd class municipality in the province of Cavite, Philippines. Alfonso is an upland town situated at the southwestern portion of the Cavite province. It is 74 kilometers from Manila via Tagaytay City. Magallanes bounds it on the west, Batangas province on the south, Mendez and Tagaytay City on the east, General Aguinaldo on the northwest and Indang on the northeast.', 'admin', '47973', '64.6'), (99, 'Amadeo', 'Amadeo is a fourth class municipality in the province of Cavite, Philippines. It is nicknamed the "Coffee Capital of the Philippines". According to the 2007 census, it has a population of 31,705 people. Amadeo is best known for the Pahimis Festival, which showcases the town\'s coffee industry. It is usually held on the last weekend of February.', 'admin', '31705', '47.9'), (100, 'Bacoor', 'Bacoor is a first class urban municipality. It is part of the first congressional district of Cavite. A sub-urban area, the town is located approximately 16 kilometers away from Manila, on the southeastern shore of Manila Bay, at the northwest portion of the province with an area of 52.4 square kilometers. Bordered to the east by Las Piñas City and Muntinlupa City in Metro Manila, to the south is Dasmariñas, to the west are Kawit and Imus and to the north by Bacoor Bay an inlet of Manila Bay. Bacoor\'s is separated from Las Piñas by the Zapote River and from Imus and Kawit by Bacoor River. Its location, southwest of Metro Manila makes Bacoor an important gateway to Metro Manila. This is further reinforced by the fact it contains the south end of the Manila-Cavite Expressway. Bacoor is among the key areas and the fastest growing municipalities in Cavite together with Imus and Dasmariñas, mainly because of their location.', 'admin', '441197', '52.4'), (101, 'Carmona', 'Carmona is a first class urban municipality in the province of Cavite, Philippines. According to the 2007 census, it has a population of 68,135 people in a land area of 30.9 square kilometres. With the continuous expansion of Metro Manila, the municipality is now included in Manila built up area which reaches Lipa City in its southernmost part.', 'admin', '68135', '30.92'), (102, 'Cavite City', 'Cavite City is a fourth class city. It occupies a hook shaped peninsula jutting out into Manila Bay. Cavite City used to be the capital of the province. The historic island of Corregidor and the adjacent islands and detached rocks of Caballo, Carabao, El Fraile and La Monja found at the mouth of Manila Bay are part of the city\'s territorial jurisdiction. The city lies 35 kilometers southwest from Manila by road. It borders the municipality of Noveleta to the south. The peninsula encloses Bacoor Bay to the southeast and Cañacao Bay to the northeast, both small parts of Manila Bay. The city proper is divided into five districts: Dalahican, Santa Cruz, Caridad, San Antonio, and San Roque. These districts are further subdivided into eight zones and a total of 84 barangays. The Sangley Point Naval Base is part of the city and occupies the northernmost portion of the peninsula.', 'admin', '104581', '11.83'), (103, 'Dasmariñas', 'Dasmariñas is a first class urban municipality. It is located approximately 30 kilometers south of Manila. According to the 2007 census, it has a population of 559,330 people, making it the most populous municipality in the Philippines. If Dasmariñas is converted into a city, it will be the 11th largest city in the country. It has a land area of 90.1 square kilometers. Dasmariñas is part of Cavite\'s second congressional district. Besides being the richest local government unit in the province of Cavite according to the 2006 Commission on Audit report, Dasmariñas is the only municipality in the Philippines that has both an SM and Robinsons Mall.', 'admin', '556330', '82.34'), (104, 'General Emilio Aguinaldo', 'General Emilio Aguinaldo (formerly Bailen) is a fifth class municipality in the province of Cavite, Philippines. According to the 2007 census, it has a population of 17,818 people. This is named after Emilio Aguinaldo, the country\'s first president.', 'admin', '17818', '51.03'), (105, 'General Trias', 'General Trias, formerly San Francisco de Malabon, is a first class municipality in the province of Cavite, Philippines. According to the 2007 census, it has a population of 218,387 people in a land area of 108.7 square kilometers. Industrialization has become the centerpiece of the municipality’s development plans and programs. Several major industrial estates, such as Gateway Business Park, a world class business community in Javalera and the New Cavite Industrial City (NCIC) in Manggahan, have chosen General Trias to be their home base. The Cavite Export Processing Zone (CEPZ) occupies about 0.60 square kilometres of land belonging to General Trias. 110 factories operate in the CEPZ.', 'admin', '218387', '117.68'), (106, 'Imus', 'Imus is a first class municipality in the province of Cavite, Philippines and it is the officially-designated capital of Cavite. Imus is strategically located near the Metropolitan Manila area, just 21 kilometers (13.1 miles) south of Manila. On June 11, 1977, then President Ferdinand Marcos issued Presidential Decree No. 1163, which transferred the provincial capital of Cavite from Trece Martires City to Imus. There is no other enabling law after that specifies the capital of Cavite, but the seat of the provincial government has been moved back to Trece Martires in 1979. Imus also has the dubious distinction as the "Traffic Capital of the Philippines".', 'admin', '253158', '96.3'), (107, 'Indang', 'Indang is a 3rd class municipality in the province of Cavite, Philippines. The 80.45% or 7,176.38 hectares are primarily

202

devoted to agriculture. They are predominantly planted with various types of crops like coconut, banana, coffee, fruit trees, and pineapple, while there are small portions of rice, root crops, vegetables, and corn. Most farmers are engaged in multi-cropping farming system. The largest number of employment is farming and trading of agricultural products. Livestock and poultry raisers occupied an area of about 22.76 hectares or 0.32% of the total agricultural area.', 'admin', '60755', '89.2'), (108, 'Kawit', 'Kawit, formerly Cavite El Viejo, is a first class urban municipality in the province of Cavite, Philippines. With the continuous expansion of Metro Manilla, the municipality is now included in Manilla built up area which reaches Lipa City in its southernmost part. The name Kawit is derived from the Tagalog word kawit (hook) which is suggestive of its location at the base of a hookshaped shoreline along Manila Bay extending to the tip of Cavite City. Kawit is politically subdivided into 23 barangays.', 'admin', '76405', '13.4'), (109, 'Magallanes', 'Magallanes is a 4th class municipality. The town is named after Ferdinand Magellan. Magallanes began its history as a barrio called Panitan, then a part of the municipality of Maragondon. Although the main source of livelihood in Magallanes is agriculture, it is evident that there has been a shift in emphasis from rice farming to coffee production because of the growing market demand for coffee.', 'admin', '18890', '78.6'), (110, 'Maragondon', 'Maragondon is a 4th class municipality 54 kilometers away from Manila going southeast. According to the 2007 census, it has a population of 33,604 people. This municipality is in the east of South China Sea. The name Maragondon was derived from Tagalog word madagundong or maugong, meaning much sound. Actually the sounds comes from a noisy river called Kay Albaran in the barrio of Capantayan.', 'admin', '33604', '165.49'), (111, 'Mendez (Mendez-Nuñez)', 'Mendez is a 4th class urban municipality in the province of Cavite, Philippines. According to the 2007 census, it has a population of 26,757 people in an area of 16.7 square kilometers. Mendez is politically subdivided into 25 barangays.', 'admin', '26757', '16.67'), (112, 'Naic', 'Naic is a 2nd class municipality in the province of Cavite, Philippines. According to the 2007 census, it has a population of 87,058 people in a land area of 86.0 square kilometers. Naic is an acronym for Nuestra Adorable Immaculada Concepcion. The town\'s name is the Spanish translation of the town\'s patron saint, Our Lady of Immaculate Concepcion. Naic is politically subdivided into 31 barangays (6 urban, 25 rural).', 'admin', '87058', '86'), (113, 'Noveleta', 'Noveleta is a fourth class urban municipality. Noveleta is the smallest town of Cavite province. It is principally a resort town located in the northwestern portion of Cavite. Noveleta is 26 kilometers away from Metro Manila and is accessible by land transport modes. The town is bordered on the north by Cavite City, on the west by Manila Bay and Rosario. It is flanked by General Trias on the south and Kawit on the east. With the continuous expansion of Metro Manila, the municipality is now included in Manila built up area which reaches Lipa City in its southernmost part.', 'admin', '39294', '5.41'), (114, 'Rosario', 'Rosario is a first class urban municipality. According to the 2007 census, it has a population of 94,228 people in an area of 8.20 square kilometers, making it one of the most densely populated city/municipality in Cavite. Geographically, Rosario is bounded in the north-northeast by Noveleta, in the South by Tanza and in the west-southwest by Manila Bay. It lies 30 km south of Manila, and 17 km south-southwest of Cavite City. It is accessible by land and water(sea) transportation.', 'admin', '94228', '5.67'), (115, 'Silang', 'Silang is a first class landlocked municipality. Silang is located in the eastern section of Cavite. This is the location of Philippine National Police Academy. It is approximately 45 kilometers south of Manila. General Trias, Dasmariñas and General Mariano Alvarez (GMA) bound it on the south and on the west by Amadeo. Silang is noted for its relatively cool and invigorating climate.', 'admin', '199825', '156.41'), (116, 'Tagaytay', 'Tagaytay City is a third class city in the province of Cavite, Philippines. Only 55 km (34 mi) away from Manila via Aguinaldo Highway, it is one of the country\'s most popular tourist destinations. Tagaytay City provides a good view of the Taal Volcano. The city is a popular summer tourist destination because of its cool climate due to its high altitude. The City is linked by the national highway to the Metropolitan Manila Area and to the Province of Batangas. It is also connected by the roads to the adjoining municipalities of Amadeo, Mendez, Indang, Silang and Alfonso in Cavite towards the northwest, to the cities of Calamba and Santa Rosa in Laguna in the northeast and to the town of Talisay in Batangas in the south.', 'admin', '61623', '66.15'), (117, 'Tanza', 'Tanza, formerly known as Sta. Cruz de Malabon, is a 1st class municipality. According to the 2007 census, it has a population of 171,795 people in a land area of 98.2 square kilometers. With the continuous expansion of Metro Manila, the municipality is now included in Manilla built up area which reaches Lipa City in its southernmost part. Tanza was the place were Emilio Aguinaldo took oath as the first president of the revolutionary government of the Philippines. ', 'admin', '171795', '96.3'), (118, 'Ternate', 'Ternate is a fourth class municipality in the province of Cavite, Philippines. According to the 2007 census, it has a population of 20,457 people. Ternate is politically subdivided into 10 barangays (3 urban and 7 rural).', 'admin', '20457', '43.5'), (119, 'Trece Martires', 'Trece Martires City is a third-class city that serves as the seat of government of the Cavite, where many of the provincial government offices are located. According to the 2007 census, it has a population of 90,177 people in a land area of 49.10 square kilometers. It is named after the Thirteen Martyrs of Cavite, who were executed by the Spaniards on September 12, 1896. With the continuous expansion of Metro Manila, the city is now included in Manila built up area which reaches Lipa City in its southernmost part.', 'admin', '90177', '39.17'), (120, 'General Mariano Alvarez', 'Gen. Mariano Alvarez is a first class urban municipality . According to the 2007 census, it has a population of 136,613 people in an area of just 11.40 square kilometers, making it the most densely populated city/municipality in Cavite. The municipality is projected to have a population of 188,125 in 2010. With the continuous expansion of Metro Manila, the municipality is now included in Manila built up area which reaches Lipa City in its southernmost part.', 'admin', '136613', '9.38'); # ------------------------------------------------------# # Table structure for table `map` # DROP TABLE IF EXISTS `map`; CREATE TABLE `map` ( `filename` varchar(100) NOT NULL default '', `name` varchar(100) default NULL, `width` int(11) NOT NULL default '0', `height` int(11) NOT NULL default '0', `area` int(11) default NULL, `units` int(11) default NULL, `contributor` varchar(100) NOT NULL default '', PRIMARY KEY (`filename`) ) TYPE=MyISAM; # # Dumping data for table `map` # INSERT INTO `map` (`filename`, `name`, `width`, `height`, `area`, `units`, `contributor`) VALUES ('mm.swf', 'Metro Manila', 405, 600, 617, 17, 'admin'), ('mega.swf', 'Mega Manila', 600, 720, 7903, 108, 'james'), ('mm2.swf', 'Metro Manila', 405, 600, 617, 17, 'yano'); # ------------------------------------------------------# # Table structure for table `region` # DROP TABLE IF EXISTS `region`; CREATE TABLE `region` ( `region_no` int(11) NOT NULL auto_increment, `code` varchar(100) default NULL, `name` varchar(100) default NULL, `description` longtext, `contributor` varchar(100) NOT NULL default '', PRIMARY KEY (`region_no`) ) TYPE=MyISAM; # # Dumping data for table `region` # INSERT INTO `region` (`region_no`, `code`, `name`, `description`, `contributor`) VALUES (9, 'NCR', 'National Capital Region', 'Metropolitan Manila or the National Capital Region (NCR) is the metropolitan area of the city of Manila, the national capital of the Philippines. Its residential population as of August 2007 Census is 11,553,427. Including suburbs in the adjacent provinces (Laguna, Cavite, Rizal, Bulacan) of Greater Manila, the population approaches 20 million. Metro Manila is one of the two defined metropolitan areas in the Philippines, the other being Metro Cebu. In 2005, it ranked as the 42nd richest urban agglomeration in the world with a GDP of $108 billion according to Price Waterhouse Coopers. Metro Manila is expected to climb to the 30th spot by 2020 with a GDP of $257 billion and an annual growth rate of 5.9%. As proclaimed by Presidential Decree No. 940, Metro Manila as a whole is the Philippines\' seat of government although only the

203

City of Manila is the capital.', 'admin'), (7, 'District 3', 'CAMANAVA District', 'Composed of Caloocan, Malabon, Navotas, and Valenzuela Cities, CAMANAVA - a non-functioning district - covers the northern cities of Metro Manila (4 Cities, 255 Bgys). Commonly associated with the most flood-ridden cities in the metropolis. \r\n', 'admin'), (8, 'District 4', 'Southern Manila District', 'Composed of Las Piñas, Makati, Muntinlupa, Parañaque, Pasay, Pateros, Taguig (1 Mun. 6 Cities 317 Bgys), the non-functioning district covers southern cities of Metro Manila.', 'admin'), (6, 'District 2', 'Eastern Manila District', 'Composed of Mandaluyong, Marikina, Pasig, Quezon City, San Juan (5 Cities 236 Bgys) the non-functioning district covers eastern cities of Metro Manila.', 'admin'), (5, 'District 1', 'The Capital District', 'The capital district contains the City of Manila (1 City 14 City District 897 Bgys) as its lone city.', 'admin'), (10, 'Bulacan', 'Bulacan', 'Bulacan, officially called the Province of Bulacan (or Lalawigan ng Bulakan in Filipino) or simply Bulacan Province, is a first class province of the Republic of the Philippines located in the Central Luzon Region (Region 3) in the island of Luzon, north of Manila (the nation\'s capital), and part of the Metro Luzon Urban Beltway Super Region. Bulacan is located immediately north of Metropolitan Manila. Bordering Bulacan are the provinces of Pampanga to the west, Nueva Ecija to the north, Aurora and Quezon to the east, & Metro Manila and Rizal to the south. Bulacan also lies on the north-eastern shore of Manila Bay.', 'admin'), (11, 'Rizal', 'Rizal', 'Rizal is a province of the Philippines located in the CALABARZON region in Luzon, just 20 kilometers east of Manila. Rizal is bordered by Metro Manila to the west, the province of Bulacan to the north, Quezon to the east and Laguna province to the south. The province also lies on the northern shores of Laguna de Bay, the largest lake in the country.', 'admin'), (12, 'Laguna', 'Laguna', 'Laguna is a province of the Philippines found in the CALABARZON region in Luzón. Its capital is Santa Cruz and the province is located southeast of Metro Manila, south of the province of Rizal, west of Quezon, north of Batangas and east of Cavite. Laguna almost completely surrounds Laguna de Bay, the largest lake in the country. Laguna lies on the southern shores of Laguna de Bay, the largest lake in the country. On the southern border of the province are Mt. Makiling and Mt. Banahaw, both are long dormant volcanoes, but still sources of geothermal energy. Mt. Makiling is popular for the numerous hot spring resorts that are found on its slopes. Pagsanjan Falls, is a popular waterfall that tumbles down a deep gorge in the hills. The eastern portion of Laguna straddles the southernmost portions of the Sierra Madre mountain range.', 'admin'), (13, 'Cavite', 'Cavite', 'Cavite is a province of the Philippines located on the southern shores of Manila Bay in the CALABARZON region in Luzon, just 30 kilometers south of Manila. Cavite is surrounded by Laguna to the east, Metro Manila to the northeast, and Batangas to the south. To the west lies the South China Sea. Cavite is located at the intermediate zone of the metropolitan Manila area. The urban influence of the metropolis together with easy accessibility, adequate infrastructure and fresh natural setting makes the picturesque province an ideal refuge. Cavite has a total population of 2,856,765 within an area of 1,512.4 km² making it the most populous (if independent cities are excluded FROM Cebu and Negros Occidental), and the second most densely-populated province in the country.', 'admin'), (14, 'Mega Manila', 'Mega Manila', 'Using the definition of TV ratings agency AGB Nielsen Philippines, Mega Manila consists of Metro Manila and the provinces of Bulacan, Cavite, Laguna and Rizal for their TV audience ratings gathering. The area has a population of 17,902,899 or about 23% of the population, but the area has a higher ownership of televisions per household anywhere in the country due to its relative economic prosperity as compared to other places in the Philippines. Radio ratings agency Radio Research Council (provided by KBP) also provide measurement of audience ratings.', 'admin'), (18, 'Greater Muntinlupa', 'Greater Muntinlupa', 'Muntilupa plus surrounding areas.', 'melba'); # -------------------------------------------------------# # Table structure for table `subregion` # DROP TABLE IF EXISTS `subregion`; CREATE TABLE `subregion` ( `region` int(11) NOT NULL default '0', `g_unit` int(11) NOT NULL default '0' ) TYPE=MyISAM; # # Dumping data for table `subregion` # INSERT INTO `subregion` (`region`, `g_unit`) VALUES (9, 19), (9, 17), (9, 18), (9, 16), (9, 15), (9, 14), (9, 13), (9, 20), (9, 21), (9, 22), (9, 23), (9, 24), (9, 25), (9, 26), (9, 27), (9, 28), (9, 29), (5, 18), (7, 14), (7, 16), (7, 21), (7, 29), (6, 17), (6, 19), (6, 24), (6, 26), (6, 27), (8, 13), (8, 15), (8, 20), (8, 22), (8, 23), (8, 25), (8, 28), (10, 30), (10, 31), (10, 32), (10, 33), (10, 34), (10, 35), (10, 36), (10, 37), (10, 38), (10, 39), (10, 40), (10, 41), (10, 42), (10, 43), (10, 44), (10, 45), (10, 46), (10, 47), (10, 48), (10, 49), (10, 50), (10, 51), (10, 52), (10, 53), (11, 54), (11, 55), (11, 56), (11, 57), (11, 58), (11, 59), (11, 60), (11, 61), (11, 62), (11, 63), (11, 64), (11, 65), (11, 66), (11, 67), (12, 68), (12, 69), (12, 70), (12, 71), (12, 72), (12, 73), (12, 74), (12, 75), (12, 76), (12, 77), (12, 78), (12, 79), (12, 80), (12, 81), (12, 82), (12, 83), (12, 84), (12, 85), (12, 86), (12, 87), (12, 88), (12, 89), (12, 90), (12, 91), (12, 92), (12, 93), (12, 94), (12, 95), (12, 96), (12, 97), (13, 98), (13, 99), (13, 100), (13, 101), (13, 102), (13, 103), (13, 104), (13, 105), (13, 106), (13, 107), (13, 108), (13, 109), (13, 110), (13, 111), (13, 112), (13, 113), (13, 114), (13, 115), (13, 116), (13, 117), (13, 118), (13, 119), (13, 120), (14, 13), (14, 14), (14, 15), (14, 16), (14, 17), (14, 18), (14, 19), (14, 20), (14, 21), (14, 22), (14, 23), (14, 24), (14, 25), (14, 26), (14, 27), (14, 28), (14, 29), (14, 30), (14, 31), (14, 32), (14, 33), (14, 34), (14, 35), (14, 36), (14, 37), (14, 38), (14, 39), (14, 40), (14, 41), (14, 42), (14, 43), (14, 44), (14, 45), (14, 46), (14, 47), (14, 48), (14, 49), (14, 50), (14, 51), (14, 52), (14, 53), (14, 54), (14, 55), (14, 56), (14, 57), (14, 58), (14, 59), (14, 60), (14, 61), (14, 62), (14, 63), (14, 64), (14, 65), (14, 66), (14, 67), (14, 68), (14, 69), (14, 70), (14, 71), (14, 72), (14, 73), (14, 74), (14, 75), (14, 76), (14, 77), (14, 78), (14, 79), (14, 80), (14, 81), (14, 82), (14, 83), (14, 84), (14, 85), (14, 86), (14, 87), (14, 88), (14, 89), (14, 90), (14, 91), (14, 92), (14, 93), (14, 94), (14, 95), (14, 96), (14, 97), (14, 98), (14, 99), (14, 100), (14, 101), (14, 102), (14, 103), (14, 104), (14, 105), (14, 106), (14, 107), (14, 108), (14, 109), (14, 110), (14, 111), (14, 112), (14, 113), (14, 114), (14, 115), (14, 116), (14, 117), (14, 118), (14, 119), (14, 120), (15, 15), (15, 17), (15, 18), (15, 24), (15, 26), (15, 27), (18, 13), (18, 20), (18, 22), (18, 28), (18, 93), (18, 100), (18, 103); # -------------------------------------------------------# # Table structure for table `traffic` # DROP TABLE IF EXISTS `traffic`; CREATE TABLE `traffic` ( `source` int(11) NOT NULL default '0', `destination` int(11) NOT NULL default '0', `traffic` double NOT NULL default '0', PRIMARY KEY (`source`,`destination`) ) TYPE=MyISAM; # # Dumping data for table `traffic` # INSERT INTO `traffic` (`source`, `destination`, `traffic`) VALUES (13, 20, '0.011061121234322'), (13, 22, '0.013467053644669'), (14, 16, '0.0073090784437727'), (14, 18, '0.0075883990234002'), (14, 21, '0.0072554107656395'), (14, 26, '0.0043312475462751'), (14, 29, '0.0049762750183244'), (15, 17, '0.016725870571708'), (15, 18, '0.018149395370032'), (15, 23, '0.016482719839807'), (15, 24, '0.011665189251433'), (15, 25, '0.025354815240058'), (15, 28, '0.0092288536256106'), (16, 14, '0.027711556739744'), (16, 21, '0.031522130658462'), (16, 29, '0.022881041352174'), (17, 15, '0.02793609445768'), (17, 18, '0.037901349769428'), (17, 24, '0.027071217260892'), (17, 26, '0.02320404743828'), (17, 27, '0.04056797654266'), (18, 14, '0.0063004885391521'), (18, 15, '0.0055778074112357'), (18, 17, '0.0069739538879921'), (18, 21, '0.007134968969457'), (18, 23, '0.0068992269934154'), (18, 26, '0.0047070975840168'), (18, 27, '0.0079021088863843'), (19, 24, '0.014059288018922'), (19, 26, '0.011276229952191'), (20, 13, '0.012999796148007'), (20, 22, '0.0099653819575532'), (20, 28, '0.0071040947757223'), (21, 14, '0.040776080387809'), (21, 16, '0.046726229294379'), (21, 18, '0.048296036818275'), (22, 13, '0.012971658282971'), (22, 20, '0.0081673180617378'), (22, 23, '0.014838689248362'), (22, 28, '0.0081397242427532'), (23, 15, '0.020871375265467'), (23, 18, '0.028426361215943'), (23, 22, '0.020346024452692'), (23, 28, '0.017130654188913'), (24, 15, '0.0096447507548413'), (24, 17, '0.013400779013341'), (24, 19, '0.0096706700389507'), (24, 25, '0.020535169961463'), (24, 26, '0.0073022954534567'), (24, 28, '0.0072022632163471'), (25, 15, '0.20892261328167'), (25, 24, '0.20465581130741'), (25, 28,

204

'0.18458050801851'), (26, 14, '0.0022288778169649'), (26, 17, '0.0026462893504264'), (26, 18, '0.0029174430786702'), (26, 19, '0.0017869338856855'), (26, 24, '0.0016823281963516'), (26, 27, '0.003221556662748'), (26, 29, '0.0015732333128067'), (27, 17, '0.099822042564842'), (27, 18, '0.10567243638338'), (27, 26, '0.069508080555936'), (28, 15, '0.0076796343970666'), (28, 20, '0.0052462488362955'), (28, 22, '0.007334395273118'), (28, 23, '0.01125756713617'), (28, 24, '0.00724874056721'), (28, 25, '0.018640331212171'), (29, 14, '0.012060518495603'), (29, 16, '0.014626455368693'), (29, 26, '0.0074093734180775'), (13, 100, '0.011187843380359'), (14, 42, '0.0038653589158936'), (16, 44, '0.016456625449226'), (19, 55, '0.0079694072207437'), (19, 58, '0.011603051427585'), (20, 93, '0.0095056276396809'), (20, 100, '0.0072866961184961'), (20, 103, '0.0056998657352344'), (21, 44, '0.024092547606626'), (24, 58, '0.0075270993443733'), (26, 50, '0.00081916363432794'), (26, 63, '0.00071720465020807'), (26, 64, '0.0009337364011271'), (28, 58, '0.0055483174449968'), (28, 66, '0.0053681545236515'), (29, 42, '0.006280244014474'), (29, 44, '0.0048659267956578'), (30, 35, '0.0058187585895288'), (30, 37, '0.0026313044787921'), (30, 43, '0.0039307001524936'), (30, 45, '0.0098720372008961'), (30, 52, '0.0046609371764219'), (30, 53, '0.0086962070254613'), (31, 33, '0.015793886797269'), (31, 34, '0.0078367685533789'), (31, 38, '0.018140314912896'), (31, 45, '0.011401123093612'), (31, 47, '0.011336086561164'), (31, 53, '0.010404751269406'), (32, 35, '0.0068152567490619'), (32, 47, '0.0083572202917172'), (32, 48, '0.010735139166703'), (32, 52, '0.0063662926515893'), (33, 31, '0.009356001398641'), (33, 34, '0.0078373418259826'), (33, 41, '0.017510787491613'), (33, 42, '0.015920510566985'), (33, 53, '0.009358566473926'), (34, 31, '0.006795501390253'), (34, 33, '0.01147234019007'), (34, 38, '0.013506999681833'), (34, 40, '0.011456514822449'), (34, 42, '0.016404662765658'), (34, 44, '0.0052737207597283'), (35, 30, '0.0050934394621051'), (35, 32, '0.015384840394852'), (35, 45, '0.0092631630988283'), (35, 47, '0.0091959797959823'), (35, 52, '0.0047016364265586'), (36, 39, '0.0098060438495363'), (36, 40, '0.01031876103125'), (36, 46, '0.0074825183386555'), (36, 47, '0.0074795724211106'), (36, 48, '0.010802792712829'), (37, 30, '0.0073230116315624'), (37, 43, '0.0040450592057005'), (37, 49, '0.012893150302141'), (37, 51, '0.015932725558001'), (37, 52, '0.0060773341716441'), (38, 31, '0.01274427010367'), (38, 34, '0.010943205379658'), (38, 40, '0.01652056598487'), (38, 47, '0.013401611095545'), (39, 36, '0.0076083797069556'), (39, 46, '0.0078965637343761'), (40, 34, '0.0037126628980271'), (40, 36, '0.0045340858658083'), (40, 38, '0.0066080338370639'), (40, 46, '0.0046972909727483'), (40, 47, '0.0046959965302216'), (41, 33, '0.011548244957994'), (41, 42, '0.013770421475997'), (41, 50, '0.010724659088076'), (41, 53, '0.0094428640875242'), (42, 14, '0.027114007464724'), (42, 29, '0.018176857320669'), (42, 33, '0.0085703272981328'), (42, 34, '0.0060328773441726'), (42, 41, '0.011240285429883'), (42, 44, '0.006290761344193'), (43, 30, '0.0019795866123068'), (43, 37, '0.00073199962074524'), (43, 50, '0.0057364179387504'), (43, 53, '0.0037864172615097'), (43, 63, '0.0031461647861951'), (44, 16, '0.10638419424793'), (44, 21, '0.105068825767'), (44, 29, '0.049208325926979'), (44, 34, '0.0067764940097408'), (44, 42, '0.021980316873452'), (45, 30, '0.0086477398288174'), (45, 31, '0.011786005244323'), (45, 35, '0.0092698847238485'), (45, 47, '0.012753257087257'), (45, 53, '0.011790481530607'), (46, 36, '0.013706111007288'), (46, 39, '0.018642590170062'), (46, 40, '0.019581760418613'), (47, 31, '0.0071189401604937'), (47, 32, '0.011468875542242'), (47, 35, '0.0055904430107096'), (47, 36, '0.0073446932887184'), (47, 38, '0.011979510003306'), (47, 40, '0.010494517466965'), (47, 45, '0.007747370187443'), (47, 48, '0.010969820605041'), (48, 32, '0.01729861699291'), (48, 36, '0.01245597277119'), (48, 47, '0.012880841607064'), (49, 37, '0.0026336037443724'), (49, 51, '0.0058004951590003'), (49, 52, '0.0037873955635466'), (50, 26, '0.0049987656289143'), (50, 41, '0.0039189983830194'), (50, 43, '0.0013778951923296'), (50, 53, '0.0019543816269362'), (50, 63, '0.0018005921337311'), (51, 37, '0.0021902491374902'), (51, 49, '0.0039037062112711'), (52, 30, '0.0029029477979457'), (52, 32, '0.010225452605413'), (52, 35, '0.0033452933727311'), (52, 37, '0.001360067539046'), (52, 49, '0.0041495083094914'), (53, 30, '0.0022504186368932'), (53, 31, '0.0031775201384181'), (53, 33, '0.0048246374249551'), (53, 41, '0.0073815706504566'), (53, 43, '0.0019456168752079'), (53, 45, '0.003483125766457'), (53, 50, '0.0041808330421783'), (54, 55, '0.012197944634756'), (54, 57, '0.018797256426874'), (54, 66, '0.026933000030861'), (54, 67, '0.014447324836178'), (55, 19, '0.0053376100799563'), (55, 54, '0.0018703536912572'), (55, 58, '0.0032504036725129'), (55, 63, '0.00081644744002486'), (55, 64, '0.0017316091745521'), (55, 65, '0.00053252698730173'), (55, 66, '0.0030761028501304'), (55, 67, '0.0011616304215808'), (56, 61, '0.014419236137546'), (56, 65, '0.0083842997927505'), (57, 54, '0.0076476576919696'), (57, 59, '0.0070614633513441'), (57, 61, '0.0048941514495817'), (57, 67, '0.0057671566268086'), (58, 19, '0.016998656697708'), (58, 24, '0.016031597341852'), (58, 28, '0.011741318851431'), (58, 55, '0.00710982416311'), (58, 64, '0.0091110110534917'), (58, 66, '0.012051911503061'), (59, 57, '0.037541776066931'), (59, 61, '0.023491655912064'), (60, 62, '0.018611159440462'), (60, 89, '0.022169114065001'), (61, 56, '0.0089942617436385'), (61, 57, '0.02313832165895'), (61, 59, '0.020890458664767'), (61, 65, '0.0068795493819832'), (61, 67, '0.014771300803356'), (62, 60, '0.0091387868432294'), (62, 65, '0.0049189947315962'), (62, 89, '0.0088950619393422'), (62, 95, '0.0044645023494233'), (63, 26, '0.0085946581750852'), (63, 43, '0.0014840559227886'), (63, 50, '0.00353597144825'), (63, 55, '0.0023149279497661'), (63, 64, '0.0049089599899818'), (64, 26, '0.013534025749216'), (64, 55, '0.005938493995456'), (64, 58, '0.014284710952432'), (64, 63, '0.0059375419236179'), (65, 55, '0.0035740701531512'), (65, 56, '0.0027980803161832'), (65, 61, '0.0036806972969158'), (65, 62, '0.0030476833227468'), (65, 67, '0.0058889124144259'), (65, 95, '0.0013850748112076'), (66, 28, '0.01254365011334'), (66, 54, '0.0099743985370593'), (66, 55, '0.0074296055012667'), (66, 58, '0.013307585830301'), (67, 54, '0.031605229993699'), (67, 55, '0.016573048879287'), (67, 57, '0.031009823116392'), (67, 61, '0.01679971194527'), (67, 65, '0.012518378491913'), (68, 74, '0.0045415546013621'), (68, 80, '0.0041491849417538'), (68, 115, '0.0020811241780721'), (68, 116, '0.0022436500953422'), (69, 71, '0.0027240413781283'), (69, 75, '0.0022608134289251'), (69, 92, '0.0024653648544418'), (70, 73, '0.013050381542127'), (70, 74, '0.012324478758886'), (70, 115, '0.0090037461180851'), (71, 69, '0.016005530790821'), (71, 72, '0.015027488855869'), (71, 75, '0.0094659484893512'), (72, 71, '0.011955433840334'), (72, 75, '0.0097900740799117'), (72, 80, '0.024304121680195'), (73, 70, '0.013259398252993'), (73, 93, '0.014832380535521'), (73, 101, '0.0073934116124612'), (73, 115, '0.005083962928426'), (73, 120, '0.015684381601233'), (74, 68, '0.007967025520671'), (74, 70, '0.016019073958658'), (74, 115, '0.0055603397346006'), (75, 69, '0.0098878914122794'), (75, 71, '0.0070460662144227'), (75, 72, '0.0091598768618198'), (75, 86, '0.0044343570269872'), (75, 92, '0.0059147188221993'), (75, 97, '0.011614591014108'), (76, 81, '0.0084214747504356'), (76, 82, '0.0083235217483349'), (76, 88, '0.015820834758252'), (77, 83, '0.061315459969065'), (77, 95, '0.042870602243991'), (77, 96, '0.070282954015369'), (78, 82, '0.014194099891525'), (78, 87, '0.028703956987219'), (79, 84, '0.0084315993638571'), (79, 85, '0.0084669131502022'), (79, 86, '0.0090575569611228'), (80, 68, '0.015156213563687'), (80, 72, '0.012507021119121'), (81, 76, '0.008952436596555'), (81, 84, '0.0082766442853433'), (81, 85, '0.0083366658010906'), (81, 88, '0.015704102830434'), (82, 76, '0.0059900209776278'), (82, 78, '0.010581074429561'), (82, 88, '0.010560682769047'), (82, 94, '0.02114789227578'), (83, 62, '0.029061269498713'), (83, 77, '0.047278509768287'), (83, 95, '0.020142028244737'), (84, 79, '0.013657738684466'), (84, 81, '0.0078878828803349'), (84, 85, '0.0083629125774246'), (84, 86, '0.0093196538167831'), (84, 88, '0.015384294481998'), (84, 91, '0.021693069972'), (84, 94, '0.030288867833809'), (85, 79, '0.011701223202849'), (85, 81, '0.0067785355348169'), (85, 84, '0.0071350148099441'), (85, 88, '0.01317427473502'), (86, 75, '0.0042150867355879'), (86, 79, '0.0051940891303078'), (86, 84, '0.0032993566797667'), (86, 91,

205

'0.0080387681794288'), (86, 92, '0.0050654751474797'), (86, 94, '0.011081864377081'), (86, 97, '0.010483499795573'), (87, 78, '0.02464407191448'), (87, 89, '0.028042031098154'), (88, 76, '0.0090094777060613'), (88, 81, '0.0084126001557979'), (88, 82, '0.0083568189405742'), (88, 84, '0.0086474595402372'), (88, 85, '0.0086796127309148'), (88, 94, '0.021004117516136'), (89, 60, '0.031473965023219'), (89, 62, '0.025717987353028'), (89, 83, '0.03033096202615'), (89, 87, '0.034212330797352'), (89, 90, '0.032153410400817'), (90, 83, '0.027410301296557'), (90, 89, '0.027789135106671'), (90, 96, '0.03260869874614'), (91, 84, '0.0099099370455669'), (91, 86, '0.010373131797318'), (91, 94, '0.019952393334388'), (91, 97, '0.01918027072452'), (92, 69, '0.037837505660133'), (92, 75, '0.020755654742653'), (92, 86, '0.018700217780365'), (93, 20, '0.015278159243173'), (93, 73, '0.013828512675297'), (93, 103, '0.012967061920578'), (93, 120, '0.019878305442003'), (94, 82, '0.0059021282650078'), (94, 84, '0.0060046341593332'), (94, 86, '0.0062056439743313'), (94, 88, '0.007407932178111'), (94, 91, '0.0086586190317326'), (95, 62, '0.009947272242738'), (95, 65, '0.004980932983084'), (95, 77, '0.022159141381455'), (95, 83, '0.013502144642834'), (96, 77, '0.027359912454244'), (96, 90, '0.021897764524854'), (97, 75, '0.018625094839733'), (97, 86, '0.017685811975918'), (97, 91, '0.025075699350656'), (98, 104, '0.0055221478748463'), (98, 107, '0.0051242454833225'), (98, 109, '0.0047658891459779'), (98, 110, '0.0038014577644369'), (98, 111, '0.014248792723685'), (99, 105, '0.0114919176786'), (99, 107, '0.0072443282943204'), (99, 115, '0.0082049203595647'), (99, 116, '0.010051789938496'), (99, 119, '0.018697997161331'), (100, 13, '0.01349878776752'), (100, 20, '0.0074806900318905'), (100, 103, '0.006004511104369'), (100, 106, '0.0048098687585515'), (100, 108, '0.0081246729541074'), (101, 73, '0.028509693989873'), (101, 115, '0.012655566155427'), (101, 120, '0.053531782490644'), (102, 113, '0.098420975129326'), (103, 20, '0.0046406166946134'), (103, 93, '0.0065684428050155'), (103, 100, '0.0047618720646276'), (103, 105, '0.0021519341680554'), (103, 106, '0.0025225243153901'), (103, 115, '0.0019646096484358'), (103, 120, '0.0069708128012408'), (104, 98, '0.014867774160961'), (104, 109, '0.011028173756875'), (104, 110, '0.0084315486212444'), (105, 99, '0.0016683742622043'), (105, 103, '0.0054819450595241'), (105, 106, '0.0030684652322101'), (105, 113, '0.0077138989500291'), (105, 114, '0.020086560784296'), (105, 115, '0.0016472054197365'), (105, 117, '0.0031044029635464'), (105, 119, '0.0031705699057178'), (106, 100, '0.0083825107903628'), (106, 103, '0.005543399585954'), (106, 105, '0.0026470145785109'), (106, 108, '0.0092383610235505'), (106, 113, '0.0074687968251711'), (106, 114, '0.018142085838357'), (107, 98, '0.0040461760936784'), (107, 99, '0.0037804531079159'), (107, 110, '0.0021585838516132'), (107, 111, '0.010407946044025'), (107, 112, '0.0049339384177669'), (107, 116, '0.0046681495938018'), (107, 119, '0.0091801732955547'), (108, 100, '0.046915533451127'), (108, 106, '0.030610104050782'), (108, 113, '0.043888061427044'), (109, 98, '0.01210344097406'), (109, 104, '0.010402329274749'), (109, 110, '0.006032468678313'), (110, 98, '0.0054269531404991'), (110, 104, '0.0044706979327858'), (110, 107, '0.0039026533122474'), (110, 109, '0.0033910645558068'), (110, 112, '0.0070320001587113'), (110, 118, '0.0080045034321311'), (111, 98, '0.02554686001171'), (111, 107, '0.023632498482818'), (111, 116, '0.026959125960808'), (112, 107, '0.0034432381696275'), (112, 110, '0.0027143207210519'), (112, 117, '0.0074484826207815'), (112, 118, '0.0050265340347814'), (112, 119, '0.0076144639206047'), (113, 102, '0.26194747289663'), (113, 105, '0.042872073344531'), (113, 106, '0.048118940974873'), (113, 108, '0.085337897219253'), (113, 114, '0.14270159566346'), (114, 105, '0.046553505858131'), (114, 106, '0.048741501110781'), (114, 113, '0.059507964723861'), (114, 117, '0.048824791993887'), (115, 68, '0.0037522307018641'), (115, 70, '0.012027959464531'), (115, 73, '0.0066845239584637'), (115, 74, '0.0057148021185204'), (115, 99, '0.0013018240960841'), (115, 101, '0.0043152108094583'), (115, 103, '0.0054696423656414'), (115, 105, '0.0018002164393845'), (115, 116, '0.0015717202552233'), (115, 120, '0.015216389340673'), (116, 68, '0.013117577852425'), (116, 99, '0.0051716404589196'), (116, 107, '0.0046023956732296'), (116, 111, '0.011705780850224'), (116, 115, '0.0050966197685929'), (117, 105, '0.0039463386594488'), (117, 112, '0.003774556884659'), (117, 114, '0.026779955761227'), (117, 119, '0.0052762303908728'), (118, 110, '0.013148718450082'), (118, 112, '0.021391210832478'), (119, 99, '0.0065739601006909'), (119, 105, '0.0076783575634585'), (119, 107, '0.0061849632231215'), (119, 112, '0.007351098395378'), (119, 117, '0.01005167614802'), (120, 73, '0.030164303543587'), (120, 93, '0.041005361861609'), (120, 101, '0.026698688997387'), (120, 103, '0.028387285878462'), (120, 115, '0.02225714243886');

206

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.