require_once '../config/config.php'; require_once INCLUDE_DIR . 'class.masterData.php'; $out = ob_get_clean(); $objMaster = new MasterData(); $id = $_POST['id']; $table = $_POST['tableName']; $option = "var optData = new Object();"; if ($table == 'states') { $dataArr = $objMaster->getStatesOfCountry($id); $option .= "optData['']='--Select--';"; foreach ($dataArr as $data) { $option .= "optData[" . $data['stateId'] . "]='" . $data['stateName'] . "';"; } } if ($table == 'cities') { $dataArr = $objMaster->getCitiesOfState($id); $option .= "optData['']='--Select--';"; foreach ($dataArr as $data) { $option .= "optData[" . $data['cityId'] . "]='" . $data['cityName'] . "';"; } } if ($table == 'schools') { $dataArr = $objMaster->getSchoolsOfCity($id); $option .= "optData['']='--Select--';"; foreach ($dataArr as $data) { $option .= "optData[" . $data['schoolId'] . "]='" . $data['schoolName'] . "';"; } } if ($table == 'student') { $dataArr = $objMaster->getStudentsOfClass($id); $option .= "optData['']='--Select--';";
} else if($user['userType'] == 2) { require_once(INCLUDE_DIR.'teacher.php'); $objUser = new Teacher($user['userId']); $_SESSION['objUser'] = serialize($objUser); header("Location:teacher/home.php"); } } } */ if ($_GET['act'] == "logout") { unset($_SESSION['userId']); session_destroy(); header("location:index.php"); } $tpl_display = 'index.tpl'; if ($_REQUEST['action'] == "submit") { $states = $objMaster->getStatesOfCountry($_REQUEST['countryId']); $cities = $objMaster->getCitiesOfState($_REQUEST['stateId']); $schools = $objMaster->getSchoolsOfCity($_REQUEST['cityId']); $objTpl->assign('states', $states); $objTpl->assign('cities', $cities); $objTpl->assign('schools', $schools); $tpl_display = 'login.tpl'; } //$countries = $objMaster->getAllCountries(); $objTpl->assign('login_error', $login_error); $objTpl->assign('sess', $sess); //$objTpl->assign('countries', $countries); $objTpl->display($tpl_display);