Ejemplo n.º 1
0
}
// To load district for selected state
if (isset($_GET['loaddatafromdb'])) {
    $rangeFunction = new rangeFunction();
    $rangeFunction->rangetestbatteryid = $_POST['testbattery_id'];
    $selectcategory_data = $rangeFunction->categoryselect();
    $category_json = array();
    while ($result = mysql_fetch_array($selectcategory_data)) {
        $tmp = array('categories_id' => $result['categories_id'], 'categories_name' => $result['categories_name']);
        array_push($category_json, $tmp);
    }
    $selecttest_data = $rangeFunction->testselect();
    $test_json = array();
    while ($result = mysql_fetch_array($selecttest_data)) {
        $tmp = array('test_id' => $result['test_id'], 'test_name' => $result['test_name']);
        array_push($test_json, $tmp);
    }
    echo json_encode($category_json) . '#####' . json_encode($test_json);
}
// To load parameter format and unit using testattribute id
if (isset($_GET['paramformat'])) {
    $json = array();
    $rangeFunction = new rangeFunction();
    $rangeFunction->rangetestattributeid = $_POST['testattribute_id'];
    $select_data = $rangeFunction->parameterSelect();
    while ($result = mysql_fetch_array($select_data)) {
        $tmp = array('test_parameter_type' => $result['test_parameter_type'], 'test_parameter_unit' => $result['test_parameter_unit'], 'test_parameter_format' => $result['test_parameter_format']);
        array_push($json, $tmp);
    }
    echo json_encode($json);
}