B4A=true
Group=Default Group
ModulesStructureVersion=1
Type=Class
Version=11.5
@EndOfDesignText@
Sub Class_Globals
	Private Root As B4XView 'ignore
	Private xui As XUI 'ignore
	'//Process Globals
	Dim ruta As String
	Dim c As Cursor
	Dim C2 As Cursor
	Private frontCamera As Boolean = False
	Dim OK_CheckList As Int
	'//Globals
	Dim IME As IME
	Private Edt_FH As EditText
	Private Sp_MENU As Spinner
	Dim LISTMENU As List
	Private LB_CATEGORIA As Label
	Private SCROLLPRINC As ScrollView
	Private Pnl_CABINA As Panel
	Dim sDate,sTime As String
	''''''''' PANELS CHECKS
	Private camEx As CameraExClass
	Private Rb_4_4 As RadioButton
	Private Rb_3_4 As RadioButton
	Private Rb_2_4 As RadioButton
	Private Rb_1_4 As RadioButton
	Private Lb_4 As Label
	Private Lb_3 As Label
	Private Lb_2 As Label
	Private Lb_1 As Label
	Private Et_KilometrajeIni As EditText
	Private Cbox_Claxon As CheckBox
	Private Cbox_Parabrisas As CheckBox
	Private Cbox_Cinturon As CheckBox
	Private Cbox_Espejos As CheckBox
	Private Cbox_Licencia As CheckBox
	Private Pnl_CabinaInfo As Panel
	Private Pnl_MotorEncen As Panel
	Private Pnl_Inspec As Panel
	Private Pnl_CofreAbierto As Panel
	Private Pnl_Carga As Panel
	Private SP_MENUC As SD_Spinner
	Private Im_1 As ImageView
	Private Im2 As ImageView
	Private Im3 As ImageView
	Private Im4 As ImageView
	Private Bt_Foto1 As Button
	Private Bt_Foto2 As Button
	Private Bt_Foto3 As Button
	Private Bt_Foto4 As Button
	Private Bt_GuardarCheck As Button
	Private N_Ruta As String
	Private Id_Almacen As String
	Private Combustible As String
	Private PLACAS As String
	'' PANEL 2
	Private Ch_OBJETOSINE As CheckBox
	Private CH_OBJMPERV As CheckBox
	Private Ch_ORHERRA As CheckBox
	Private Ch_LIMPIO As CheckBox
	Private Ch_UNILIMPIA As CheckBox
	Private Ch_BASURA As CheckBox
	Private Ch_RESPON As CheckBox
	Private Ch_AUDITORIA As CheckBox
	Private Ch_HABITUAL As CheckBox
	'' PANEL 3
	Private Ch_HERRAMIENTAS As CheckBox
	Private Ch_CONOS As CheckBox
	Private Ch_EDOCARROCE As CheckBox
	Private Ch_FUN_LUCES As CheckBox
	Private Ch_PLACAS_CIRCU As CheckBox
	Private Ch_COND_LLANTAS As CheckBox
	'' PANEL 4
	Private Ch_ACEITEMOTOR As CheckBox
	Private Ch_ACEITEDIREC As CheckBox
	Private Ch_NVL_REFRIGE As CheckBox
	Private Ch_NVL_LIQUIDBRI As CheckBox
	Private Ch_COND_BANMOTOR As CheckBox
	''''' p_resumenAcumulado
	Private Ch_FUGASGRAL As CheckBox
	Private Ch_FRENOS As CheckBox
	Private Edt_COMENTARIO As AutoCompleteEditText
	Private Pnl_Fotos As Panel
	Private btnTakePicture As Button
	Private b_guardar As Button
	Private Pnl_foto As Panel
	Dim camera1 As Camera
	Private TOMO_FOTO1 As String
	Private TOMO_FOTO2 As String
	Private TOMO_FOTO3 As String
	Private TOMO_FOTO4 As String
	Private LBL_REGRESA As Label
	Private Label5 As Label
	Dim out As OutputStream
	Private CUANTOS As String
End Sub

'You can add more parameters here.
Public Sub Initialize As Object
	Return Me
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
	Root = Root1
	'load the layout to Root
	Root.LoadLayout("checklist")
	SCROLLPRINC.Panel.LoadLayout("checks")
	SCROLLPRINC.Panel.Height = Pnl_MotorEncen.Height
	IME.Initialize("IME")
	IME.AddHeightChangedEvent

	OK_CheckList=0
	Pnl_CabinaInfo.Visible=True
	btnTakePicture.Enabled = True
	camera1.Initialize(Pnl_foto, "Camera1")

	LISTMENU.IsInitialized
	LISTMENU.Initialize
	LISTMENU.AddAll(Array As String ("Cabina con switch encendido", "Cabina y espacio de carga", "Inspección General Exterior", "Cofre abierto, motor apagado","Con motor encendido"))

	SP_MENUC.AddAll(LISTMENU,"CheckList",Colors.White,Colors.Blue,Gravity.CENTER)
	DateTime.DateFormat="dd/MM/yyyy"
	Edt_FH.Text=DateTime.Date(DateTime.Now)
	ruta = File.DirInternal
End Sub

'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.

Sub Camera1_Ready (Success As Boolean)
	Log("Camara lista")
	If Success Then
		camera1.StartPreview
		camera1.Initialize(Pnl_foto, "Camera1")
		btnTakePicture.Enabled = True
	Else
		ToastMessageShow("No se puede abrir la camara.", True)
	End If
End Sub

