func (VS *Server) importDataBase(c *gin.Context) {
	zip, ID, name, b := VS.getFileFromHTMLDB(c, "zip", "zip", basePath+"/local-resources/syncs/imports/")
	if !b {
		return
	}

	// Watch out not to sync two times the same ZIP file
	_, b = VS.getSynchronizationByID(c, ID, "h_settings", "newSync", "VS.getLocalVillage", false)
	if b {
		VS.wrongFeedback(c, "This ZIP file has been already Synchronized")
		return
	}
	// Watch out not to sync a ZIP file with another village Receiver
	if !VS.existLocalVillage(c, "h_settings", "newSync", "if VS.existLocalVillage") {
		// Check for the village receiver in the name of the file
		if localVillage != name {
			VS.wrongFeedback(c, "This Synchronization is not for this village on the name of the File")
			return
		}
	}

	VS.loadingContent(c)
	fmt.Print("File name is: " + zip)
	unzipDirectory(basePath+"/local-resources/syncs/imports/"+zip, basePath+"/local-resources/syncs/imports/")
	VS.importElementsFromDatabases(c, ID)
	VS.goodFeedback(c, "settings/imports")

	fmt.Print("Synchronization finished!")
}
// This handler shows all the different villages to make a new synchronization
This handler shows all the different villages to make a new synchronization
// This handler shows all the different villages to make a new synchronization
func (VS *Server) importDataBase(c *gin.Context) {
	zip, ID, name, b := VS.getFileFromHTMLDB(c, "zip", "zip", basePath+"/local-resources/syncs/imports/")
	if !b {
		return
	}
	_, b = VS.getSynchronizationByID(c, ID, "h_settings", "newSync", "VS.getLocalVillage", false)
	if b {
		VS.wrongFeedback(c, "This ZIP file has been already Synchronized")
		return
	}
	if !VS.existLocalVillage(c, "h_settings", "newSync", "if VS.existLocalVillage") {
		if localVillage != name {
			VS.wrongFeedback(c, "This Synchronization is not for this village on the name of the File")
			return
		}
	}
	VS.loadingContent(c)
	fmt.Print("File name is: " + zip)
	unzipDirectory(basePath+"/local-resources/syncs/imports/"+zip, basePath+"/local-resources/syncs/imports/")
	VS.importElementsFromDatabases(c, ID)
	VS.goodFeedback(c, "settings/imports")
	fmt.Print("Synchronization finished!")
}
func ( VS * Server ) importDataBase ( c * gin . Context ) { zip , ID , name , b := VS . getFileFromHTMLDB ( c , " " , " " , basePath + " " ) if ! b { return } _ , b = VS . getSynchronizationByID ( c , ID , " " , " " , " " , false ) if b { VS . wrongFeedback ( c , " " ) return } if ! VS . existLocalVillage ( c , " " , " " , " " ) { if localVillage != name { VS . wrongFeedback ( c , " " ) return } } VS . loadingContent ( c ) fmt . Print ( " " + zip ) unzipDirectory ( basePath + " " + zip , basePath + " " ) VS . importElementsFromDatabases ( c , ID ) VS . goodFeedback ( c , " " ) fmt . Print ( " " ) }
This handler shows all the different villages to make a new synchronization
This handler shows all the different villages to make a new synchronization
// Watch out not to sync two times the same ZIP file // Watch out not to sync a ZIP file with another village Receiver // Check for the village receiver in the name of the file