package com.example.fideliza;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class LugaresBD extends SQLiteOpenHelper {
	 
	   public LugaresBD(Context contexto) {
	      super(contexto, "lugares", null, 1);
	   }
	 
	   @Override public void onCreate(SQLiteDatabase bd) {
	      bd.execSQL("CREATE TABLE lugares ("+
	             "_id INTEGER PRIMARY KEY AUTOINCREMENT, "+
	             "nombre TEXT, " +
	             "direccion TEXT, " +
	             "longitud REAL, " + 
	             "latitud REAL, " +  
	             "tipo INTEGER, " +
	             "foto TEXT, " +
	             "telefono INTEGER, " +
	             "url TEXT, " +
	             "comentario TEXT, " +
	             "fecha LONG, " +
	             "valoracion REAL," +
	             "distancia LONG)"); 
	     
	      bd.execSQL("INSERT INTO lugares VALUES (null, 'Interzoo Valencia', "+
	   	       "'Gran via fernando el catolico, 8 - 46008, Valencia', "+
	   	       " -0.384092, 39.469902, " +  TipoLugar.TIENDA.ordinal() + ", 'http://www.interzoo.es/uploads/img4d80b418244d7.gif', "+
	   	       "961105232, 'http://www.interzoo.es', "+"'En el centro de Valencia.', " +
	   	       System.currentTimeMillis() +", 3.0, 0)");
	      bd.execSQL("INSERT INTO lugares VALUES (null, 'Interzoo Madrid', "+
		   	       "'Calle Pedro Teixeira, 10 - 28020, Madrid', "+
		   	       " -3.693101, 40.454866, " +  TipoLugar.TIENDA.ordinal() + ", 'http://www.interzoo.es/uploads/img4cc6fc678304b.jpg', "+
		   	       " 917703989, 'http://www.interzoo.es', "+"'Especialistas en peces tropicales.', " +
		   	       System.currentTimeMillis() +", 3.0, 0)");
	      bd.execSQL("INSERT INTO lugares VALUES (null, 'Interzoo Pinto', "+
		   	       "'C/ Pintor Antonio López, 10 Local 11- 28320, Pinto (Madrid)', "+
		   	       " -3.699517, 40.25228, " +  TipoLugar.TIENDA.ordinal() + ", 'http://www.interzoo.es/uploads/img4cc15904a883c.gif', "+
		   	       "912274232, 'http://www.interzoo.es', "+"'Todo para su mascota.', " +
		   	       System.currentTimeMillis() +", 3.0, 0)");    
	      bd.execSQL("INSERT INTO lugares VALUES (null, 'Interzoo Andorra', "+
		   	       "'Av. 2 de mayo, 59 local - 44500 Andorra (Teruel)', "+
		   	       " -0.44529, 40.977339, " +  TipoLugar.TIENDA.ordinal() + ", 'http://www.interzoo.es/uploads/img5406d0a02160e.gif', "+
		   	       "978842809, 'http://www.interzoo.es', "+"'Su tienda en Teruel.', " +
		   	       System.currentTimeMillis() +", 3.0, 0)");
	      
	      bd.execSQL("INSERT INTO lugares VALUES (null, 'Interzoo Albal', "+
		   	       "'C/ L´Eixample, 3 - 46470 Albal, Valencia', "+
		   	       " -0.414605, 39.396457, " +  TipoLugar.TIENDA.ordinal() + ", 'http://www.interzoo.es/uploads/img4cbc34d78920d.gif', "+
		   	       " 961844324, 'http://www.interzoo.es', "+"'Su tienda de mascotas.', " +
		   	       System.currentTimeMillis() +", 3.0, 0)"); 
	      
	      
	      
	      
	     
	   }
	 
	   @Override
	   public void onUpgrade(SQLiteDatabase db, int oldVersion,
	                                                                                              int newVersion) {
	   }
	}
