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; }
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']); } }
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; }
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; }