Subversion Repositories eFlore/Applications.cel

Rev

Rev 2464 | Rev 2468 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2464 Rev 2465
Line 45... Line 45...
45
 
45
 
46
		$values = array();
46
		$values = array();
47
		foreach ($ids_images_filtrees as $id_img) {
47
		foreach ($ids_images_filtrees as $id_img) {
48
			foreach ($infos_observations_filtrees as $infos_obs) {
48
			foreach ($infos_observations_filtrees as $infos_obs) {
49
				$id_obs = $infos_obs['id_observation'];
49
				$id_obs = $infos_obs['id_observation'];
50
				$dateTransmission = $infos_obs['date_transmission'];
50
				$dateTransmission = ($infos_obs['date_transmission'] != '') ? $infos_obs['date_transmission'] : 'NULL' ;
51
				$transmission = $infos_obs['transmission'];
51
				$transmission = $infos_obs['transmission'];
52
				$values[] = "($id_img, $id_obs, NOW(), $dateTransmission, $transmission)";
52
				$values[] = "($id_img, $id_obs, NOW(), $dateTransmission, $transmission)";
53
			}
53
			}
54
		}
54
		}
55
		$clauseValues = implode(',', $values);
55
		$clauseValues = implode(',', $values);
56
		$requete = 'INSERT INTO cel_images (id_image, ce_observation, date_liaison, date_transmission, transmission) '.
56
		$requete = 'INSERT INTO cel_images (id_image, ce_observation, date_liaison, date_transmission, transmission) '.
57
			"VALUES $clauseValues ".
57
			"VALUES $clauseValues ".
58
			'ON DUPLICATE KEY UPDATE '.
58
			'ON DUPLICATE KEY UPDATE '.
59
			'	ce_observation = VALUES(ce_observation), '.
59
			'	ce_observation = VALUES(ce_observation), '.
60
			'	date_liaison = NOW(), '.
60
			'	date_liaison = NOW(), '.
61
			'	date_transmission = VALUES(date_tranmission), '.
61
			'	date_transmission = VALUES(date_transmission), '.
62
			'	transmission = VALUES(tranmission) '.
62
			'	transmission = VALUES(transmission) '.
63
			' -- ' . __FILE__ . ':' . __LINE__;
63
			' -- ' . __FILE__ . ':' . __LINE__;
64
		$resultat = Cel::db()->executer($requete);
64
		$resultat = Cel::db()->executer($requete);
65
		if ($resultat) {
65
		if ($resultat) {
66
			exit('OK');
66
			exit('OK');