Sub B4XPage_Appear
'	If Subs.traeUltimaActividadBD <> "CHECKLIST_AUTO" Then Subs.iniciaActividad(Subs.traeUltimaActividadBD)
	c=Starter.skmt.ExecQuery("SELECT COUNT(*) as CUANTOS  FROM TMP_INSPECCION_AUTO_DIARIA")
	c.Position = 0
	CUANTOS = c.GetString("CUANTOS")
	c.Close
	If CUANTOS > 0 Then
		If Et_KilometrajeIni.Text = "" Then
			c=Starter.skmt.ExecQuery("select * from tmp_inspeccion_auto_diaria")
			If c.RowCount > 0 Then
				c.Position = 0
				If c.GetString("TMP_AUTO_COMBUSTIBLE") = "4/4" Then Rb_4_4.Checked = True
				If c.GetString("TMP_AUTO_COMBUSTIBLE") = "3/4" Then Rb_3_4.Checked = True
				If c.GetString("TMP_AUTO_COMBUSTIBLE") = "2/4" Then Rb_2_4.Checked = True
				If c.GetString("TMP_AUTO_COMBUSTIBLE") = "1/4" Then Rb_1_4.Checked = True
				If c.GetString("TMP_AUTO_KILOMETRAJE") <> "" Then Et_KilometrajeIni.text = c.GetString("TMP_AUTO_KILOMETRAJE")
				If c.GetString("TMP_AUTO_CLAXON ") = "1" Then Cbox_Claxon.Checked = True
				If c.GetString("TMP_AUTO_PARABRISAS ") = "1" Then Cbox_Parabrisas.Checked = True
				If c.GetString("TMP_AUTO_CINTURON ") = "1" Then Cbox_Cinturon.Checked = True
				If c.GetString("TMP_AUTO_ESPEJOS ") = "1" Then Cbox_Espejos.Checked = True
				If c.GetString("TMP_AUTO_LICENCIA ") = "1" Then Cbox_Licencia.Checked = True
				If c.GetString("TMP_AUTO_LIB_OBJETOSINE ") = "1" Then Ch_OBJETOSINE.Checked = True
				If c.GetString("TMP_AUTO_LIB_OBJETOTMPERVI ") = 1 Then CH_OBJMPERV.Checked = True
				If c.GetString("TMP_AUTO_ORDEN_HERRA ") = "1" Then Ch_ORHERRA.Checked = True
				If c.GetString("TMP_AUTO_UNILIMPIA ") = "1" Then Ch_UNILIMPIA.Checked = True
				If c.GetString("TMP_AUTO_LIMPIO ") = "1" Then Ch_LIMPIO.Checked = True
				If c.GetString("TMP_AUTO_BASURA ") = "1" Then Ch_BASURA.Checked = True
				If c.GetString("TMP_AUTO_RESPONSABILIDAD ") ="1" Then Ch_RESPON.Checked = True
				If c.GetString("TMP_AUTO_AUDITORIA ") = "1" Then Ch_AUDITORIA.Checked = True
				If c.GetString("TMP_AUTO_HABITUAL ") = "1" Then Ch_HABITUAL.Checked = True
				If c.GetString("TMP_AUTO_HERRAMIENTAS ") = "1" Then Ch_HERRAMIENTAS.Checked = True
				If c.GetString("TMP_AUTO_CONOS ") = "1" Then Ch_CONOS.Checked = True
				If c.GetString("TMP_AUTO_EDO_CARROCERIA ") = "1" Then Ch_EDOCARROCE.Checked = True
				If c.GetString("TMP_AUTO_FUN_LUCES ") = "1" Then Ch_FUN_LUCES.Checked = True
				If c.GetString("TMP_AUTO_PLACAS_CIRCU ") = "1" Then Ch_PLACAS_CIRCU.Checked = True
				If c.GetString("TMP_AUTO_COND_LLANTAS ") = "1" Then Ch_COND_LLANTAS.Checked = True
				If c.GetString("TMP_AUTO_ACEITEMOTOR ") = "1" Then Ch_ACEITEMOTOR.Checked = True
				If c.GetString("TMP_AUTO_ACEITEDIREC ") = "1" Then Ch_ACEITEDIREC.Checked = True
				If c.GetString("TMP_AUTO_NVL_REFRIGERANTE ") = "1" Then Ch_NVL_REFRIGE.Checked = True
				If c.GetString("TMP_AUTO_NVL_LIQUIDBRISAS ") = "1" Then Ch_NVL_LIQUIDBRI.Checked = True
				If c.GetString("TMP_AUTO_COND_BANMOTOR ") = "1" Then Ch_COND_BANMOTOR.Checked = True
				If c.GetString("TMP_AUTO_FUGASGRAL ") = "1" Then Ch_FUGASGRAL.Checked = True
				If c.GetString("TMP_AUTO_FRENOS ") = "1" Then Ch_FRENOS.Checked = True
				If c.GetString("TMP_AUTO_COMENTARIOS ") <> "" Then Edt_COMENTARIO.text = c.GetString("TMP_AUTO_COMENTARIOS ")
			End If
		End If
		Pnl_CabinaInfo.Visible=False
		Pnl_Carga.Visible=False
		Pnl_Inspec.Visible=True
		Pnl_MotorEncen.Visible=True
		Pnl_CofreAbierto.Visible=False
		If File.Exists(File.DirInternal,"FOTO1.jpg") = True Then
			Im_1.Bitmap = LoadBitmap(File.DirInternal, "FOTO1.jpg")
		Else
			If File.Exists(File.DirInternal,"FOTO1.jpg")  = False Then
				Im_1.Bitmap = LoadBitmap(File.DirAssets,"foto1.jpg")
			End If
		End If
		If File.Exists(File.DirInternal,"FOTO2.jpg") = True Then
			Im2.Bitmap = LoadBitmap(File.DirInternal, "FOTO2.jpg")
		Else
			If File.Exists(File.DirInternal,"FOTO2.jpg")  = False Then
				Im2.Bitmap = LoadBitmap(File.DirAssets,"foto2.jpg")
			End If
		End If
		If File.Exists(File.DirInternal,"FOTO3.jpg") = True Then
			Im3.Bitmap = LoadBitmap(File.DirInternal, "FOTO3.jpg")
		Else
			If File.Exists(File.DirInternal,"FOTO3.jpg")  = False Then
				Im3.Bitmap = LoadBitmap(File.DirAssets,"foto3.jpg")
			End If
		End If
		If File.Exists(File.DirInternal,"FOTO4.jpg") = True Then
			Im4.Bitmap = LoadBitmap(File.DirInternal, "FOTO4.jpg")
		Else
			If File.Exists(File.DirInternal,"FOTO4.jpg")  = False Then
				Im4.Bitmap = LoadBitmap(File.DirAssets,"foto4.jpg")
			End If
		End If
	End If
