mirror of
https://github.com/atlanticbiomedical/portal-legacy.git
synced 2025-07-02 01:47:28 -04:00
initial commit
This commit is contained in:
6300
extra/Atlbiomed 20070917 1520.sql
Executable file
6300
extra/Atlbiomed 20070917 1520.sql
Executable file
File diff suppressed because it is too large
Load Diff
BIN
extra/Auto_select_Dropdown_src.zip
Executable file
BIN
extra/Auto_select_Dropdown_src.zip
Executable file
Binary file not shown.
4748
extra/atlbiomed.sql
Executable file
4748
extra/atlbiomed.sql
Executable file
File diff suppressed because it is too large
Load Diff
386
extra/clientManager/actions/actions.class.php
Executable file
386
extra/clientManager/actions/actions.class.php
Executable file
@ -0,0 +1,386 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* clientManager actions.
|
||||
*
|
||||
* @package atlbiomed
|
||||
* @subpackage clientManager
|
||||
* @author Your name here
|
||||
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
|
||||
*/
|
||||
class clientManagerActions extends sfActions
|
||||
{
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
//Set Default "mode"
|
||||
if(!isset($this->mode))
|
||||
{
|
||||
$this->mode = '';
|
||||
}
|
||||
|
||||
//initialize form values
|
||||
$this->populateClient = new Client();
|
||||
$this->populateDevice = new Device();
|
||||
// $this->populateSpecification = new Specification();
|
||||
|
||||
if($this->getRequestParameter('mode') == 'edit')
|
||||
{
|
||||
//retrieve client information
|
||||
$client_id = $this->getRequestParameter('id');
|
||||
$this->client_id = $client_id;
|
||||
$this->populateClient = ClientPeer::retrieveByPk($client_id);
|
||||
$this->mode = 'edit';
|
||||
|
||||
$locationId = $this->populateClient->getLocationId();
|
||||
|
||||
//link devices to clients
|
||||
$c = new Criteria();
|
||||
$c->add(DevicePeer::CLIENT_ID, $client_id);
|
||||
$c->addjoin(DevicePeer::SPECIFICATION_ID, SpecificationPeer::ID, Criteria::LEFT_JOIN);
|
||||
$join = new sfPropelCustomJoinHelper('Device');
|
||||
$join->addSelectTables('Device', 'Specification');
|
||||
$join->setHas('Device', 'Specification');
|
||||
$this->populateDevice = $join->doSelect($c);
|
||||
|
||||
} else {
|
||||
|
||||
$this->populateClient->setClientIdentification('');
|
||||
$this->populateClient->setClientName('');
|
||||
$this->populateClient->setAddress('');
|
||||
$this->populateClient->setAddress2('');
|
||||
$this->populateClient->setCity('');
|
||||
$this->populateClient->setState('');
|
||||
$this->populateClient->setZip('');
|
||||
$this->populateClient->setAttn('');
|
||||
$this->populateClient->setEmail('');
|
||||
$this->populateClient->setPhone('');
|
||||
$this->populateClient->setExt('');
|
||||
$this->populateClient->setCategory('');
|
||||
$this->populateClient->setNotes('');
|
||||
$this->populateClient->setAllDevices('');
|
||||
|
||||
}
|
||||
|
||||
//check for initial post
|
||||
if ($this->getRequest()->getMethod() != sfRequest::POST)
|
||||
{
|
||||
return sfView::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
public function executeAddDevice()
|
||||
{
|
||||
//Request Device form values
|
||||
$device_info = $this->getRequest()->getParameterHolder()->getAll();
|
||||
|
||||
//Save "Time for all Devices" to client database
|
||||
$client = new Client();
|
||||
$client->setAllDevices($this->getRequestParameter('all_devices'));
|
||||
|
||||
|
||||
//Aquire update device data
|
||||
if(isset($device_info['device_update']))
|
||||
{
|
||||
|
||||
foreach(array_keys($device_info['device_update']) as $key)
|
||||
{
|
||||
$this->deviceAddUpdate($key,
|
||||
$device_info['id'],
|
||||
$this->getRequestParameter('device_update['.$key.'][device_name]'),
|
||||
$this->getRequestParameter('device_update['.$key.'][manufacturer]'),
|
||||
$this->getRequestParameter('device_update['.$key.'][model_number]'),
|
||||
$this->getRequestParameter('device_update['.$key.'][serial_number]'),
|
||||
$this->getRequestParameter('device_update['.$key.'][location]'),
|
||||
$this->getRequestParameter('device_update['.$key.'][frequency]'),
|
||||
$this->getRequestParameter('device_update['.$key.'][status]')
|
||||
);
|
||||
|
||||
/*
|
||||
$update_device = new Device();
|
||||
$update_specification = new Specification();
|
||||
|
||||
// Test for duplicate specification entries, based on "manufacturer" and "model_number"
|
||||
$q = new Criteria();
|
||||
$q->add(SpecificationPeer::MANUFACTURER, $this->getRequestParameter('device_update['.$key.'][manufacturer]'));
|
||||
$q->add(SpecificationPeer::MODEL_NUMBER, $this->getRequestParameter('device_update['.$key.'][model_number]'));
|
||||
|
||||
$specification_count_update = SpecificationPeer::doCount($q);
|
||||
// print_r($this->getRequestParameter('device_update'));
|
||||
|
||||
?><b><?php print_r($specification_count_update) ?></b><?
|
||||
if($specification_count_update == 0)
|
||||
{
|
||||
$update_specification->setDeviceName($this->getRequestParameter('device_update['.$key.'][device_name]'));
|
||||
$update_specification->setManufacturer($this->getRequestParameter('device_update['.$key.'][manufacturer]'));
|
||||
$update_specification->setModelNumber($this->getRequestParameter('device_update['.$key.'][model_number]'));
|
||||
|
||||
$update_specification->save();
|
||||
}
|
||||
|
||||
$update_specificication = SpecificationPeer::doSelectOne($q);
|
||||
// print_r($update_specification);
|
||||
|
||||
$update_device = DevicePeer::retrieveByPk($key);
|
||||
$update_device->setSpecificationId($update_specification->getId());
|
||||
$update_device->setSerialNumber($this->getRequestParameter('device_update['.$key.'][serial_number]'));
|
||||
$update_device->setLocation($this->getRequestParameter('device_update['.$key.'][location]'));
|
||||
$update_device->setFrequency($this->getRequestParameter('device_update['.$key.'][frequency]'));
|
||||
$update_device->setStatus($this->getRequestParameter('device_update['.$key.'][status]'));
|
||||
|
||||
if ($update_device->isModified())
|
||||
{
|
||||
$update_device->save();
|
||||
}
|
||||
|
||||
/* if ($update_specification->isModified())
|
||||
{
|
||||
$update_specification->save();
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
//Test for blank entries in "new" entry fields
|
||||
if(!(($device_info['new_device_name'] == '') && ($device_info['new_manufacturer'] == '') && ($device_info['new_model_number'] == '') && ($device_info['new_serial_number'] == '') && ($device_info['new_frequency'] == '') && ($device_info['new_status'] == '')))
|
||||
{
|
||||
$this->deviceAddUpdate(-1,
|
||||
$device_info['id'],
|
||||
$this->getRequestParameter('new_device_name'),
|
||||
$this->getRequestParameter('new_manufacturer'),
|
||||
$this->getRequestParameter('new_model_number'),
|
||||
$this->getRequestParameter('new_serial_number'),
|
||||
$this->getRequestParameter('new_location'),
|
||||
$this->getRequestParameter('new_frequency'),
|
||||
$this->getRequestParameter('new_status')
|
||||
);
|
||||
/*
|
||||
//Add New device
|
||||
$device = new Device();
|
||||
$specification = new Specification();
|
||||
|
||||
// Test for duplicate Specification data
|
||||
$c = new Criteria;
|
||||
$c->add(SpecificationPeer::MANUFACTURER, $device_info['new_manufacturer']);
|
||||
$c->add(SpecificationPeer::MODEL_NUMBER, $device_info['new_model_number']);
|
||||
$specification_count_new = SpecificationPeer::doCount($c);
|
||||
|
||||
if($specification_count_new == 0)
|
||||
{
|
||||
//Set Specifications to database
|
||||
$specification->setDeviceName($device_info['new_device_name']);
|
||||
$specification->setManufacturer($device_info['new_manufacturer']);
|
||||
$specification->setModelNumber($device_info['new_model_number']);
|
||||
|
||||
$specification->save();
|
||||
}
|
||||
|
||||
//retrieve Specification ID
|
||||
$specification = SpecificationPeer::doSelectOne($c);
|
||||
|
||||
//Test for duplicate database entries.
|
||||
$r = new Criteria();
|
||||
$r->add(DevicePeer::SPECIFICATION_ID, $specification->getId());
|
||||
$r->add(DevicePeer::SERIAL_NUMBER, $device_info['new_serial_number']);
|
||||
|
||||
$duplicate_count = DevicePeer::doCount($r);
|
||||
|
||||
if ($duplicate_count == 0)
|
||||
{
|
||||
//Set Device information to database
|
||||
$device->setSpecificationId($specification->getId());
|
||||
$device->setClientId($device_info['id']);
|
||||
$device->setSerialNumber($device_info['new_serial_number']);
|
||||
$device->setLocation($device_info['new_location']);
|
||||
$device->setFrequency($device_info['new_frequency']);
|
||||
$device->setStatus($device_info['new_status']);
|
||||
|
||||
$device->save();
|
||||
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
$this->redirect('clientManager/index?mode=edit&id='.$device_info['id']);
|
||||
}
|
||||
|
||||
/* This function saves our client form data to the database */
|
||||
public function executeAddClient()
|
||||
{
|
||||
// Create a client object to store parsed information
|
||||
$client = new Client();
|
||||
|
||||
if ($this->getRequestParameter('mode') == 'edit')
|
||||
{
|
||||
$client_id = $this->getRequestParameter('id');
|
||||
$client = ClientPeer::retrieveByPk($client_id);
|
||||
}
|
||||
|
||||
$client->setClientIdentification($this->getRequestParameter('client_identification'));
|
||||
$client->setClientName($this->getRequestParameter('client_name'));
|
||||
$client->setAddress($this->getRequestParameter('address'));
|
||||
$client->setAddress2($this->getRequestParameter('address2'));
|
||||
$client->setCity($this->getRequestParameter('city'));
|
||||
$client->setState($this->getRequestParameter('state'));
|
||||
$client->setZip($this->getRequestParameter('zip'));
|
||||
$client->setAttn($this->getRequestParameter('attn'));
|
||||
$client->setEmail($this->getRequestParameter('email'));
|
||||
$client->setPhone($this->getRequestParameter('phone'));
|
||||
$client->setExt($this->getRequestParameter('ext'));
|
||||
$client->setCategory($this->getRequestParameter('category'));
|
||||
$client->setNotes($this->getRequestParameter('notes'));
|
||||
|
||||
if ($client->isModified())
|
||||
{
|
||||
$client->save();
|
||||
}
|
||||
|
||||
|
||||
if ($this->getRequestParameter('mode') != 'edit')
|
||||
{
|
||||
$c = new Criteria();
|
||||
$c->add(ClientPeer::CLIENT_IDENTIFICATION, $client->getClientIdentification());
|
||||
$c->add(ClientPeer::CLIENT_NAME, $client->getClientName());
|
||||
$c->add(ClientPeer::ADDRESS, $client->getAddress());
|
||||
$c->add(ClientPeer::ADDRESS_2, $client->getAddress2());
|
||||
$c->add(ClientPeer::CITY, $client->getCity());
|
||||
$c->add(ClientPeer::STATE, $client->getState());
|
||||
$c->add(ClientPeer::ZIP, $client->getZip());
|
||||
$c->add(ClientPeer::ATTN, $client->getAttn());
|
||||
$c->add(ClientPeer::EMAIL, $client->getEmail());
|
||||
$c->add(ClientPeer::PHONE, $client->getPhone());
|
||||
$c->add(ClientPeer::EXT, $client->getExt());
|
||||
$c->add(ClientPeer::CATEGORY, $client->getCategory());
|
||||
$c->add(ClientPeer::NOTES, $client->getNotes());
|
||||
|
||||
$d = ClientPeer::doSelect($c);
|
||||
$client_id = $d[0]->getId();
|
||||
|
||||
}
|
||||
|
||||
$this->redirect('clientManager/index?mode=edit&id='.$client_id);
|
||||
}
|
||||
|
||||
public function executeDeleteClient()
|
||||
{
|
||||
$client_id = $this->getRequestParameter('delete_client');
|
||||
|
||||
$client = ClientPeer::retrieveByPk($client_id);
|
||||
$client->delete();
|
||||
|
||||
$this->redirect('clientManager/index');
|
||||
}
|
||||
|
||||
public function handleErrorAddClient()
|
||||
{
|
||||
$this->forward('clientManager', 'index');
|
||||
}
|
||||
|
||||
/* public function handleErrorAddDevice()
|
||||
{
|
||||
$this->forward('clientManager', 'index');
|
||||
}*/
|
||||
|
||||
private function deviceAddUpdate($device_id, $client_id, $device_name, $manufacturer, $model_number, $serial_number, $location, $frequency, $status)
|
||||
{
|
||||
//Add New device
|
||||
$device = new Device();
|
||||
$specification = new Specification();
|
||||
|
||||
// Test for duplicate Specification data
|
||||
$c = new Criteria;
|
||||
$c->add(SpecificationPeer::MANUFACTURER, $manufacturer);
|
||||
$c->add(SpecificationPeer::MODEL_NUMBER, $model_number);
|
||||
$specification_count_new = SpecificationPeer::doCount($c);
|
||||
// print_r($specification_count_new);
|
||||
|
||||
/* if( !($specification = SpecificationPeer::doSelectOne($c)) )
|
||||
{
|
||||
$specification = new Specification();
|
||||
//Set Specifications to database
|
||||
$specification->setDeviceName($device_name);
|
||||
$specification->setManufacturer($manufacturer);
|
||||
$specification->setModelNumber($model_number);
|
||||
|
||||
$specification->save();
|
||||
} */
|
||||
|
||||
//If the specification doesn't exist already create it
|
||||
if($specification_count_new == 0)
|
||||
{
|
||||
//Set Specifications to database
|
||||
$specification->setDeviceName($device_name);
|
||||
$specification->setManufacturer($manufacturer);
|
||||
$specification->setModelNumber($model_number);
|
||||
|
||||
$specification->save();
|
||||
}
|
||||
|
||||
//retrieve Specification ID
|
||||
$specification = SpecificationPeer::doSelectOne($c);
|
||||
// print_r($specification);
|
||||
|
||||
echo "<h1> ".$specification->getId()."</h1>";
|
||||
//Test for duplicate database entries.
|
||||
$r = new Criteria();
|
||||
$r->add(DevicePeer::SPECIFICATION_ID, $specification->getId());
|
||||
$r->add(DevicePeer::SERIAL_NUMBER, $serial_number);
|
||||
|
||||
$duplicate_count = DevicePeer::doCount($r);
|
||||
|
||||
/* // If true this entry is already in the database
|
||||
if ($duplicate_count == 1)
|
||||
{
|
||||
// $device = DevicePeer::retrieveByPk($device_id);
|
||||
if( $device_id < 0 ) // This is a new entry and it is a duplicate this is an error
|
||||
{
|
||||
/// PRINTER ERROR FOR DUPLICATE NEW!!!
|
||||
}
|
||||
else // we are modifying the existing entry
|
||||
{
|
||||
$bbb = new Criteria();
|
||||
$bbb->add(DevicePeer::ID, $device_id);
|
||||
|
||||
$device = DevicePeer::doSelectOne($bbb);
|
||||
}
|
||||
} */
|
||||
|
||||
if ($duplicate_count == 1)
|
||||
{
|
||||
$device = DevicePeer::retrieveByPk($device_id);
|
||||
}
|
||||
|
||||
|
||||
// print_r($device);
|
||||
|
||||
//Set Device information to database
|
||||
$device->setSpecificationId($specification->getId());
|
||||
$device->setClientId($client_id);
|
||||
$device->setSerialNumber($serial_number);
|
||||
$device->setLocation($location);
|
||||
$device->setFrequency($frequency);
|
||||
$device->setStatus($status);
|
||||
|
||||
// Write any additions or modifications
|
||||
if($device->isModified())
|
||||
{
|
||||
$device->save();
|
||||
}
|
||||
}
|
||||
|
||||
public function executeQualifications()
|
||||
{
|
||||
$this->techId = $this->getRequestParameter('techId');
|
||||
}
|
||||
}
|
276
extra/clientManager/templates/indexSuccess.php
Executable file
276
extra/clientManager/templates/indexSuccess.php
Executable file
@ -0,0 +1,276 @@
|
||||
<?php
|
||||
use_helper('Object');
|
||||
use_helper('Validation');
|
||||
use_helper('Javascript');
|
||||
echo javascript_include_tag('dropdown');
|
||||
|
||||
//set field values
|
||||
if($sf_request->hasErrors())
|
||||
{
|
||||
$clientIdValue = $sf_params->get('client_identification');
|
||||
$clientNameValue = $sf_params->get('client_name');
|
||||
$addressValue = $sf_params->get('address');
|
||||
$address2Value = $sf_params->get('address2');
|
||||
$cityValue = $sf_params->get('city');
|
||||
$stateValue = $sf_params->get('state');
|
||||
$zipValue = $sf_params->get('zip');
|
||||
$attnValue = $sf_params->get('attn');
|
||||
$emailValue = $sf_params->get('email');
|
||||
$phoneValue = $sf_params->get('phone');
|
||||
$extValue = $sf_params->get('ext');
|
||||
$categoryValue = $sf_params->get('category');
|
||||
$notesValue = $sf_params->get('notes');
|
||||
$allDevicesValue = $sf_params->get('all_devices');
|
||||
|
||||
} else {
|
||||
$clientIdValue = $populateClient->getClientIdentification();
|
||||
$clientNameValue = $populateClient->getClientName();
|
||||
$addressValue = $populateClient->getAddress();
|
||||
$address2Value = $populateClient->getAddress2();
|
||||
$cityValue = $populateClient->getCity();
|
||||
$stateValue = $populateClient->getState();
|
||||
$zipValue = $populateClient->getZip();
|
||||
$attnValue = $populateClient->getAttn();
|
||||
$emailValue = $populateClient->getEmail();
|
||||
$phoneValue = $populateClient->getPhone();
|
||||
$extValue = $populateClient->getExt();
|
||||
$categoryValue = $populateClient->getCategory();
|
||||
$notesValue = $populateClient->getNotes();
|
||||
$allDevicesValue = $populateClient->getAllDevices();
|
||||
}
|
||||
?>
|
||||
|
||||
<?php echo javascript_tag('
|
||||
function submitClientSelect()
|
||||
{
|
||||
clientSelect = document.getElementById("id").value;
|
||||
|
||||
if(clientSelect == "")
|
||||
{
|
||||
alert("Please select a client before continuing.");
|
||||
} else {
|
||||
document.getElementById("clientSelect").submit();
|
||||
}
|
||||
} ');
|
||||
|
||||
?>
|
||||
|
||||
<div class="newClient">
|
||||
|
||||
<?php echo form_tag('clientManager/index', array('id' => 'clientSelect')); ?>
|
||||
<?php echo input_hidden_tag('mode', 'edit'); ?>
|
||||
<table class="clientSelect"><tr>
|
||||
<td width="100">Select Client</td>
|
||||
<td><?php echo select_tag('id', options_for_select($clients, $client_id,'include_custom=Please Select a Client'), array('onFocus' => "this.enteredText='';", 'onkeydown' => "return handleKey();", 'onkeyup' => "event.cancelbubble=true;return false;", 'onkeypress' => "return selectItem();") );?></td>
|
||||
</tr></table>
|
||||
</form>
|
||||
|
||||
</form>
|
||||
</tr></table>
|
||||
|
||||
<?php echo form_tag('clientManager/addClient'); ?>
|
||||
<?php echo input_hidden_tag('mode', $mode); ?>
|
||||
<?php echo input_hidden_tag('id', $populateClient->getId()); ?>
|
||||
|
||||
<table class="clientInfo"><tr>
|
||||
<td colspan=2><?php echo form_error('client_identification'); ?></td>
|
||||
<tr></tr>
|
||||
<td width="100">Client ID:</td>
|
||||
<td><?php echo input_tag('client_identification', $clientIdValue, array('size' => '30')); ?></td>
|
||||
</tr><tr>
|
||||
<td colspan=2><?php echo form_error('client_name'); ?></td>
|
||||
<tr></tr>
|
||||
<td>Client Name:</td>
|
||||
<td><?php echo input_tag('client_name', $clientNameValue, array('size' => '30')); ?></td>
|
||||
</tr><tr>
|
||||
<td colspan=2><?php echo form_error('address'); ?></td>
|
||||
<tr></tr>
|
||||
<td>Address:</td>
|
||||
<td><?php echo input_tag('address', $addressValue, array('size' => '30')); ?></td>
|
||||
</tr><tr>
|
||||
<td></td>
|
||||
<td><?php echo input_tag('address_2', $address2Value, array('size' => '30')); ?></td>
|
||||
</tr><tr>
|
||||
<td colspan=2><?php echo form_error('city'); ?></td>
|
||||
<tr></tr>
|
||||
<td>City:</td>
|
||||
<td><?php echo input_tag('city', $cityValue, array('size' => '30')); ?></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' => 'Deleware',
|
||||
'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'), $stateValue)); ?></td>
|
||||
</tr><tr>
|
||||
<td colspan=2><?php echo form_error('zip'); ?></td>
|
||||
<tr></tr>
|
||||
<td>Zip:</td>
|
||||
<td><?php echo input_tag('zip', $zipValue, array('size' => '5')); ?></td>
|
||||
</tr><tr>
|
||||
<td colspan=2><?php echo form_error('attn'); ?></td>
|
||||
<tr></tr>
|
||||
<td>Attn:</td>
|
||||
<td><?php echo input_tag('attn', $attnValue, array('size' => '30')); ?></td>
|
||||
</tr><tr>
|
||||
<td colspan=2><?php echo form_error('email'); ?></td>
|
||||
<tr></tr>
|
||||
<td>Email:</td>
|
||||
<td><?php echo input_tag('email', $emailValue, array('size' => '30')); ?></td>
|
||||
</tr><tr>
|
||||
<td colspan=2><?php echo form_error('phone'); echo form_error('ext'); ?></td>
|
||||
<tr></tr>
|
||||
<td>Phone:</td>
|
||||
<td><?php echo input_tag('phone', $phoneValue, 'size=8').' ext.:'.input_tag('ext', $extValue, 'size=4'); ?></td>
|
||||
</tr><tr>
|
||||
<td colspan=2><?php echo form_error('category'); ?></td>
|
||||
<tr></tr>
|
||||
<td>Category:</td>
|
||||
<td><?php echo select_tag('category', options_for_select(array(
|
||||
'' => 'Please Select...',
|
||||
'orthopedics' => 'Orthopedics',
|
||||
'pediatrics' => 'Pediatrics',
|
||||
'radiology' => 'Radiology'), $categoryValue)); ?></td>
|
||||
|
||||
</tr><tr>
|
||||
<td>Notes:</td>
|
||||
<td><?php echo textarea_tag('notes', $notesValue, array('width' => '30')); ?></td>
|
||||
</tr><tr>
|
||||
<td></td>
|
||||
<td><?php echo submit_tag('Save'); ?></td>
|
||||
</tr></table>
|
||||
|
||||
</form>
|
||||
<div id="clientOptions">
|
||||
<?php
|
||||
if($mode == 'edit')
|
||||
{
|
||||
// Delete Button
|
||||
echo form_tag('clientManager/deleteClient');
|
||||
echo input_hidden_tag('delete_client', $populateClient->getId());
|
||||
echo submit_tag('Delete');
|
||||
?></form><?php
|
||||
|
||||
// New client Button (refresh form)
|
||||
echo form_tag('clientManager/index');
|
||||
echo submit_tag('New Client');
|
||||
} ?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php if ($mode == 'edit')
|
||||
{ ?>
|
||||
<div class="clientDevice">
|
||||
<?php echo form_tag('clientManager/addDevice?mode=edit&id='.$populateClient->getId()); ?>
|
||||
<table><tr>
|
||||
<td class='deviceId'><b><u>Device ID</u></b></td>
|
||||
<td><b><u>Device</u></b></td>
|
||||
<td><b><u>Manufacturer</u></b></td>
|
||||
<td><b><u>Model #</u></b></td>
|
||||
<td><b><u>Serial #</u></b></td>
|
||||
<td><b><u>Loc.</u></b></td>
|
||||
<td><b><u>Frequency</u></b></td>
|
||||
<td><b><u>Status</u></b></td>
|
||||
</tr><tr>
|
||||
<?php
|
||||
foreach ($populateDevice as $device)
|
||||
{ ?>
|
||||
<td><?php echo input_tag('device_update['.$device->getDevice()->getId().'][identification]', $device->getIdentification(), 'size=8'); echo input_hidden_tag('device_update['.$device->getDevice()->getId().'][specification_id]', $device->getSpecification()->getId()); ?></td>
|
||||
|
||||
<td><?php echo input_tag('device_update_'.$device->getDevice()->getId().'_name', $device->getSpecification()->getDeviceName()); ?></td>
|
||||
<td><?php echo input_tag('device_update['.$device->getDevice()->getId().'][manufacturer]', $device->getSpecification()->getManufacturer()); ?></td>
|
||||
<td><?php echo input_tag('device_update['.$device->getDevice()->getId().'][model_number]', $device->getSpecification()->getModelNumber(), 'size=4'); //$device->getModelNumber()); ?></td>
|
||||
<td><?php echo input_tag('device_update['.$device->getDevice()->getId().'][serial_number]', $device->getDevice()->getSerialNumber(), 'size=4'); ?></td>
|
||||
<td><?php echo input_tag('device_update['.$device->getDevice()->getId().'][location]', $device->getDevice()->getLocation(),'size=4'); ?></td>
|
||||
<td><?php echo select_tag('device_update['.$device->getDevice()->getId().'][frequency]', options_for_select(array(
|
||||
'' => 'Please Select...',
|
||||
'annual' => 'Annually',
|
||||
'monthly' => 'Monthly',
|
||||
'biannually' => 'Bi-annually',
|
||||
'bimonthly' => 'Bi-monthly',
|
||||
'twice_annually'=> 'Twice Annually',
|
||||
'twice_monthly' => 'Twice Montly'),$device->getDevice()->getFrequency())); ?></td>
|
||||
<td><?php echo select_tag('device_update['.$device->getDevice()->getId().'][status]', options_for_select(array(
|
||||
'' => 'Please Select...',
|
||||
'active' => 'Active',
|
||||
'retired' => 'Retired'), $device->getDevice()->getStatus())); ?></td>
|
||||
</tr><tr>
|
||||
<?php } ?>
|
||||
<td></td>
|
||||
<td><?php echo input_tag('new_device_name', ''); ?></td>
|
||||
<td><?php echo input_tag('new_manufacturer', ''); ?></td>
|
||||
<td><?php echo input_tag('new_model_number', '','size=4'); ?></td>
|
||||
<td><?php echo input_tag('new_serial_number', '','size=4'); ?></td>
|
||||
<td><?php echo input_tag('new_location', '', 'size=4'); ?></td>
|
||||
<td><?php echo select_tag('new_frequency', options_for_select(array(
|
||||
'' => 'Please Select...',
|
||||
'annually' => 'Annually',
|
||||
'monthly' => 'Monthly',
|
||||
'biannually' => 'Bi-annually',
|
||||
'bimonthly' => 'Bi-monthly',
|
||||
'twice_annually'=> 'Twice Annually',
|
||||
'twice_monthly' => 'Twice Montly'))); ?></td>
|
||||
<td><?php echo select_tag('new_status', options_for_select(array(
|
||||
'' => 'Please Select...',
|
||||
'active' => 'Active',
|
||||
'retired' => 'Retired'))); ?></td>
|
||||
</tr></table>
|
||||
<?php echo submit_tag('Save'); ?>
|
||||
<?php echo ' Time for All Devices: '.input_tag('all_devices', $allDevicesValue, 'size=4'); ?>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
77
extra/clientManager/validate/AddClient.yml
Executable file
77
extra/clientManager/validate/AddClient.yml
Executable file
@ -0,0 +1,77 @@
|
||||
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.
|
||||
|
||||
attn:
|
||||
required:
|
||||
msg: Please enter the full name of point of contact.
|
||||
sfStringValidator:
|
||||
min: 5
|
||||
min_error: Point of contact name does not meet acceptable paramaters (5 character min)
|
||||
max: 50
|
||||
max_error: Point of contact name exceeds acceptable parameters (50 character max)
|
||||
|
||||
email:
|
||||
required:
|
||||
msg: Please enter an email address before continuing.
|
||||
sfEmailValidator:
|
||||
strict: true
|
||||
email_error: Please enter a valid email address (name@domain.extension)
|
||||
|
||||
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:
|
||||
|
||||
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.
|
34
extra/clientManager/validate/devices
Executable file
34
extra/clientManager/validate/devices
Executable 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
|
||||
|
||||
|
Reference in New Issue
Block a user