initial commit

This commit is contained in:
Chris Sewell
2012-11-28 03:55:08 -05:00
parent 7adb399b2e
commit cf140a2e97
3247 changed files with 492437 additions and 0 deletions

BIN
A.zip Normal file

Binary file not shown.

View File

@ -0,0 +1,19 @@
dev:
site_images_url: http://portal.atlanticbiomedical.com/images/
google:
maps_api_key:ABQIAAAAH8eXa0M6ghDzYagwHY4v2hSIy_WAr7UwMnWXIzgcAQul7TtErhSWFvWS5hr8ADs9x3KcyKFHEIyaHQ
prod:
# site_images_url: http://portal.atlanticbiomedical.com/images/
site_images_url: http://biomed.wootroot.me/images/
google:
# maps_api_key: AIzaSyBvoem1A2w23DhZX119IU_nnjn3hCNoLu4
maps_api_key: AIzaSyBJhZuTYgvG5q65VgZLgtfbe44Q82Dpl0c
all:
default_map_location: 818 Oregon Avenue Linthicum MD 2109
default_map_location_title: Atlantic Biomedical

View File

@ -0,0 +1,4 @@
default:
enabled: off
with_layout: false
lifetime: 86400

View File

@ -0,0 +1,8 @@
<?php
// include project configuration
include(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
// symfony bootstraping
require_once($sf_symfony_lib_dir.'/util/sfCore.class.php');
sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir);

View File

@ -0,0 +1,42 @@
cli:
controller:
class: sfConsoleController
request:
class: sfConsoleRequest
response:
class: sfConsoleResponse
test:
storage:
class: sfSessionTestStorage
all:
# controller:
# class: sfFrontWebController
#
# request:
# class: sfWebRequest
#
# response:
# class: sfWebResponse
#
user:
class: AtlanticBiomedicalUser
storage:
class: sfMySQLSessionStorage
param:
db_table: sessions # Name of the table storing the sessions
database: sessions_db # Name of the database connection to use
#
# storage:
# class: sfSessionStorage
# param:
# session_name: symfony
#
# view_cache:
# class: sfFileCache
# param:
# automaticCleaningFactor: 0
# cacheDir: %SF_TEMPLATE_CACHE_DIR%

View File

@ -0,0 +1,10 @@
rendering: ~
web_debug: ~
security: ~
# generally, you will want to insert your own filters here
cache: ~
common: ~
flash: ~
execution: ~

7
apps/atlbiomed/config/i18n.yml Executable file
View File

@ -0,0 +1,7 @@
#all:
# default_culture: en
# source: XLIFF
# debug: off
# cache: on
# untranslated_prefix: "[T]"
# untranslated_suffix: "[/T]"

View File

@ -0,0 +1,22 @@
prod:
enabled: off
level: err
rotate: on
purge: off
#all:
# enabled: on
# level: debug
# rotate: off
# period: 7
# history: 10
# purge: on
# loggers:
# sf_web_debug:
# class: sfWebDebugLogger
# param:
# condition: %SF_WEB_DEBUG%
# sf_file_debug:
# class: sfFileLogger
# param:
# file: %SF_LOG_DIR%/%SF_APP%_%SF_ENVIRONMENT%.log

View File

@ -0,0 +1,15 @@
# default rules
homepage:
url: /
param: { module: dashboard, action: index }
default_symfony:
url: /symfony/:action/*
param: { module: default }
default_index:
url: /:module
param: { action: index }
default:
url: /:module/:action/*

View File

@ -0,0 +1,2 @@
all:
is_secure: on

View File

@ -0,0 +1,111 @@
prod:
.settings:
no_script_name: off
timeout: 999999999
use_security: on
dev:
.settings:
# E_ALL | E_STRICT = 4095
error_reporting: 4095
web_debug: on
cache: off
no_script_name: off
etag: off
timeout: 999999999
use_security: off
test:
.settings:
# E_ALL | E_STRICT & ~E_NOTICE = 2047
error_reporting: 2047
cache: off
web_debug: off
no_script_name: off
etag: off
use_security: off
all:
# .actions:
# default_module: default # Default module and action to be called when
# default_action: index # A routing rule doesn't set it
#
# error_404_module: default # To be called when a 404 error is raised
# error_404_action: error404 # Or when the requested URL doesn't match any route
#
login_module: security # To be called when a non-authenticated user
login_action: index # Tries to access a secure page
secure_module: security # To be called when a user doesn't have
secure_action: secure # The credentials required for an action
#
# module_disabled_module: default # To be called when a user requests
# module_disabled_action: disabled # A module disabled in the module.yml
#
# unavailable_module: default # To be called when a user requests a page
# unavailable_action: unavailable # From an application disabled via the available setting below
#
# .settings:
# available: on # Enable the whole application. Switch to off to redirect all requests to the unavailable module and action.
#
# # Optional features. Deactivating unused features boots performance a bit.
# use_database: on # Enable database manager. Set to off if you don't use a database.
# use_security: on # Enable security features (login and credentials). Set to off for public applications.
# use_flash: on # Enable flash parameter feature. Set to off if you never use the set_flash() method in actions.
# i18n: off # Enable interface translation. Set to off if your application should not be translated.
# check_symfony_version: off # Enable check of symfony version for every request. Set to on to have symfony clear the cache automatically when the framework is upgraded. Set to off if you always clear the cache after an upgrade.
# use_process_cache: on # Enable symfony optimizations based on PHP accelerators. Set to off for tests or when you have enabled a PHP accelerator in your server but don't want symfony to use it internally.
# compressed: off # Enable PHP response compression. Set to on to compress the outgoing HTML via the PHP handler.
# check_lock: off # Enable the application lock system triggered by the clear-cache and disable tasks. Set to on to have all requests to disabled applications redirected to the $sf_symfony_data_dir/web/arrors/unavailable.php page.
#
# # Output escaping settings
# escaping_strategy: bc # Determines how variables are made available to templates. Accepted values: bc, both, on, off. The value off deactivates escaping completely and gives a slight boost.
# escaping_method: ESC_ENTITIES # Function or helper used for escaping. Accepted values: ESC_RAW, ESC_ENTITIES, ESC_JS, ESC_JS_NO_ENTITIES.
#
# # Routing settings
# suffix: . # Default suffix for generated URLs. If set to a single dot (.), no suffix is added. Possible values: .html, .php, and so on.
# no_script_name: off # Enable the front controller name in generated URLs
#
# # Validation settings, used for error generation by the Validation helper
# validation_error_prefix: ' &darr;&nbsp;'
# validation_error_suffix: ' &nbsp;&darr;'
# validation_error_class: form_error
# validation_error_id_prefix: error_for_
#
# # Cache settings
# cache: off # Enable the template cache
# etag: on # Enable etag handling
#
# # Logging and debugging settings
# web_debug: off # Enable the web debug toolbar
# error_reporting: 341 # Determines which events are logged. The default value is E_PARSE | E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR | E_USER_ERROR = 341
#
# # Assets paths
# rich_text_js_dir: js/tiny_mce
# prototype_web_dir: /sf/prototype
# admin_web_dir: /sf/sf_admin
# web_debug_web_dir: /sf/sf_web_debug
#
# # Helpers included in all templates by default
# standard_helpers: [Partial, Cache, Form]
#
# # Activated modules from plugins or from the symfony core
# enabled_modules: [default]
#
# # Charset used for the response
# charset: utf-8
#
# # Miscellaneous
# strip_comments: on # Remove comments in core framework classes as defined in the core_compile.yml
# autoloading_functions: ~ # Functions called when a class is requested and this it is not already loaded. Expects an array of callables. Used by the framework bridges.
timeout: 999999999 # Session timeout, in seconds
# max_forwards: 5
# path_info_array: SERVER
# path_info_key: PATH_INFO
# url_format: PATH
#
# # ORM
# orm: propel

17
apps/atlbiomed/config/view.yml Executable file
View File

@ -0,0 +1,17 @@
default:
http_metas:
content-type: text/html
metas:
title: Atlantic Biomedical
robots: index, follow
description: Atlantic Biomedical
keywords: Atlantic Biomedical, medical, equipment, repair
language: en
stylesheets: [main, client, user, theme]
javascripts: []
has_layout: on
layout: layout

View File

@ -0,0 +1,5 @@
<?php
class AtlanticBiomedicalUser extends sfBasicSecurityUser
{
}

View File

@ -0,0 +1,68 @@
<?php
/**
* Represents a pinpointed location on a Google Map.
*
* @author Ciphent
**/
class GMapMarker
{
var $address;
var $title;
var $contents;
var $imageColor;
var $latitude;
var $longitude;
public function GMapMarker($theAddress, $theLatitude, $theLongitude, $theTitle, $theContents, $theImageColor)
{
$this->address = $theAddress;
if($theLatitude != '')
$this->latitude = $theLatitude;
if($theLongitude != '')
$this->longitude = $theLongitude;
$this->title = $theTitle;
$this->contents = $theContents;
$this->imageColor = $theImageColor;
}
public function hasLatLong()
{
return isset($this->latitude) && isset($this->longitude);
}
public function getLatitude()
{
return $this->latitude;
}
public function getLongitude()
{
return $this->longitude;
}
public function getAddress()
{
return $this->address;
}
public function getTitle()
{
return $this->title;
}
public function getContent()
{
return $this->contents;
}
public function getImageColor()
{
return $this->imageColor;
}
}
?>

View File