End Sub

Sub Camera1_PictureTaken (Data() As Byte)
	Log("foto tomada")
	camera1.StartPreview
	If Bt_Foto1.Tag="1" Then
		Dim salida As OutputStream
		salida = File.OpenOutput(File.DirInternal, "FOTO1.jpg", False)
		salida.WriteBytes(Data, 0, Data.Length)
		salida.Close
		ToastMessageShow("FOTO GUARDADA "& "FOTO1.jpg", True)
		Bt_Foto1.Tag="2"
	End If
	If Bt_Foto2.Tag="1" Then
		Dim salida As OutputStream
		salida = File.OpenOutput(File.DirInternal, "FOTO2.jpg", False)
		salida.WriteBytes(Data, 0, Data.Length)
		salida.Close
		ToastMessageShow("FOTO GUARDADA "& "FOTO2.jpg", True)
		Bt_Foto2.Tag="2"
	End If
	If Bt_Foto3.Tag="1" Then
		Dim salida As OutputStream
		salida = File.OpenOutput(File.DirInternal, "FOTO3.jpg", False)
		salida.WriteBytes(Data, 0, Data.Length)
		salida.Close
		ToastMessageShow("FOTO GUARDADA "& "FOTO3.jpg", True)
		Bt_Foto3.Tag="2"
	End If
	If Bt_Foto4.Tag="1" Then
		Dim salida As OutputStream
		salida = File.OpenOutput(File.DirInternal, "FOTO4.jpg", False)
		salida.WriteBytes(Data, 0, Data.Length)
		salida.Close
		ToastMessageShow("FOTO GUARDADA "& "FOTO4.jpg", True)
		Bt_Foto4.Tag="2"
	End If
End Sub

Sub btnTakePicture_Click
	btnTakePicture.Enabled = True
	camera1.TakePicture
End Sub

Sub Nvl_Combustible_CheckedChange(Checked As Boolean)
	If Rb_1_4.Checked Then
		Lb_1.Visible=True
		Lb_2.Visible=False
		Lb_3.Visible=False
		Lb_4.Visible=False
	End If
	If Rb_2_4.Checked Then
		Lb_1.Visible=False
		Lb_2.Visible=True
		Lb_3.Visible=False
		Lb_4.Visible=False
	End If
	If Rb_3_4.Checked Then
		Lb_1.Visible=False
		Lb_2.Visible=False
		Lb_3.Visible=True
		Lb_4.Visible=False
	End If
	If Rb_4_4.Checked Then
		Lb_1.Visible=False
		Lb_2.Visible=False
		Lb_3.Visible=False
		Lb_4.Visible=True
	End If
End Sub

Sub SP_MENUC_ItemClick (Position As Int, Value As String)
	LB_CATEGORIA.Text =LISTMENU.Get(Position)
	If LB_CATEGORIA.Text = "Cabina con switch encendido" Then
		Pnl_CabinaInfo.Visible=True
		Pnl_Carga.Visible=False
		Pnl_Inspec.Visible=False
		Pnl_MotorEncen.Visible=False
		Pnl_CofreAbierto.Visible=False
	End If
	If LB_CATEGORIA.Text = "Cabina y espacio de carga" Then
		Pnl_CabinaInfo.Visible=False
		Pnl_Carga.Visible=True
		Pnl_Inspec.Visible=False
		Pnl_MotorEncen.Visible=False
		Pnl_CofreAbierto.Visible=False
	End If
	If LB_CATEGORIA.Text = "Inspección General Exterior" Then
		Pnl_CabinaInfo.Visible=False
		Pnl_Carga.Visible=False
		Pnl_Inspec.Visible=True
		Pnl_MotorEncen.Visible=False
		Pnl_CofreAbierto.Visible=False
	End If
	If LB_CATEGORIA.Text = "Cofre abierto, motor apagado" Then
		Pnl_CabinaInfo.Visible=False
		Pnl_Carga.Visible=False
		Pnl_Inspec.Visible=False
		Pnl_MotorEncen.Visible=False
		Pnl_CofreAbierto.Visible=True
		If Pnl_CofreAbierto.Visible=True Then
			Pnl_Fotos.visible=False
		End If
	End If
	If LB_CATEGORIA.Text = "Con motor encendido"  Then
		Pnl_CabinaInfo.Visible=False
		Pnl_Carga.Visible=False
		Pnl_Inspec.Visible=True
		Pnl_MotorEncen.Visible=True
		Pnl_CofreAbierto.Visible=False
	End If
End Sub

