Ejemplo n.º 1
0
function validate_integer($id, $value)
{
    global $db;
    $value = intval($value);
    $select = $db->select();
    $columns['value'] = $value;
    $db->update("station_variables", $columns, '"svid"=\'' . $id . '\'');
    $result = $db->fetchAll('select sid from station_variables where "svid"=\'' . $id . '\'');
    workflow_input($result[0]['sid']);
    return $value;
}
Ejemplo n.º 2
0
function validate_timer($id, $value)
{
    global $db;
    $result = $db->fetchAll('select value, sid from station_variables where "svid"=\'' . $id . '\'');
    if ($result[0]['value'] + $value <= time()) {
        $value = time();
        $select = $db->select();
        $columns['value'] = $value;
        $db->update("station_variables", $columns, '"svid"=\'' . $id . '\'');
        workflow_input($result[0]['sid']);
    }
}
Ejemplo n.º 3
0
function validate_checkbox($id, $value)
{  
	global $db;
	if($value=="yes") $value="no";
	else $value="yes";

	$select = $db->select();
	$columns['value']	= $value;
	
	$db->update("station_variables",$columns,'"svid"=\''.$id.'\'');
	
	$result = $db->fetchAll('select sid from station_variables where "svid"=\''.$id.'\'');
	workflow_input($result[0]['sid']);
	
	return $value;  
} 
Ejemplo n.º 4
0
function validate_dropdowntable($id, $value)
{
    //echo "<script type='text/javascript'>alert('$id')</script>";
    global $db;
    $select = $db->select();
    //The following updates the column 'value' with the changed dropdown option's value
    $columns['value'] = $value;
    $db->update("station_variables", $columns, '"svid"=\'' . $id . '\'');
    $result = $db->fetchAll('select sid from station_variables where "svid"=\'' . $id . '\'');
    //$result[0]['sid'] == sid
    workflow_input($result[0]['sid']);
    return $value;
}