@ -0,0 +1,113 @@
<?php
/**
* Represents a Google Map. A simple wrapper over the api.
*
* @author Ciphent
**/
class GoogleMap
{
var $map;
public function GoogleMap($mapId)
{
$this->map = new GoogleMapAPI($mapId);
$this->map->setAPIKey(sfConfig::get('app_google_maps_api_key'));
$this->map->disableDirections();
$this->map->enableSidebar();
}
public function includeDefaultLocation()
{
/*
$this->map->addMarkerByAddress(sfConfig::get('app_default_map_location'),
sfConfig::get('app_default_map_location_title'),
'<h2>' . sfConfig::get('app_default_map_location_title') . '</h2>'
);
$this->map->addMarkerIcon(sfConfig::get('app_site_images_url') . 'pin_blue.png',
sfConfig::get('app_site_images_url') . 'pin_shadow_big.png', 10, 35, 10, 10);
*/
// support for chaining
return $this;
}
public function setWidth($width)
{
$this->map->setWidth($width);
// support for chaining
return $this;
}
public function setHeight($height)
{
$this->map->setHeight($height);
// support for chaining
return $this;
}
public function getMapJS()
{
return $this->map->printHeaderJS() . ' ' . $this->map->printMapJS();
}
public function getMapHtml()
{
return $this->map->printMap();
}
public function addMarkers($markers)
{
// create some map markers
foreach($markers as $mapMarker)
{
$this->addMarker($mapMarker);
}
// support for chaining
return $this;
}
public function addMarker($mapMarker)
{
static $cc = 0;
$cc++;
$distance = $this->map->geoGetDistance(39.227088,-76.660942,$mapMarker->getLatitude(),$mapMarker->getLongitude());
$distance = 'Distance: '.substr($distance, 0, 5).' mi (approx)';
if ($mapMarker->hasLatLong())
{
$this->map->addMarkerByCoords($mapMarker->getLongitude(),
$mapMarker->getLatitude(),
$mapMarker->getTitle(),
'<h2>' . $mapMarker->getTitle() . "</h2><br />{$mapMarker->getAddress()}<br/>" . $mapMarker->getContent());
}
else
{
$cord_found = $this->map->addMarkerByAddress($mapMarker->getAddress(), $mapMarker->getTitle(),
'<h2>' . $mapMarker->getTitle() . "</h2><br />{$mapMarker->getAddress()}<br/>" . $mapMarker->getContent());
if($cord_found===false)
return false;
}
// print "$cc. ". $mapMarker->getTitle()." ".$mapMarker->getImageColor()."<br/>";
$this->map->addMarkerIcon('/images/pins/' . 'pin_' . $mapMarker->getImageColor() . '.png',
'/images/' . 'pin_shadow_big.png', 10, 35, 10, 10);
// support for chaining
return $this;
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,847 @@
NAME:
GoogleMapAPI - A library used for creating google maps.
AUTHOR:
Monte Ohrt <monte [AT] ohrt [DOT] com>
LATEST VERSION:
2.4 - Aug 1st, 2007
SYNOPSIS:
<?php
require('GoogleMapAPI.class.php');
$map = new GoogleMapAPI('map');
// setup database for geocode caching
$map->setDSN('mysql://USER:PASS@localhost/GEOCODES');
// enter YOUR Google Map Key
$map->setAPIKey('YOURGOOGLEMAPKEY');
// create some map markers
$map->addMarkerByAddress('621 N 48th St # 6 Lincoln NE 68502','PJ Pizza','<b>PJ Pizza</b>');
$map->addMarkerByAddress('826 P St Lincoln NE 68502','Old Chicago','<b>Old Chicago</b>');
$map->addMarkerByAddress('3457 Holdrege St Lincoln NE 68502',"Valentino's","<b>Valentino's</b>");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<?php $map->printHeaderJS(); ?>
<?php $map->printMapJS(); ?>
<!-- necessary for google maps polyline drawing in IE -->
<style type="text/css">
v\:* {
behavior:url(#default#VML);
}
</style>
</head>
<body onload="onLoad()">
<table border=1>
<tr><td>
<?php $map->printMap(); ?>
</td><td>
<?php $map->printSidebar(); ?>
</td></tr>
</table>
</body>
</html>
OUTPUT:
View the output of the above example here:
http://www.phpinsider.com/php/code/GoogleMapAPI/demo/
DESCRIPTION:
GoogleMapAPI - A library used for creating google maps using the
Google Map public API. Features include multiple map markers, customizable
icons, map directions built into info window, and sidebar generation.
More information on the Google Map API can be found here:
http://www.google.com/apis/maps/
DISCUSSION:
-----------
Discussions are currently held in the Smarty add-on forum (although Smarty
is not necessary to use GoogleMapAPI.)
http://www.phpinsider.com/smarty-forum/viewforum.php?f=19
BASE CLASS METHODS:
-------------------
GoogleMapAPI($map_id = 'map', $app_id = 'MyMapApp')
---------------------------------------------------
Class Constructor.
The map id is needed only if you have multiple maps on the same page.
The App ID is used for the Yahoo GeoCode API, which is the default
lookup service. Use a unique App ID per application.
Example:
// use defaults
$map = new GoogleMapAPI();
// set custom map id and app id
$map = new GoogleMapAPI('mymap','myapp');
setDSN($dsn)
------------
Used to set the database DSN. The database is used to cache
geocode lookups (highly recommended!) The PEAR::DB module
is required for database access. You will need to create
the following database schema (mysql example given):
CREATE TABLE GEOCODES (
address varchar(255) NOT NULL default '',
lon float default NULL,
lat float default NULL,
PRIMARY KEY (address)
);
Example:
$map->setDSN('mysql://DBUSER:DBPASS@DBHOST/DBNAME');
$map->setDSN('mysql://geo:foobar@localhost/GEOCODES');
setAPIKey($key)
---------------
Sets the Google Map API Key. This is mandatory, you will need
an API Key for your hostname! You can register free here:
http://www.google.com/apis/maps/signup.html
Example:
// enter YOUR registered API Key
$map->setAPIKey('ABQIAAAAxp5FF-A0RhHOnnTBwrlRbx');
setWidth($width)
----------------
Sets the width of the map window. This can be either px or %.
Default is 500px.
Example:
$map->setWidth('500px');
$map->setWidth('100%');
setHeight($height)
------------------
Sets the height of the map window. This can be either px or %.
Default is '500px'.
Example:
$map->setHeight('500px');
$map->setHeight('100%');
enableMapControls()
-------------------
This will enable the map controls to zoom/move around the map.
Enabled by default.
disableMapControls()
--------------------
This will disable the map controls to zoom/move around the map.
Enabled by default.
setZoomLevel()
--------------
This sets the default map zoom level.
Example:
$map->setZoomLevel(4);
setControlSize($size)
---------------------
This sets the map control size. Relevant only if map controls are
enabled. large = map zoom/move with slider. small = zoom/move without
slider. Large is default.
Example:
$map->setControlSize = 'small';
enableTypeControls()
--------------------
This will enable the map type controls (map/satellite/hybrid).
Enabled by default.
disableTypeControls()
---------------------
This will disable the map type controls (map/satellite/hybrid).
Enabled by default.
setMapType($type)
-----------------
This sets the default map type. Relevant only if map type controls are
enabled. map = default map. satellite = satellite view. hybrid = hybrid
view.
Example:
$map->setMapType('map'); // default
$map->setMapType('satellite');
$map->setMapType('hybrid');
enableSidebar()
---------------
This enables the map sidebar. Use printSideBar() or getSideBar() to
output the sidebar text. Enabled by default.
disableSidebar()
----------------
This disables the map sidebar. Enabled by default.
enableDirections()
------------------
This enables map directions in the bottom of the pop-up info window.
Enabled by default.
disableDirections()
-------------------
This disables map directions in the bottom of the pop-up info window.
Enabled by default.
enableZoomEncompass()
---------------------
This enables zoom encompass so default map zoom is as small as possible
and include all map markers.
Enabled by Default.
disableZoomEncompass()
----------------------
This disables zoom encompass.
Enabled by Default.
setBoundsFudge($val)
--------------------
Set the map boundary fudge factor. This will adjust how much map
boundary encompasses the map markers. (0.01 is default.)
Example:
$map->setBoundsFudge(0.01);
setBrowserAlert($message)
-------------------------
This sets the alert message that pops up when a browser is not
compatible with the Google Map API. Default is:
"Sorry, the Google Maps API is not compatible with this browser."
setJSAlert($message)
--------------------
This sets the alert message that displays when javascript is disabled.
Default: "<b>Javascript must be enabled in order to use Google Maps.</b>"
enableOnLoad()
--------------
This enables the onLoad() javascript function, which is used by default.
This allows the map javascript to be put into the <head></head> tag,
then loaded upon page entry with either <body onload="onLoad()"> right
in the body tag, or use printOnLoad() to place this elsewhere. With onLoad
disabled, the map javascript must be embedded inside the <body></body>
tags. Using onLoad() is the best method to use for browser
compatability.
enableInfoWindow()
------------------
enables info windows on map markers.
Enabled by default.
disableInfoWindow()
-------------------
disables info windows on map markers.
Enabled by default.
enableScaleControl()
--------------------
enables the map scale.
Enabled by default.
disableScaleControl()
---------------------
disables the map scale.
Enabled by default.
enableOverviewControl()
-----------------------
enables the map overview.
Disabled by default.
disableOverviewControl()
------------------------
disable the map overview.
Disabled by default.
disableOnLoad()
---------------
This disables the onLoad() javascript function. (see enableOnLoad())
Enabled by default.
setInfoWindowTrigger($type)
---------------------------
This sets the info window trigger behavior. click = info window comes up
when clicking on a marker. mouseover = info window comes up when mousing
over a marker. Default is click.
Example:
$map->setInfoWindowTrigger('mouseover');
addMarkerByAddress($address,$title = '',$html = '')
---------------------------------------------------
This adds a marker to the map. The address must be a fully qualified
address that can be used by the available geocode lookup services.
To add markers with geocodes directly, see addMarkerByCoords().
The title is used for the sidebar navigation link. The html is used
in the info window that pops up when you click on the map marker. If
no html is provided, the title will be used.
Note: map centering is done automatically as markers are added.
Note: You can use tabbed windows by passing an array of
title=>text values as the $html parameter. If driving directions
are enabled, they show up under the first tab.
Example:
$map->addMarkerByAddress('621 N 48th St # 6 Lincoln NE 68502','PJ Pizza','<b>PJ Pizza</b>');
addMarkerByCoords($lon,$lat,$title = '',$html = '')
---------------------------------------------------
This adds a map marker by geocode (lon/lat) directly. See
addMarkerByAddress() for more details.
Example:
$map->addMarkerByAddress(-96.6539,40.8191,'PJ Pizza','<b>PJ Pizza</b>');
addPolyLineByAddress($address1,$address2,$color,$weight,$opacity)
-----------------------------------------------------------------
This adds a polyline between the two given addresses. You can optionally
supply a color (in #ffffff hex notation), weight (thickness in pixels),
and opacity (in percentage 0-100).
Example:
$map->addPolyLineByAddress(
'3457 Holdrege St Lincoln NE 68502',
'826 P St Lincoln NE 68502','#eeeeee',5,50);
addPolyLineByCoords($lon1,$lat1,$lon2,$lat2,$color,$weight,$opacity)
--------------------------------------------------------------------
This adds a polyline between the two given geocoordinate points. You can optionally
supply a color (in #ffffff hex notation), weight (line thickness in pixels),
and opacity (in percentage 0-100).
Example:
$map->addPolyLineByCoords(-96.67,40.8279,-96.7095,40.8149,'#eeeeee',5,50);
adjustCenterCoords($lon,$lat)
-----------------------------
This adjusts the map center coords by the given lon/lat. This is done
automatically as you add markers to the map, or you can do it manually
with this function. Note: this function is used internally by the
library, it isn't normally necessary unless you have a specific need and
you know what you are doing.
setCenterCoords($lon,$lat)
--------------------------
This sets the map center coords to the given lon/lat. Center coords are
calculated automatically as you add markers to the map, or you reset it
manually with this function. Note: this function is used internally by
the library, it isn't normally necessary unless you have a specific need
and you know what you are doing.
setLookupService('GOOGLE')
-------------------------
This sets the geocode lookup service. Default is GOOGLE, which uses the
GOOGLE Geocode API. If you use the YAHOO Geocode API, be sure to set
your application ID when instantiating GoogleMapAPI. NOTE: Yahoo API
works only for US addresses (AFAIK).
setMarkerIcon($iconImage,$iconShadowImage,$iconAnchorX,$iconAnchorY,$infoWindowAnchorX,$infoWindowAnchorY)
----------------------------------------------------------------------------------------------------------
This sets the icon image for ALL the map markers. Call this once. If you
want to set a different icon for each marker, use addMarkerIcon()
instead.
You must supply a separate image for the icon and its shadow.
iconAnchorX/Y is the X/Y coordinates of the icon for the map point.
infoWindowAnchorX/Y is the X/Y coordinates of the icon where the info
window connects.
The iconImage and iconShadowImage can be either fully qualified URLs, or
a relative path from your web server DOCUMENT_ROOT. These images MUST
exist and readable so the library can calculate the dimensions.
Example:
$map->setMarkerIcon('/images/house.png','/images/house_shadow.png',0,0,10,10);
addMarkerIcon($iconImage,$iconShadowImage,$iconAnchorX,$iconAnchorY,$infoWindowAnchorX,$infoWindowAnchorY)
----------------------------------------------------------------------------------------------------------
This sets the icon image for the CURRENT map marker. IMPORTANT: you MUST
call addMarkerIcon() once for every marker. Do not use setMarkerIcon()
if you use this function.
You must supply a separate image for the icon and its shadow.
iconAnchorX/Y is the X/Y coordinates of the icon for the map point.
infoWindowAnchorX/Y is the X/Y coordinates of the icon where the info
window connects.
The iconImage and iconShadowImage can be either fully qualified URLs, or
a relative path from your web server DOCUMENT_ROOT. These images MUST
exist and readable so the library can calculate the dimensions.
Example:
$map->addMarkerIcon('/images/house.png','/images/house_shadow.png',0,0,10,10);
printHeaderJS()
---------------
This prints the header javascript that goes into the <head></head> tags.
To return the header javascript in a variable, use getHeaderJS().
Example:
<head>
<?php $map->printHeaderJS(); ?>
</head>
getHeaderJS()
-------------
This returns the header javascript that goes into the <head></head> tags.
To print the header javascript directly, use printHeaderJS().
Example:
<?php
$headerjs = getHeaderJS();
?>
<head>
<?php echo $headerjs; ?>
</head>
printMapJS()
------------
This prints the map javascript. If onLoad() is enabled, put this in the
<head></head> tags, and supply <body onload="onLoad()"> in the body tag
(or use printOnLoad()).
Otherwise, put this just before the </body> tag to make it load
automatically. Note that using onLoad() is recommended over this method.
To return the map javascript in a variable, use getMapJS().
Example:
<head>
<?php $map->printMapJS(); ?>
</head>
getMapJS()
----------
This returns the map javascript that goes into the <head></head> tags.
To print the map javascript directly, use printMapJS().
Example:
<?php
$mapjs = $map->printMapJS();
?>
<head>
<?php echo $mapjs; ?>
</head>
printOnLoad()
-------------
This prints the onLoad() javascript call. This is an alternate to
using <body onload="onLoad()"> in the body tag. You can place
this anywhere in the html body.
To return the onLoad() javascript in a variable, use getOnLoad().
Example:
<head>
<?php $map->printMapJS(); ?>
</head>
<body>
<?php echo $map->printMap(); ?>
<?php $map->printOnLoad(); ?>
</body>
getOnLoad()
-----------
This returns the map javascript that goes into the <head></head> tags.
To print the map javascript directly, use printMapJS().
Example:
<?php
$onload = $map->getOnLoad();
$mapjs = $map->getMapJS();
$map = $map->getMap();
?>
<head>
<?php echo $mapjs; ?>
</head>
<body>
<?php echo $map; ?>
<?php echo $onload; ?>
</body>
printMap()
----------
This prints the map html.
To return the map html in a variable, use getMap().
Example:
<head>
<?php $map->printMapJS(); ?>
</head>
<body onload="onLoad()">
<?php echo $map->printMap(); ?>
</body>
Example 2 (using printOnLoad):
<head>
<?php $map->printMapJS(); ?>
</head>
<body>
<?php echo $map->printMap(); ?>
<?php echo $map->printOnLoad(); ?>
</body>
getMap()
--------
This returns the map html in a variable.
To print the map html directly, use printMap().
Example:
<?php
$map = $map->getMap();
?>
<body onload="onLoad()">
<?php echo $map; ?>
</body>
printSidebar()
--------------
This prints the sidebar html.
To return the sidebar html in a variable, use getSidebar().
Example:
<body onload="onLoad()">
<table>
<tr>
<td>
<?php $map->printMap(); ?>
</td>
<td>
<?php $map->printSidebar(); ?>
</td>
</tr>
</table>
</body>
getSidebar()
------------
This returns the sidebar html in a variable.
To print the sidbar html directly, use printSidebar().
Example:
<?php
$map = $map->getMap();
$sidebar = $map->getSidebar();
?>
<body onload="onLoad()">
<table>
<tr>
<td>
<?php echo $map; ?>
</td>
<td>
<?php echo $sidebar; ?>
</td>
</tr>
</table>
</body>
getGeocode($address)
--------------------
This looks up the geocode of an address. It will use the database cache
if available. If you want to lookup a geocode without using the database
cache, use geoGetCoords(). Note: this function is used internally by the
library, it isn't normally necessary unless you have a specific need and
you know what you are doing.
Example:
$geocode = $map->getGeocode('237 S 70th suite 220 Lincoln NE 68510');
echo $geocode['lat'];
echo $geocode['lon'];
getCache($address)
------------------
This will get the cached geocode info for an address from the database
cache, or return FALSE if nothing is available. Note: this function is
used internally by the library, it isn't normally necessary unless you
have a specific need and you know what you are doing.
Example:
$geocode = $map->getCache('237 S 70th suite 220 Lincoln NE 68510');
echo $geocode['lat'];
echo $geocode['lon'];
putCache($address,$lon,$lat)
----------------------------
This will insert geocode info for the given address into the database
cache. Note: this function is used internally by the library, it isn't
normally necessary unless you have a specific need and you know what you
are doing.
Example:
$map->putCache('237 S 70th suite 220 Lincoln NE 68510',-96.62538,40.812438);
geoGetCoords($address)
----------------------
This looks up the geocode of an address directly (not from cache.) Note:
this function is used internally by the library, it isn't normally
necessary unless you have a specific need and you know what you are
doing.
Example:
$geocode = $map->geoGetCoords('237 S 70th suite 220 Lincoln NE 68510');
echo $geocode['lon'];
echo $geocode['lat'];
geoGetDistance($lat1,$lon1,$lat2,$lon2,$unit)
---------------------------------------------
This gets the distance between too coorinate points using the great
circle formula. $unit can be M (miles),K (kilometers),N (nautical
miles),I (inches), or F (feet). Default is M.
Example:
$distance = $map->geoGetDistance($lat1,$lon1,$lat2,$lon2,$unit);
INTEGRATING GOOGLE MAPS WITH SMARTY TEMPLATES
---------------------------------------------
Integrating with Smarty is as simple as assigning the necessary vars to the
template and then displaying them. Note: This example does not cover how to
setup Smarty, please use the Smarty documentation.
Example:
<?php
require('Smarty.class.php');
require('GoogleMapAPI.class.php');
$smarty = new Smarty();
$map = new GoogleMapAPI();
// setup database for geocode caching
$map->setDSN('mysql://USER:PASS@localhost/GEOCODES');
// enter YOUR Google Map Key
$map->setAPIKey('YOURGOOGLEMAPKEY');
// create some map markers
$map->addMarkerByAddress('621 N 48th St # 6 Lincoln NE 68502','PJ Pizza','<b>PJ Pizza</b>');
$map->addMarkerByAddress('826 P St Lincoln NE 68502','Old Chicago','<b>Old Chicago</b>');
$map->addMarkerByAddress('3457 Holdrege St Lincoln NE 68502',"Valentino's","<b>Valentino's</b>");
// assign Smarty variables;
$smarty->assign('google_map_header',$map->getHeaderJS());
$smarty->assign('google_map_js',$map->getMapJS());
$smarty->assign('google_map_sidebar',$map->getSidebar());
$smarty->assign('google_map',$map->getMap());
// display the template
$smarty->display('index.tpl');
?>
contents of index.tpl:
----------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
{$google_map_header}
{$google_map_js}
<!-- necessary for google maps polyline drawing in IE -->
<style type="text/css">
v\:* {ldelim}
behavior:url(#default#VML);
{rdelim}
</style>
</head>
<body onload="onLoad()">
<table>
<tr>
<td>{$google_map}</td>
<td>{$google_map_sidebar}</td>
</tr>
</table>
</body>
</html>
CREDITS:
--------
Excellent Google Maps tutorials by Mike:
http://www.econym.demon.co.uk/googlemaps/index.htm
People who have helped/contributed:
Charlie Dawes
Jake Krohn
Clark Freifeld <clark AT users DOT sourceforge DOT net>
Angelo Conforti
Jerome Combaz
drakos7 (from forums)
nmweb (from forums)
Anyone I missed, drop me a line!
Monte Ohrt <monte [AT] ohrt [DOT] com>

View File

@ -0,0 +1,311 @@
<?php
class GoogleMapCache{
public function __construct(){
}
//get the cordinate of the client. if its not in there add it
public function getCordinateCache($id){
if(empty($id))
return array('lat'=>null,'lon'=> null);
$c = new Criteria;
$c->add(CordinatesPeer::CLIENT_ID, $id);
$cordCache = CordinatesPeer::doSelect($c);
if($cordCache){
return array('lat'=>$cordCache[0]->getLat(),'lon'=> $cordCache[0]->getLon());
}
$client1 = ClientPeer::retrieveByPk($id);
$address = $client1->getAddress().' '.$client1->getCity().' '.$client1->getState().' '.$client1->getZip();
$map = new GoogleMapAPI('map');
$map->setAPIKey('ABQIAAAAbu56iy-6LS_GeUSAnMXHPxQYy8GCRil3btyRMCq9tZ8qFFyM6RT30TkD-cPNxYzl_SZslQgaOgpnFQ');
$geodata = $map->getGeocode($address);
$cord = new Cordinates($id);
($geodata) ? $cord->setFound(1) : $cord->setFound(0);
$cord->setClientId($id);
$cord->setLat($geodata['lat']);
$cord->setLon($geodata['lon']);
$cord->save();
return array('lat'=>$cord->getLat(),'lon'=> $cord->getLon());
}
//update the latitude, longitude cordinate for the client
public function updateCordinateCache($id){
$client1 = ClientPeer::retrieveByPk($id);
if(!$client1)
return false;
$address = $client1->getAddress().' '.$client1->getCity().' '.$client1->getState().' '.$client1->getZip();
if(!empty($address)){
$map = new GoogleMapAPI('map');
$map->setAPIKey('ABQIAAAAbu56iy-6LS_GeUSAnMXHPxQYy8GCRil3btyRMCq9tZ8qFFyM6RT30TkD-cPNxYzl_SZslQgaOgpnFQ');
$geodata = $map->getGeocode($address);
//save the cordinate for the new client
$cord = new Cordinates();
($geodata) ? $cord->setFound(1) : $cord->setFound(0);
$cord->setClientId($id);
$cord->setLat($geodata['lat']);
$cord->setLon($geodata['lon']);
$cord->save();
//indicate that we've already updated the client
$client1->setRequireCoordsUpdate(0);
$client1->save();
return true;
}
}
//update the driving information for the client to all other clients
//if overide = false dont update, only insert records if it doesn't exist
public function updateCacheById($id, $overide = true){
if(empty($id)) return false;
$c = new Criteria();
$clients = ClientPeer::doSelect($c);
if(!$clients)
return;
$connection = Propel::getConnection();
foreach($clients as $client){
$thisClientId = $client->getId();
if($thisClientId == $id) continue;
$query = "SELECT * FROM distances WHERE (client_id_1 = $id and client_id_2 = $thisClientId) or (client_id_2 = $id and client_id_1 = $thisClientId)";
$statement = $connection->prepareStatement($query);
$result = $statement->executeQuery();
$dataFound = $result->next();
//overide equals true we want to replace data
if( $dataFound and $overide == true){
//$hrs = 0; $min = 0; $distance = 0;
$drivingInfo = $this->getDrivingDistanceNoCache($id,$thisClientId);
$hrs = (int)$drivingInfo['hours'];
$min = (int)$drivingInfo['min'];
$distance = (int)$drivingInfo['distance'];
$query = "UPDATE distances SET updated_at = NOW(), travel_time_hours = $hrs, travel_time_mins = $min, travel_distance = $distance WHERE (client_id_1 = $id and client_id_2 = $thisClientId) or (client_id_2 = $id and client_id_1 = $thisClientId)";
$statement = $connection->prepareStatement($query);
$result = $statement->executeQuery();
//overwrite date
}elseif(!$dataFound){
// $hrs =0; $min =0; $distance =0;
$drivingInfo = $this->getDrivingDistanceNoCache($id,$thisClientId);
$hrs = (int)$drivingInfo['hours'];
$min = (int)$drivingInfo['min'];
$distance = (int)$drivingInfo['distance'];
$query = "INSERT INTO distances(updated_at,client_id_1, client_id_2, travel_time_hours,travel_time_mins,travel_distance) VALUE(NOW(),$id,$thisClientId,$hrs,$min,$distance)";
$statement = $connection->prepareStatement($query);
$result = $statement->executeQuery();
//insert new record
}
}//if
}//public
public function updateTechDistanceCacheById($id, $overide = true){
if(empty($id)) return false;
$c = new Criteria();
$clients = ClientPeer::doSelect($c);
if(!$clients)
return;
$connection = Propel::getConnection();
foreach($clients as $client){
$thisClientId = $client->getId();
$query = "SELECT * FROM tech_distances WHERE (tech_id = $id and client_id = $thisClientId)";
$statement = $connection->prepareStatement($query);
$result = $statement->executeQuery();
$dataFound = $result->next();
//overide equals true we want to replace data
if( $dataFound and $overide == true){
//$hrs = 0; $min = 0; $distance = 0;
$drivingInfo = $this->getDrivingDistanceNoCache($id,$thisClientId,true); //true means tech to client NOT client to client
$hrs = (int)$drivingInfo['hours'];
$min = (int)$drivingInfo['min'];
$distance = (int)$drivingInfo['distance'];
$query = "UPDATE tech_distances SET updated_at = NOW(), travel_time_hours = $hrs, travel_time_mins = $min, travel_distance = $distance WHERE (tech_id = $id and client_id = $thisClientId)";
$statement = $connection->prepareStatement($query);
$result = $statement->executeQuery();
//overwrite date
}elseif(!$dataFound){
// $hrs =0; $min =0; $distance =0;
$drivingInfo = $this->getDrivingDistanceNoCache($id,$thisClientId,true); //true means tech to client NOT client to client
$hrs = (int)$drivingInfo['hours'];
$min = (int)$drivingInfo['min'];
$distance = (int)$drivingInfo['distance'];
$query = "INSERT INTO tech_distances(updated_at,tech_id, client_id, travel_time_hours,travel_time_mins,travel_distance) VALUE(NOW(),$id,$thisClientId,$hrs,$min,$distance)";
$statement = $connection->prepareStatement($query);
$result = $statement->executeQuery();
//insert new record
}
}//if
}//public
public function getDrivingDistanceCache($id1,$id2, $forTech = false){
if(empty($id1) || empty($id2))
return array('hours'=>0, 'min'=>0, 'distance'=>0);
$connection = Propel::getConnection();
if(!$forTech){//checking cache for client to client
$query = "SELECT * FROM distances WHERE (client_id_1 = $id1 and client_id_2 = $id2 )
or (client_id_2 = $id1 and client_id_1 = $id2)";
$statement = $connection->prepareStatement($query);
$result = $statement->executeQuery();
while($result->next()){
$hours = $result->getInt('travel_time_hours');
$mins = $result->getInt("travel_time_mins");
$travelDistance = (float)$result->get("travel_distance");
return array('hours'=>$hours, 'min'=>$mins, 'distance'=>$travelDistance);
}
$client1 = ClientPeer::retrieveByPk($id1);
$client2 = ClientPeer::retrieveByPk($id2);
$address1 = ($client1) ? $client1->getFullAddress() : '';
$address2 = ($client2) ? $client2->getFullAddress() : '';
$drivingT = $this->getDrivingDistance($address1, $address2);
$distance = new Distances();
$distance->setClientId1($id1);
$distance->setClientId2($id2);
$distance->setTravelTimeHours($drivingT['hours']);
$distance->setTravelTimeMins($drivingT['min']);
$distance->setTravelDistance($drivingT['distance']);
$distance->save();
}else{ //checking cache for tech to client
$query = "SELECT * FROM tech_distances WHERE (tech_id = $id1 and client_id = $id2 )";
$statement = $connection->prepareStatement($query);
$result = $statement->executeQuery();
while($result->next()){
$hours = $result->getInt('travel_time_hours');
$mins = $result->getInt("travel_time_mins");
$travelDistance = (float)$result->get("travel_distance");
return array('hours'=>$hours, 'min'=>$mins, 'distance'=>$travelDistance);
}
$user = UserPeer::retrieveByPk($id1);
$client = ClientPeer::retrieveByPk($id2);
$address1 = ($user) ? $user->getFullAddress() : '';
$address2 = ($client) ? $client->getFullAddress() : '';
$drivingT = $this->getDrivingDistance($address1, $address2);
$distance = new TechDistances();
$distance->setTechId($id1);
$distance->setClientId($id2);
$distance->setTravelTimeHours($drivingT['hours']);
$distance->setTravelTimeMins($drivingT['min']);
$distance->setTravelDistance($drivingT['distance']);
$distance->save();
}
return array('hours'=>$drivingT['hours'],'min'=>$drivingT['min'],'distance'=>$drivingT['distance']);
}
// return the driving time and distances between the 2 clients skip cache
public function getDrivingDistanceNoCache($id1,$id2, $forTech = false){
//client to client
if(!$forTech){
$client1 = ClientPeer::retrieveByPk($id1);
$client2 = ClientPeer::retrieveByPk($id2);
$address1 = ($client1) ? $client1->getFullAddress() : '';
$address2 = ($client2) ? $client2->getFullAddress() : '';
}else{
$tech = UserPeer::retrieveByPk($id1);
$client = ClientPeer::retrieveByPk($id2);
$address1 = ($tech) ? $tech->getFullAddress() : '';
$address2 = ($client) ? $client->getFullAddress() : '';
}
$drivingT = $this->getDrivingDistance($address1, $address2);
return array('hours'=>$drivingT['hours'],'min'=>$drivingT['min'],'distance'=>$drivingT['distance']);
}
// get driving time and distances base on address
public function getDrivingDistance($address1,$address2){
$a = urlencode($address1);
$b = urlencode($address2);
$url = "http://maps.google.com/maps";
$query = "q=from+$a+to+$b&output=kml";
$full_url= $url."?".$query;
$fp = fopen($full_url,'r');
while($data = fread(($fp),1024)){
$kml .= $data;
}
//Commented this out second. Everything seems to be working again.
//I commented out a section in apps/atlbiomed/modules/scheduler/actions/actions.class.php
//and then got the second line in this section as broken. Commenting out the entire section
//fixed everything.
// -Chris
/* if(!empty($kml)){
$xml_object = new SimpleXMLElement($kml);
$totalPlacemark = count($xml_object->Document->Placemark);
$lastPlacemark = $xml_object->Document->Placemark[$totalPlacemark-1];
$distance_info = split ('mi', $lastPlacemark->description[0]);
$mileage = (float)str_replace('Distance: ','',$distance_info[0]);
$time_str = str_replace('(about','',$distance_info[1]);
$time_str = str_replace('hours','hour',$time_str);
$hourTextPos = strrpos($time_str, "hour");
$time_arr = explode('hour', $time_str);
if($hourTextPos!==false){
$hours = (int)$time_arr[0];
$min= (int)$time_arr[1];
}
else{
$hours = 0;
$min = (int)$time_arr[0];
}
}//if
*/
return array('hours'=>$hours,'min'=>$min,'distance'=>$mileage);
}
}
?>

View File

@ -0,0 +1,176 @@
<?php
class TechnicianScheduler
{
var $technician;
var $workorders;
var $tempWorkorder;
public function TechnicianScheduler($technician, $workDate)
{
$this->technician = $technician;
$this->workorders = WorkorderPeer::getOrdersForTechnician($technician->getId(), $workDate);
}
/*
* Determines if a workorder can be slotted into the current schedule.
*/
public function isSchedulable($workOrder)
{
// easy check, is it outside of this technician's working hours
if($this->technician->getStartTime() > $workOrder->getJobStart()
|| $this->technician->getEndTime() < $workOrder->getJobEnd())
{
return false;
}
else
{
// we will search through the workorders using an anonymous function which checks to see if the proposed
// work order starts or ends within the time span for any of the orders.
$overlappingOrder = create_function('$order',
'return (' . abs($workOrder->getJobEnd()) . ' >= $order->getJobStart()'
. ' && ' . abs($workOrder->getJobEnd()) . ' <= $order->getJobEnd())'
. ' || (' . abs($workOrder->getJobStart()) . ' >= $order->getJobStart()'
. ' && ' . abs($workOrder->getJobStart()) . ' < $order->getJobEnd());');
//return count(array_filter($this->workorders, $overlappingOrder)) == 0;
$this->tempWorkorder = $workOrder;
//count(array_filter($this->workorders, array('TechnicianScheduler','callbackfunc'))) == 0;
return count(array_filter($this->workorders, array('TechnicianScheduler','callbackfunc'))) == 0;
}
}
public function callbackfunc($order){
$workOrder = $this->tempWorkorder;
/*
* DEBUGGING PURPOSES
print $workOrder->getJobStart() . " == " . $order->getJobStart()."<br/>";
print $workOrder->getJobStart() . " > " . $order->getJobStart() . " && ". $workOrder->getJobStart() ." < ". $order->getJobEnd() ."<br/>";
print $workOrder->getJobEnd() . " > " . $order->getJobStart() . " && ". $workOrder->getJobEnd() ." <= ". $order->getJobEnd()."<br/>"; // job end falls between job
print $workOrder->getJobStart() . " < ". $order->getJobStart() . " && " . $workOrder->getJobEnd() . " >= " . $order->getJobEnd() . "<br/><br/><br/>";
print "return: ";
var_dump((
($workOrder->getJobStart() == $order->getJobStart()) || //PROBLEM both jobs
($workOrder->getJobStart() > $order->getJobStart() && $workOrder->getJobStart() < $order->getJobEnd()) || //start time falls in the rage of another job
($workOrder->getJobEnd() > $order->getJobStart() && $workOrder->getJobEnd() <= $order->getJobEnd()) || // job end falls between job
($workOrder->getJobStart() < $order->getJobStart() && $workOrder->getJobEnd() >= $order->getJobEnd()) // enclose a current job
));
*/
return (
($workOrder->getJobStart() == $order->getJobStart()) || //PROBLEM both jobs
($workOrder->getJobStart() > $order->getJobStart() && $workOrder->getJobStart() < $order->getJobEnd()) || //start time falls in the rage of another job
($workOrder->getJobEnd() > $order->getJobStart() && $workOrder->getJobEnd() <= $order->getJobEnd()) || // job end falls between job
($workOrder->getJobStart() < $order->getJobStart() && $workOrder->getJobEnd() >= $order->getJobEnd()) // enclose a current job
);
}
/*
* Attempts to add a workorder to this schedule. NOTE: This performs no insert/update
* operations to the database.
*/
public function scheduleWorkorder($workOrder)
{
if($this->isSchedulable($workOrder))
{
$this->workorders[] = $workOrder;
}
}
/*
* Gets the technician in this schedule.
*/
public function getTechnician()
{
return $this->technician;
}
/*
* Gets the workorders in this schedule.
*/
public function getWorkorders()
{
return $this->workorders;
}
/*
* Gets the order scheduled at the time slot.
*/
public function getWorkorderAtTime($time)
{
$isInSlot = create_function('$order',
'return ' . abs($time) . ' >= abs($order->getJobStart())'
. ' && ' . abs($time) . ' < abs($order->getJobEnd());');
$orders = array_filter($this->workorders, $isInSlot);
return array_pop($orders);
}
/*
* Gets the earliest start time for this schedule. Returns null if the tech is booked.
*/
public function getFirstAvailableStartTime()
{
$firstAvailable = null;
$start = $this->technician->getStartTime();
$counter = 0;
while( $start < $this->technician->getEndTime() )
{
if ($this->getWorkorderAtTime($start) == null)
{
$counter++;
if ($counter == 4)
{
break;
}
else if ($counter == 1)
{
$firstAvailable = $start;
}
}
else
{
$counter = 0;
$firstAvailable = null;
}
// increment time
if (substr($start, 2, 2) == '30')
{
$start = abs(substr($start, 0, 2)) + 1 . '00';
if(strlen($start) != 4)
{
$start = '0' . $start;
}
}
else
{
$start = substr($start, 0, 2) . '30';
}
}
return $firstAvailable;
}
public function sortWorkorder($workorders){
usort(&$workorders, array(get_class($this), 'uksort_workers'));
return $workorders;
}
private function uksort_workers($a, $b)
{
if ($a->getJobStart() == $b->getJobStart()) return 0;
return ($a->getJobStart() < $b->getJobStart()) ? -1 : 1;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

230
apps/atlbiomed/lib/deviceData.php Executable file
View File

@ -0,0 +1,230 @@
<?php
class DeviceData {
private $uploadedData = null;
public function getData(){
return $this->uploadedData;
}
public function __construct() {
}
public function getTotalRecords(){
return count($this->uploadedData);
}
public function readRow($rows) {
$rows = $this->groupData($rows);
$this->uploadedData = $rows;
}
private function groupData($rows){
$groupedData = array();
$lastRow = count($rows)-1;
$temp = array();
for($i = 0; $i < count($rows); $i++){
$startRowIndex = $i; //checking index
$nextIndex = $i+1; //next index
$startRow = $rows[$i]; //checking row
array_push($temp, $startRow);
while($startRow[0] == $rows[$nextIndex][0] && $rows[$nextIndex][1] == 3){
array_push($temp,$rows[$nextIndex]); //add to temp array
$currentRow = $nextIndex;
$nextIndex++;
$i++; //increment becuase we don't want to check in next for loop
}//while
$groupedData[] = $temp;
unset($temp);
$temp = array();
}//for
return $groupedData;
}//function
public function getDeviceId($index){
$totalRows = count($this->uploadedData);
if($index >= $totalRows)
return null;
return $this->uploadedData[$index][0][0];
}
public function getRowIndicator($index){
$totalRows = count($this->uploadedData);
if($index >= $totalRows)
return null;
return $this->uploadedData[$index][0][1];
}
public function getDate($index){
$totalRows = count($this->uploadedData);
if($index >= $totalRows)
return null;
return $this->uploadedData[$index][0][2];
}
public function getTime($index){
$totalRows = count($this->uploadedData);
if($index >= $totalRows)
return null;
return $this->uploadedData[$index][0][3];
}
public function getPassFail($index){
$totalRows = count($this->uploadedData);
if($index >= $totalRows)
return null;
if(@strtolower($this->uploadedData[$index][0][4]) == 'fail' || @strtolower($this->uploadedData[$index][1][4]) == 'fail'
|| @strtolower($this->uploadedData[$index][0][12]) == 'fail' || @strtolower($this->uploadedData[$index][1][12]) == 'fail')
return 'fail';
else
return $this->uploadedData[$index][0][4];
}
public function getDeviceTechId($index){
$totalRows = count($this->uploadedData);
if($index >= $totalRows)
return null;
return $this->uploadedData[$index][0][5];
}
public function getDeviceName($index){
$totalRows = count($this->uploadedData);
if($index >= $totalRows)
return null;
return $this->uploadedData[$index][0][6];
}
public function getManufacturer($index){
$totalRows = count($this->uploadedData);
if($index >= $totalRows)
return null;
return $this->uploadedData[$index][0][7];
}
public function getLocation($index){
$totalRows = count($this->uploadedData);
if($index >= $totalRows)
return null;
return $this->uploadedData[$index][0][50];
}
public function getModel($index){
$totalRows = count($this->uploadedData);
if($index >= $totalRows)
return null;
return $this->uploadedData[$index][0][9];
}
public function getSerial($index){
$totalRows = count($this->uploadedData);
if($index >= $totalRows)
return null;
return $this->uploadedData[$index][0][10];
}
public function getPassFailCode($index){
$totalRows = count($this->uploadedData);
if($index >= $totalRows)
return null;
return $this->uploadedData[$index][1][12];
}
public function getRecNumber($index){
$totalRows = count($this->uploadedData);
if($index >= $totalRows)
return null;
return $this->uploadedData[$index][0][14];
}
public function getRowPurpose($index){
$totalRows = count($this->uploadedData);
if($index >= $totalRows)
return null;
return $this->uploadedData[$index][0][18];
}
public function getPhysicalInspection($index){
$totalRows = count($this->uploadedData);
if($index >= $totalRows)
return null;
return $this->uploadedData[$index][0][49];
}
public function getRoom($index){
$totalRows = count($this->uploadedData);
if($index >= $totalRows)
return null;
return $this->uploadedData[$index][0][51];
}
public function getTotalTest($index){
$firstTestIndex = 54; // tests always start at index 54
$currentIndex = $firstTestIndex;
$totalTests = 0;
if($this->uploadedData[$index][0][1] == 3)
$row = $this->uploadedData[$index][0];
else if($this->uploadedData[$index][1][1] == 3){
$row = $this->uploadedData[$index][1];
}else
return 0;
while(is_numeric($row[$currentIndex])){
$totalTests += 1; //if its a int that is one test
$currentIndex += 4; //if value at every 4 increment is INT then it is a test
}
return $totalTests;
}
public function getTestDetail($index,$testNumber){
$totalTests = $this->getTotalTest($index);
if($testNumber> $totalTests)
return array('name'=>'','passFail'=>'','value'=>'','unit'=>'','type'=>'');
$firstTestIndex = 54; // tests always start at index 54
$currentIndex = $firstTestIndex;
$totalTests = 0;
$totalRows = count($this->uploadedData[$index]);
if($this->uploadedData[$index][0][1] == 3){
$usingType3 = true;
$row = $this->uploadedData[$index][0];
}
else if($this->uploadedData[$index][1][1] == 3){
$usingType3 = false;
$row = $this->uploadedData[$index][1];
}else
return 0;
$searchIndex = $firstTestIndex + (($testNumber-1)*4);
if($totalRows>=2){
$name = @$this->uploadedData[$index][1][$searchIndex+1];//second line
$type = @$this->uploadedData[$index][0][$searchIndex+2];
$passFail = @$this->uploadedData[$index][1][$searchIndex+2];
$value = @$this->uploadedData[$index][0][$searchIndex+3];
$unit = @$this->uploadedData[$index][0][$searchIndex+4];
}elseif($totalRows == 1 && $this->uploadedData[$index][0][1] == 3){
$name = @$this->uploadedData[$index][0][$searchIndex+1];//second line
//$type = @$this->uploadedData[$searchIndex][0][$searchIndex+2];
$passFail = @$this->uploadedData[$index][0][$searchIndex+2];
//$value = @$this->uploadedData[$searchIndex][0][$searchIndex+3];
//$unit = @$this->uploadedData[$searchIndex][0][$searchIndex+4];
}else if($totalRows == 1 && $this->uploadedData[$index][0][1] == 1){
//$name = @$this->uploadedData[$searchIndex][1][$searchIndex+1];//second line
$type = @$this->uploadedData[$index][0][$searchIndex+2];
//$passFail = @$this->uploadedData[$searchIndex][1][$searchIndex+2];
$value = @$this->uploadedData[$index][0][$searchIndex+3];
$unit = @$this->uploadedData[$index][0][$searchIndex+4];
}
return array('name'=>$name,'passFail'=>$passFail,'value'=>$value,'unit'=>$unit,'type'=>$type);
}
public function getAllTestData($index){
$temp = array();
$total = $this->getTotalTest($index);
for($i = 0; $i < $total; $i++){
$temp[] = $this->getTestDetail($index, $i);
}//for
return $temp;
}
}
?>

1647
apps/atlbiomed/lib/fpdf.php Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,69 @@
<?php
class myUser extends sfBasicSecurityUser
{
public function initialize($context, $parameters = null)
{
$this->context = $context;
$this->parameterHolder = new sfParameterHolder();
$this->parameterHolder->add($parameters);
$this->attributeHolder = new sfParameterHolder(self::ATTRIBUTE_NAMESPACE);
// read attributes from storage
$attributes = $context->getStorage()->read(self::ATTRIBUTE_NAMESPACE);
if (is_array($attributes))
{
foreach ($attributes as $namespace => $values)
{
$this->attributeHolder->add($values, $namespace);
}
}
// set the user culture to sf_culture parameter if present in the request
// otherwise
// - use the culture defined in the user session
// - use the default culture set in i18n.yml
if (!($culture = $context->getRequest()->getParameter('sf_culture')))
{
if (null === ($culture = $context->getStorage()->read(self::CULTURE_NAMESPACE)))
{
$culture = sfConfig::get('sf_i18n_default_culture', 'en');
}
}
$this->setCulture($culture);
// read data from storage
$storage = $this->getContext()->getStorage();
$this->authenticated = $storage->read(self::AUTH_NAMESPACE);
$this->credentials = $storage->read(self::CREDENTIAL_NAMESPACE);
$this->lastRequest = $storage->read(self::LAST_REQUEST_NAMESPACE);
if ($this->authenticated == null)
{
$this->authenticated = false;
$this->credentials = array();
}
else
{
// Automatic logout logged in user if no request within [sf_timeout] setting
if (0 != sfConfig::get('sf_timeout') && null !== $this->lastRequest && (time() - $this->lastRequest) > sfConfig::get('sf_timeout'))
{
if (sfConfig::get('sf_logging_enabled'))
{
$this->getContext()->getLogger()->info('{sfUser} automatic user logout due to timeout');
}
$this->setTimedOut();
$this->setAuthenticated(false);
}
}
$this->lastRequest = time();
}
}

View File

@ -0,0 +1,332 @@
<?php
class processHandler{
private $parsedFileData = array();
private $deviceData = null;
private $fileName = null;
private $partial = array();
private $noMatch = array();
private $match = array();
private $shouldForward = false;
public function __construct($request=''){
if(empty($request))
return false;
$uploadedFile = $this->readUploadedFile($request);
$c = new Criteria();
$c->add(DevicesFilesPeer::FILENAME, $this->fileName);
$devicesFiles = DevicesFilesPeer::doSelect($c);
$devicesFilesResult = $devicesFiles[0];
if(!$devicesFilesResult){
$this->parseData($uploadedFile);
$this->deviceData = new DeviceData();
$this->deviceData->readRow($this->parsedFileData);
$this->searchForMatch();
//save the parsed content of the file
$devicesFiles = new DevicesFiles();
$devicesFiles->setFilename($this->fileName);
$devicesFiles->setData(serialize($this->parsedFileData));
$devicesFiles->saveToDisk();
$devicesFiles->save();
}else{
$this->shouldForward = true;
}
}
public function loadFile($filename){
$c = new Criteria();
$c->add(DevicesFilesPeer::FILENAME, $filename);
$result = DevicesFilesPeer::doSelect($c);
$result = $result[0];
if(!$result)
return false;
$deviceFile = new DevicesFiles();
$deviceFile->loadFromDisk($filename);
if(!$deviceFile->fileLoaded()) //fail to load data
return false;
$this->parsedFileData = $deviceFile->getData();
$this->fileName = $filename;
$this->deviceData = new DeviceData();
$this->deviceData->readRow($this->parsedFileData);
$this->searchForMatch(true); //element those that were already processed
}
public function shouldForward(){
return $this->shouldForward;
}
private function readUploadedFile($request){
$this->request = $request;
//$upload_path = 'uploads/spreadsheet/unparsed';
$fileName = $this->request->getFileName ( 'upload' );
$micro = microtime();
$micro = str_replace(' ','-',$micro);
$date = date("M-d-Y",time());
$destination_path = $upload_path . DIRECTORY_SEPARATOR . "$date-$micro-$fileName";
$destination_path = $upload_path . DIRECTORY_SEPARATOR .$fileName;
//read file data
if ( !empty($fileName)) {
$this->fileName = $fileName;
$tmpPath = $this->request->getFilePath ( 'upload' );
//$this->request->moveFile ( 'upload', $destination_path);
if(file_exists($tmpPath)){
$fp = fopen($tmpPath,'r');
if($fp){
while($partial_data = fread($fp,1024)){
$data .= $partial_data;
}
}
}
return $data;
}//if
}
private function parseData($rawFile){
//break down the data by ',' and newline into arrays
$rows_data = array();
if(!empty($rawFile)){
$rows = explode("\n", $rawFile);
foreach($rows as $row){
$row = trim($row,' ');
if(empty($row)) continue;
$columns = explode(',',$row);
$explodedData [] = $columns; //all the rows and columns exploded
}//for each
//strip away quotes and blank spaces
$tempData = array();
for($i = 0; $i < count($explodedData); $i++){
for($j = 0; $j < count($explodedData[$i]); $j++){
$tempData[$i][$j] = trim ( str_replace ( '"', '', $explodedData[$i][$j] ), ' ' );
}//for
}//for'
$this->parsedFileData=$tempData;
}
}
public function getParsedData(){
return $this->parsedFileData;
}
public function searchForMatch($eliminateSaved= false){
if(!$this->deviceData)
return false;
$notAlreadySavedDevices = ($eliminateSaved) ? $this->getUnprocessedDevices($this->fileName) : array();
$totalRecords = $this->deviceData->getTotalRecords();
for($row = 0; $row < $totalRecords; $row++){
//data for this row
$device_id = $this->deviceData->getDeviceId($row);
$device_name = $this->deviceData->getDeviceName($row);
$manufacturer = $this->deviceData->getManufacturer($row);
$model = $this->deviceData->getModel($row);
$serial = $this->deviceData->getSerial($row);
$p_date = $this->deviceData->getDate($row);
$pass_fail = $this->deviceData->getPassFail($row);
$location = $this->deviceData->getLocation($row);
$random_id = $this->getRandomNumber();
$p_date = str_replace('/','-',$p_date);
$testData = $this->deviceData->getAllTestData($row);
$time = $this->deviceData->getTime($row);
$deviceTechId = $this->deviceData->getDeviceTechId($row);
$rowIndicator = $this->deviceData->getRowIndicator($row);
$passFailCode = $this->deviceData->getPassFailCode($row);
$recNumber = $this->deviceData->getRecNumber($row);
$rowPurpose = $this->deviceData->getRowPurpose($row);
$physicalInspection = $this->deviceData->getPhysicalInspection($row);
$room = $this->deviceData->getRoom($row);
$extraData = array('time'=>$time,'techId'=>$deviceTechId, 'rowIndicator'=>$rowIndicator, 'location'=>$location, 'passFailCode'=>$passFailCode,
'recNumber'=>$recNumber, 'rowPurpose'=>$rowPurpose,'physicalInspection'=>$physicalInspection, 'room'=>$room);
//search for a device with this indentification
$c = new Criteria();
$c->add(DevicePeer::IDENTIFICATION, $device_id); //$c->addjoin(DevicePeer::SPECIFICATION_ID, SpecificationPeer::ID, Criteria::LEFT_JOIN);
$result = DevicePeer::doSelect($c);
//if id matches
if(!empty($result[0])){
$_deviceName = $result[0]->getSpecification()->getDeviceName();
$_model = $result[0]->getSpecification()->getModelNumber();
$_manufacturer = $result[0]->getSpecification()->getManufacturer();
$_serial = $result[0]->getSerialNumber();
$_status = $result[0]->getStatus();
$retiredWarning = (strtolower($_status)=='retired') ? "<span style='color:red'> Warning: Retired</span>" : '';
//if the serial in mup file is empty consider it a match still
if(strtolower($device_name) == strtolower($_deviceName) && strtolower($model) == strtolower($_model) && strtolower($manufacturer) == strtolower($_manufacturer) && (strtolower($serial) == strtolower($_serial) || empty($serial)) ){
$this->changePm2Missing($result[0]->getClientId()); // changed any 'pm scheduled' to 'missing' because we have a match
//for matched devices
//save the pass fail code
$result[0]->setStatus(strtolower($pass_fail));
$result[0]->setLocation($location);
$result[0]->setComments($passFailCode);
$result[0]->setLastPmDate(FinalDeviceReport::convertImportedDate($p_date));
$result[0]->save();
$client_name = $result[0]->getClient()->getClientIdentification().' - '.$result[0]->getClient()->getClientName();
//total match
$deviceCheckup = new DeviceCheckup();
$deviceCheckup->setDeviceId($result[0]->getId());
$deviceCheckup->setClientId($result[0]->getClientId());
$deviceCheckup->setDeviceIdentification($device_id);
$deviceCheckup->setDate($p_date);
$deviceCheckup->setPassFail($pass_fail);
$deviceCheckup->setPassFailCode($passFailCode);
$deviceCheckup->setRowIndicator($rowIndicator);
$deviceCheckup->setRowPurpose($rowPurpose);
$deviceCheckup->setRoom($room);
$deviceCheckup->setPhysicalInspection($physicalInspection);
$deviceCheckup->setRecNumber($recNumber);
$deviceCheckup->setTime($time);
$deviceCheckup->save();
$match = array('id'=>$result[0]->getId(),'client_name'=>$client_name, 'random_id'=>$random_id,'type'=>2,'device_id'=>$device_id, 'device_name'=>$device_name,'model'=>$model,
'manufacturer'=>$manufacturer, 'serial'=>$serial, 'date'=>$p_date);
if($eliminateSaved){ //these devices were not saved yet
if(in_array($device_id,$notAlreadySavedDevices))
$this->match[] = $match;
}else
$this->match[] = $match;
}else{
//give option
$pm_deviceName = array($device_name, $_deviceName);
$pm_manufacturer = array($manufacturer, $_manufacturer);
$pm_serial = array($serial, $_serial);
$pm_model = array($model, $_model);
$client_name = $result[0]->getClient()->getClientIdentification().' - '.$result[0]->getClient()->getClientName();
$misMatch = array('device_name'=>false, 'model'=>false, 'manufacturer'=>false, 'serial'=>false);
if(strtolower($device_name) != strtolower($_deviceName))
$misMatch['device_name'] = true;
if(strtolower($model) != strtolower($_model))
$misMatch['model'] = true;
if(strtolower($manufacturer) != strtolower($_manufacturer))
$misMatch['manufacturer'] = true;
if((strtolower($serial) != strtolower($_serial) && !empty($serial)))
$misMatch['serial'] = true;
$partial_match = array('misMatch'=>$misMatch, 'comments'=>$passFailCode, 'location'=>$location, 'warning'=>$retiredWarning,'client_name'=>$client_name,'random_id'=>$random_id,'type'=>2,'device_id'=>$device_id, 'device_name'=>$pm_deviceName,'model'=>$pm_model,
'manufacturer'=>$pm_manufacturer, 'serial'=>$pm_serial, 'date'=>$p_date, 'pass_fail'=>$pass_fail, 'testData'=>$testData, 'extraData'=>$extraData);
$this->totalPartialMatch += 1;
if($eliminateSaved){ //these devices were not saved yet
if(in_array($device_id,$notAlreadySavedDevices))
$this->partial[] = $partial_match;
}else
$this->partial[] = $partial_match;
if(!$eliminateSaved){
$c = new Criteria();
$c->add(UnprocessedDevicesPeer::FILENAME, $this->fileName);
$c->add(UnprocessedDevicesPeer::DEVICE_ID,$device_id);
$c->setLimit(1);
$dcheck = UnprocessedDevicesPeer::doSelect($c);
if(empty($dcheck)){ //unprocessed device record of this does not exit
//saved as unprocessed
$unprocessed = new UnprocessedDevices();
$unprocessed->setFilename($this->fileName);
$unprocessed->setDeviceId($device_id);
$unprocessed->save();
}
}
}
}else{
$no_match = array('comments'=>$passFailCode, 'location'=>$location, 'warning'=>$retiredWarning,'random_id'=>$random_id,'type'=>3, 'device_id'=>$device_id, 'device_name'=>$device_name,'model'=>$model,
'manufacturer'=>$manufacturer, 'serial'=>$serial, 'date'=>$p_date, 'pass_fail'=>$pass_fail, 'testData'=>$testData, 'extraData'=>$extraData );
if($eliminateSaved){ //these devices were not saved yet
if(in_array($device_id,$notAlreadySavedDevices))
$this->noMatch[] = $no_match;
}else
$this->noMatch[] = $no_match;
//saved as unprocessed
if(!$eliminateSaved){
$c = new Criteria();
$c->add(UnprocessedDevicesPeer::FILENAME, $this->fileName);
$c->add(UnprocessedDevicesPeer::DEVICE_ID,$device_id);
$c->setLimit(1);
$dcheck = UnprocessedDevicesPeer::doSelect($c);
if(empty($dcheck)){ //unprocessed device record of this does not exit
//saved as unprocessed
$unprocessed = new UnprocessedDevices();
$unprocessed->setFilename($this->fileName);
$unprocessed->setDeviceId($device_id);
$unprocessed->save();
}//if
}
}//if
}//for
}//function
public function getUnprocessedDevices($filename){
$unprocessedDevices_id = array();
$c = new Criteria();
$c->add(UnprocessedDevicesPeer::FILENAME, $filename);
$unprocessedDevices = UnprocessedDevicesPeer::doSelect($c);
foreach($unprocessedDevices as $unprocessedDevice){
$unprocessedDevices_id[] = $unprocessedDevice->getDeviceId();
}
return $unprocessedDevices_id;
}
public function getMatched(){
return $this->match;
}
public function getFilename(){
return $this->fileName;
}
public function getPartialMatch(){
return $this->partial;
}
public function getNoMatch(){
return $this->noMatch;
}
public function getRandomNumber(){
srand((double)microtime()*1000000);
return rand(0,2000000);
}
private function changePm2Missing($clientId = null){
if(empty($clientId)) return;
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID,$clientId);
$c->add(DevicePeer::STATUS,'pm scheduled');
$devices = DevicePeer::doSelect($c);
foreach($devices as $device){
$device->setStatus('missing');
$device->save();
}
}
}

View File

@ -0,0 +1,184 @@
<?php
class sfPropelCustomJoinObjectProxy
{
protected
$customJoin,
$className,
$obj,
$extObjs;
public function __construct($customJoin, $className)
{
$this->customJoin = $customJoin;
$this->className = $className;
$this->obj = new $className;
$this->extObjs = array();
}
public function getDataObject()
{
return $this->obj;
}
public function isAllPrimaryKeyNull()
{
$pks = $this->obj->getPrimaryKey();
foreach ((array)$pks as $pk)
if ($pk)
return false;
return true;
}
public function __call($name, $args)
{
if (preg_match('/^get(.*)$/', $name, $matches))
{
if (array_key_exists($matches[1], $this->extObjs))
return $this->extObjs[$matches[1]];
}
return call_user_func_array(array($this->obj, $name), $args);
}
public function hydrate(ResultSet $rs, $startcol = 1)
{
$startcol = $this->obj->hydrate($rs, $startcol);
return $startcol;
}
public function addExternalObject($obj, $alias=false)
{
$key = $alias?$alias:get_class($obj->getDataObject());
$this->extObjs[$key] = $obj;
}
}
class sfPropelCustomJoinHelper
{
protected
$mainClassName = '',
$selectClasses,
$classOwnership;
public function __construct($mainClassName)
{
$this->mainClassName = $mainClassName;
$this->selectClasses = array();
$this->classOwnership = array();
}
public function addSelectTables()
{
$classes = array();
if (func_num_args() == 1)
$classes = (array)func_get_arg(0);
else
$classes = func_get_args();
$this->selectClasses = array_merge($this->selectClasses, $classes);
}
public function clearSelectClasses()
{
$this->selectClasses = array();
}
public function hydrate($rs, $startCol=1)
{
$obj = new sfPropelCustomJoinObjectProxy($this, $this->mainClassName);
$startCol = $obj->hydrate($rs, 1);
$childObjs = array();
foreach ($this->selectClasses as $className)
{
$childObj = new sfPropelCustomJoinObjectProxy($this, $className);
$startCol = $childObj->hydrate($rs, $startCol);
if ($childObj->isAllPrimaryKeyNull())
$childObjs[$className] = null;
else
$childObjs[$className] = $childObj;
}
foreach ($childObjs as $childClassName => $childObj)
{
$obj->addExternalObject($childObj, $childClassName); //main class object always holds all child objects.
if (isset($this->classOwnership[$childClassName]))
foreach ($this->classOwnership[$childClassName] as $tmp)
if (array_key_exists($tmp[0], $childObjs))
$childObj->addExternalObject($childObjs[$tmp[0]], $tmp[1]);
}
return $obj;
}
public function doCount($c, $con=null)
{
return call_user_func_array(array($this->mainClassName.'Peer', 'doCount'), array($c, $con));
}
public function doSelect($c, $con=null)
{
$rs = $this->doSelectRS($c, $con=null);
$a = array();
while ($rs->next())
$a[] = $this->hydrate($rs);
return $a;
}
public function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = $this->doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
/**
* Return the Propel ResultSet object.
*
* This method adds all columns specified with addSelectTables method.
* @see addSelectTables
*/
public function doSelectRS($criteria, $con=null)
{
$c = clone $criteria;
$c->clearSelectColumns();
call_user_func(array($this->mainClassName.'Peer', 'addSelectColumns'), $c);
foreach ($this->selectClasses as $className)
call_user_func(array($className.'Peer', 'addSelectColumns'), $c);
$rs = call_user_func_array(array($this->mainClassName.'Peer', 'doSelectRS'), array($c, $con));
return $rs;
}
public function setHas($className, $has, $alias=false)
{
if (!isset($this->classOwnership[$className]))
$this->classOwnership[$className] = array();
$alias = ($alias === false?$className:$alias);
$this->classOwnership[$className][] = array($has, $alias);
}
/**
* Do proxy call to peer method of the main class.
*/
protected function __call($name, $args)
{
return call_user_func_array(array($this->mainClassName.'Peer', $name), $args);
}
/**
* Return the main class name. This is to work around when the pager object
* tries to include the Peer class file.
*/
public function __toString()
{
return $this->mainClassName;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
indexSuccess:
stylesheets: [/css/clientManager]
javascripts: [/js/clientManager, /js/scriptaculous/lib/prototype]

View File

@ -0,0 +1,42 @@
<div class='regularCont'>
<div class='innerCont'><table border="0">
<tr>
<td style='width: 100px'>Report
</td>
<td style='width: 100px'>Status
</td>
<td style='width: 200px'>
Date
</td>
<td >
Action
</td>
</tr>
<?php
foreach($finalReport as $report){
?>
<tr>
<td>
<a target='_blank' href='/index.php/process/createPdf/id/<?php print $report->getId(); ?>'>View</a>
</td>
<td>
<?php print ucwords($report->getPassFail()); ?>
</td>
<td>
<?php print $report->formattedDate(); ?>
</td>
<td>
<a href='javascript:void(0)' onclick='deleteReport(<?php print $report->getId(); ?>,<?php print $report->getClientId(); ?>)' >Delete</a>
</td>
</tr>
<?php
}
if(empty($finalReport)){
?>
<tr><td colspan='4'><div style='text-align:center;font-weight:bold;'>No Reports Found</div></td></tr>
<?php
}
?>
</table>
</div>
</div>

View File

@ -0,0 +1,42 @@
<div class='regularCont'>
<div class='innerCont'><table border="0">
<tr>
<td style='width: 100px'>Report
</td>
<td style='width: 100px'>Status
</td>
<td style='width: 200px'>
Date
</td>
<td >
Action
</td>
</tr>
<?php
foreach($finalReport as $report){
?>
<tr>
<td>
<a target='_blank' href='/index.php/process/createPdf/id/<?php print $report->getId(); ?>'>View</a>
</td>
<td>
<?php print ucwords($report->getPassFail()); ?>
</td>
<td>
<?php print $report->formattedDate(); ?>
</td>
<td>
<a href='javascript:void(0)' onclick='deleteReport(<?php print $report->getId(); ?>,<?php print $report->getClientId(); ?>)' >Delete</a>
</td>
</tr>
<?php
}
if(empty($finalReport)){
?>
<tr><td colspan='4'><div style='text-align:center;font-weight:bold;'>No Reports Found</div></td></tr>
<?php
}
?>
</table>
</div>
</div>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,63 @@
fillin:
enabled: true
fields:
client_identification:
required:
msg: Please enter a client identification before continuing
sfStringValidator:
client_name:
required:
msg: Please enter a client name before continuing
sfStringValidator:
min: 5
min_error: Client name does not meet acceptable parameters (5 character min)
max: 50
max_error: Clint name exceeds acceptable parameters (50 characters max)
address:
required:
msg: Please enter an address.
city:
required:
msg: Please enter a city.
state:
required:
msg: Please select a state.
zip:
required:
msg: Please enter a zip code.
sfStringValidator:
min: 5
min_error: You have submitted an incomplete zip code. Please enter a valid zip code.
max: 5
max_error: Please submit a 5-digit zip code.
email:
sfEmailValidator:
strict: true
email_error: Please enter a valid email address (name@domain.extension)
phone:
sfStringValidator:
min: 12
min_error: Please enter a valid telephone number (e.g. 555-555-5555).
max: 17
max_error: Please enter a valid telephone number.
ext:
sfStringValidator:
max: 5
max_error: Please enter a valid extention.
# freq_month:
# required:
# msg: Please select month to start maintainence.
# sfStringValidator:
# min: 2
# min_error: Please select a month to start Maintainence.

View File

@ -0,0 +1,34 @@
fillin:
enabled: true
fields:
new_device_name:
required:
msg: Please enter a device description
new_manufacturer:
required:
msg: Please enter a device manufacturer
new_model_number:
required:
msg: Please enter a model number
new_serial_number:
required:
msg: Please enter a serial number
new_location:
required:
msg: Please enter where the device is located
new_frequency:
required:
msg: Please select a maintainance frequency
new_status:
required:
msg: Please select a status for the device

View File

@ -0,0 +1,21 @@
<?php
/**
* dashboard actions.
*
* @package atlbiomed
* @subpackage dashboard
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class dashboardActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
$this->date = date('Y-m-d');
}
}

View File

@ -0,0 +1,3 @@
indexSuccess:
javascripts: [/js/scheduler]
stylesheets: [/css/email.css]

View File

@ -0,0 +1,146 @@
<?php use_helper('Javascript'); ?>
<?php use_helper('Object'); ?>
<?php
$api_key = sfConfig::get('app_google_maps_api_key');
echo javascript_include_tag('http://maps.google.com/maps?file=api&amp;v=2&amp;key='.$api_key); ?>
<!-- Javascript Calander -->
<?php
echo javascript_include_tag('jscalendar/calendar');
echo javascript_include_tag('jscalendar/lang/calendar-en');
echo javascript_tag("
Event.observe(window, 'load', initFunctions, false);
function initFunctions(evt)
{
showFlatCalendar();
load()
}"); ?>
<?php echo javascript_tag("
var MINUTE = 60 * 1000;
var HOUR = 60 * MINUTE;
var DAY = 24 * HOUR;
var WEEK = 7 * DAY;
function setActiveStyleSheet(link, title)
{
var i, a, main;
for(i=0; (a = document.getElementsByTagName('link')[i]); i++)
{
if(a.getAttribute('rel').indexOf('style') != -1 && a.getAttribute('title'))
{
a.disabled = true;
if(a.getAttribute('title') == title) a.disabled = false;
}
}
if (oldLink) oldLink.style.fontWeight = 'normal';
oldLink = link;
link.style.fontWeight = 'bold';
return false;
}
function isDisabled(date)
{
var today = new Date();
return (Math.abs(date.getTime() - today.getTime()) / DAY);
}
function flatSelected(cal, date)
{
document.getElementById('date').value = date;
var el = document.getElementById('display_date');
el.innerHTML = date;".
remote_function(array(
'update' => 'techDisplay',
'url' => 'scheduler/populateTechDisplay',
'with' => '"date=" + date')).";"."
}
function showFlatCalendar()
{".
//initiate TechDisplay
remote_function(array(
'update' => 'techDisplay',
'url' => 'scheduler/populateTechDisplay',
'with' => '"date='.$date.'"')).";"."
var parent = document.getElementById('display');
// construct a calendar giving only the 'selected' handler.
var cal = new Calendar(0, null, flatSelected);
// hide week numbers
cal.weekNumbers = false;
// We want some dates to be disabled; see function isDisabled above
//cal.setDisabledHandler(isDisabled);
//cal.setDateFormat('%A, %B %e');
// this call must be the last as it might use data initialized above; if
// we specify a parent, as opposite to the 'showCalendar' function above,
// then we create a flat calendar -- not popup. Hidden, though, but...
cal.create(parent);
// ... we can show it here.
cal.show();
}
"); ?>
<!--////////////////Map stuff///////////////-->
<?php echo javascript_tag("
function load()
{
if (GBrowserIsCompatible())
{
var map = new GMap2(document.getElementById('map'));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
}
if (window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest();
xmlhttp.overrideMimeType('text/xml');
} else if (window.ActiveXObject)
{
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
}
}
"); ?>
<?php echo input_hidden_tag('date', $date); ?>
<div id = 'emailPopUp' style='display:none'>
</div>
<div id="leftCol">
<div id="dashMap">
<div id="map" style="width: 350px; height: 250px"></div>
</div>
<div id="dashTech">
<div id="techDisplay">
</div>
</div>
<div id="rightCol">
<div id="dashCal">
<div id="display"></div>
<div id="preview"></div>
</div>
<div id="dashPendingJobs">
</div>
</div>

View File

@ -0,0 +1,20 @@
<?php
/**
* faq actions.
*
* @package atlbiomed
* @subpackage faq
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class faqActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
}
}

View File

@ -0,0 +1 @@
<h2>Content for this page coming soon.</h2>

View File

@ -0,0 +1,180 @@
<?php
/**
* maps actions.
*
* @package atlbiomed
* @subpackage maps
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class mapsActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
// default view values
$this->bogusWorkOrder = new Workorder();
$this->bogusWorkOrder->setJobStatusId('');
$this->bogusWorkOrder->setJobTypeId('');
$this->bogusWorkOrder->setTech('');
$this->technicians = array();
foreach(UserPeer::getUserByType(1) as $tech)
{
$this->technicians[$tech->getId()] = $tech->getDisplayName();
}
$this->dateFilter = date('Y-m-d');
$this->dateFilterType = 'day';
$this->markers = array();
if ($this->getRequestParameter('viewMode', 0) == 1)
{
// show all clients
foreach(ClientPeer::doSelect(new Criteria()) as $client)
{
$title = $client->getClientIdentification() . ' - ' . $client->getClientName();
$address = $client->getAddress() . ' ' .
$client->getCity() . ' ' .
$client->getState() . ' ' .
$client->getZip();
$content = $address . '<br />' .
'ATTN: ' . $client->getAttn() . '<br />' .
'Phone: ' . $client->getPhone();
if(!$client->getLocation())
$this->markers[] = new GMapMarker($address, '', '',$title, $content, 'green');
else
$this->markers[] = new GMapMarker($address,
$client->getLocation()->getLatitude(),
$client->getLocation()->getLongitude(), $title, $content, 'green');
}
}
else
{
// show jobs
$jobDate = date('Ymd');
$usersWithWork = new Criteria();
$workorders = new Criteria();
if($this->getRequest()->getMethod() == sfRequest::POST)
{
$this->dateFilter = $this->getRequestParameter('jobDate');
$this->dateFilterType = $this->getRequestParameter('dateFilterType');
if($this->getRequestParameter('technicianId') != '')
{
$usersWithWork->add(UserPeer::ID, $this->getRequestParameter('technicianId'));
$workorders->add(WorkorderTechPeer::USER_ID, $this->getRequestParameter('technicianId'));
$workorders->addJoin(WorkorderPeer::ID, WorkorderTechPeer::WORKORDER_ID, Criteria::INNER_JOIN);
$this->bogusWorkOrder->setTech($this->getRequestParameter('technicianId'));
}
if($this->getRequestParameter('job_status_id') != '')
{
$usersWithWork->add(WorkorderPeer::JOB_STATUS_ID, $this->getRequestParameter('job_status_id'));
$workorders->add(WorkorderPeer::JOB_STATUS_ID, $this->getRequestParameter('job_status_id'));
$this->bogusWorkOrder->setJobStatusId($this->getRequestParameter('job_status_id'));
}
if($this->getRequestParameter('job_type_id') != '')
{
$workorders->add(WorkorderPeer::JOB_TYPE_ID, $this->getRequestParameter('job_type_id'));
$this->bogusWorkOrder->setJobTypeId($this->getRequestParameter('job_type_id'));
}
}
$usersWithWork->addJoin(UserPeer::ID, WorkorderPeer::TECH);
$usersWithWork->setDistinct(true);
if ($this->dateFilterType == 'day')
{
$usersWithWork->add(WorkorderPeer::JOB_DATE, $this->getRequestParameter('jobDate'));
$workorders->add(WorkorderPeer::JOB_DATE, $this->getRequestParameter('jobDate'));
}
else if ($this->dateFilterType == 'month')
{
$year = substr($this->getRequestParameter('jobDate'), 0, 4);
$month = substr($this->getRequestParameter('jobDate'), 5, 2);
$start = $year . '-' . $month . '-01';
$end = $year . '-' . $month . '-31'; // easy check, even for months without 31 days since all dates are
// strings in our database
$usersWithWork->add(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL);
$usersWithWork->addAnd($usersWithWork->getNewCriterion(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_EQUAL)); // inclusive
$workorders->add(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL);
$workorders->addAnd($workorders->getNewCriterion(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_EQUAL)); // inclusive
}
else
{
// week from the selected date
$start = date('Y-m-d', strtotime($this->getRequestParameter('jobDate')));
$end = date('Y-m-d', strtotime('+7 days', strtotime($this->getRequestParameter('jobDate'))));
//$this->renderText($start . $end); return sfView::NONE;
$usersWithWork->add(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_THAN); // exclusive
$usersWithWork->addAnd($usersWithWork->getNewCriterion(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL));
$workorders->add(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_THAN); // exclusive
$workorders->addAnd($workorders->getNewCriterion(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL));
}
$techs = UserPeer::doSelect($usersWithWork);
$orders = WorkorderPeer::doSelect($workorders);
foreach($orders as $order)
{
$findTech = create_function('$tech', 'return $tech->getId() ==' . $order->getTech() . ';');
$theTech = array_filter($techs, $findTech);
if(isset($theTech) && count($theTech) == 1)
{
$address = $order->getClient()->getAddress() . ' ' .
$order->getClient()->getCity() . ' ' .
$order->getClient()->getState() . ' ' .
$order->getClient()->getZip();
$jobDate = $order->getJobDate();
$tech = array_pop($theTech);
$content = 'Contact: ' . $order->getClient()->getAttn() . '<br />' .
'Phone: ' . $order->getClient()->getPhone() . '<br />' .
'City: ' . $order->getClient()->getCity() . ', ' . $order->getClient()->getState() . '<br/><span class="red">';
if($order->getClient()->getAnesthesia() != null){
$content .= $order->getClient()->getAnesthesia();
}
if($order->getClient()->getAnesthesia() != null && $order->getClient()->getMedgas() != null){
$content .= '&nbsp;&frasl;&nbsp;';
}
if($order->getClient()->getMedgas() != null){
$content .= $order->getClient()->getMedgas();
}
$content .= '</span><br/><br/>' .
'<a href="/index.php/scheduler/index/mode/edit/ticket/' .$order->getId().'" >Schedule</a>';
if(!$order->getClient()->getLocation())
$this->markers[] = new GMapMarker($address, '', '',$order->getClient()->getClientName(), $content, 'green');
else
$this->markers[] = new GMapMarker($address,
$order->getClient()->getLocation()->getLatitude(),
$order->getClient()->getLocation()->getLongitude(),
$order->getClient()->getClientName(), $content, 'green');
}
unset($theTech);
}
}
}
}

View File

@ -0,0 +1,25 @@
<?php
/**
* Defines components for the map actions, namely the ability to easily print a technician
* map.
*
* @author Ciphent
**/
class mapsComponents extends sfComponents
{
/**
* Displays the google map for all technicians. You can only have one instance of this component on a page.
*
* Call it as so: include_component('maps', 'displayTechnicianMap', array('markers' => array(elements of type GMapMarer))
*
**/
public function executeDisplayTechnicianMap()
{
$map = new GoogleMap('map');
$map->includeDefaultLocation()->setWidth($this->mapwidth)->addMarkers($this->markers);
$map->setHeight($this->mapheight);
$this->map = $map;
}
}

View File

@ -0,0 +1,3 @@
all:
is_secure: off
credentials: Office

View File

@ -0,0 +1,2 @@
all:
javascripts: [%SF_PROTOTYPE_WEB_DIR%/js/prototype]

View File

@ -0,0 +1,19 @@
<?php use_helper('Javascript') ?>
<div><h2>Mon:<img src='/images/pins/pin_red1.png' /> Tue:<img src='/images/pins/pin_blue1.png' /> Wed: <img src='/images/pins/pin_orange1.png' /> Thu:<img src='/images/pins/pin_green1.png' /> Fri: <img src='/images/pins/pin_grey1.png' /> </h2></div>
<?php
echo $map->getMapJS();
echo javascript_tag("
Event.observe(window, 'load', showMap, false);
function showMap(evt)
{
onLoad();
}
");
echo $map->getMapHtml();
?>

View File

@ -0,0 +1,6 @@
<?php echo radiobutton_tag('dateFilterType', 'month', $dateFilterType == 'month') ?>By Selected Month<br />
<?php echo radiobutton_tag('dateFilterType', 'week', $dateFilterType == 'week') ?>By Selected Week (selected day plus seven days)<br />
<?php echo radiobutton_tag('dateFilterType', 'day', $dateFilterType == 'day') ?>By Selected Day<br />
<?php echo input_date_tag('jobDate', $initialDate, 'rich=true'); ?>

View File

@ -0,0 +1,50 @@
<?php use_helper('Javascript') ?>
<?php use_helper('Object') ?>
<div class="content" style="padding: 5px;">
<div class="mapsCollapsingPanelContainer">
<?php echo form_tag('maps/index'); ?>
<?php include_partial('global/collapsingDivContainer',
array('title' => 'Filter by Status',
'uniqueId' => 'filterByStatus',
'content' => object_select_tag($bogusWorkOrder, 'getJobStatusId', 'include_custom=All', ''))); ?>
<?php include_partial('global/collapsingDivContainer',
array('title' => 'Filter by Job Type',
'uniqueId' => 'filterByJType',
'content' => object_select_tag($bogusWorkOrder, 'getJobTypeId', 'include_custom=All', ''))); ?>
<?php include_partial('global/collapsingDivContainer',
array('title' => 'Filter by Technician',
'uniqueId' => 'filterByTechnician',
'content' => select_tag('technicianId',
options_for_select($technicians,
$bogusWorkOrder->getTech(),
'include_custom=All')))); ?>
<?php include_partial('global/collapsingDivContainer',
array('title' => 'Filter by Date',
'uniqueId' => 'filterByDate',
'content' => get_partial('mapDateFilterControl',
array('initialDate' => $dateFilter,
'dateFilterType' => $dateFilterType)))); ?>
<div class="mapsCollapsingPanelContainerControl">
<?php echo submit_tag('Filter'); ?>
</div>
<div class="mapsCollapsingPanelContainerControl">
<hr />
</div>
<div class="mapsCollapsingPanelContainerControl">
<h3><?php echo link_to('View all Client Locations', 'maps/index?viewMode=1'); ?></h3>
</div>
</form>
</div>
<div style="float: left; display: inline; border: 1px solid black;">
<?php include_component('maps', 'displayTechnicianMap', array('markers' => $markers, 'mapwidth' => '800px')); ?>
</div>
</div>

View File

@ -0,0 +1,179 @@
<?php
/**
* messages actions.
*
* @package atlbiomed
* @subpackage messages
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class messagesActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
$userId = $this->getUser()->getAttribute('userId');
$user = UserPeer::retrieveByPk ($userId);
if($user){
$email = $user->getEmail();
$firstName = $user->getFirstName();
}
$signed_info = $firstName."||".$email;
if($this->getRequest()->getMethod() == sfRequest::POST && !empty($userId)){
$for = $this->getRequestParameter('for');
$name = $this->getRequestParameter('name');
$company = $this->getRequestParameter('company');
$phone = "(".$this->getRequestParameter('phone').")".$this->getRequestParameter('phone-2')."-".$this->getRequestParameter('phone-3');
$ext = "ext. ".$this->getRequestParameter('ext');
$time_to_call = $this->getRequestParameter('time_to_call');
$mobile = "(".$this->getRequestParameter('mobile').")".$this->getRequestParameter('mobile-2')."-".$this->getRequestParameter('mobile-3');
$time_to_call_mobile = $this->getRequestParameter('time_to_call_mobile');
$fax = "(".$this->getRequestParameter('fax').")".$this->getRequestParameter('fax-2')."-".$this->getRequestParameter('fax-3');
$telephoned = $this->getRequestParameter('telephoned');
$came_to_see_you = $this->getRequestParameter('came_to_see_you');
$wants_to_see_you = $this->getRequestParameter('wants_to_see_you');
$returned_your_call = $this->getRequestParameter('returned_your_call');
$please_call = $this->getRequestParameter('please_call');
$will_call_again = $this->getRequestParameter('will_call_again');
$rush = $this->getRequestParameter('rush');
$special_attention = $this->getRequestParameter('special_attention');
$callers_message = $this->getRequestParameter('callers_message');
$signed_data = explode('||',$signed_info);
//$signed = $_POST['signed'];
//$from = $_POST['signed'];
$signed = $signed_data[0];
$from = $signed_data[0];
$reply_to = $signed_data[1];
$date = "Time of call: ".date("F j, Y, g:i a");
$time = date("F j, Y, g:i a");
if($ext == 'ext. ')
$ext = '';
else $ext = $ext;
if($time_to_call != '')
$time_to_call = 'Time to call: '.$time_to_call;
if($mobile != '()-')
$mobile = 'Mobile: '.$mobile;
else $mobile = '';
if($time_to_call_mobile != '')
$time_to_call_mobile = 'Time to call mobile: '.$time_to_call_mobile;
if($fax != '()-')
$fax = 'Fax: '.$fax;
else $fax = '';
if($telephoned == 'on')
$telephoned = 'Telephoned';
else $telephoned = '';
if($came_to_see_you == 'on')
$came_to_see_you = 'Came to see you';
else $came_to_see_you = '';
if($wants_to_see_you == 'on')
$wants_to_see_you = 'Wants to see you';
else $wants_to_see_you = '';
if($returned_your_call == 'on')
$returned_your_call = 'Returned your call';
else $returned_your_call = '';
if($please_call == 'on')
$please_call = 'Please call';
else $please_call = '';
if($will_call_again == 'on')
$will_call_again = 'Will call again';
else $will_call_again = '';
if($rush == 'on')
$rush = 'Rush';
else $rush = '';
if($special_attention == 'on')
$special_attention = 'Special Attention';
else $special_attention = '';
if($callers_message != '')
$callers_message = 'Message: '.$callers_message;
if($signed != '')
$signed = 'Signed: '.$signed;
$body = "$date
Name: $name
Company: $company
Phone: $phone $ext
";
if($time_to_call != '')
$body .= $time_to_call;
if($mobile != '')
$body .= $mobile;
if($time_to_call_mobile != '')
$body .= $time_to_call_mobile;
if($fax != '')
$body .= $fax;
if($telephoned != '' || $came_to_see_you != '' || $wants_to_see_you != '' || $returned_your_call != '' || $please_call != '' || $will_call_again != '' || $rush != '' || $special_attention != '')
$body .= "
Please:
";
if($telephoned != '')
$body .= $telephoned."\n";
if($came_to_see_you != '')
$body .= $came_to_see_you."\n";
if($wants_to_see_you != '')
$body .= $wants_to_see_you."\n";
if($returned_your_call != '')
$body .= $returned_your_call."\n";
if($please_call != '')
$body .= $please_call."\n";
if($will_call_again != '')
$body .= $will_call_again."\n";
if($rush != '')
$body .= $rush."\n";
if($special_attention != '')
$body .= $special_attention."\n";
$body .= "
$callers_message
$signed";
$subject = "Important Message From " . $name ." - ". $time;
//mail($for, $subject, $body, 'from: messages@atlanticbiomedical.com');
mail($for, $subject, $body, "from: $reply_to");
$this->redirect('messages/index');
//header('Location: /messages/index.php');
}
}
}

View File

@ -0,0 +1,3 @@
indexSuccess:
stylesheets: [messages]
javascripts: ['scriptaculous/lib/prototype.js', 'scriptaculous/src/effects.js', validation, autotab]

View File

@ -0,0 +1,140 @@
<script type="text/javascript" src="/sf/prototype/js/prototype.js"></script>
<script type="text/javascript" src="/sf/calendar/calendar.js"></script>
<script type="text/javascript" src="/sf/calendar/lang/calendar-en.js"></script>
<script type="text/javascript" src="/sf/calendar/calendar-setup.js"></script>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="autotab.js"></script>
<script src="scriptaculous/lib/prototype.js" type="text/javascript"></script>
<script src="scriptaculous/src/effects.js" type="text/javascript"></script>
<script type="text/javascript" src="validation.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="/css/main.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/css/client.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/css/user.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/css/theme.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/sf/calendar/skins/aqua/theme.css" />
<div id="main">
<center>
<br/>
<?php echo form_tag('messages/index', array('id'=>'test')) ?>
<fieldset>
<label for="for">For </label>
<select name="for" class="half">
<option value="allison.wolcott@atlanticbiomedical.com">Allison Wolcott</option>
<option value="caendres1@gmail.com">Carl Endres</option>
<option value="chris.endres@atlanticbiomedical.com" selected="selected">Chris Endres</option>
<!--
<option value="niles.armstrong@atlanticbiomedical.com">Niles Armstrong</option>
<option value="eric.frasse@atlanticbiomedical.com">Eric Frasse</option>
-->
<option value="ryan.foley@atlanticbiomedical.com">Ryan Foley</option>
<option value="will.turner@atlanticbiomedical.com">Will Turner</option>
<option value="kelli.kirk@atlanticbiomedical.com">Kelli Kirk</option>
</select>
<div class="form-row">
<label for="name" class="name">Name </label>
<input type="text" name="name" id="name" class="validate-name half" />
<div class="form-row-ff"></div>
</div>
<div class="form-row">
<label for="company">Company </label>
<input type="text" name="company" class="validate-company" />
<div class="form-row-ff"></div>
</div>
<div class="form-row"><span id="bug">
<label for="phone">Phone </label>
<input type="text" name="phone" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="validate-phone phone" />
<input type="text" name="phone-2" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="validate-phone phone" />
<input type="text" name="phone-3" onKeyUp="return autoTab(this, 4, event);" maxlength="4" size="4" class="validate-phone phone3" />
<label for="ext" class="ext">ext. </label>
<input type="text" name="ext" size="4" class="phone" />
<label for="time_to_call" class="time">Time To Call</label>
<input type="text" name="time_to_call" class="phone" /></span>
</div>
<span style="display:inline-block"><label for="mobile">Mobile </label>
<input type="text" name="mobile" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="phone" />
<input type="text" name="mobile-2" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="phone" />
<input type="text" name="mobile-3" onKeyUp="return autoTab(this, 4, event);" maxlength="4" size="4" class="phone3" />
<label for="time_to_call_mobile" class="time2">Time To Call</label>
<input type="text" name="time_to_call_mobile" class="phone" /></span>
<span style="display:inline-block"><label for="fax">Fax </label>
<input type="text" name="fax" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="phone" />
<input type="text" name="fax-2" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="phone" />
<input type="text" name="fax-3" onKeyUp="return autoTab(this, 4, event);" maxlength="4" size="4" class="phone3" /></span>
<span style="display:inline-block"><div id="checkboxes">
<label for="telephoned" class="row1_label">Telephoned </label>
<input type="checkbox" name="telephoned" />
<label for="came_to_see_you" class="row2_label">Came To See You </label>
<input type="checkbox" name="came_to_see_you" />
<label for="wants_to_see_you" class="row3_label">Wants To See You </label>
<input type="checkbox" name="wants_to_see_you" />
<label for="returned_your_call" class="row1_label">Returned Your Call </label>
<input type="checkbox" name="returned_your_call" />
<label for="please_call" class="row2_label">Please Call </label>
<input type="checkbox" name="please_call" />
<label for="will_call_again" class="row3_label">Will Call Again </label>
<input type="checkbox" name="will_call_again" />
<label for="rush" class="row1_label">Rush </label>
<input type="checkbox" name="rush" />
<label for="special_attention" class="row2_label">Special Attention </label>
<input type="checkbox" name="special_attention" />
</div></span>
<div class="form-row">
<label for="callers_message" id="message">Message </label>
<textarea name="callers_message" cols="10" rows="10" class="validate-message"></textarea>
<div class="form-row-ff"></div>
</div>
<input type="submit" value="Submit Message" class="button" />
<div class="form-row">
<div class="form-row-ff"></div>
</div>
</fieldset>
</form>
<script type="text/javascript">
var valid = new Validation('test', {immediate : true});
Validation.addAllThese([
['validate-name', 'A name is required.', function(v){
return !Validation.get('IsEmpty').test(v);
}],
['validate-company', 'A company is required.', function(v){
return !Validation.get('IsEmpty').test(v);
}],
['validate-phone', 'A phone number is required.', function(v){
return !Validation.get('IsEmpty').test(v);
}],
['validate-message', 'A message is required.', function(v){
return !Validation.get('IsEmpty').test(v);
}]
]);
</script>
</center><br/>
</div>

View File

@ -0,0 +1,740 @@
<?php
/**
* process actions.
*
* @package atlbiomed
* @subpackage process
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class processActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
$this->client_id = '';
//populate Client Select dropdown
$m = new Criteria();
$m->addAscendingOrderByColumn(ClientPeer::CLIENT_IDENTIFICATION);
$this->clients = array();
foreach(ClientPeer::doSelect($m) as $client)
{
$this->clients[$client->getId()] = $client->getClientIdentification();
}
}
public function executeProcessUpload(){ //get all clients
$c = new Criteria();
$c->addAscendingOrderByColumn(ClientPeer::CLIENT_IDENTIFICATION);
$clients = ClientPeer::doSelect($c);
//read and parse upload file
$processHandler = new processHandler($this->getRequest());
if($processHandler->shouldForward()){//file was already uploaded
$this->getUser()->setAttribute('fileAlreadyExist',true);
$this->redirect('/unprocessed/index?warning=yes&fn='.$processHandler->getFilename());
}
$this->partialMatch = $processHandler->getPartialMatch();
$this->noMatch = $processHandler->getNoMatch();
$this->match = $processHandler->getMatched();
$this->clients = $clients;
$this->filename = $processHandler->getFilename();
}//public
public function executeSavePartialMatch(){
$pass_fail = $this->getRequestParameter('pass_fail');
$device_id = $this->getRequestParameter('device_id');
$device_name = $this->getRequestParameter('device_name');
$serial = $this->getRequestParameter('serial');
$model = $this->getRequestParameter("model");
$manufacturer = $this->getRequestParameter('manufacturer');
$date = $this->getRequestParameter('date');
$serialize_test_data = $this->getRequestParameter('test_data');
$serialize_extra_data = $this->getRequestParameter('extra_data');
$test_data = unserialize($serialize_test_data);
$extra_data = unserialize($serialize_extra_data);
$filename = $this->getRequestParameter('filename');
$location = $this->getRequestParameter('location');
$comments = $this->getRequestParameter('comments');
$assoc_client_id = $this->getRequestParameter('assoc_client');
$c = new Criteria();
$c->add(DevicePeer::IDENTIFICATION, $device_id);
$deviceResult = DevicePeer::doSelect($c);
if($deviceResult){
$this->changePm2Missing($deviceResult[0]->getClientId());
$c = new Criteria();
$c->add(UnprocessedDevicesPeer::DEVICE_ID, $device_id);
$c->add(UnprocessedDevicesPeer::FILENAME, $filename);
$unprocessDevice = UnprocessedDevicesPeer::doSelect($c);
$unprocessDevice = $unprocessDevice[0];
if($unprocessDevice)
$unprocessDevice->delete();
//saving device info
$deviceResult = $deviceResult[0];
$deviceResult->setSerialNumber($serial);
$deviceResult->setStatus(strtolower($pass_fail));
$deviceResult->setLocation($location);
$deviceResult->setComments($comments);
$deviceResult->setLastPmDate(FinalDeviceReport::convertImportedDate($date));
if($assoc_client_id > 0)
$deviceResult->setClientId($assoc_client_id);
$specificationId = $deviceResult->getSpecificationId();
$deviceResult->save();
$deviceCheckup = new DeviceCheckup();
$deviceCheckup->setDeviceId($deviceResult->getId());
$deviceCheckup->setClientId($deviceResult->getClientId());
$deviceCheckup->setDeviceIdentification($device_id);
$deviceCheckup->setDate($date);
$deviceCheckup->setPassFail($pass_fail);
$deviceCheckup->setTime($extra_data['time']);
$deviceCheckup->setRowIndicator($extra_data['rowIndicator']);
$deviceCheckup->setDeviceTechId($extra_data['techId']);
//$deviceCheckup->setLocation($extra_data['location']);
$deviceCheckup->setPassFailCode($extra_data['passFailCode']);
$deviceCheckup->setRecNumber($extra_data['recNumber']);
$deviceCheckup->setRowPurpose($extra_data['rowPurpose']);
$deviceCheckup->setPhysicalInspection($extra_data['physicalInspection']);
$deviceCheckup->setRoom($extra_data['room']);
$deviceCheckup->save();
$deviceCheckup->save();
$device_test_data = new DeviceTestData();
$device_test_data->setDeviceCheckupId($deviceCheckup->getId());
$device_test_data->setName($test_data['name']);
$device_test_data->setPassFail($test_data['passFail']);
$device_test_data->setType($test_data['type']);
$device_test_data->setUnit($test_data['unit']);
$device_test_data->setValue($test_data['value']);
$device_test_data->save();
$this->changePm2Missing();
}
$c = new Criteria();
$c->add(SpecificationPeer::ID, $specificationId);
$specificationResult = SpecificationPeer::doSelect($c);
if($specificationResult){
$specificationResult = $specificationResult[0];
$specificationResult->setManufacturer($manufacturer);
$specificationResult->setModelNumber($model);
$specificationResult->setDeviceName($device_name);
$specificationResult->save();
}
return sfView::NONE;
}
public function executeSaveNoMatch(){
$option = $this->getRequestParameter('option');
$device_id = $this->getRequestParameter('device_id');
$d_device_id = $this->getRequestParameter('get_devices');
$device_name = $this->getRequestParameter('device_name');
$serial = $this->getRequestParameter('serial');
$model = $this->getRequestParameter("model");
$manufacturer = $this->getRequestParameter('manufacturer');
$pass_fail = $this->getRequestParameter('pass_fail');
$date = $this->getRequestParameter('date');
$client_id = $this->getRequestParameter('client_id');
$serialize_test_data = $this->getRequestParameter('test_data');
$serialize_extra_data = $this->getRequestParameter('extra_data');
$test_data = unserialize($serialize_test_data);
$extra_data = unserialize($serialize_extra_data);
$filename = $this->getRequestParameter('filename');
$location = $this->getRequestParameter('location');
$comments = $this->getRequestParameter('comments');
//if this is -1 use the origanal device identification
//otherwise use whatever value this is for the identifcation
$existingId = $this->getRequestParameter('existingId');
$c = new Criteria();
$c->add(UnprocessedDevicesPeer::DEVICE_ID, $device_id);
$c->add(UnprocessedDevicesPeer::FILENAME, $filename);
$unprocessDevice = UnprocessedDevicesPeer::doSelect($c);
$unprocessDevice = $unprocessDevice[0];
if($unprocessDevice)
$unprocessDevice->delete();
//add as new entry
if($option == 1){
$this->changePm2Missing($client_id);
$specification = new Specification();
$specification->setDeviceName($device_name);
$specification->setManufacturer($manufacturer);
$specification->setModelNumber($model);
$specification->save();
$specification_id = $specification->getId();
$device = new Device();
$device->setIdentification($device_id);
$device->setClientId($client_id);
$device->setSpecificationId($specification_id);
$device->setSerialNumber($serial);
$device->setLocation($location);
$device->setStatus(strtolower($pass_fail));
$device->setLastPmDate(FinalDeviceReport::convertImportedDate($date));
$device->setComments($comments);
$device->save();
$deviceCheckup = new DeviceCheckup();
$deviceCheckup->setDeviceId($device->getId());
$deviceCheckup->setClientId($device->getClientId());
$deviceCheckup->setDeviceIdentification($device_id);
$deviceCheckup->setDate($date);
$deviceCheckup->setPassFail($pass_fail);
$deviceCheckup->setTime($extra_data['time']);
$deviceCheckup->setRowIndicator($extra_data['rowIndicator']);
$deviceCheckup->setDeviceTechId($extra_data['techId']);
//$deviceCheckup->setLocation($extra_data['location']);
$deviceCheckup->setPassFailCode($extra_data['passFailCode']);
$deviceCheckup->setRecNumber($extra_data['recNumber']);
$deviceCheckup->setRowPurpose($extra_data['rowPurpose']);
$deviceCheckup->setPhysicalInspection($extra_data['physicalInspection']);
$deviceCheckup->setRoom($extra_data['room']);
$deviceCheckup->save();
$device_test_data = new DeviceTestData();
$device_test_data->setDeviceCheckupId($deviceCheckup->getId());
$device_test_data->setName($test_data['name']);
$device_test_data->setPassFail($test_data['passFail']);
$device_test_data->setType($extra_data['physicalInspection']);
$device_test_data->setUnit($test_data['unit']);
$device_test_data->setValue($test_data['value']);
$device_test_data->save();
}else{
//update existing
$c = new Criteria();
$c->add(DevicePeer::IDENTIFICATION, $d_device_id);
$c->add(DevicePeer::CLIENT_ID, $client_id);
$device = DevicePeer::doSelect($c);
$device = $device[0];
if($device){
$specification_id = $device->getSpecificationId();
if($existingId != '-1'){
$device->setIdentification($existingId);
}
$device->setSerialNumber($serial);
$device->setLocation($location);
$device->setStatus(strtolower($pass_fail));
$device->setComments($comments);
$device->setLastPmDate(FinalDeviceReport::convertImportedDate($date));
$device->save();
$deviceCheckup = new DeviceCheckup();
$deviceCheckup->setDeviceId($device->getId());
$deviceCheckup->setClientId($device->getClientId());
$deviceCheckup->setDeviceIdentification($d_device_id);
$deviceCheckup->setDate($date);
$deviceCheckup->setPassFail($pass_fail);
$deviceCheckup->setTime($extra_data['time']);
$deviceCheckup->setRowIndicator($extra_data['rowIndicator']);
$deviceCheckup->setDeviceTechId($extra_data['techId']);
//$deviceCheckup->setLocation($extra_data['location']);
$deviceCheckup->setPassFailCode($extra_data['passFailCode']);
$deviceCheckup->setRecNumber($extra_data['recNumber']);
$deviceCheckup->setRowPurpose($extra_data['rowPurpose']);
$deviceCheckup->setPhysicalInspection($extra_data['physicalInspection']);
$deviceCheckup->setRoom($extra_data['room']);
$deviceCheckup->save();
$device_test_data = new DeviceTestData();
$device_test_data->setDeviceCheckupId($deviceCheckup->getId());
$device_test_data->setName($test_data['name']);
$device_test_data->setPassFail($test_data['passFail']);
$device_test_data->setType($test_data['type']);
$device_test_data->setUnit($test_data['unit']);
$device_test_data->setValue($test_data['value']);
$device_test_data->save();
}
$c= new Criteria();
$c->add(SpecificationPeer::ID,$specification_id);
$specification = SpecificationPeer::doSelect($c);
$specification = $specification[0];
if($specification){
$specification->setDeviceName($device_name);
$specification->setManufacturer($manufacturer);
$specification->setModelNumber($model);
$specification->Save();
}
}
return sfView::NONE;
}
public function executeGetDevices(){
$client_id = $this->getRequestParameter('client_id');
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->addAscendingOrderByColumn(DevicePeer::IDENTIFICATION);
$result = DevicePeer::doSelect($c);
$this->devices = $result;
}
public function executeDeviceIdChanged(){
//these info are from the uploaded file
$device_name = $this->getRequestParameter('dn');
$manufacturer = $this->getRequestParameter('man');
$model = $this->getRequestParameter('mod');
$serial = $this->getRequestParameter('ser');
//device id we want to associate to
$existing_device_id = $this->getRequestParameter('existing_device_id');
$c = new Criteria();
$c->add(DevicePeer::IDENTIFICATION, $existing_device_id);// <---------------------------------------------------
$c->addjoin(DevicePeer::SPECIFICATION_ID, SpecificationPeer::ID, Criteria::LEFT_JOIN);
$result = DevicePeer::doSelect($c);
$this->oldDevice = $result[0];
$this->newDevice = array('device_name'=>$device_name, 'manufacturer'=>$manufacturer, 'model'=>$model, 'serial'=>$serial);
}
public function executeListDevices(){
$client_id = $this->getRequestParameter('client_id');
$c= new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->addjoin(DevicePeer::SPECIFICATION_ID, SpecificationPeer::ID,Criteria::LEFT_JOIN);
$devices = DevicePeer::doSelect($c);
$this->devices = $devices;
$this->client_id = $client_id;
if($devices && $devices[0]->getClient() )
$this->contact = $devices[0]->getClient()->getAttn();
}
public function executeQuotes(){
$client_id = $this->getRequestParameter('client_id');
$checkedItemStr = $this->getRequestParameter('checkedItems'); //ids of items that were checked for update
$c= new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$devices = DevicePeer::doSelect($c);
if(!empty($checkedItemStr)){
$checkedItems = explode(',',$checkedItemStr);
for($i = 0; $i<count($devices); $i++){
if(strtolower($devices[$i]->getStatus())=='fail' and in_array($devices[$i]->getId(),$checkedItems)){
$devices[$i]->setStatus('quote');
$devices[$i]->save();
}
}
}//if
$this->devices = $devices;
$this->client_id = $client_id;
$this->setTemplate('listDevices');
}
public function executePendingRepair(){
$client_id = $this->getRequestParameter('client_id');
$checkedItemStr = $this->getRequestParameter('checkedItems'); //ids of items that were checked for update
$c= new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$devices = DevicePeer::doSelect($c);
if(!empty($checkedItemStr)){
$checkedItems = explode(',',$checkedItemStr);
for($i = 0; $i<count($devices); $i++){
if(strtolower($devices[$i]->getStatus())=='quote' and in_array($devices[$i]->getId(),$checkedItems)){
$devices[$i]->setStatus('pending repair');
$devices[$i]->save();
}
}
}
$this->devices = $devices;
$this->client_id = $client_id;
$this->setTemplate('listDevices');
}
public function executeGenerateReport(){
$client_id = $this->getRequestParameter('client_id');
$contact = trim($this->getRequestParameter('contact'),' ');
$client = ClientPeer::retrieveByPk($client_id);
if($client){
if(!empty($contact))
$contactName = $contact ;
else {
$contactName = ($client->getAddressType() == 1) ? $client->getAttn() : $client->getSecondaryAttn();
}
}
//-------------------------------------------------------------------
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->add(DevicePeer::STATUS, strtolower('fail'));
$totalFail = count(DevicePeer::doSelect($c));
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->add(DevicePeer::STATUS, strtolower('pass'));
$totalPass = count(DevicePeer::doSelect($c));
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->add(DevicePeer::STATUS, strtolower('missing'));
$totalMissing = count(DevicePeer::doSelect($c));
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->add(DevicePeer::STATUS, "missing", CRITERIA::NOT_EQUAL);
$c->addJoin(DevicePeer::SPECIFICATION_ID, SpecificationPeer::ID, CRITERIA::LEFT_JOIN);
$c->add(SpecificationPeer::DEVICE_NAME,'BAUMANOMETER');
$totalBp = count(DevicePeer::doSelect($c));
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->add(DevicePeer::STATUS, "missing", CRITERIA::NOT_EQUAL);
$c->addJoin(DevicePeer::SPECIFICATION_ID, SpecificationPeer::ID, CRITERIA::LEFT_JOIN);
$c->add(SpecificationPeer::DEVICE_NAME,'TRACE GAS N20');
$totalTrace = count(DevicePeer::doSelect($c));
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->add(DevicePeer::STATUS, "missing", CRITERIA::NOT_EQUAL);
$c->addJoin(DevicePeer::SPECIFICATION_ID, SpecificationPeer::ID, CRITERIA::LEFT_JOIN);
$c->add(SpecificationPeer::DEVICE_NAME,'WALL OUTLET');
$totalOutlets = count(DevicePeer::doSelect($c));
//-------------------------------------------------------------------
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->add(DevicePeer::STATUS, 'missing');
$missingDevices = DevicePeer::doSelect($c);
if($missingDevices){
$report = new FinalDeviceReport();
$report->setClientId($client_id);
$report->setDate(date('Y').'-'.date('m').'-'.date('d'));
$report->setPassFail('missing');
$report->setTotalPassed($totalPass);
$report->setTotalFailed($totalFail);
$report->setTotalMissed($totalMissing);
$report->setTotalTrace($totalTrace);
$report->setTotalBp($totalBp);
$report->setTotalOutlets($totalOutlets);
$report->setContact($contactName);
$report->save();
foreach($missingDevices as $f_device){
$missing = new DevicesFailed();
$missing->setReportId($report->getId());
$missing->setClientId($f_device->getClientId());
$missing->setDeviceId($f_device->getId());
$missing->setStatus($f_device->getStatus());
$missing->save();
}//foreach
}
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->add(DevicePeer::STATUS, 'fail');
$failDevices = DevicePeer::doSelect($c);
if($failDevices){
//report failed
$report = new FinalDeviceReport();
$report->setClientId($client_id);
$report->setDate(date('Y').'-'.date('m').'-'.date('d'));
$report->setPassFail('fail');
$report->setTotalPassed($totalPass);
$report->setTotalFailed($totalFail);
$report->setTotalMissed($totalMissing);
$report->setTotalTrace($totalTrace);
$report->setTotalBp($totalBp);
$report->setTotalOutlets($totalOutlets);
$report->setContact($contactName);
$report->save();
foreach($failDevices as $f_device){
$fail = new DevicesFailed();
$fail->setReportId($report->getId());
$fail->setClientId($f_device->getClientId());
$fail->setDeviceId($f_device->getId());
$fail->setStatus($f_device->getStatus());
$fail->save();
}//foreach
}else{
//report passed
//in order to get contact name
$report = new FinalDeviceReport();
$report->setClientId($client_id);
$report->setDate(date('Y').'-'.date('m').'-'.date('d'));
$report->setPassFail('pass');
$report->setTotalPassed($totalPass);
$report->setTotalFailed($totalFail);
$report->setTotalMissed($totalMissing);
$report->setTotalTrace($totalTrace);
$report->setTotalBp($totalBp);
$report->setTotalOutlets($totalOutlets);
$report->setContact($contactName);
$report->save();
}
$c = new Criteria();
$c->add(FinalDeviceReportPeer::CLIENT_ID, $client_id);
$c->addDescendingOrderByColumn(FinalDeviceReportPeer::CREATED_AT);
$finalReport = FinalDeviceReportPeer::doSelect($c);
$this->finalReport = $finalReport;
}
public function executeGetReports(){
$client_id = $this->getRequestParameter('client_id');
$c = new Criteria();
$c->add(FinalDeviceReportPeer::CLIENT_ID, $client_id);
$c->addDescendingOrderByColumn(FinalDeviceReportPeer::CREATED_AT);
$finalReport = FinalDeviceReportPeer::doSelect($c);
$this->finalReport = $finalReport;
$this->setTemplate('generateReport');
}
public function executeDeleteReport(){
$client_id = $this->getRequestParameter('client_id');
$report_id = $this->getRequestParameter('id');
$c = new Criteria();
$c->add(FinalDeviceReportPeer::ID, $report_id);
$c->add(FinalDeviceReportPeer::CLIENT_ID, $client_id);
$c->addDescendingOrderByColumn(FinalDeviceReportPeer::CREATED_AT);
$forDelete = FinalDeviceReportPeer::doSelect($c);
if($forDelete){
$forDelete[0]->delete();
}
$c = new Criteria();
$c->add(FinalDeviceReportPeer::CLIENT_ID, $client_id);
$c->addDescendingOrderByColumn(FinalDeviceReportPeer::CREATED_AT);
$finalReport = FinalDeviceReportPeer::doSelect($c);
$this->finalReport = $finalReport;
$this->setTemplate('generateReport');
}
public function executeSaveComments(){
$device_id = $this->getRequestParameter('device_id');
$comments = $this->getRequestParameter('comments');
$device = DevicePeer::retrieveByPK($device_id);
if($device){
$device->setComments($comments);
$device->save();
}
return sfView::NONE;
}
public function executeCreatePdf(){
$client_id = 0; //default val
$id = $this->getRequestParameter('id');
$c = new Criteria();
$c->add(DeviceCheckupPeer::DATE, $date);
$c->add(DeviceCheckupPeer::CLIENT_ID, $client_id);
$c->add(DeviceCheckupPeer::PASS_FAIL, 'FAIL');
$failedDevices = DeviceCheckupPeer::doSelect($c);
$c = new Criteria();
$c->add(FinalDeviceReportPeer::ID, $id);
$c->setLimit(1);
$all = FinalDeviceReportPeer::doSelect($c);
if(empty($all))
$passed = true;
elseif(strtolower($all[0]->getPassFail())=='fail'){
$passed = false;
$missing = false;
}elseif(strtolower($all[0]->getPassFail())=='pass'){
$passed = true;
$missing = false;
}elseif(strtolower($all[0]->getPassFail())=='missing'){
$missing = true;
}
if(!empty($all))
$client_id = $client_id = $all[0]->getClientId();
$c = new Criteria();
$c->add(ClientPeer::ID, $client_id);
$clientinfo = ClientPeer::doSelect($c);
define('FPDF_FONTPATH',SF_ROOT_DIR.'/web/font/');
$date = date("F d, Y", time());
$clientName = $clientinfo[0]->getClientName();
if($clientinfo[0]->getAddressType() == 1){
$address_line_1 = $clientinfo[0]->getAddress();
$address_line_2 = $clientinfo[0]->getAddress2();
$address_line_3 = $clientinfo[0]->getCity().', '.$clientinfo[0]->getState().' '.$clientinfo[0]->getZip();
//$contact = $clientinfo[0]->getAttn();
$contact = $all[0]->getContact();
}else{
$address_line_1 = $clientinfo[0]->getSecondaryAddress();
$address_line_2 = $clientinfo[0]->getSecondaryAddress2();
$address_line_3 = $clientinfo[0]->getSecondaryCity().', '.$clientinfo[0]->getSecondaryState().' '.$clientinfo[0]->getSecondaryZip();
//$contact = $clientinfo[0]->getSecondaryAttn();
$contact = $all[0]->getContact();
}
$subject = "Re: Preventive Maintenance Test Results ";
if($missing){
$line_1 = "While our technician was doing preventive maintenance on your equipment, some devices were missed. The following is a list of the equipment that were not checked:
";
$line_2 = "
We would like to schedule a time to complete the preventive maintenance on this equipment. Please call us and we will arrange for a technician to complete this work. If you have any questions, please do not hesitate to call. ";
$signer = "Chris Endres, VP";
}else{
$line_1 = "While our technician was doing preventive maintenance on your equipment, some failures were found. The following is a list of the equipment and the problems that were found:
";
$line_2 = "
We would like to schedule a time to repair this equipment. Please call us and we will arrange for a technician to perform the needed repair immediately. If you have any questions, please do not hesitate to call.";
$signer = "Chris Endres, VP";
}
$passed_line = "While our technician was doing preventive maintenance on your equipment there were no problems found. Enclosed please find the reports for all equipment tested. If you need any repairs or have any questions, please do not hesitate to call.
";
$pdf=new FPDF();
$pdf->SetMargins(30,25,30);
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times','',12);
//for($i=1;$i<=40;$i++)
$pdf->Cell(0,5,$date,0,1);
$pdf->Cell(0,5,"",0,1);
$pdf->Cell(0,5,$clientName,0,1);
$pdf->Cell(0,5,$address_line_1,0,1);
if(!empty($address_line_2))
$pdf->Cell(0,5,$address_line_2,0,1);
$pdf->Cell(0,5,$address_line_3,0,1);
$pdf->Cell(0,5,"",0,1);
$pdf->Cell(0,5,$subject,0,1);
$pdf->Cell(0,5,"",0,1);
$pdf->Cell(0,5,"Dear $contact,",0,1);
$pdf->Cell(0,5,"",0,1);
if($passed)
$pdf->MultiCell(0,5,$passed_line,0,1);
else{
$pdf->MultiCell(0,5,$line_1,0,1);
//search for failed device for report
if($missing){
$c = new Criteria();
$c->add(DevicesFailedPeer::CLIENT_ID, $client_id);
$c->add(DevicesFailedPeer::REPORT_ID, $id);
$c->add(DevicesFailedPeer::STATUS, 'missing');
$c->addjoin(DevicesFailedPeer::DEVICE_ID,DevicePeer::ID, Criteria::LEFT_JOIN);
$failedDevices = DevicesFailedPeer::doSelect($c);
foreach($failedDevices as $failedDevice){
$currentDevice = $failedDevice->getDevice();
if($currentDevice){
$deviceName = $currentDevice->getSpecification()->getDeviceName();
$deviceIdentification = $currentDevice->getIdentification();
$pdf->Cell(0,5," * $deviceIdentification - $deviceName",0,1);
}
}
}else{
$c = new Criteria();
$c->add(DevicesFailedPeer::CLIENT_ID, $client_id);
$c->add(DevicesFailedPeer::REPORT_ID, $id);
$c->add(DevicesFailedPeer::STATUS, 'fail');
$c->addjoin(DevicesFailedPeer::DEVICE_ID,DevicePeer::ID, Criteria::LEFT_JOIN);
$failedDevices = DevicesFailedPeer::doSelect($c);
foreach($failedDevices as $failedDevice){
$currentDevice = $failedDevice->getDevice();
if($currentDevice){
$comments = ($currentDevice->getComments()) ? '- ' . $currentDevice->getComments() : '';
$comments = strtoupper($comments);
$deviceName = $currentDevice->getSpecification()->getDeviceName();
$deviceIdentification = $currentDevice->getIdentification();
$pdf->Cell(0,5," * $deviceIdentification - $deviceName $comments",0,1);
}
}
}
$pdf->Cell(0,5," ",0,1);
$pdf->MultiCell(0,5,$line_2,0,1);
}
$pdf->Cell(0,5," ",0,1);
$pdf->Cell(0,5,"Sincerely, ",0,1);
$pdf->Cell(0,5," ",0,1);
$pdf->Cell(0,5," ",0,1);
$pdf->Cell(0,5," ",0,1);
$pdf->Cell(0,5,$signer,0,1);
//$pdf->Cell(0,5,$subject,0,1);
//$pdf->Cell(0,5,$subject,0,1);
//$pdf->Cell(0,5,$subject,0,1);
$pdf->Output();
return svView::NONE;
}
private function changePm2Missing($clientId = null){
if(empty($clientId)) return;
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID,$clientId);
$c->add(DevicePeer::STATUS,'pm scheduled');
$devices = DevicePeer::doSelect($c);
foreach($devices as $device){
$device->setStatus('missing');
$device->save();
}
}
public function executeUpdateFullMatch(){
$client_id = $this->getRequestParameter('client_id');
$device_id = $this->getRequestParameter('device_id');
if($client_id > 0){
$device = DevicePeer::retrieveByPk($device_id);
if($device){
$device->setClientId($client_id);
$device->save();
}
}
return sfView::NONE;
}
}

View File

@ -0,0 +1,11 @@
generateReportSuccess:
layout: no
listDevicesSuccess:
layout: no
deviceIdChangedSuccess:
layout: no
getDevicesSuccess:
layout: no
all:
stylesheets: [process]
javascripts: [scriptaculous/lib/prototype, process]

View File

@ -0,0 +1,11 @@
<? if(empty($devices)) {?>
<option value='-1'>No Device</option>
<? }else{?>
<option value='-2'>Select A Device</option>
<?php
}?>
<?php foreach($devices as $device) { ?>
<option value='<?print $device->getIdentification(); ?>'><?print $device->getIdentification(); ?></option>
<?php } ?>

View File

@ -0,0 +1,57 @@
<?
$oldDevice_name = ($oldDevice->getSpecification()) ? $oldDevice->getSpecification()->getDeviceName() : '';
$oldDevice_manufacturer = ($oldDevice->getSpecification()) ? $oldDevice->getSpecification()->getManufacturer() : '';
$oldDevice_serial = $oldDevice->getSerialNumber();
$oldDevice_model = ($oldDevice->getSpecification()) ? $oldDevice->getSpecification()->getModelNumber() : '';
?>
<?php
//$_device_name = "<select>";
if(!empty($newDevice)){
$_device_name .= "<option value='".$newDevice['device_name']."'>".$newDevice['device_name']."</option>";
if(!empty($oldDevice_name)){
$_device_name .= "<option value='$oldDevice_name'>$oldDevice_name</option>";
}
}
//$_device_name .= "</select>";
//print $_device_name;
//$_manufacturer = "<select>";
if(!empty($newDevice)){
$_manufacturer .= "<option value='".$newDevice['manufacturer']."'>".$newDevice['manufacturer']."</option>";
}
if(!empty($oldDevice_manufacturer)){
$_manufacturer .= "<option value='$oldDevice_manufacturer'>$oldDevice_manufacturer</option>";
}
//$_manufacturer .= "</select>";
//print $_manufacturer;
//$_serial ="<select>";
if(!empty($newDevice))
$_serial.= "<option value='".$newDevice['serial']."'>".$newDevice['serial']."</option>";
if(!empty($oldDevice_serial))
$_serial.= "<option value='$oldDevice_serial'>$oldDevice_serial</option>";
//$_serial.= "</select>";
//print $_serial;
//$_model = "<select>";
if(!empty($newDevice))
$_model .= "<option value='".$newDevice['model']."'>".$newDevice['model']."</option>";
if(!empty($oldDevice_model))
$_model .= "<option value='$oldDevice_model'>$oldDevice_model</option>";
//$_model .= "</select>";
//print $_model;
print "
{
serial: \"$_serial\",
model: \"$_model\",
manufacturer: \"$_manufacturer\",
device_name: \"$_device_name\"
}";
?>

View File

@ -0,0 +1,70 @@
<div>
<div class='regularCont'>
<div class='titleBar'>Match (<a href='javascript:void(0);' onclick='toggle_matched()' id='toggle_matched_but'>Show</a>)</div>
<div class='innerCont' id='matched_cont' style='display:NONE'>
<table id='noMatchTable'>
<tr>
<td class='partial_match_column_title'>Assoc. Client</td>
<td class='partial_match_column_title'>Device ID</td>
<td class='partial_match_column_title'>Device Name</td>
<td class='partial_match_column_title'>Manufacturer</td>
<td class='partial_match_column_title'>Model</td>
<td class='partial_match_column_title'>Serial</td>
<td class='partial_match_column_title'></td>
</tr>
<?php
foreach($match as $partial) { ?>
<tr>
<td >
<select id='new_client_match_<?php print $partial['random_id']; ?>' >
<option value='-1' selected='selected'>Existing Client</option>
<?php foreach($clients as $client) { ?>
<option value='<?print $client->getId(); ?>'><?print $client->getClientIdentification(); ?></option>>
<?php } ?>
</select>
</td>
<td>
<select id='device_id_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
</select>
</td>
<td>
<select id='device_name_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['device_name']; ?>'><?php print print $partial['device_name']; ?></option>
</select>
</td>
<td>
<select id='manufacturer_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['manufacturer']; ?>'><?php print $partial['manufacturer']; ?></option>
</select>
</td>
<td>
<select id='model_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['model']; ?>'><?php print $partial['model']; ?></option>
</select>
</td>
<td>
<select id='serial_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['serial']; ?>'><?php print $partial['serial']; ?></option>
</select>
</td>
<td>
<input id='input_<?php print $partial['random_id']; ?>' type='button' value='save' onclick="saveFullMatchUpdate(<?php print $partial['id']; ?>,<?php print $partial['random_id']; ?>)">
<input type='hidden' id='location_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['location']; ?>'>
<input type='hidden' id='date_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['date']; ?>'>
<input type='hidden' id='pass_fail_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['pass_fail']; ?>'>
<input type='hidden' id='extra_data_match_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['extraData']); ?>'>
<input type='hidden' id='test_data_match_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['testData']); ?>'>
<input type='hidden' id='comments_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['comments']; ?>'>
</td>
<td>
(<?php print $partial['client_name']?>)<?php print $partial['warning'];?>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>

View File

@ -0,0 +1,86 @@
<div class='regularCont'>
<div class='titleBar'>No Match</div>
<div class='innerCont'>
<table>
<tr>
<td class='partial_match_column_title'>Client</td>
<td class='partial_match_column_title'>Option</td>
<td class='partial_match_column_title'>Device ID</td>
<td class='partial_match_column_title' style='width: 130px'>ID Options</td>
<td class='partial_match_column_title'>Device Name</td>
<td class='partial_match_column_title'>Manufacturer</td>
<td class='partial_match_column_title'>Model</td>
<td class='partial_match_column_title'>Serial</td>
<td></td>
</tr>
<?php foreach($noMatch as $partial) { ?>
<tr>
<td>
<select id='client_<?php print $partial['random_id']; ?>' onChange='updateDevices(<?php print $partial['random_id']; ?>); restoreFields(<?php print $partial['random_id']; ?>)'>
<option value='-1' selected='selected'>Select A Client</option>
<?php foreach($clients as $client) { ?>
<option value='<?print $client->getId(); ?>'><?print $client->getClientIdentification(); ?></option>>
<?php } ?>
</select>
</td>
<td>
<select id='option_<?php print $partial['random_id']; ?>' onchange='optionChanged(<?php print $partial['random_id']; ?>)'>
<option value='1'>Add As New Device</option>
<option value='2'>Associate Device</option>
</select>
</td>
<td>
<select id='device_id_<?php print $partial['random_id']; ?>' style='width: 100px'>
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
</select>
<select id='get_devices_<?php print $partial['random_id']; ?>' style='width: 100px; display:none' onChange='device_id_changed(<?php print $partial['random_id']; ?>)'>
</select>
</td>
<td>
<select id='device_id_option_<?php print $partial['random_id']; ?>' style='width: 130px' disabled='disabled'>
<option value='-1'>-Use Existing Id-</option>
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
</select>
</td>
<td>
<select id='device_name_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['device_name']; ?>'><?php print $partial['device_name']; ?></option>
</select>
<input type='hidden' id='hidden_device_name_<?php print $partial['random_id']; ?>' value='<?php print $partial['device_name']; ?>'>
</td>
<td>
<select id='manufacturer_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['manufacturer']; ?>'><?php print $partial['manufacturer']; ?></option>
</select>
<input type='hidden' id='hidden_manufacturer_<?php print $partial['random_id']; ?>' value='<?php print $partial['manufacturer']; ?>'>
</td>
<td>
<select id='model_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['model']; ?>'><?php print $partial['model']; ?></option>
</select>
<input type='hidden' id='hidden_model_<?php print $partial['random_id']; ?>' value='<?php print $partial['model']; ?>'>
</td>
<td>
<select id='serial_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['serial']; ?>'><?php print $partial['serial']; ?></option>
</select>
<input type='hidden' id='hidden_serial_<?php print $partial['random_id']; ?>' value='<?php print $partial['serial']; ?>'>
</td>
<td>
<input id='input_<?php print $partial['random_id']; ?>' type='button' value='save' onclick='save_no_match(<?php print $partial['random_id']; ?>)'>
<input type='hidden' id='location_<?php print $partial['random_id']; ?>' value='<?php print $partial['location']; ?>'>
<input type='hidden' id='date_<?php print $partial['random_id']; ?>' value='<?php print $partial['date']; ?>'>
<input type='hidden' id='pass_fail_<?php print $partial['random_id']; ?>' value='<?php print $partial['pass_fail']; ?>'>
<input type='hidden' id='extra_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['extraData']); ?>'>
<input type='hidden' id='test_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['testData']); ?>'>
<input type='hidden' id='comments_<?php print $partial['random_id']; ?>' value='<?php print $partial['comments']; ?>'>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>

View File

@ -0,0 +1,77 @@
<div>
<div class='regularCont'>
<div class='titleBar'>Partial Match</div>
<div class='innerCont'>
<table id='noMatchTable'>
<tr>
<td class='partial_match_column_title'>New Client</td>
<td class='partial_match_column_title'>Device ID</td>
<td class='partial_match_column_title'>Device Name</td>
<td class='partial_match_column_title'>Manufacturer</td>
<td class='partial_match_column_title'>Model</td>
<td class='partial_match_column_title'>Serial</td>
<td class='partial_match_column_title'></td>
</tr>
<?php
foreach($partialMatch as $partial) { ?>
<tr>
<td >
<select id='new_client_partial_<?php print $partial['random_id']; ?>' >
<option value='-1' selected='selected'>Existing Client</option>
<?php foreach($clients as $client) { ?>
<option value='<?print $client->getId(); ?>'><?print $client->getClientIdentification(); ?></option>>
<?php } ?>
</select>
</td>
<td >
<select id='device_id_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
</select>
</td>
<td>
<select id='device_name_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['device_name']==true){ print ";border: 1px solid red";}?>'>
<?php foreach($partial['device_name'] as $device_name) { ?>
<option value='<?php print $device_name; ?>'><?php print $device_name; ?></option>
<?php }?>
</select>
</td>
<td>
<select id='manufacturer_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['manufacturer']==true){ print ";border: 1px solid red";}?>'>
<?php foreach($partial['manufacturer'] as $manufacturer) { ?>
<option value='<?php print $manufacturer; ?>'><?php print $manufacturer; ?></option>
<?php }?>
</select>
</td>
<td>
<select id='model_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['model']==true){ print ";border: 1px solid red";}?>'>
<?php foreach($partial['model'] as $model) { ?>
<option value='<?php print $model; ?>'><?php print $model; ?></option>
<?php }?>
</select>
</td>
<td>
<select id='serial_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['serial']==true){ print ";border: 1px solid red";}?>'>
<?php foreach($partial['serial'] as $serial) { ?>
<option value='<?php print $serial; ?>'><?php print $serial; ?></option>
<?php }?>
</select>
</td>
<td>
<input id='input_<?php print $partial['random_id']; ?>' type='button' value='save' onclick='save_partial_match(<?php print $partial['random_id']; ?>)'>
<input type='hidden' id='location_<?php print $partial['random_id']; ?>' value='<?php print $partial['location']; ?>'>
<input type='hidden' id='date_<?php print $partial['random_id']; ?>' value='<?php print $partial['date']; ?>'>
<input type='hidden' id='pass_fail_<?php print $partial['random_id']; ?>' value='<?php print $partial['pass_fail']; ?>'>
<input type='hidden' id='extra_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['extraData']); ?>'>
<input type='hidden' id='test_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['testData']); ?>'>
<input type='hidden' id='comments_<?php print $partial['random_id']; ?>' value='<?php print $partial['comments']; ?>'>
</td>
<td>
(<?php print $partial['client_name']?>)<?php print $partial['warning'];?>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>

View File

@ -0,0 +1,3 @@
<?php
include_partial('device_changed',array('oldDevice'=>$oldDevice, 'newDevice'=>$newDevice))
?>

View File

@ -0,0 +1,78 @@
<div class='regularCont'>
<div class='innerCont'><table>
<tr>
<td style='width: 100px'>Report
</td>
<td style='width: 100px'>Status
</td>
<td style='width: 200px'>
Date
</td>
<td style='width: 50px'>
Pass
</td>
<td style='width: 50px'>
Fail
</td>
<td style='width: 50px'>
Missed
</td>
<td style='width: 50px'>
Bp
</td>
<td style='width: 50px'>
Trace
</td>
<td style='width: 50px'>
Outlets
</td>
<td style='width: 200px'>
Action
</td>
</tr>
<?php
foreach($finalReport as $report){
?>
<tr>
<td>
<a target='_blank' href='/index.php/process/createPdf/id/<?php print $report->getId(); ?>'>View Report</a>
</td>
<td>
<?php print ucwords($report->getPassFail()); ?>
</td>
<td>
<?php print $report->formattedDate(); ?>
</td>
<td>
<?php print (int)$report->getTotalPassed(); ?>
</td>
<td>
<?php print (int)$report->getTotalFailed(); ?>
</td>
<td>
<?php print (int)$report->getTotalMissed(); ?>
</td>
<td>
<?php print (int)$report->getTotalBp(); ?>
</td>
<td>
<?php print (int)$report->getTotalTrace(); ?>
</td>
<td>
<?php print (int)$report->getTotalOutlets(); ?>
</td>
<td>
<a href='javascript:void(0)' onclick='deleteReport(<?php print $report->getId(); ?>,<?php print $report->getClientId(); ?>)' >Delete</a>
</td>
</tr>
<?php
}
if(empty($finalReport)){
?>
<tr><td colspan='4'><div style='text-align:center;font-weight:bold;'>No Reports Found</div></td></tr>
<?php
}
?>
</table>
</div>
</div>

View File

@ -0,0 +1,2 @@
<?php
include_partial('device',array('devices'=>$devices)); ?>

View File

@ -0,0 +1,44 @@
<div class='regularCont'>
<div class='titleBar'>New File Upload</div>
<div class='innerCont'>
<form name='uploadForm' id='uploadForm' action='process/processUpload' method='post' enctype='multipart/form-data'>
<input type='file' name='upload'>
<input type='submit' name='submit' value='Upload'>
<input type='button' name='unprocessed' value='View Unprocessed' onclick="document.location='/index.php/unprocessed/index'">
</form>
</div>
</div>
<iframe name='iframe' id='iframe' width="0" height="0" border="0" style='visibility:hidden'>
</iframe>
<div class='regularCont'>
<div class='titleBar'>Reporting</div>
<div class='innerCont'>
<table style='margin: 4px;float:left'>
<tr><td>Client</td></tr>
<tr>
<td>
<?php echo select_tag('client', options_for_select($clients, $client_id,'include_custom=Please Select a Client'), array('id'=>'current_client','onchange'=>'process_client_change()') );?>
</td>
</tr>
<tr><td>Contact</td></tr>
<tr>
<td>
<input type='text' value='' id='theContact'>
</td>
</tr>
</table>
<table style='float:left; margin-left:20px;'>
<tr><td> <div id='listedReport'></div>
</td></tr></table>
<div style='clear:both'></div>
</div>
</div>
<div id='listedDevices'>
</div>

View File

@ -0,0 +1,140 @@
<br><br>
<div class='regularCont'>
<div class='titleBar'>Client Devices</div>
<div class='innerCont'>
<div >
<? if(!empty($devices)){?>
<input type='button' value='Quote Failed Item' onclick='quoted()'>
<input type='button' value='Pending Repairs' onClick='pendingRepair()'>
<input type='button' value='Schedule Repair' onClick="scheduleRepair(<?php print $client_id;?>)">
<input type='button' value='Reschedule Missing' onClick="rescheduleMissing(<?php print $client_id;?>)">
<input type='button' value='Print Final Report' onClick="generateReport()">
<? }else{
?>
<input type='button' value='Quote Failed Item' disabled='disabled'>
<input type='button' value='Pending Repairs' disabled='disabled'>
<input type='button' value='Schedule Repair' disabled='disabled'>
<input type='button' value='Reschedule Missing' disabled='disabled'>
<input type='button' value='Print Final Report' disabled='disabled'>
<?php
} ?>
</div>
<br/>
<table style='margin-left: 30px;'>
<tr>
<td style='width: 20px; font-weight:bold'>
</td>
<td style='width:150px; font-weight:bold'>
Device Id
</td>
<td style='width:150px; font-weight:bold'>
Device
</td>
<td style='width:150px;font-weight:bold'>
Manufacturer
</td>
<td style='width:150px;font-weight:bold'>
Model
</td>
<td style='width:150px;font-weight:bold'>
Serial
</td>
<td style='width:150px;font-weight:bold'>
Location
</td>
<td style='width:150px;font-weight:bold'>
Status
</td>
<td style='width:150px;font-weight:bold'>
Comments
</td>
</tr>
<?php
$listDeviceIdAr = array();
foreach($devices as $device){
if($device->getSpecification()){
$manufacturer = $device->getSpecification()->getManufacturer();
$model = $device->getSpecification()->getModelNumber();
$d_name = $device->getSpecification()->getDeviceName();
}
$listDeviceIdAr[] = $device->getId();
?>
<tr>
<td>
<input type='checkbox' id='checkbox_<?php print $device->getId(); ?>' />
</td>
<td>
<input type='text' id='device_' value='<?php print $device->getIdentification(); ?>'/>
</td>
<td>
<input type='text' id='dd_name_' value='<?php print $d_name; ?>'/>
</td>
<td>
<input type='text' id='manufacturer_' value='<?php print $manufacturer; ?>'/>
</td>
<td>
<input type='text' id='serial_' value='<?php print $model; ?>'/>
</td>
<td>
<input type='text' id='serial_' value='<?php print $device->getSerialNumber(); ?>'/>
</td>
<td>
<input type='text' id='serial_' value='<?php print $device->getLocation(); ?>'/>
</td>
<td>
<select style='width: 140px'>
<option value='<?php print ucwords($device->getStatus()); ?>'/><?php print ucwords($device->getStatus()); ?></option>
</select>
</td>
<td>
<input type='text' id='device_comment_' value='<?php print $device->getComments(); ?>' onblur='save_comments(this,<?php print $device->getId(); ?>)'/>
</td>
</tr>
<?php }
if(empty($devices)){
?><td>
<!--checkboxes would be here -->
</td>
<tr>
<td>
<input type='checkbox' />
</td>
<td>
<input type='text' id='device_' value=' '/>
</td>
<td>
<input type='text' id='dd_name_' />
</td>
<td>
<input type='text' id='manufacturer_' />
</td>
<td>
<input type='text' id='serial_' />
</td>
<td>
<input type='text' id='serial_' />
</td>
<td>
<input type='text' id='serial_' />
</td>
<td>
<input type='text' id='device_comment_' />
</td>
</tr>
<?php
}
?>
</table>
<input type='hidden' id='hidden_device_id' value='<?php print implode(',',$listDeviceIdAr); ?>'/>
</div>
</div>
<script type='text/javascript'>
window.insertContact('<?php print $contact; ?>');
</script>

View File

@ -0,0 +1,22 @@
<div style='font-size: 13px; width: 300px; border: 1px solid black; margin-top: 30px;'>
<div style='color: #fff; background-color:#08C46E ; font-weight: bold; text-align:center'> UPLOAD STATUS </div>
<div style='padding: 5px;'>
<?php
print "<b>Filename</b>: ".$filename." <br/>";
print "<b>Total Uploaded</b>: ".(count($match)+count($partialMatch)+count($noMatch))." <br/>";
print "<b>Matched</b>: ".count($match)."<br/>";
print "<b>Partial Match</b>: ".count($partialMatch)."<br/>";
print "<b>No Match</b>: ".count($noMatch)."<br/>";
?>
</div>
</div>
<input type='hidden' name='filename' id='filename' value='<?php echo $filename; ?>'/>
<div id='test'></div>
<?php
if(!empty($match))
include_partial('process_match', array('match' => $match, 'clients'=>$clients));
if(!empty($partialMatch))
include_partial('process_partial_match', array('partialMatch' => $partialMatch));
if(!empty($noMatch))
include_partial('process_no_match', array('noMatch' => $noMatch, 'clients'=>$clients));
?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,11 @@
techMapSuccess:
javascripts: [%SF_PROTOTYPE_WEB_DIR%/js/prototype]
layout: techMap
indexSuccess:
javascripts: [/js/scheduler]
stylesheets: [/css/email.css]
sendEmailSuccess:
has_layout: off
javascripts: [/js/scheduler]
stylesheets: [/css/email.css]

View File

@ -0,0 +1,79 @@
<?php use_helper('Object'); ?>
<?php use_helper('Javascript'); ?>
<?php use_helper('DateForm'); ?>
<div class="client_select">
<?php echo form_tag('scheduler/index'); ?>
<table><tr>
<td width=50><b>Client: </b></td>
<td><?php echo $client->getClientName(); ?></td>
</tr></table>
</form>
</div>
<div class="job_details">
<?php echo form_tag('scheduler/jobScheduler', array('id' => 'jobScheduler')); ?>
<?php echo input_hidden_tag('client_select', $client->getId()); ?>
<?php echo input_hidden_tag('start_time'); ?>
<?php echo input_hidden_tag('end_time'); ?>
<?php echo input_hidden_tag('date', $date); ?>
<?php echo input_hidden_tag('workorder_id', $workorder_id); ?>
<?php echo input_hidden_tag('job_status', 'scheduled'); ?>
<?php echo input_hidden_tag('job_date', $date); ?>
<?php echo input_hidden_tag('edit', $mode); ?>
<?php echo input_hidden_tag('technician'); ?>
<table><tr>
<td>Device: </td>
<td><?php if (isset($specification_options))
{
echo select_tag('specification_select', options_for_select($specification_options, $specification_select), array(
'onChange' => 'populateDeviceMenu()'));
} else {
echo 'Please Select a Client...';
} ?></td>
</tr><tr>
<td>Device ID: </td>
<td><div id=device><?php echo select_tag('device_select', options_for_select($device_options)); ?></div></td>
</tr><tr>
<td>Reason: </td>
<td><?php echo select_tag('reason_select', objects_for_select($reason_dropdown, 'getid', 'getvalue'), $edit_workorder->getReason()); ?></td>
</tr><tr>
<td>Notes: </td>
<td><?php echo textarea_tag('notes', $edit_workorder->getRemarks() , 'size=25x3'); ?></td>
</tr></table>
</div>
<div class="tech_details">
<table><tr>
<td>Technician: </td>
<td colspan=2><div id='selectTech'><?php echo $technician->getLastName().', '.$technician->getFirstName(); ?></div></td>
</tr><tr>
<td>job date:</td>
<td><div id="display_date"><?php echo input_date_tag('job_date', $date); ?></div></td>
</tr><tr>
<td>start time: </td>
<td><?php echo input_tag('start_time_hours', $start_time_hours , array(
'size' => '2',
'maxlength' => '2')).' : '.
input_tag('start_time_minutes', $start_time_minutes, array(
'size' => '2',
'maxlength' => '2')); ?></td>
<td><?php echo radiobutton_tag('start_time_ampm[]','am', true).'am '.' '.
radiobutton_tag('start_time_ampm[]','pm', false).'pm'; ?></td>
</tr><tr>
<td>end time: </td>
<td><?php echo input_tag('end_time_hours', $end_time_hours, array(
'size' => '2',
'maxlength' => '2')).' : '.
input_tag('end_time_minutes', $end_time_minutes, array(
'size' => '2',
'maxlength' => '2')); ?></td>
<td><?php echo radiobutton_tag('end_time_ampm[]','am', true).'am '.' '.
radiobutton_tag('end_time_ampm[]','pm', false).'pm'; ?></td>
</tr><tr>
<td><?php echo button_to('Schedule New', 'scheduler/index'); ?></td>
<td><?php echo button_to('Delete Job', 'scheduler/deleteJob?id='.$edit_workorder->getId(), array('confirm' => 'Are you sure you want to delete this job?')); ?></td>
<?php // <td><?php echo button_to('Delete Job', 'scheduler/deleteJob?workorder_id='.$edit_workorder->getId(), array('onClick' => "confirm('Are you sure you want to delete this job?')")); </td> ?>
<td><?php echo submit_tag('Save Job'); ?></td>
</tr></table>
</div>
</form>

View File

@ -0,0 +1,58 @@
<?php use_helper('Javascript'); ?>
<h2>Available Technicians: </h2>
<div id="availableTechs" >
<?php
$c_count = 0;
foreach($availableTechnicians as $tech)
{
$available = $availableTimes[$tech->getId()];
if (isset($available))
{
echo '<div class="availTech">'.$tech->getFirstName().' '.$tech->getLastName().'<br />';
//parse time string
$inc = 2;
$available_minutes = $available % 100;
$available_hours = ($available - $available_minutes) / 100;
$available_hrs = $available_hours;
if($available_hours > 12) { $available_hours = $available_hours - 12; }
if($available_minutes == 0) { $available_minutes = '00'; }
$available_endhours = $available_hours + 2;
if($available_hours == 11) { $available_endhours = 1; }
if($available_hours == 12) { $available_endhours = 2; }
$s_hours = substr($tech->getStartTime(),0,2);
$s_mins = substr($tech->getStartTime(),2,2);
$e_hours = substr($tech->getEndTime(),0,2);
$e_mins = substr($tech->getEndTime(),2,2);
$available_minutes_str = (strlen($available_minutes)<2) ? "0".$available_minutes : $available_minutes;
echo link_to_function($available_hours.':'.$available_minutes_str, "selectTech(".$tech->getId().", '".$tech->getFirstName()."', '".$tech->getLastName()."', ".$available_hrs.", ".$available_minutes_str.")");
echo " | ";
echo link_to_function('Add', "selectSTech(".$tech->getId().", '".$tech->getFirstName()."', '".$tech->getLastName()."')");
echo " | ";
echo link_to_function('Day', "alldayTech(".$tech->getId().", '".$tech->getFirstName()."', '".$tech->getLastName()."', ".$s_hours.", ".$s_mins.", ".$e_hours.", ".$e_mins.")");
echo " | ";
echo link_to_function('Week', "allweekTech(".$tech->getId().", '".$tech->getFirstName()."', '".$tech->getLastName()."', ".intval($s_hours).", ".$s_mins.", ".$e_hours.", ".$e_mins.")");
/*
echo " | ";echo link_to_function('MWF', "MWF_TT(".$tech->getId().", '".$tech->getFirstName()."', '".$tech->getLastName()."', ".$s_hours.", ".$s_mins.", ".$e_hours.", ".$e_mins.",'mwf')");
echo " | ";echo link_to_function('TT', "MWF_TT(".$tech->getId().", '".$tech->getFirstName()."', '".$tech->getLastName()."', ".$s_hours.", ".$s_mins.", ".$e_hours.", ".$e_mins.",'tt')");
*/
?><br />
<input type='checkbox' value='1' id='d_m_<?php print $c_count; ?>' />M
<input type='checkbox' value='1' id='d_t_<?php print $c_count; ?>' />T
<input type='checkbox' value='1' id='d_w_<?php print $c_count; ?>' />W
<input type='checkbox' value='1' id='d_tt_<?php print $c_count; ?>' />T
<input type='checkbox' value='1' id='d_f_<?php print $c_count; ?>' />F
<?php echo link_to_function('Update', "MWF_TT(".$tech->getId().", '".$tech->getFirstName()."', '".$tech->getLastName()."', '".$s_hours."', '".$s_mins."', '".$e_hours."', '".$e_mins."','$c_count')"); ?>
</div><?php $c_count++;
}
}
?>
</div>
<div id='testing'></div>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
<?php use_helper('Javascript'); ?>
<?php echo select_tag('device_select', options_for_select($device_options)); ?>

View File

@ -0,0 +1,39 @@
<?php use_helper('Javascript'); ?>
<?php echo input_hidden_tag('schedule_date'); ?>
<div id="techInfo">
<div id="techMenu" style="padding: 4px">
<?php echo "<span style='height: 100%; display:table-cell;'>"; echo link_to_function('All', "selectTechSchedule('all')"); echo "</span>";
foreach($tech_info as $tech)
{
echo "<span style='padding-top: 0px; height: 20px; display:table-cell;' id = 'tech_id_".$tech->getId()."'>";
echo link_to_function($tech->getFirstName().' '.$tech->getLastName(), "selectTechSchedule(".$tech->getId().")");
echo "</span>";
}
?>
</div>
<div class="techSchedule">
<?php
$techCount = 0;
foreach($schedules as $schedule)
{
$techCount++;
include_partial('global/technicianSchedule', array('schedule' => $schedule, 'workorderCallbackFunction' => 'populateWorkorder'));
if ($techCount % 5 == 0){
echo '</div><div class="techSchedule">';
}
}
?>
</div>
<div id="techMap" style="float:left">
<iframe frameborder="0" id="techMapDisplay"></iframe>
</div>
</div>

View File

@ -0,0 +1,26 @@
<?php use_helper('Javascript'); ?>
<?php echo input_hidden_tag('schedule_date'); ?>
<div id="techInfo">
<div class="techSchedule">
<?php
$techCount = 0;
foreach($schedules as $schedule)
{
$techCount++;
include_partial('global/technicianEmailSchedule', array('date'=>$date,'emailComment'=>$emailComment,'schedule' => $schedule, 'workorderCallbackFunction' => 'populateWorkorder','job_reason'=>$dropdowns));
if ($techCount % 5 == 0){
echo '</div><div class="techSchedule">';
}
}
?>
</div>
<div id="techMap" style="float:left">
<iframe frameborder="0" id="techMapDisplay"></iframe>
</div>
</div>

View File

@ -0,0 +1,2 @@
<?php include_component('maps', 'displayTechnicianMap', array('markers' => $markers, 'mapwidth' => '500px', 'mapheight' => '400px')); ?>

View File

@ -0,0 +1,83 @@
<?php
/**
* security actions.
*
* @package atlbiomed
* @subpackage security
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class securityActions extends sfActions
{
public function executeSecure()
{
}
/**
* Generates a random challenge string.
*
*/
private function generateChallenge()
{
return substr(preg_replace('/[\/\\\:*?"<>|.$^1]/', '', crypt(time())), 0, 16);
}
/**
* Executes index action
*
*/
public function executeIndex()
{
if($this->getRequest()->getMethod() == sfRequest::POST)
{
// check fields
$username = $this->getRequestParameter('username');
$password = $this->getRequestParameter('password');
/* $password = hash('sha256', $password);*/
// authenticate user
$c = new Criteria();
$c->add(UserPeer::USER_NAME, $username);
$c->add(UserPeer::PASSWORD, $password);
$user = UserPeer::doSelectOne($c);
if($user != null)
{
// success
$userId = $user->getId();
$this->getUser()->setAuthenticated(true);
$this->getUser()->addCredential($user->getUserType()->getTypeName());
$this->getUser()->setAttribute('name', $user->getDisplayName());
$this->getUser()->setAttribute('userId',$userId);
$this->redirect('scheduler');
}
}
$this->logoutUser();
}
public function executeLogout()
{
$this->logoutUser();
$this->redirect('security/index');
}
private function logoutUser()
{
$this->getUser()->setAuthenticated(false);
$this->getUser()->clearCredentials();
$this->getUser()->getAttributeHolder()->remove('name');
}
public function handleErrorIndex()
{
return sfView::SUCCESS;
}
}

View File

@ -0,0 +1,2 @@
all:
is_secure: off

View File

@ -0,0 +1,6 @@
indexSuccess:
javascripts: [%SF_PROTOTYPE_WEB_DIR%/js/prototype]
layout: noLayout
secureSuccess:
layout: noLayout

View File

@ -0,0 +1,32 @@
<?php use_helper('Validation') ?>
<?php echo form_tag('security/index'); ?>
<div class="loginForm">
<div class="loginFormInner">
<?php echo form_error('username') ?><br />
<?php echo form_error('password') ?><br />
<fieldset >
<legend>Please Log In</legend>
<div class="loginFormInnerRow">
<div>
<label for="username">Username:</label>
</div>
<div>
<?php echo input_tag('username'); ?>
</div>
</div>
<div class="loginFormInnerRow">
<div>
<label for="password">Password:</label>
</div>
<div>
<?php echo input_password_tag('password'); ?>
</div>
</div>
<div class="loginFormInnerRow">
<div></div>
<div><?php echo submit_tag('Login'); ?></div>
</div>
</fieldset>
</div>
</div>
</form>

View File

@ -0,0 +1,6 @@
<div class="secureModuleMain">
<div class="secureModuleMessage">
<?php echo image_tag('lock48'); ?>
<div>You are not authorized to view this page. Click <?php echo link_to('here', 'security/logout'); ?> to return to the application.</div>
</div>
</div>

View File

@ -0,0 +1,8 @@
fields:
username:
required:
msg: Please enter a username.
password:
required:
msg: Please enter a password.

View File

@ -0,0 +1,24 @@
<?php
/**
* support actions.
*
* @package atlbiomed
* @subpackage support
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class supportActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
$c = new Criteria();
$c->add(UserPeer::USER_TYPE, 'Administrator');
$c->add(UserPeer::USER_TYPE, 'Office');
$this->administrator = UserPeer::doSelect($c);
}
}

View File

@ -0,0 +1,14 @@
<h2>Administrative Contacts</h2>
<?php
foreach($administrator as $admin)
{
echo $admin->getLastName().', '.$admin->getFirstName().' - '.mail_to($admin->getEmail(), $admin->getEmail(), 'encode=true');
?><br /><?
}
?>
<br />
<h2>Bug Reporting</h2>
Hepner, Nicholas - <?php echo mail_to('nicholas.hepner@ciphent.com', 'nicholas.hepner@ciphent.com'); ?>

View File

@ -0,0 +1,58 @@
<?php
/**
* unprocessed actions.
*
* @package atlbiomed
* @subpackage unprocessed
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class unprocessedActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
$connection = Propel::getConnection();
$query = "select DISTINCT filename FROM unprocessed_devices";
$statement = $connection->prepareStatement($query);
$result = $statement->executeQuery();
while($result->next()){
$n = $result->get('filename');
$file_p = $_SERVER['DOCUMENT_ROOT'].'/uploads/spreadsheet/'.$n;
if(file_exists($file_p)){
$filenames[] = $n;
}else{
$filename_not_found[] = $file_p;
}
}//while
$this->filenamesList = $filenames;
$processFilename = $this->getRequestParameter('fn');
if(!empty($processFilename)){
$this->filenames = $filenames;
$processHandler = new processHandler();
$processHandler->loadFile($processFilename);
$c = new Criteria();
$c->addAscendingOrderByColumn(ClientPeer::CLIENT_IDENTIFICATION);
$clients = ClientPeer::doSelect($c);
$this->partialMatch = $processHandler->getPartialMatch();
$this->noMatch = $processHandler->getNoMatch();
$this->match = $processHandler->getMatched();
$this->clients = $clients;
$this->filename = $processHandler->getFilename();
}//if
}//function
}

View File

@ -0,0 +1,3 @@
all:
stylesheets: [process]
javascripts: [scriptaculous/lib/prototype, process]

View File

@ -0,0 +1,11 @@
<? if(empty($devices)) {?>
<option value='-1'>No Device</option>
<? }else{?>
<option value='-2'>Select A Device</option>
<?php
}?>
<?php foreach($devices as $device) { ?>
<option value='<?print $device->getIdentification(); ?>'><?print $device->getIdentification(); ?></option>
<?php } ?>

View File

@ -0,0 +1,57 @@
<?
$oldDevice_name = ($oldDevice->getSpecification()) ? $oldDevice->getSpecification()->getDeviceName() : '';
$oldDevice_manufacturer = ($oldDevice->getSpecification()) ? $oldDevice->getSpecification()->getManufacturer() : '';
$oldDevice_serial = $oldDevice->getSerialNumber();
$oldDevice_model = ($oldDevice->getSpecification()) ? $oldDevice->getSpecification()->getModelNumber() : '';
?>
<?php
//$_device_name = "<select>";
if(!empty($newDevice)){
$_device_name .= "<option value='".$newDevice['device_name']."'>".$newDevice['device_name']."</option>";
if(!empty($oldDevice_name)){
$_device_name .= "<option value='$oldDevice_name'>$oldDevice_name</option>";
}
}
//$_device_name .= "</select>";
//print $_device_name;
//$_manufacturer = "<select>";
if(!empty($newDevice)){
$_manufacturer .= "<option value='".$newDevice['manufacturer']."'>".$newDevice['manufacturer']."</option>";
}
if(!empty($oldDevice_manufacturer)){
$_manufacturer .= "<option value='$oldDevice_manufacturer'>$oldDevice_manufacturer</option>";
}
//$_manufacturer .= "</select>";
//print $_manufacturer;
//$_serial ="<select>";
if(!empty($newDevice))
$_serial.= "<option value='".$newDevice['serial']."'>".$newDevice['serial']."</option>";
if(!empty($oldDevice_serial))
$_serial.= "<option value='$oldDevice_serial'>$oldDevice_serial</option>";
//$_serial.= "</select>";
//print $_serial;
//$_model = "<select>";
if(!empty($newDevice))
$_model .= "<option value='".$newDevice['model']."'>".$newDevice['model']."</option>";
if(!empty($oldDevice_model))
$_model .= "<option value='$oldDevice_model'>$oldDevice_model</option>";
//$_model .= "</select>";
//print $_model;
print "
{
serial: \"$_serial\",
model: \"$_model\",
manufacturer: \"$_manufacturer\",
device_name: \"$_device_name\"
}";
?>

View File

@ -0,0 +1,70 @@
<div>
<div class='regularCont'>
<div class='titleBar'>Match (<a href='javascript:void(0);' onclick='toggle_matched()' id='toggle_matched_but'>Show</a>)</div>
<div class='innerCont' id='matched_cont' style='display:NONE'>
<table id='noMatchTable'>
<tr>
<td class='partial_match_column_title'>Assoc. Client</td>
<td class='partial_match_column_title'>Device ID</td>
<td class='partial_match_column_title'>Device Name</td>
<td class='partial_match_column_title'>Manufacturer</td>
<td class='partial_match_column_title'>Model</td>
<td class='partial_match_column_title'>Serial</td>
<td class='partial_match_column_title'></td>
</tr>
<?php
foreach($match as $partial) { ?>
<tr>
<td >
<select id='new_client_match_<?php print $partial['random_id']; ?>' >
<option value='-1' selected='selected'>Existing Client</option>
<?php foreach($clients as $client) { ?>
<option value='<?print $client->getId(); ?>'><?print $client->getClientIdentification(); ?></option>>
<?php } ?>
</select>
</td>
<td>
<select id='device_id_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
</select>
</td>
<td>
<select id='device_name_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['device_name']; ?>'><?php print print $partial['device_name']; ?></option>
</select>
</td>
<td>
<select id='manufacturer_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['manufacturer']; ?>'><?php print $partial['manufacturer']; ?></option>
</select>
</td>
<td>
<select id='model_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['model']; ?>'><?php print $partial['model']; ?></option>
</select>
</td>
<td>
<select id='serial_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['serial']; ?>'><?php print $partial['serial']; ?></option>
</select>
</td>
<td>
<input id='input_<?php print $partial['random_id']; ?>' type='button' value='save' onclick="saveFullMatchUpdate(<?php print $partial['id']; ?>,<?php print $partial['random_id']; ?>)">
<input type='hidden' id='location_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['location']; ?>'>
<input type='hidden' id='date_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['date']; ?>'>
<input type='hidden' id='pass_fail_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['pass_fail']; ?>'>
<input type='hidden' id='extra_data_match_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['extraData']); ?>'>
<input type='hidden' id='test_data_match_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['testData']); ?>'>
<input type='hidden' id='comments_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['comments']; ?>'>
</td>
<td>
(<?php print $partial['client_name']?>)<?php print $partial['warning'];?>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>

View File

@ -0,0 +1,86 @@
<div class='regularCont'>
<div class='titleBar'>No Match</div>
<div class='innerCont'>
<table>
<tr>
<td class='partial_match_column_title'>Client</td>
<td class='partial_match_column_title'>Option</td>
<td class='partial_match_column_title'>Device ID</td>
<td class='partial_match_column_title' style='width: 130px'>ID Options</td>
<td class='partial_match_column_title'>Device Name</td>
<td class='partial_match_column_title'>Manufacturer</td>
<td class='partial_match_column_title'>Model</td>
<td class='partial_match_column_title'>Serial</td>
<td></td>
</tr>
<?php foreach($noMatch as $partial) { ?>
<tr>
<td>
<select id='client_<?php print $partial['random_id']; ?>' onChange='updateDevices(<?php print $partial['random_id']; ?>); restoreFields(<?php print $partial['random_id']; ?>)'>
<option value='-1' selected='selected'>Select A Client</option>
<?php foreach($clients as $client) { ?>
<option value='<?print $client->getId(); ?>'><?print $client->getClientIdentification(); ?></option>>
<?php } ?>
</select>
</td>
<td>
<select id='option_<?php print $partial['random_id']; ?>' onchange='optionChanged(<?php print $partial['random_id']; ?>)'>
<option value='1'>Add As New Device</option>
<option value='2'>Associate Device</option>
</select>
</td>
<td>
<select id='device_id_<?php print $partial['random_id']; ?>' style='width: 100px'>
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
</select>
<select id='get_devices_<?php print $partial['random_id']; ?>' style='width: 100px; display:none' onChange='device_id_changed(<?php print $partial['random_id']; ?>)'>
</select>
</td>
<td>
<select id='device_id_option_<?php print $partial['random_id']; ?>' style='width: 130px' disabled='disabled'>
<option value='-1'>-Use Existing Id-</option>
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
</select>
</td>
<td>
<select id='device_name_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['device_name']; ?>'><?php print $partial['device_name']; ?></option>
</select>
<input type='hidden' id='hidden_device_name_<?php print $partial['random_id']; ?>' value='<?php print $partial['device_name']; ?>'>
</td>
<td>
<select id='manufacturer_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['manufacturer']; ?>'><?php print $partial['manufacturer']; ?></option>
</select>
<input type='hidden' id='hidden_manufacturer_<?php print $partial['random_id']; ?>' value='<?php print $partial['manufacturer']; ?>'>
</td>
<td>
<select id='model_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['model']; ?>'><?php print $partial['model']; ?></option>
</select>
<input type='hidden' id='hidden_model_<?php print $partial['random_id']; ?>' value='<?php print $partial['model']; ?>'>
</td>
<td>
<select id='serial_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['serial']; ?>'><?php print $partial['serial']; ?></option>
</select>
<input type='hidden' id='hidden_serial_<?php print $partial['random_id']; ?>' value='<?php print $partial['serial']; ?>'>
</td>
<td>
<input id='input_<?php print $partial['random_id']; ?>' type='button' value='save' onclick='save_no_match(<?php print $partial['random_id']; ?>)'>
<input type='hidden' id='location_<?php print $partial['random_id']; ?>' value='<?php print $partial['location']; ?>'>
<input type='hidden' id='date_<?php print $partial['random_id']; ?>' value='<?php print $partial['date']; ?>'>
<input type='hidden' id='pass_fail_<?php print $partial['random_id']; ?>' value='<?php print $partial['pass_fail']; ?>'>
<input type='hidden' id='extra_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['extraData']); ?>'>
<input type='hidden' id='test_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['testData']); ?>'>
<input type='hidden' id='comments_<?php print $partial['random_id']; ?>' value='<?php print $partial['comments']; ?>'>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>

View File

@ -0,0 +1,77 @@
<div>
<div class='regularCont'>
<div class='titleBar'>Partial Match</div>
<div class='innerCont'>
<table id='noMatchTable'>
<tr>
<td class='partial_match_column_title'>New Client</td>
<td class='partial_match_column_title'>Device ID</td>
<td class='partial_match_column_title'>Device Name</td>
<td class='partial_match_column_title'>Manufacturer</td>
<td class='partial_match_column_title'>Model</td>
<td class='partial_match_column_title'>Serial</td>
<td class='partial_match_column_title'></td>
</tr>
<?php
foreach($partialMatch as $partial) { ?>
<tr>
<td >
<select id='new_client_partial_<?php print $partial['random_id']; ?>' >
<option value='-1' selected='selected'>Existing Client</option>
<?php foreach($clients as $client) { ?>
<option value='<?print $client->getId(); ?>'><?print $client->getClientIdentification(); ?></option>>
<?php } ?>
</select>
</td>
<td >
<select id='device_id_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
</select>
</td>
<td>
<select id='device_name_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['device_name']==true){ print ";border: 1px solid red";}?>'>
<?php foreach($partial['device_name'] as $device_name) { ?>
<option value='<?php print $device_name; ?>'><?php print $device_name; ?></option>
<?php }?>
</select>
</td>
<td>
<select id='manufacturer_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['manufacturer']==true){ print ";border: 1px solid red";}?>'>
<?php foreach($partial['manufacturer'] as $manufacturer) { ?>
<option value='<?php print $manufacturer; ?>'><?php print $manufacturer; ?></option>
<?php }?>
</select>
</td>
<td>
<select id='model_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['model']==true){ print ";border: 1px solid red";}?>'>
<?php foreach($partial['model'] as $model) { ?>
<option value='<?php print $model; ?>'><?php print $model; ?></option>
<?php }?>
</select>
</td>
<td>
<select id='serial_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['serial']==true){ print ";border: 1px solid red";}?>'>
<?php foreach($partial['serial'] as $serial) { ?>
<option value='<?php print $serial; ?>'><?php print $serial; ?></option>
<?php }?>
</select>
</td>
<td>
<input id='input_<?php print $partial['random_id']; ?>' type='button' value='save' onclick='save_partial_match(<?php print $partial['random_id']; ?>)'>
<input type='hidden' id='location_<?php print $partial['random_id']; ?>' value='<?php print $partial['location']; ?>'>
<input type='hidden' id='date_<?php print $partial['random_id']; ?>' value='<?php print $partial['date']; ?>'>
<input type='hidden' id='pass_fail_<?php print $partial['random_id']; ?>' value='<?php print $partial['pass_fail']; ?>'>
<input type='hidden' id='extra_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['extraData']); ?>'>
<input type='hidden' id='test_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['testData']); ?>'>
<input type='hidden' id='comments_<?php print $partial['random_id']; ?>' value='<?php print $partial['comments']; ?>'>
</td>
<td>
(<?php print $partial['client_name']?>)<?php print $partial['warning'];?>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>

View File

@ -0,0 +1,3 @@
<?php
include_partial('device_changed',array('oldDevice'=>$oldDevice, 'newDevice'=>$newDevice))
?>

View File

@ -0,0 +1,2 @@
<?php
include_partial('device',array('devices'=>$devices)); ?>

View File

@ -0,0 +1,63 @@
<?php
if($sf_params->get('warning')=='yes'){
?>
<div class='alreadyExist'>
This file has already been uploaded. Please select from the list of unprocessed files below.
</div>
<?php
}
?>
<div class='regularCont'>
<div class='titleBar'>Unprocessed Files</div>
<div class='innerCont'>
File Name
<select onchange='gotounprocessed()' id='processedFile'>
<option value='-1' >Please Select A File</option>
<?php
foreach($filenamesList as $_filename){
$selectedItem = ($sf_params->get('fn')==$_filename) ? "selected='selected'" : '';
print "<option value='$_filename' $selectedItem >$_filename</option>";
}
?>
</select>
</div>
</div>
<?php
if(empty($filenamesList)){
?>
<div class='alreadyExist'>
No unprocessed files were found
</div>
<?php
}
?>
<div style='font-size: 13px; width: 300px; border: 1px solid black; margin-top: 30px;'>
<div class='titleBar'>Uprocessed File</div>
<div style='padding: 5px;'>
<?php
print "<b>Filename</b>: ".$filename."<br/>";
print "<b>Total Records</b>: ".(count($match)+count($partialMatch)+count($noMatch))." <br/>";
print "<b>Matched</b>: ".count($match)."<br/>";
print "<b>Partial Match</b>: ".count($partialMatch)."<br/>";
print "<b>No Match</b>: ".count($noMatch)."<br/>";
?>
</div>
</div>
<input type='hidden' name='filename' id='filename' value='<?php echo $filename; ?>'/>
<div id='test'></div>
<?php
if(!empty($match))
include_partial('process_match', array('match' => $match, 'clients'=>$clients));
if(!empty($partialMatch))
include_partial('process_partial_match', array('partialMatch' => $partialMatch, 'clients'=>$clients));
if(!empty($noMatch))
include_partial('process_no_match', array('noMatch' => $noMatch, 'clients'=>$clients));
?>

View File

@ -0,0 +1,223 @@
<?php
/**
* userManager actions.
*
* @package atlbiomed
* @subpackage userManager
* @author nicholas hepner
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class userManagerActions extends sfActions
{
protected $user_info;
public function executeIndex()
{
//set values for start/end time radio boxes
$this->start_time_am = true;
$this->start_time_pm = false;
$this->end_time_am = true;
$this->end_time_pm = false;
$this->start_time_hours = '';
$this->start_time_minutes = '';
$this->end_time_hours = '';
$this->end_time_minutes = '';
//populate user type dropdown
$this->userTypes = UserTypePeer::doSelect(new Criteria());
//Current Users;
$this->current_user = UserPeer::doSelect(new Criteria());
//Initialize "mode"
if(!isset($this->mode))
{
$this->mode = '';
}
//Initialize "saveStatus"
if($this->getRequestParameter('saveStatus') == 'success')
{
$this->saveStatus = 'success';
} else {
$this->saveStatus = '';
}
//Initialize form values
$this->populateUser = new User();
if($this->getRequestParameter('mode') == 'edit')
{
$user_id = $this->getRequestParameter('id');
$this->populateUser = UserPeer::retrieveByPk($user_id);
//parse start/end times
$start_time = $this->populateUser->getStartTime();
$end_time = $this->populateUser->getEndTime();
$this->start_time_minutes = $start_time % 100;
$this->start_time_hours = ($start_time - $this->start_time_minutes) / 100;
$this->end_time_minutes = $end_time % 100;
$this->end_time_hours = ($end_time - $this->end_time_minutes) / 100;
if ($this->start_time_hours > 12)
{
$this->start_time_hours = $this->start_time_hours - 12;
$this->start_time_am = false;
$this->start_time_pm = true;
}
if ($this->end_time_hours > 12)
{
$this->end_time_hours = $this->end_time_hours - 12;
$this->end_time_am = false;
$this->end_time_pm = true;
}
//make minutes more visable in end production
if ($this->start_time_minutes < 10)
{
$this->start_time_minutes = '0'.$this->start_time_minutes;
}
if ($this->end_time_minutes < 10)
{
$this->end_time_minutes = '0'.$this->end_time_minutes;
}
$this->mode = 'edit';
}else{
$this->populateUser->setUserName('');
$this->populateUser->setFirstName('');
$this->populateUser->setLastName('');
$this->populateUser->setEmail('');
$this->populateUser->setPhone('');
$this->populateUser->setAddress('');
$this->populateUser->setAddress2('');
$this->populateUser->setCity('');
$this->populateUser->setState('');
$this->populateUser->setZip('');
$this->populateUser->setPassword('');
}
}
public function executeAddUser()
{
$user = new User();
if($this->getRequestParameter('mode') == 'edit')
{
$user_id = $this->getRequestParameter('id');
$user = UserPeer::retrieveByPk($user_id);
}
$user->setUserName($this->getRequestParameter('user_name'));
$user->setFirstName($this->getRequestParameter('first_name'));
$user->setLastName($this->getRequestParameter('last_name'));
$user->setEmail($this->getRequestParameter('email'));
$user->setPhone($this->getRequestParameter('phone'));
$user->setAddress($this->getRequestParameter('address'));
$user->setAddress2($this->getRequestParameter('address2'));
$user->setCity(ucfirst($this->getRequestParameter('city')));
$user->setState($this->getRequestParameter('state'));
$user->setZip($this->getRequestParameter('zip'));
$user->setPassword($this->getRequestParameter('password'));
$user->setUserTypeId($this->getRequestParameter('user_type_id'));
$user->setWeight($this->getRequestParameter('order_weight'));
$start_hrs = $this->getRequestParameter('start_time_hours');
$start_min = $this->getRequestParameter('start_time_minutes');
$start_ampm = $this->getRequestParameter('start_time_ampm');
$end_hrs = $this->getRequestParameter('end_time_hours');
$end_min = $this->getRequestParameter('end_time_minutes');
$end_ampm = $this->getRequestParameter('end_time_ampm');
if($start_ampm == 'am'){
if($start_hrs < 10){
$start_hrs = '0'.$start_hrs;
}
$start_hrs = $start_hrs;
}
if($start_ampm == 'pm'){
$start_hrs = $start_hrs + 12;
}
$start_time = $start_hrs.$start_min;
if($end_ampm == 'am'){
if($end_hrs < 10){
$end_hrs = '0'.$end_hrs;
}
$end_hrs = $end_hrs;
}
if($end_ampm == 'pm'){
$end_hrs = $end_hrs + 12;
}
$end_time = $end_hrs.$end_min;
$user->setStartTime($start_time);
$user->setEndTime($end_time);
$user->save();
$this->redirect('userManager/index?mode=edit&id='.$user->getId().'&saveStatus=success');
}
public function handleErrorAddUser()
{
$this->forward('userManager', 'index');
}
public function startEndTime($user_info)
{
$start_time_hours = $user_info['start_time_hours'];
$start_time_minutes = $user_info['start_time_minutes'];
$start_time_ampm = $user_info['start_time_ampm'];
unset($user_info['start_time_hours']);
unset($user_info['start_time_minutes']);
unset($user_info['start_time_ampm']);
if ( $start_time_ampm == 'pm' )
{
$start_time_hours = $start_time_hours + 12;
}
$user_info['start_time'] = $start_time_hours.$start_time_minutes;
$end_time_hours = $user_info['end_time_hours'];
$end_time_minutes = $user_info['end_time_minutes'];
$end_time_ampm = $user_info['end_time_ampm'];
unset($user_info['end_time_hours']);
unset($user_info['end_time_minutes']);
unset($user_info['end_time_ampm']);
$user_info['end_time'] = $end_time_hours.$end_time_minutes;
}
public function executeDeleteUser()
{
$user_id = $this->getRequestParameter('delete_user');
$user = UserPeer::retrieveByPk($user_id);
$user->delete();
$this->redirect('userManager/index');
}
}
?>

View File

@ -0,0 +1 @@
<?php include('indexSuccess.php'); ?>

View File

@ -0,0 +1,327 @@
<?php use_helper('Object'); ?>
<?php use_helper('Validation'); ?>
<?php use_helper('Javascript'); ?>
<?php
$validation_error = '';
/* echo javascript_tag("
function submitForm()
{
try { var start_time_hours = document.getElementById('start_time_hours').value; } catch(e) { var start_time_hours; }
try { var start_time_minutes = document.getElementById('start_time_minutes').value; } catch(e) { var start_time_minutes; }
try { var end_time_hours = document.getElementById('end_time_hours').value; } catch(e) { var end_time_hours; }
try { var end_time_minutes = document.getElementById('end_time_minutes').value; } catch(e) { var end_time_minutes; }
if (document.getElementById('start_time_ampm_am').checked == true)
{
var start_time_ampm = 'am';
} else {
var start_time_ampm = 'pm';
}
if (document.getElementById('end_time_ampm_am').checked == true)
{
var end_time_ampm = 'am';
} else {
var end_time_ampm = 'pm';
}
if((start_time_hours == '') || (start_time_minutes == ''))
{
if(document.getElementById('job_status').value != 'unscheduled')
{
if(confirm('You have not set a start time for this job. Would you like to submit this job as unscheduled?') == true)
{
document.getElementById('job_status').value = 'unscheduled';
} else {
return;
}
}
} else {
if ((start_time_hours > 12) || (start_time_hours < 1))
{
alert('Invalid starting hour. Please enter a valid starting hour.');
return;
}
if((start_time_minutes > 59) || (start_time_minutes < 0))
{
alert('Invalid starting minutes. Please enter a valid start time.');
return;
}
var start_time = convertTime(start_time_hours, start_time_minutes, start_time_ampm);
}
}
function getQualifications(id)
{
alert('Shit\'s Wurkin\'');
".
remote_function(array(
'update' => 'qualifications',
'url' => 'userManager/qualifications',
'with' => '"tech_id=" + id')).
" }
");*/
/* echo javascript_tag("
function getQualifications(user)
{".
remote_function(array(
'update' => 'qualifications',
'url' => 'userManager/qualifications',
'with' => '"techId=" + user'))."
} ");*/ ?>
<?php
if ($sf_request->hasErrors())
{
/*foreach($sf_request->getErrors() as $name => $error)
{
$validation_error .= $error;
// echo '-'.$error."<br />";
}
echo javascript_tag("alert('".$validation_error."');");*/
} else {
if($saveStatus == 'success')
{
echo javascript_tag("alert('User information saved successfully')");
}
}
?>
<div class="userForm">
<?php echo form_tag('userManager/addUser'); ?>
<?php echo input_hidden_tag('mode', $mode); ?>
<?php echo input_hidden_tag('id', $populateUser->getId()); ?>
<table>
<tr>
<td colspan=2><?php echo form_error('user_name'); ?></td>
</tr>
<tr>
<td width="100">User Name</td>
<td><?php echo input_tag('user_name', $populateUser->getUserName()); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('first_name'); ?></td>
</tr>
<tr>
<td>First Name</td>
<td><?php echo input_tag('first_name', $populateUser->getFirstName()); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('last_name'); ?></td>
</tr>
<tr>
<td>Last Name</td>
<td><?php echo input_tag('last_name', $populateUser->getLastName()); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('email'); ?></td>
</tr>
<tr>
<td>Email</td>
<td><?php echo input_tag('email', $populateUser->getEmail()); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('verify_email'); ?></td>
</tr>
<tr>
<td>Verify Email</td>
<td><?php echo input_tag('verify_email', $populateUser->getEmail()); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('phone'); ?></td>
</tr>
<tr>
<td>Phone</td>
<td><?php echo input_tag('phone', $populateUser->getPhone()); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('address'); ?></td>
</tr>
<tr>
<td>Address</td>
<td><?php echo input_tag('address', $populateUser->getAddress()); ?></td>
</tr>
<tr>
<td colspan=2></td>
</tr>
<tr>
<td></td>
<td><?php echo input_tag('address_2'); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('city', $populateUser->getAddress2()); ?></td>
</tr>
<tr>
<td>City</td>
<td><?php echo input_tag('city', $populateUser->getCity()); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('state'); ?></td>
</tr>
<tr>
<td>State</td>
<td><?php echo select_tag('state', options_for_select(array(
'' => 'Please Select...',
'AL' => 'Alabama',
'AK' => 'Alaska',
'AZ' => 'Arizona',
'AR' => 'Arkansas',
'CA' => 'California',
'CO' => 'Colorado',
'CT' => 'Connecticut',
'DE' => 'Delaware',
'DC' => 'District of Columbia',
'FL' => 'Florida',
'GA' => 'Georgia',
'HI' => 'Hawaii',
'ID' => 'Idaho',
'IL' => 'Illinois',
'IN' => 'Indiana',
'IA' => 'Iowa',
'KS' => 'Kansas',
'KY' => 'Kentucky',
'LA' => 'Louisiana',
'ME' => 'Maine',
'MD' => 'Maryland',
'MA' => 'Massachusetts',
'MI' => 'Michigan',
'MN' => 'Minnesota',
'MS' => 'Mississippi',
'MO' => 'Missouri',
'MT' => 'Montana',
'NE' => 'Nebraska',
'NV' => 'Nevada',
'NH' => 'New Hampshire',
'NJ' => 'New Jersey',
'NM' => 'New Mexico',
'NY' => 'New York',
'NC' => 'North Carolina',
'ND' => 'North Dakota',
'OH' => 'Ohio',
'OK' => 'Oklahoma',
'OR' => 'Oregon',
'PA' => 'Pennsylvania',
'RI' => 'Rhode Island',
'SC' => 'South Carolina',
'SD' => 'South Dakota',
'TN' => 'Tennessee',
'TX' => 'Texas',
'UT' => 'Utah',
'VT' => 'Vermont',
'VA' => 'Virginia',
'WA' => 'Washington',
'WV' => 'West Virginia',
'WI' => 'Wisconsin',
'WY' => 'Wyoming'), $populateUser->getState())); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('zip'); ?></td>
</tr>
<tr>
<td>Zip</td>
<td><?php echo input_tag('zip', $populateUser->getZip()); ?></td>
</tr>
<tr>
<?php
if ($mode != 'edit')
{
?>
<td colspan=2><?php echo form_error('password'); ?></td>
</tr>
<tr>
<td>Password</td>
<td><?php echo input_password_tag('password', $populateUser->getPassword()); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('verify_password'); ?></td>
</tr>
<tr>
<td>Verify password</td>
<td><?php echo input_password_tag('verify_password', $populateUser->getPassword()); ?></td>
</tr>
<tr>
<?php
}
?>
<td colspan=2><?php echo form_error('user_type'); ?></td>
</tr>
<tr>
<td>User type</td>
<td><?php echo select_tag('user_type_id', objects_for_select($userTypes, 'getId', 'getTypeName', $populateUser->getUserTypeId()));
//select_tag('user_type_id', objects_for_select($user_type_request,'getvalue'), $populateUser->getUserTypeId()); ?> </td>
</tr>
<tr>
<td>Start time</td>
<td><?php echo input_tag('start_time_hours', $start_time_hours, array('size' => '1', 'maxlength' => '2')).' : '
.input_tag('start_time_minutes' , $start_time_minutes , array('size' => '1', 'maxlength' => '2'))
.' '.radiobutton_tag('start_time_ampm','am', $start_time_am).'am '.' '
.radiobutton_tag('start_time_ampm','pm', $start_time_pm).'pm'; ?></td>
</tr>
<tr>
<td>End Time</td>
<td><?php echo input_tag('end_time_hours', $end_time_hours, array('size' => '1', 'maxlength' => '2')).' : '
.input_tag('end_time_minutes' , $end_time_minutes , array('size' => '1', 'maxlength' => '2'))
.' '.radiobutton_tag('end_time_ampm','am', $end_time_am).'am '.' '
.radiobutton_tag('end_time_ampm','pm', $end_time_pm).'pm'; ?></td>
</tr>
<tr>
<td>Order Weight</td>
<td><?php echo select_tag('order_weight', options_for_select(array(
'' => 'Select...',
'1' => '1',
'2' => '2',
'3' => '3',
'4' => '4',
'5' => '5','6' => '6','7' => '7','8' => '8','9' => '9','10' => '10','11' => '11','12' => '12',
'13' => '13','14' => '14','15' => '15','16' => '16','17' => '17','18' => '18','19' => '19','20' => '20'
), $populateUser->getWeight())); ?></td>
</tr>
<tr>
<td></td>
<td align="right"><?php echo submit_tag('Save'); ?></td>
</tr>
</table>
</form>
</div>
<div class="currentUsers">
<?php echo form_tag('userManager/deleteUser'); ?>
<!-- Display all current users -->
<table cellspacing='10'><tr>
<!-- <td></td> -->
<td><b><u>Name</u></b></td>
<td><b><u>User Type</u></b></td>
</tr><tr>
<?php foreach ($current_user as $user){ ?>
<!-- <td><?php //echo radiobutton_tag('delete_user', $user->getId(), false); ?></td> -->
<td><?php echo link_to(ucfirst($user->getLastName()).', '.ucfirst($user->getFirstName()), 'userManager/index?mode=edit&id='.$user->getId()); ?></td>
<?php // <td><?php echo link_to_function(ucfirst($user->getLastName()).', '.ucfirst($user->getFirstName()), 'getQualifications('.$user->getId().')'); </td> ?>
<td><?php echo $user->getUserType()->getTypeName(); ?></td>
</tr><tr>
<?php } ?>
</tr>
<td><?php echo button_to('New User', 'userManager/index');echo input_hidden_tag('delete_user', $populateUser->getId()); ?></td>
<td><?php echo submit_tag('Delete User'); ?></td>
</tr></table>
</form>
</div>
<div id="qualifications">
<?php
?>
</div>

View File

@ -0,0 +1 @@
Test Successful

View File

@ -0,0 +1,110 @@
fillin:
enabled: true
fields:
user_name:
required:
msg: Please enter a user name before continuing.
sfStringValidator:
min: 5
min_error: User name does not meet acceptable parameters. (5 characters minimum)
max: 50
max_error: User name exceeds acceptable parameters. (50 characters maximum)
first_name:
required:
msg: Please enter a first name before continuing.
sfStringValidator:
min: 2
min_error: First name does not meet acceptable parameters. (2 character minimum)
max: 25
max_error: First name exceeds acceptable parameters. (25 character maximum)
last_name:
required:
msg: Please enter a last name before continuing.
sfStringValidator:
min: 2
min_error: Last name does not meet acceptable parameters. (2 character minimum)
max: 25
max_error: Last name exceeds acceptable parameters. (25 character maximum)
email:
required:
msg: Please enter an email address before continuing.
sfEmailValidator:
strict: true
email_error: Please enter a valid email address (name@domain.extension)
verify_email:
required:
msg: Please verify your email address.
sfCompareValidator:
check: email
compare_error: Your email verification does not match. Please Retype your email.
phone:
required:
msg: Please enter a telephone number
sfStringValidator:
min: 10
min_error: Please enter a valid telephone number. Please include area code. (e.g. 5555555555)
max: 15
max_error: Please enter a valid telephone number.
# sfNumberValidator:
# nan_error: Please enter a valid telephone number.
address:
required:
msg: Please enter an address.
city:
required:
msg: Please enter a city.
state:
required:
msg: Please select a state.
zip:
required:
msg: Please enter a zip code.
sfStringValidator:
min: 5
min_error: You have submitted an incomplete zip code. Please enter a valid zip code.
max: 5
max_error: Please submit a 5-digit zip code.
# password:
# required:
# msg: Please enter a password.
# sfStringValidator:
# min: 8
# min_error: Password must be more than 8 characters.
# verify_password:
# required:
# msg: Please verify your password.
# sfCompareValidator:
# check: password
# compare_error: Your password verification does not match. Please retype your password.
user_type_id:
required:
msg: Please select a user type.
start_time_hours:
required:
msg: Please enter a start time for this user
start_time_minutes:
required:
msg: Please enter a start time for this user
end_time_hours:
required:
msg: Please enter an end time for this user
end_time_minutes:
required:
msg: Please enter an end time for this user.

View File

@ -0,0 +1,147 @@
fields:
user_name:
required:
msg: No user name has been entered. Please enter a user name before continuing.
sfStringValidator:
min: 5
min_error: User name does not meet acceptable parameters. (5 characters minimum)
max: 50
max_error: User name exceeds acceptable parameters. (50 characters maximum)
first_name:
required:
msg: No first name has been entered. Please enter a first name before continuing.
sfStringValidator:
min: 2
min_error: First name does not meet acceptable parameters. (2 character minimum)
max: 25
max_error: First name exceeds acceptable parameters. (25 character maximum)
last_name:
required:
msg: No last name has been entered. Please enter a last name before continuing.
sfStringValidator:
min: 2
min_error: Last name does not meet acceptable parameters. (2 character minimum)
max: 25
max_error: Last name exceeds acceptable parameters. (25 character maximum)
email:
required:
msg: No email address has been entered. Please enter an email address before continuing.
sfEmailValidator:
strict: true
email_error: Please enter a valid email address (name@domain.extension)
verify_email:
required:
msg: Please verify your email address.
sfEmailValidator:
strict: true
sfCompareValidator:
check: email
compare_error: Your email verification does not match. Please Retype your email.
phone:
required:
msg: Please enter a telephone number
sfStringValidator:
min: 10
min_error: Please enter a valid telephone number. Please include area code. (e.g. 5555555555)
max: 15
max_error: Please enter a valid telephone number.
address:
required:
msg: Please enter an address.
address_2:
city:
required:
msg: Please enter a city.
state:
required:
msg: Please select a state.
zip:
required:
msg: Please enter a zip code.
sfStringValidator:
min: 5
min_error: You have submitted an incomplete zip code. Please enter a valid zip code.
max: 5
max_error: Please submit a 5-digit zip code.
password:
required:
msg: Please enter a password.
sfStringValidator:
min: 8
min_error: Password must be more than 8 characters.
verify_password:
required:
msg: Please verify your password.
sfCompareValidator:
check: password
compare_error: Your password verification does not match. Please retype your password.
user_type:
required:
msg: Please select a user type.
start_time_hours:
required:
msg: Please enter a valid start time
sfNumberValidator:
min: 0
min_error: Please enter a valid start time
max: 2
max_error: Please enter a valid start time
start_time_minutes:
required:
msg: Please enter a valid start time
sfNumberValidator:
min: 0
min_error: Please enter a valid start time
max: 2
max_error: Please enter a valid start time
start_time_ampm:
required:
msg: Please select AM or PM for start time.
end_time_hours:
required:
msg: Please enter a valid end time.
sfNumberValidator:
min: 0
min_error: Please enter a valid end time
max: 2
max_error: Please enter a valid end time
end_time_minutes:
required:
msg: Please enter a valid end time
sfNumberValidator:
min: 0
min_error: Please enter a valid end time
max: 2
max_error: Please enter a valid end time
end_time_ampm:
required:
msg: Please select AM or PM for end time
fillin:
enabled: true
param:
skip_fields: [validate_email]
exclude_types: [password]
check_types: [text, radio]
converters:
htmlentities: [user_name, first_name, last_name, address, address_2, city, zip, password, start_time_hours, start_time_minutes, end_time_hours, end_time_minutes]

View File

@ -0,0 +1,312 @@
<?php
/**
* workOrder actions.
*
* @package atlbiomed
* @subpackage workOrder
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class workOrderActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
// default view values
$this->bogusWorkOrder = new Workorder();
$this->bogusWorkOrder->setJobStatusId('');
$this->bogusWorkOrder->setJobTypeId('');
$this->bogusWorkOrder->setTech('');
$this->bogusWorkOrder->setClientId('');
$this->technicians = array();
$this->clients = array();
$c = new Criteria();
$c->addAscendingOrderByColumn(ClientPeer::CLIENT_IDENTIFICATION);
$this->client_dropdown = ClientPeer::doSelect($c);
$t = new Criteria();
$t->addAscendingOrderByColumn(JobTypePeer::TYPE_NAME);
$this->jobtype_dropdown = JobTypePeer::doSelect($t);
$s = new Criteria();
$s->addAscendingOrderByColumn(JobStatusPeer::STATUS_NAME);
$this->jobstatus_dropdown = JobStatusPeer::doSelect($s);
foreach($this->client_dropdown as $client)
{
$this->clients[$client->getId()] = $client->getClientIdentification();
}
foreach(UserPeer::getUserByType(1) as $tech)
{
$this->technicians[$tech->getId()] = $tech->getDisplayName();
}
$this->dateFilter = date('Y-m-d');
$this->dateFilterType = 'day';
// show jobs
$jobDate = date('Ymd');
$usersWithWork = new Criteria();
$workorders = new Criteria();
if($this->getRequest()->getMethod() == sfRequest::POST)
{
$this->dateFilter = $this->getRequestParameter('jobDate');
$this->dateFilterType = $this->getRequestParameter('dateFilterType');
if($this->getRequestParameter('client_id') != '')
{
$workorders->add(WorkorderPeer::CLIENT_ID, $this->getRequestParameter('client_id'));
$this->bogusWorkOrder->setClientId($this->getRequestParameter('client_id'));
}
if($this->getRequestParameter('technician_id') != '')
{
$usersWithWork->add(UserPeer::ID, $this->getRequestParameter('technician_id'));
$workorders->add(WorkorderTechPeer::USER_ID, $this->getRequestParameter('technician_id'));
$workorders->addJoin(WorkorderPeer::ID, WorkorderTechPeer::WORKORDER_ID, Criteria::INNER_JOIN);
$this->bogusWorkOrder->setTech($this->getRequestParameter('technician_id'));
}
if($this->getRequestParameter('job_status_id') != '')
{
$usersWithWork->add(WorkorderPeer::JOB_STATUS_ID, $this->getRequestParameter('job_status_id'));
$workorders->add(WorkorderPeer::JOB_STATUS_ID, $this->getRequestParameter('job_status_id'));
$this->bogusWorkOrder->setJobStatusId($this->getRequestParameter('job_status_id'));
}
}
$usersWithWork->addJoin(UserPeer::ID, WorkorderPeer::TECH);
$usersWithWork->setDistinct(true);
if ($this->dateFilterType == 'day')
{
$usersWithWork->add(WorkorderPeer::JOB_DATE, $this->getRequestParameter('jobDate'));
$workorders->add(WorkorderPeer::JOB_DATE, $this->getRequestParameter('jobDate'));
}
else if ($this->dateFilterType == 'month')
{
$year = substr($this->getRequestParameter('jobDate'), 0, 4);
$month = substr($this->getRequestParameter('jobDate'), 5, 2);
$start = $year . '-' . $month . '-01';
$end = $year . '-' . $month . '-31'; // easy check, even for months without 31 days since all dates are
// strings in our database
$usersWithWork->add(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL);
$usersWithWork->addAnd($usersWithWork->getNewCriterion(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_EQUAL)); // inclusive
$workorders->add(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL);
$workorders->addAnd($workorders->getNewCriterion(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_EQUAL)); // inclusive
}
else if ($this->dateFilterType == 'year')
{
$year = substr($this->getRequestParameter('jobDate'), 0, 4);
$startMonth = "01";
$endMonth = "12";
$start = $year . '-' . $startMonth . '-01';
$end = $year . '-' . $endMonth . '-31'; // easy check, even for months without 31 days since all dates are
// strings in our database
$usersWithWork->add(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL);
$usersWithWork->addAnd($usersWithWork->getNewCriterion(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_EQUAL)); // inclusive
$workorders->add(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL);
$workorders->addAnd($workorders->getNewCriterion(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_EQUAL)); // inclusive
}
else
{
// week from the selected date
$start = date('Y-m-d', strtotime($this->getRequestParameter('jobDate')));
$end = date('Y-m-d', strtotime('+7 days', strtotime($this->getRequestParameter('jobDate'))));
//$this->renderText($start . $end); return sfView::NONE;
$usersWithWork->add(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_THAN); // exclusive
$usersWithWork->addAnd($usersWithWork->getNewCriterion(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL));
$workorders->add(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_THAN); // exclusive
$workorders->addAnd($workorders->getNewCriterion(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL));
}
$this->techs = UserPeer::doSelect($usersWithWork);
$this->orders = WorkorderPeer::doSelect($workorders);
}
public function executePopulateWorkorder()
{
$ticket = $this->getRequestParameter('ticket');
$t = new Criteria();
$t->addAscendingOrderByColumn(JobTypePeer::TYPE_NAME);
$this->jobtype_dropdown = JobTypePeer::doSelect($t);
$s = new Criteria();
$s->addAscendingOrderByColumn(JobStatusPeer::STATUS_NAME);
$this->jobstatus_dropdown = JobStatusPeer::doSelect($s);
$g = new Criteria();
$g->add(DropdownPeer::MENU, 'reason');
$g->addAscendingOrderByColumn(DropdownPeer::VALUE);
$this->reason_dropdown = DropdownPeer::doSelect($g);
$this->openWorkorder = WorkorderPeer::retrieveByPk($ticket);
$this->openClient = ClientPeer::retrieveByPk($this->openWorkorder->getClientId());
$this->openTech = UserPeer::retrieveByPk($this->openWorkorder->getTech());
$this->openDevice = DevicePeer::retrieveByPk($this->openWorkorder->getDeviceId());
$reason = $this->openWorkorder->getReason();
if (!empty($reason)){
$this->openReason = DropdownPeer::retrieveByPk($this->openWorkorder->getReason());
}
$this->type_select = $this->openWorkorder->getJobTypeId();
$this->status_select = $this->openWorkorder->getJobStatusId();
}
public function executeUpdateworkorder(){
$wid_y = $this->getRequestParameter('wid');
$invoice_num = $this->getRequestParameter('invoice_num');
$action = $this->getRequestParameter('action_taken');
$remarks_y = $this->getRequestParameter('remarks');
$job_status = $this->getRequestParameter('job_status');
$job_type = $this->getRequestParameter('job_type');
$reason_select_y = $this->getRequestParameter('reason_select');
$onsite_time = $this->getRequestParameter('onsite_time');
$travel_time = $this->getRequestParameter('travel_time');
$travel_service = $this->getRequestParameter('travel_service');
$zone_charge = $this->getRequestParameter('zone_charge');
$salestax = $this->getRequestParameter('salestax');
$shipping = $this->getRequestParameter('shipping');
$cid = $this->getRequestParameter('cid');
$name = $this->getRequestParameter('print_name');
$c = new Criteria();
$c->add(WorkorderPeer::ID,$wid_y);
$wo = WorkorderPeer::doSelectOne($c);
if(!$wo){
print "<script type='text/javascript'>alert('Unable to save data');</script>";
return sfView::NONE;
}
$c = new Criteria();
$c->add(ClientPeer::ID,$cid);
$client = ClientPeer::doSelectOne($c);
if($client){
$client->setAttn($name);
$client->save();
}
$wo->setTravelTime($travel_time);
$wo->setOnsiteTime($onsite_time);
$wo->setReason($reason_select_y);
$wo->setJobTypeId($job_type);
$wo->setJobStatusId($job_status);
$wo->setInvoice($invoice_num);
$wo->setRemarks($remarks_y);
$wo->setActionTaken($action);
$wo->setSaletax($salestax);
$wo->setServiceTravel($travel_service);
$wo->setShippingHandling($shipping);
$wo->setZoneCharge($zone_charge);
if(!empty($invoice_num))
$wo->setJobStatusId(7);
$wo->save();
print "<script type='text/javascript'>alert('Data was save successfully');</script>";
return sfView::NONE;
}
/* public function executeInformation()
{
$r = new Criteria();
$this->result = array();
$search_select = $this->getRequestParameter('search_select');
if (isset($search_select))
{
// $search_by = $this->getRequestParameter('search_by');
switch($this->search_by)
{
case 'Client':
$r->add(WorkorderPeer::CLIENT_ID, $this->getRequestParameter('search_select'));
break;
case 'Technician':
$r->add(WorkorderPeer::TECH, $this->getRequestParameter('search_select'));
break;
case 'Date':
$r->add(WorkorderPeer::DATE_RECIEVED, $this->getRequestParameter('search_select'));
break;
case 'Status':
$r->add(workorderPeer::JOB_STATUS, $this->getRequestParameter('search_select'));
break;
}
$r->addJoin(WorkorderPeer::CLIENT_ID, ClientPeer::ID);
$r->addJoin(WorkorderPeer::TECH, UserPeer::ID);
$join = new sfPropelCustomJoinHelper('Workorder');
$join->addSelectTables('Client', 'User');
$join->setHas('Workorder', 'User');
$join->setHas('Workorder', 'Client');
$this->result = $join->doSelect($r);
}
$this->redirect('workOrder/search_by/'.$search_by);
}*/
/* public function executeSelectWorkorder()
{
$search_by = $this->getRequestParameter('search_by');
$r = new Criteria();
$result = new Workorder();
switch($search_by)
{
case 'Client':
$r->add(WorkorderPeer::CLIENT_ID, $this->getRequestParameter('search_select'));
$result = WorkorderPeer::doSelect($r);
break;
case 'Technician':
$r->add(WorkorderPeer::TECH, $this->getRequestParameter('search_select'));
$result = WorkorderPeer::doSelect($r);
break;
// case 'Date':
// $r->add(WorkorderPeer::DATE, $this->getRequestParameter('search_select'
// break;
case 'Status':
$r->add(workorderPeer::STATUS, $this->getRequestParameter('search_select'));
$result = WorkorderPeer::doSelect($r);
break;
}
$this->redirect('workOrder/index?searchby='.$this->getRequestParameter('search_by'));
}*/
}

View File

@ -0,0 +1,2 @@
all:
javascripts: [workorder]

View File

@ -0,0 +1,6 @@
<?php echo radiobutton_tag('dateFilterType', 'year', $dateFilterType == 'year') ?>By Selected Year<br />
<?php echo radiobutton_tag('dateFilterType', 'month', $dateFilterType == 'month') ?>By Selected Month<br />
<?php echo radiobutton_tag('dateFilterType', 'week', $dateFilterType == 'week') ?>By Selected Week (selected day plus seven days)<br />
<?php echo radiobutton_tag('dateFilterType', 'day', $dateFilterType == 'day') ?>By Selected Day<br />
<?php echo input_date_tag('jobDate', $initialDate, 'rich=true'); ?>

View File

@ -0,0 +1,139 @@
<?php use_helper('Javascript') ?>
<?php use_helper('Object') ?>
<?php
/* Event.observe(window, 'load', initFunctions, false);
function initFunctions(evt)
{
showWorkorder();
}*/
echo javascript_tag("
function showWorkorder(id)
{".
//initiate TechDisplay
remote_function(array(
'update' => 'workOrder',
'url' => 'workOrder/populateWorkorder',
'with' => '"ticket=" + id')).";"."
}
");
?>
<?php echo javascript_tag('
function editSchedule(workorder_id)
{
window.location = "'.url_for('scheduler/index?mode=edit&ticket=').'" + "/" + workorder_id;
} ');
?>
<?php echo javascript_tag("
function saveWorkorder(id)
{
{".
remote_function(array(
'url' => 'workOrder/saveWorkorder',
'with' => '"ticket=" + id'))."
}
}"); ?>
<div class="mapsCollapsingPanelContainer">
<?php echo form_tag('workOrder/index'); ?>
<?php include_partial('global/collapsingDivContainer',
array('title' => 'Filter by Client',
'uniqueId' => 'filterByClient',
'content' => select_tag('client_id',
options_for_select($clients,
$bogusWorkOrder->getClientId(),
'include_custom=All')))); ?>
<?php include_partial('global/collapsingDivContainer',
array('title' => 'Filter by Status',
'uniqueId' => 'filterByStatus',
'content' => object_select_tag($bogusWorkOrder, 'getJobStatusId', 'include_custom=All', ''))); ?>
<?php include_partial('global/collapsingDivContainer',
array('title' => 'Filter by Technician',
'uniqueId' => 'filterByTechnician',
'content' => select_tag('technician_id',
options_for_select($technicians,
$bogusWorkOrder->getTech(),
'include_custom=All')))); ?>
<?php include_partial('global/collapsingDivContainer',
array('title' => 'Filter by Date',
'uniqueId' => 'filterByDate',
'content' => get_partial('mapDateFilterControl',
array('initialDate' => $dateFilter,
'dateFilterType' => $dateFilterType)))); ?>
<div class="mapsCollapsingPanelContainerControl">
<?php echo submit_tag('Filter'); ?>
</div>
</form>
</div>
<div id="workOrder_content" style="padding-left:10px;">
<div id="workOrder"></div>
<?php
if (!empty($orders) )
{ ?>
<div id="searchResults">
<table class="workorder_search_results" cellpadding="3" cellspacing="1"><tr>
<td><b><u>Client ID</u></b></td>
<td><b><u>Invoice #</u></b></td>
<td><b><u>Client Name</u></b></td>
<td><b><u>Technician</u></b></td>
<td><b><u>Job Date</u></b></td>
<td><b><u>Remarks</u></b></td>
<td><b><u>Reason</u></b></td>
<td><b><u>Job Status</u></b></td>
<td><b><u>Action</u></b></td>
</tr><tr>
<?php
foreach($orders as $order)
{
$tech = UserPeer::retrieveByPk($order->getTech());
$reason = DropdownPeer::retrieveByPk($order->getReason());
if($order->getClient() != NULL){
?>
<tr>
<td><?php echo $order->getClient()->getClientIdentification(); ?></td>
<td><?php echo $order->getInvoice(); ?></td>
<td><?php echo $order->getClient()->getClientName(); ?></td>
<td><?php if(method_exists($tech,"getFirstName")) { echo $tech->getFirstName() .' '. $tech->getLastName(); } ?></td>
<td><?php echo $order->getJobDate(); ?></td>
<td><?php echo $order->getRemarks(); ?></td>
<td><?php $c = new Criteria();
$c->add(DropdownPeer::ID, $order->getReason());
$dr = DropdownPeer::doSelectOne($c);
print $dr->getValue(); ?></td>
<?php $cc=''; if($order->getJobStatusId() == 7){ $cc = "style='color:red'"; }elseif($order->getJobStatusId()== 9){ $cc = "style='color:green'"; }?>
<td><span <?php print $cc;?>> <?php echo $order->getJobStatus(); ?></span></td>
<td><?php echo link_to_function('Open', "showWorkorder(".$order->getId().")", array(
'target' => '_top'));?></td>
</tr>
<?php
}//if
}//for ?>
</tr></table></div>
<?php } ?>
</div>

Some files were not shown because too many files have changed in this diff Show More