Sub Bt_GuardarCheck_Click
	DateTime.DateFormat = "MM/dd/yyyy"
	sDate=DateTime.Date(DateTime.Now)
	sTime=DateTime.Time(DateTime.Now)
	N_Ruta=0
	c=Starter.skmt.ExecQuery("select CAT_CL_RUTA FROM kmt_info")
	If c.RowCount > 0 Then
		c.Position=0
		N_Ruta= c.GetString("CAT_CL_RUTA")
	End If
	C2=Starter.skmt.ExecQuery("select ID_ALMACEN FROM CAT_ALMACEN")
	C2.Position=0
	Id_Almacen=C2.GetString("ID_ALMACEN")
	''''''''''''''''''''''''''''''''''''NIVELES DE GASOLINA CHECK''''''''''''''''''
	If Rb_1_4.Checked Then
		Combustible="1/4"
	End If
	If Rb_2_4.Checked Then
		Combustible="2/4"
	End If
	If Rb_3_4.Checked Then
		Combustible="3/4"
	End If
	If Rb_4_4.Checked Then
		Combustible="4/4"
	End If
	''''''''''''''''''''''''''''''''''''INDICADORES DE TABLERO''''''''''''''''''
	If Cbox_Claxon.Checked=True Then
		Cbox_Claxon.Tag="1"
	Else
		Cbox_Claxon.Tag="0"
	End If
	If Cbox_Cinturon.Checked=True Then
		Cbox_Cinturon.Tag="1"
	Else
		Cbox_Cinturon.Tag="0"
	End If
	If Cbox_Parabrisas.Checked=True Then
		Cbox_Parabrisas.Tag="1"
	Else
		Cbox_Parabrisas.Tag="0"
	End If
	If Cbox_Espejos.Checked=True Then
		Cbox_Espejos.Tag="1"
	Else
		Cbox_Espejos.Tag="0"
	End If
	If Cbox_Licencia.Checked=True Then
		Cbox_Licencia.Tag="1"
	Else
		Cbox_Licencia.Tag="0"
	End If
	'''''' SEGUNDO PANEL
	If Ch_OBJETOSINE.Checked=True Then
		Ch_OBJETOSINE.Tag="1"
	Else
		Ch_OBJETOSINE.Tag="0"
	End If
	If CH_OBJMPERV.Checked=True Then
		CH_OBJMPERV.Tag="1"
	Else
		CH_OBJMPERV.Tag="0"
	End If
	If Ch_ORHERRA.Checked=True Then
		Ch_ORHERRA.Tag="1"
	Else
		Ch_ORHERRA.Tag="0"
	End If
	If Ch_UNILIMPIA.Checked=True Then
		Ch_UNILIMPIA.Tag="1"
	Else
		Ch_UNILIMPIA.Tag="0"
	End If
	If Ch_LIMPIO.Checked=True Then
		Ch_LIMPIO.Tag="1"
	Else
		Ch_LIMPIO.Tag="0"
	End If
	If Ch_BASURA.Checked=True Then
		Ch_BASURA.Tag="1"
	Else
		Ch_BASURA.Tag="0"
	End If
	If Ch_RESPON.Checked=True Then
		Ch_RESPON.Tag="1"
	Else
		Ch_RESPON.Tag="0"
	End If
	If Ch_AUDITORIA.Checked=True Then
		Ch_AUDITORIA.Tag="1"
	Else
		Ch_AUDITORIA.Tag="0"
	End If
	If Ch_HABITUAL.Checked=True Then
		Ch_HABITUAL.Tag="1"
	Else
		Ch_HABITUAL.Tag="0"
	End If
	''''' PANEL 3
	If Ch_HERRAMIENTAS.Checked=True Then
		Ch_HERRAMIENTAS.Tag="1"
	Else
		Ch_HERRAMIENTAS.Tag="0"
	End If
	If Ch_CONOS.Checked=True Then
		Ch_CONOS.Tag="1"
	Else
		Ch_CONOS.Tag="0"
	End If
	If Ch_EDOCARROCE.Checked=True Then
		Ch_EDOCARROCE.Tag="1"
	Else
		Ch_EDOCARROCE.Tag="0"
	End If
	If Ch_FUN_LUCES.Checked=True Then
		Ch_FUN_LUCES.Tag="1"
	Else
		Ch_FUN_LUCES.Tag="0"
	End If
	If Ch_PLACAS_CIRCU.Checked=True Then
		Ch_PLACAS_CIRCU.Tag="1"
	Else
		Ch_PLACAS_CIRCU.Tag="0"
	End If
	If Ch_COND_LLANTAS.Checked=True Then
		Ch_COND_LLANTAS.Tag="1"
	Else
		Ch_COND_LLANTAS.Tag="0"
	End If
	'''' PANEL 4
	If Ch_ACEITEMOTOR.Checked=True Then
		Ch_ACEITEMOTOR.Tag="1"
	Else
		Ch_ACEITEMOTOR.Tag="0"
	End If
	If Ch_ACEITEDIREC.Checked=True Then
		Ch_ACEITEDIREC.Tag="1"
	Else
		Ch_ACEITEDIREC.Tag="0"
	End If
	If Ch_NVL_REFRIGE.Checked=True Then
		Ch_NVL_REFRIGE.Tag="1"
	Else
		Ch_NVL_REFRIGE.Tag="0"
	End If
	If Ch_NVL_LIQUIDBRI.Checked=True Then
		Ch_NVL_LIQUIDBRI.Tag="1"
	Else
		Ch_NVL_LIQUIDBRI.Tag="0"
	End If
	If Ch_COND_BANMOTOR.Checked=True Then
		Ch_COND_BANMOTOR.Tag="1"
	Else
		Ch_COND_BANMOTOR.Tag="0"
	End If
	''''' PANEL 5
	If Ch_FUGASGRAL.Checked=True Then
		Ch_FUGASGRAL.Tag="1"
	Else
		Ch_FUGASGRAL.Tag="0"
	End If
	If Ch_FRENOS.Checked=True Then
		Ch_FRENOS.Tag="1"
	Else
		Ch_FRENOS.Tag="0"
	End If
	c=Starter.skmt.ExecQuery2("SELECT COUNT(*) AS CUANTOS FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?",Array As String("PLACAS") )
	c.Position=0
	PLACAS = c.GetString("CUANTOS")
	c.Close
	If PLACAS > 0 Then
		c=Starter.skmt.ExecQuery2("SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?",Array As String("PLACAS") )
		c.Position=0
		PLACAS = c.GetString("CAT_VA_VALOR")
		c.Close
	Else
		PLACAS = "0000"
	End If
	'''''''''''''''''''''''''''''''''' FOTOS  '''''''''''''''''''''''''''''''
	Private fotosOk As Int = 0
	If Not(File.Exists(File.DirInternal,"FOTO1.jpg")) Or _
			Not(File.Exists(File.DirInternal,"FOTO2.jpg")) Or _
			Not(File.Exists(File.DirInternal,"FOTO3.jpg")) Or _
			Not(File.Exists(File.DirInternal,"FOTO4.jpg")) Then
		Msgbox("Por favor tomar las 4 fotos.", "Atención") 'ignore
		Pnl_CabinaInfo.Visible=False
		Pnl_Carga.Visible=False
		Pnl_Inspec.Visible=True
		Pnl_MotorEncen.Visible=True
		Pnl_CofreAbierto.Visible=False
	Else
		fotosOk = 1
	End If
	''''''''''''''''''''''  Kilometraje inicial '''''''''''''''''
	Private kmsOk As Int = 0
	If Et_KilometrajeIni.Text="" Then
		Msgbox("Atención","Ingresa el Kilometraje Inicial") 'ignore
		Pnl_CabinaInfo.Visible=True
		Pnl_Carga.Visible=False
		Pnl_Inspec.Visible=False
		Pnl_MotorEncen.Visible=False
		Pnl_CofreAbierto.Visible=False
	Else
		kmsOk = 1
	End If
	
	If kmsOk = 1 And fotosOk = 1 Then
		CUANTOS = 0
		c = Starter.skmt.ExecQuery("SELECT COUNT(*) as CUANTOS FROM TMP_INSPECCION_AUTO_DIARIA")
		If c.RowCount > 0 Then
			c.Position = 0
			CUANTOS = c.GetString("CUANTOS")
			Log("Info checklist: " & CUANTOS)
		End If
		c.Close
		If CUANTOS = 0 Then
			Starter.skmt.ExecNonQuery("delete from TMP_INSPECCION_AUTO_DIARIA") 'Mod por CHV - 211125
			Starter.skmt.ExecNonQuery2("INSERT INTO TMP_INSPECCION_AUTO_DIARIA ( " & Chr(34) & "TMP_AUTO_RUTA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_PLACA" & Chr(34) & "," & Chr(34) & "TMP_AUTO_CEDIS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_IDALMACEN" & Chr(34) & "," & Chr(34) & "TMP_AUTO_FECHA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_KILOMETRAJE" & Chr(34) & "," & Chr(34) & "TMP_AUTO_COMBUSTIBLE" & Chr(34) & "," & Chr(34) & "TMP_AUTO_TABLERO  " & Chr(34) & "," & Chr(34) & "TMP_AUTO_CLAXON " & Chr(34) & "," & Chr(34) & "TMP_AUTO_PARABRISAS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_CINTURON " & Chr(34) & "," & Chr(34) & "TMP_AUTO_ESPEJOS " & Chr(34) & " ," & Chr(34) & "TMP_AUTO_LICENCIA " & Chr(34) & " ," & Chr(34) & "TMP_AUTO_LIB_OBJETOSINE " & Chr(34) & " ," & Chr(34) & "TMP_AUTO_LIB_OBJETOTMPERVI " & Chr(34) & "," & Chr(34) & "TMP_AUTO_ORDEN_HERRA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_UNILIMPIA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_LIMPIO " & Chr(34) & "," & Chr(34) & "TMP_AUTO_BASURA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_RESPONSABILIDAD " & Chr(34) & "," & Chr(34) & "TMP_AUTO_AUDITORIA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_HABITUAL " & Chr(34) & "," & Chr(34) & "TMP_AUTO_HERRAMIENTAS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_CONOS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_EDO_CARROCERIA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_FUN_LUCES " & Chr(34) & "," & Chr(34) & "TMP_AUTO_PLACAS_CIRCU " & Chr(34) & "," & Chr(34) & "TMP_AUTO_COND_LLANTAS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_ACEITEMOTOR " & Chr(34) & "," & Chr(34) & "TMP_AUTO_ACEITEDIREC " & Chr(34) & "," & Chr(34) & "TMP_AUTO_NVL_REFRIGERANTE " & Chr(34) & "," & Chr(34) & "TMP_AUTO_NVL_LIQUIDBRISAS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_COND_BANMOTOR " & Chr(34) & "," & Chr(34) & "TMP_AUTO_FUGASGRAL " & Chr(34) & "," & Chr(34) & "TMP_AUTO_FRENOS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_COMENTARIOS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_FOTO1" & Chr(34) & "," & Chr(34) & "TMP_AUTO_FOTO2" & Chr(34) & "," & Chr(34) & "TMP_AUTO_FOTO3" & Chr(34) & "," & Chr(34) & "TMP_AUTO_FOTO4" & Chr(34) & " ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", Array As Object (N_Ruta,PLACAS,Null,Id_Almacen,sDate,Et_KilometrajeIni.Text,Combustible,1,Cbox_Claxon.Tag,Cbox_Parabrisas.Tag,Cbox_Cinturon.Tag,Cbox_Espejos.Tag,Cbox_Licencia.Tag,Ch_OBJETOSINE.Tag,CH_OBJMPERV.Tag,Ch_ORHERRA.Tag,Ch_UNILIMPIA.Tag,Ch_LIMPIO.Tag,Ch_BASURA.Tag,Ch_RESPON.Tag,Ch_AUDITORIA.Tag,Ch_HABITUAL.Tag,Ch_HERRAMIENTAS.Tag,Ch_CONOS.Tag,Ch_EDOCARROCE.Tag,Ch_FUN_LUCES.Tag,Ch_PLACAS_CIRCU.Tag,Ch_COND_LLANTAS.Tag,Ch_ACEITEMOTOR.Tag,Ch_ACEITEDIREC.Tag,Ch_NVL_REFRIGE.Tag,Ch_NVL_LIQUIDBRI.Tag,Ch_COND_BANMOTOR.Tag,Ch_FUGASGRAL.Tag,Ch_FRENOS.Tag,Edt_COMENTARIO.TeXT))
			Log("Guardamos Kilometraje")
		Else
			Starter.skmt.ExecNonQuery("delete from TMP_INSPECCION_AUTO_DIARIA") 'Mod por CHV - 211125
			Starter.skmt.ExecNonQuery2("INSERT INTO TMP_INSPECCION_AUTO_DIARIA ( " & Chr(34) & "TMP_AUTO_RUTA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_PLACA" & Chr(34) & "," & Chr(34) & "TMP_AUTO_CEDIS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_IDALMACEN" & Chr(34) & "," & Chr(34) & "TMP_AUTO_FECHA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_KILOMETRAJE" & Chr(34) & "," & Chr(34) & "TMP_AUTO_COMBUSTIBLE" & Chr(34) & "," & Chr(34) & "TMP_AUTO_TABLERO  " & Chr(34) & "," & Chr(34) & "TMP_AUTO_CLAXON " & Chr(34) & "," & Chr(34) & "TMP_AUTO_PARABRISAS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_CINTURON " & Chr(34) & "," & Chr(34) & "TMP_AUTO_ESPEJOS " & Chr(34) & " ," & Chr(34) & "TMP_AUTO_LICENCIA " & Chr(34) & " ," & Chr(34) & "TMP_AUTO_LIB_OBJETOSINE " & Chr(34) & " ," & Chr(34) & "TMP_AUTO_LIB_OBJETOTMPERVI " & Chr(34) & "," & Chr(34) & "TMP_AUTO_ORDEN_HERRA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_UNILIMPIA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_LIMPIO " & Chr(34) & "," & Chr(34) & "TMP_AUTO_BASURA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_RESPONSABILIDAD " & Chr(34) & "," & Chr(34) & "TMP_AUTO_AUDITORIA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_HABITUAL " & Chr(34) & "," & Chr(34) & "TMP_AUTO_HERRAMIENTAS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_CONOS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_EDO_CARROCERIA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_FUN_LUCES " & Chr(34) & "," & Chr(34) & "TMP_AUTO_PLACAS_CIRCU " & Chr(34) & "," & Chr(34) & "TMP_AUTO_COND_LLANTAS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_ACEITEMOTOR " & Chr(34) & "," & Chr(34) & "TMP_AUTO_ACEITEDIREC " & Chr(34) & "," & Chr(34) & "TMP_AUTO_NVL_REFRIGERANTE " & Chr(34) & "," & Chr(34) & "TMP_AUTO_NVL_LIQUIDBRISAS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_COND_BANMOTOR " & Chr(34) & "," & Chr(34) & "TMP_AUTO_FUGASGRAL " & Chr(34) & "," & Chr(34) & "TMP_AUTO_FRENOS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_COMENTARIOS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_FOTO1" & Chr(34) & "," & Chr(34) & "TMP_AUTO_FOTO2" & Chr(34) & "," & Chr(34) & "TMP_AUTO_FOTO3" & Chr(34) & "," & Chr(34) & "TMP_AUTO_FOTO4" & Chr(34) & " ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", Array As Object (N_Ruta,PLACAS,Null,Id_Almacen,sDate,Et_KilometrajeIni.Text,Combustible,1,Cbox_Claxon.Tag,Cbox_Parabrisas.Tag,Cbox_Cinturon.Tag,Cbox_Espejos.Tag,Cbox_Licencia.Tag,Ch_OBJETOSINE.Tag,CH_OBJMPERV.Tag,Ch_ORHERRA.Tag,Ch_UNILIMPIA.Tag,Ch_LIMPIO.Tag,Ch_BASURA.Tag,Ch_RESPON.Tag,Ch_AUDITORIA.Tag,Ch_HABITUAL.Tag,Ch_HERRAMIENTAS.Tag,Ch_CONOS.Tag,Ch_EDOCARROCE.Tag,Ch_FUN_LUCES.Tag,Ch_PLACAS_CIRCU.Tag,Ch_COND_LLANTAS.Tag,Ch_ACEITEMOTOR.Tag,Ch_ACEITEDIREC.Tag,Ch_NVL_REFRIGE.Tag,Ch_NVL_LIQUIDBRI.Tag,Ch_COND_BANMOTOR.Tag,Ch_FUGASGRAL.Tag,Ch_FRENOS.Tag,Edt_COMENTARIO.TeXT))
			Log("Guardamos Kilometraje")
		End If
		OK_CheckList = 1
		Msgbox("DATOS GUARDADOS CON EXITO ","") 'ignore
		'Proyecto gps
		Subs.bitacora(Subs.fechanormal(DateTime.Now),B4XPages.MainPage.principal.usuario,Subs.traeAlmacen,B4XPages.MainPage.principal.l_ruta.Text,"Salida almacen", "",Subs.fechanormal(DateTime.Now),Subs.fechanormal(DateTime.Now),Starter.lat_gps,Starter.lon_gps,"2","","")
		Subs.iniciaActividad("Principal")
