<?php
	require_once( $GLOBALS["site_root"]."/includes/models/Specialty.inc.php" );


	$this->setMigrateTitle( "Szakterületek" );

	$query = sprintf( "select * from fo_specialties order by name" );
	$data = FNTH_db_get_resultset( $query , $this->olddb );

	$sm = new SpecialtyModel();
	foreach ($data as $row) {
		$p = array();
		$p["oldid"]=$row["id"];
		$p["specialty_name"]=$row["name"];
		$spec_id = $sm->addSpecialty( $p );
	}
	for ($i=1;$i<3;$i++) {
		$query = sprintf( "select * from fo_lspecialties where langid=%d order by name" , $i );
		$ds = FNTH_db_get_resultset( $query , $this->olddb );
		$ord = 1;
		foreach ($ds as $row) 
			$sm->setSpecialtyLangdef( $sm->getSpecialtyIdFromOldid( $row["spec_id"] ) , $i , $row["name"] , $ord++ );
	}
	$u = array();
	$u["migrate"]="\"users\"";
	// $this->doMigrateProcedure( $u );
	exit();
?>
