Subversion Repositories eFlore/Applications.cel

Rev

Rev 1829 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1829 Rev 1831
Line 142... Line 142...
142
		}
142
		}
143
		return;
143
		return;
144
	}
144
	}
145
}
145
}
146
initOpenDB();
146
initOpenDB();
147
if (db.transaction) {
147
if (db !== undefined) {
148
	db.transaction(function(tx) {
148
	db.transaction(function(tx) {
149
		//tx.executeSql('DROP TABLE IMG');
149
		//tx.executeSql('DROP TABLE IMG');
150
		tx.executeSql('CREATE TABLE IF NOT EXISTS IMG (id unique, num unique, nom, parent, base64, miniature)');
150
		tx.executeSql('CREATE TABLE IF NOT EXISTS IMG (id unique, num unique, nom, parent, base64, miniature)');
151
	});
151
	});
152
}
152
}
Line 242... Line 242...
242
	var cle_obs = data.getAttribute('data-obs-num'),
242
	var cle_obs = data.getAttribute('data-obs-num'),
243
		obs = JSON.parse(bdd.getItem(cle_obs)),
243
		obs = JSON.parse(bdd.getItem(cle_obs)),
244
		nbre = bdd.length,
244
		nbre = bdd.length,
245
		a_supprimer = new Array();
245
		a_supprimer = new Array();
Line 246... Line 246...
246
	
246
	
247
	if (db.transaction) {
247
	if (db !== undefined) {
248
		db.transaction(function(tx) {
248
		db.transaction(function(tx) {
249
			tx.executeSql('DELETE FROM IMG WHERE parent LIKE ?', [cle_obs]);
249
			tx.executeSql('DELETE FROM IMG WHERE parent LIKE ?', [cle_obs]);
250
		});
250
		});
251
	}
251
	}
Line 259... Line 259...
259
	
259
	
260
	chargerListeObs();
260
	chargerListeObs();
Line 261... Line 261...
261
}
261
}
262
 
262
 
263
function detailsObs(data) {
263
function detailsObs(data) {
264
	if (db.transaction) {
264
	if (db !== undefined) {
265
		var num_obs = data.getAttribute('data-obs-num');
265
		var num_obs = data.getAttribute('data-obs-num');
Line 266... Line 266...
266
		var obs = JSON.parse(bdd.getItem(num_obs));
266
		var obs = JSON.parse(bdd.getItem(num_obs));
Line 709... Line 709...
709
}
709
}
Line 710... Line 710...
710
 
710
 
711
function stockerObsData(obs) {
711
function stockerObsData(obs) {
712
	var img_noms = new Array(),
712
	var img_noms = new Array(),
-
 
713
		img_codes = new Array();
713
		img_codes = new Array();
714
	if (db !== undefined) {
714
	db.transaction(function(tx) {
715
		db.transaction(function(tx) {
715
		tx.executeSql('SELECT * FROM IMG WHERE parent LIKE ?', [obs.num], function(tx, results) {
716
			tx.executeSql('SELECT * FROM IMG WHERE parent LIKE ?', [obs.num], function(tx, results) {
716
			var nbre = results.rows.length;
717
				var nbre = results.rows.length;
717
			for (var i = 0; i < nbre; i++) {
718
				for (var i = 0; i < nbre; i++) {
718
				photo = results.rows.item(i);
719
					photo = results.rows.item(i);
719
				img_noms.push(photo.nom);
720
					img_noms.push(photo.nom);
720
				img_codes.push(photo.base64);
721
					img_codes.push(photo.base64);
721
			}
722
				}
722
		}, null);
723
			}, null);
-
 
724
		});	
Line 723... Line 725...
723
	});	
725
	}
724
 
726
 
725
	$('#details-obs').data(obs.num, {
727
	$('#details-obs').data(obs.num, {