'		B4XPages.ShowPage("Principal")
	End If
End Sub

Sub GUARDA_TEMPORAL
	DateTime.DateFormat = "MM/dd/yyyy"
	sDate=DateTime.Date(DateTime.Now)
	sTime=DateTime.Time(DateTime.Now)
	c=Starter.skmt.ExecQuery("select CAT_CL_RUTA FROM kmt_info")
	c.Position=0
	N_Ruta= c.GetString("CAT_CL_RUTA")
	C2=Starter.skmt.ExecQuery("select ID_ALMACEN FROM CAT_ALMACEN")
	C2.Position=0
	Id_Almacen=C2.GetString("ID_ALMACEN")
	''''''''''''''''''''''''''''''''''''NIVELES DE GASOLINA CHECK''''''''''''''''''
	If Rb_1_4.Checked Then
		Combustible="1/4"
	End If
	If Rb_2_4.Checked Then
		Combustible="2/4"
	End If
	If Rb_3_4.Checked Then
		Combustible="3/4"
	End If
	If Rb_4_4.Checked Then
		Combustible="4/4"
	End If
	''''''''''''''''''''''''''''''''''''INDICADORES DE TABLERO''''''''''''''''''
	If Cbox_Claxon.Checked=True Then
		Cbox_Claxon.Tag="1"
	Else
		Cbox_Claxon.Tag="0"
	End If
	
	If Cbox_Cinturon.Checked=True Then
		Cbox_Cinturon.Tag="1"
	Else
		Cbox_Cinturon.Tag="0"
	End If
	
	If Cbox_Parabrisas.Checked=True Then
		Cbox_Parabrisas.Tag="1"
	Else
		Cbox_Parabrisas.Tag="0"
	End If
	
	If Cbox_Espejos.Checked=True Then
		Cbox_Espejos.Tag="1"
	Else
		Cbox_Espejos.Tag="0"
	End If
	
	If Cbox_Licencia.Checked=True Then
		Cbox_Licencia.Tag="1"
	Else
		Cbox_Licencia.Tag="0"
	End If
	'''''' SEGUNDO PANEL
	If Ch_OBJETOSINE.Checked=True Then
		Ch_OBJETOSINE.Tag="1"
	Else
		Ch_OBJETOSINE.Tag="0"
	End If
	
	If CH_OBJMPERV.Checked=True Then
		CH_OBJMPERV.Tag="1"
	Else
		CH_OBJMPERV.Tag="0"
	End If

	If Ch_ORHERRA.Checked=True Then
		Ch_ORHERRA.Tag="1"
	Else
		Ch_ORHERRA.Tag="0"
	End If
	
	If Ch_UNILIMPIA.Checked=True Then
		Ch_UNILIMPIA.Tag="1"
	Else
		Ch_UNILIMPIA.Tag="0"
	End If
	
	If Ch_LIMPIO.Checked=True Then
		Ch_LIMPIO.Tag="1"
	Else
		Ch_LIMPIO.Tag="0"
	End If
	
	If Ch_BASURA.Checked=True Then
		Ch_BASURA.Tag="1"
	Else
		Ch_BASURA.Tag="0"
	End If
	
	If Ch_RESPON.Checked=True Then
		Ch_RESPON.Tag="1"
	Else
		Ch_RESPON.Tag="0"
	End If
	
	If Ch_AUDITORIA.Checked=True Then
		Ch_AUDITORIA.Tag="1"
	Else
		Ch_AUDITORIA.Tag="0"
	End If
	
	If Ch_HABITUAL.Checked=True Then
		Ch_HABITUAL.Tag="1"
	Else
		Ch_HABITUAL.Tag="0"
	End If
	''''' PANEL 3
	If Ch_HERRAMIENTAS.Checked=True Then
		Ch_HERRAMIENTAS.Tag="1"
	Else
		Ch_HERRAMIENTAS.Tag="0"
	End If
	If Ch_CONOS.Checked=True Then
		Ch_CONOS.Tag="1"
	Else
		Ch_CONOS.Tag="0"
	End If
	
	If Ch_EDOCARROCE.Checked=True Then
		Ch_EDOCARROCE.Tag="1"
	Else
		Ch_EDOCARROCE.Tag="0"
	End If
	
	If Ch_FUN_LUCES.Checked=True Then
		Ch_FUN_LUCES.Tag="1"
	Else
		Ch_FUN_LUCES.Tag="0"
	End If
	
	If Ch_PLACAS_CIRCU.Checked=True Then
		Ch_PLACAS_CIRCU.Tag="1"
	Else
		Ch_PLACAS_CIRCU.Tag="0"
	End If
	
	If Ch_COND_LLANTAS.Checked=True Then
		Ch_COND_LLANTAS.Tag="1"
	Else
		Ch_COND_LLANTAS.Tag="0"
	End If
	
	'''' PANEL 4
	If Ch_ACEITEMOTOR.Checked=True Then
		Ch_ACEITEMOTOR.Tag="1"
	Else
		Ch_ACEITEMOTOR.Tag="0"
	End If
	
	If Ch_ACEITEDIREC.Checked=True Then
		Ch_ACEITEDIREC.Tag="1"
	Else
		Ch_ACEITEDIREC.Tag="0"
	End If
	
	If Ch_NVL_REFRIGE.Checked=True Then
		Ch_NVL_REFRIGE.Tag="1"
	Else
		Ch_NVL_REFRIGE.Tag="0"
	End If
	
	If Ch_NVL_LIQUIDBRI.Checked=True Then
		Ch_NVL_LIQUIDBRI.Tag="1"
	Else
		Ch_NVL_LIQUIDBRI.Tag="0"
	End If
	
	If Ch_COND_BANMOTOR.Checked=True Then
		Ch_COND_BANMOTOR.Tag="1"
	Else
		Ch_COND_BANMOTOR.Tag="0"
	End If
	''''' PANEL 5
	If Ch_FUGASGRAL.Checked=True Then
		Ch_FUGASGRAL.Tag="1"
	Else
		Ch_FUGASGRAL.Tag="0"
	End If
	
	If Ch_FRENOS.Checked=True Then
		Ch_FRENOS.Tag="1"
	Else
		Ch_FRENOS.Tag="0"
	End If
	
	c=Starter.skmt.ExecQuery2("SELECT COUNT(*) AS CUANTOS FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?",Array As String("PLACAS") )
	c.Position=0
	PLACAS = c.GetString("CUANTOS")
	c.Close
	
	If PLACAS > 0 Then
		c=Starter.skmt.ExecQuery2("SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?",Array As String("PLACAS") )
		c.Position=0
		PLACAS = c.GetString("CAT_VA_VALOR")
		c.Close
	Else
		PLACAS = "0000"
	End If
	Starter.skmt.ExecNonQuery("delete from TMP_INSPECCION_AUTO_DIARIA") 'Mod por CHV - 211125
	Starter.skmt.ExecNonQuery2("INSERT INTO TMP_INSPECCION_AUTO_DIARIA( " & Chr(34) & "TMP_AUTO_RUTA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_PLACA" & Chr(34) & "," & Chr(34) & "TMP_AUTO_CEDIS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_IDALMACEN" & Chr(34) & "," & Chr(34) & "TMP_AUTO_FECHA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_KILOMETRAJE" & Chr(34) & "," & Chr(34) & "TMP_AUTO_COMBUSTIBLE" & Chr(34) & "," & Chr(34) & "TMP_AUTO_TABLERO  " & Chr(34) & "," & Chr(34) & "TMP_AUTO_CLAXON " & Chr(34) & "," & Chr(34) & "TMP_AUTO_PARABRISAS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_CINTURON " & Chr(34) & "," & Chr(34) & "TMP_AUTO_ESPEJOS " & Chr(34) & " ," & Chr(34) & "TMP_AUTO_LICENCIA " & Chr(34) & " ," & Chr(34) & "TMP_AUTO_LIB_OBJETOSINE " & Chr(34) & " ," & Chr(34) & "TMP_AUTO_LIB_OBJETOTMPERVI " & Chr(34) & "," & Chr(34) & "TMP_AUTO_ORDEN_HERRA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_UNILIMPIA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_LIMPIO " & Chr(34) & "," & Chr(34) & "TMP_AUTO_BASURA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_RESPONSABILIDAD " & Chr(34) & "," & Chr(34) & "TMP_AUTO_AUDITORIA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_HABITUAL " & Chr(34) & "," & Chr(34) & "TMP_AUTO_HERRAMIENTAS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_CONOS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_EDO_CARROCERIA " & Chr(34) & "," & Chr(34) & "TMP_AUTO_FUN_LUCES " & Chr(34) & "," & Chr(34) & "TMP_AUTO_PLACAS_CIRCU " & Chr(34) & "," & Chr(34) & "TMP_AUTO_COND_LLANTAS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_ACEITEMOTOR " & Chr(34) & "," & Chr(34) & "TMP_AUTO_ACEITEDIREC " & Chr(34) & "," & Chr(34) & "TMP_AUTO_NVL_REFRIGERANTE " & Chr(34) & "," & Chr(34) & "TMP_AUTO_NVL_LIQUIDBRISAS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_COND_BANMOTOR " & Chr(34) & "," & Chr(34) & "TMP_AUTO_FUGASGRAL " & Chr(34) & "," & Chr(34) & "TMP_AUTO_FRENOS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_COMENTARIOS " & Chr(34) & "," & Chr(34) & "TMP_AUTO_FOTO1" & Chr(34) & "," & Chr(34) & "TMP_AUTO_FOTO2" & Chr(34) & "," & Chr(34) & "TMP_AUTO_FOTO3" & Chr(34) & "," & Chr(34) & "TMP_AUTO_FOTO4" & Chr(34) & " ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", Array As Object (N_Ruta,PLACAS,Null,Id_Almacen,sDate,Et_KilometrajeIni.Text,Combustible,1,Cbox_Claxon.Tag,Cbox_Parabrisas.Tag,Cbox_Cinturon.Tag,Cbox_Espejos.Tag,Cbox_Licencia.Tag,Ch_OBJETOSINE.Tag,CH_OBJMPERV.Tag,Ch_ORHERRA.Tag,Ch_UNILIMPIA.Tag,Ch_LIMPIO.Tag,Ch_BASURA.Tag,Ch_RESPON.Tag,Ch_AUDITORIA.Tag,Ch_HABITUAL.Tag,Ch_HERRAMIENTAS.Tag,Ch_CONOS.Tag,Ch_EDOCARROCE.Tag,Ch_FUN_LUCES.Tag,Ch_PLACAS_CIRCU.Tag,Ch_COND_LLANTAS.Tag,Ch_ACEITEMOTOR.Tag,Ch_ACEITEDIREC.Tag,Ch_NVL_REFRIGE.Tag,Ch_NVL_LIQUIDBRI.Tag,Ch_COND_BANMOTOR.Tag,Ch_FUGASGRAL.Tag,Ch_FRENOS.Tag,Edt_COMENTARIO.TeXT))
End Sub

Sub b_guardar_Click
	If Bt_Foto1.Tag="2" Then
		Im_1.Bitmap = LoadBitmap(File.DirInternal, "FOTO1.jpg")
		Pnl_Fotos.Visible=False
		Bt_Foto1.Visible=True
		Bt_Foto2.Visible=True
		Bt_Foto3.Visible=True
		Bt_Foto4.Visible=True
		Pnl_Fotos.Visible=False
		Bt_GuardarCheck.Visible=True
	End If
	
	If Bt_Foto2.Tag="2" Then
		Im2.Bitmap = LoadBitmap(File.DirInternal, "FOTO2.jpg")
		Pnl_Fotos.Visible=False
		Bt_Foto1.Visible=True
		Bt_Foto2.Visible=True
		Bt_Foto3.Visible=True
		Bt_Foto4.Visible=True
		Pnl_Fotos.Visible=False
		Bt_GuardarCheck.Visible=True
	End If
	If Bt_Foto3.Tag="2" Then
		Im3.Bitmap = LoadBitmap(File.DirInternal, "FOTO3.jpg")
		Pnl_Fotos.Visible=False
		Bt_Foto1.Visible=True
		Bt_Foto2.Visible=True
		Bt_Foto3.Visible=True
		Bt_Foto4.Visible=True
		Pnl_Fotos.Visible=False
		Bt_GuardarCheck.Visible=True
	End If
	
	If Bt_Foto4.Tag="2" Then
		Im4.Bitmap = LoadBitmap(File.DirInternal, "FOTO4.jpg")
		Pnl_Fotos.Visible=False
		Bt_Foto1.Visible=True
		Bt_Foto2.Visible=True
		Bt_Foto3.Visible=True
		Bt_Foto4.Visible=True
		Pnl_Fotos.Visible=False
		Bt_GuardarCheck.Visible=True
	End If
End Sub

Sub Bt_Foto1_Click
	foto.quien_llamo = "1"
	GUARDA_TEMPORAL
	TOMO_FOTO1 = 1
	StartActivity("foto")
End Sub

Sub Bt_Foto2_Click
	foto.quien_llamo = "2"
	GUARDA_TEMPORAL
	StartActivity("foto")
End Sub

Sub Bt_Foto3_Click
	foto.quien_llamo = "3"
	GUARDA_TEMPORAL
	TOMO_FOTO3 = 1
	StartActivity("foto")
End Sub

Sub Bt_Foto4_Click
	foto.quien_llamo = "4"
	GUARDA_TEMPORAL
	TOMO_FOTO4 = 1
	StartActivity("foto")
End Sub

Sub LBL_REGRESA_Click
	Pnl_Fotos.Visible=False
	Bt_Foto1.Visible=True
	Bt_Foto2.Visible=True
	Bt_Foto3.Visible=True
	Bt_Foto4.Visible=True
	Bt_GuardarCheck.Visible=True
End Sub

''' SUBIR PANEL.
Sub IME_HeightChanged(NewHeight As Int, OldHeight As Int)
	' para subir la entrada de datos y que este encima del teclado
	'Log("NewHeight " & NewHeight & " OldHeight " & OldHeight)
End Sub

Sub Activity_KeyPress (key As Int) As Boolean 'ignore
	' BACK key pressed
	If key=KeyCodes.KEYCODE_BACK Then
		Pnl_CabinaInfo.Visible=False
		Pnl_Carga.Visible=False
		Pnl_Inspec.Visible=True
		Pnl_MotorEncen.Visible=True
		Pnl_CofreAbierto.Visible=False
		Return False
		'End If
	End If
	' Returning False signals the system to handle the key
End Sub
