<?php
/*
********************************************************************************

    filename:     probelistprocess
    description:  open page based on selected action from probelist.php
    inputs:       probeId, add, update, calibrate, chart, delete
    outputs:      probeId
    actions:      none
    redirections: probeaddupdate.php, probecalibrate.php, probechart.php, probedeleteprocess.php, probelist.php

********************************************************************************
*/
    $probeId = $_POST["probeId"];
    if ($_POST["add"]) {
        header('Location: probeaddupdate.php?action=add');
        exit;
    } elseif ($probeId != 0) {
        if ($_POST["update"]) {
            header('Location: probeaddupdate.php?action=update&probeId=' . $probeId);
            exit;
        } elseif ($_POST["calibrate"]) {
            header('Location: probecalibrate.php?probeId=' . $probeId);
            exit;
        } elseif ($_POST["chart"]) {
            header('Location: probechart.php?probeId=' . $probeId);
            exit;
        } elseif ($_POST["delete"]) {
            header('Location: probedeleteprocess.php?probeId=' . $probeId);
            exit;
        } else {
            header('Location: probelist.php');
            exit;
        }
    } else {
            header('Location: probelist.php?probeRequired=true');
            exit;
    }
?>