/** * */ // _print_pre( $in ); $xID = 'NULL'; if( isset( $in['make'] ) === true and strlen( $in['make'] ) > 0 ) { $xID = $in['make']; } $xID2 = 'NULL'; if( isset( $in['model'] ) === true and strlen( $in['model'] ) > 0 ) { $xID2 = $in['model']; } $xID3 = 'NULL'; if( isset( $in['year'] ) === true and strlen( $in['year'] ) > 0 ) { $xID3 = $in['year']; } $oMakes = new makes(); $oModels = new models(); $oYears = new years(); /* Get all makes */ $aMakes = $oMakes->get_makes_template( 'select' ); $selector['makes'] = create_selector( 'in[make]', $aMakes, $xID, "onchange", 1, -1 ); // _print_pre( $aMakes ); // print $xID; if( array_key_exists( $xID, $aMakes ) === false ) { // print "URA"; $xID2 = 'NULL'; $xID3 = 'NULL'; } /* Get all models */ $aModels = $oModels->get_models_template( 'select', array( 'field' => 'make_url', 'id' => $xID ) ); $selector['models'] = create_selector( 'in[model]', $aModels, $xID2, "onchange", 1, -1 ); // _print_pre( $aModels ); // print $xID2; if( array_key_exists( $xID2, $aModels ) === false ) { // print "URA2"; $xID3 = 'NULL'; } /* Get all years */ $aYears= $oYears->get_years_template( 'select', array( 'field' => 'model_url', 'id' => $xID2, 'field0' => 'make_url', 'id0' => $xID ) ); $selector['years'] = create_selector( 'in[year]', $aYears, $xID3, "onchange", 1, -1 ); if( $xID !== 'NULL' and $xID2 !== 'NULL' and $xID3 !== 'NULL' ) { $sURL = $config["server"]["url"] . '/make/' . $in['make'] . '/' . $in['model'] . '/' . $in['year'] . '/'; header( "Location: $sURL" ); exit(); } // print $selector['makes']; // print $selector['models']; // print $selector['years']; ?>