$this->validation->set_error_delimiters('<span class="error">', '</span>');
+ $rules['model'] = "trim|required";
$rules['hostname'] = "trim|required";
$rules['ip'] = "trim|required|valid_ip";
$rules['username'] = "trim";
$rules['notes'] = "trim";
$this->validation->set_rules($rules);
+ $fields['model'] = "Model";
$fields['hostname'] = "Hostname";
$fields['ip'] = "IP Address";
$fields['username'] = "Username";
$data = array();
if ($this->validation->run() == TRUE)
{
- /* b/c the submit is valid, it doesn't matter if pcu_register is set */
- $this->pcu_id = $this->add_pcu($data);
+ if ($this->validation->model != "none-selected" )
+ {
+ /* b/c the submit is valid, it doesn't matter if pcu_register is set */
+ $this->pcu_id = $this->add_pcu($data);
+ }
}
$data = $this->get_stage1_data($person, $data);
$data['stage'] = 1;
function add_node(&$data)
{
global $api, $plc;
- print "Adding Node\n<br>";
$hostname = trim($_REQUEST['hostname']);
$model= trim($_REQUEST['model']);
$method = trim($_REQUEST['method']);
}
$data['node'] = $this->getnode($data['node_id']);
$data['site'] = $this->getsite($data['site_id']);
- /*print "SITENAME: " . $data['site']['login_base'] . "<BR>";*/
return $data;
}