Пример #1
0
	if(!$image) {
		$error_signe['image']  	= '*';
		$msginfo = 'Image non enregistré';
		$a = 4;
		break;
	}	
	
	$tcat = new CTableImage(array('etat'=>$etat, 'image'=>$image));
	$tcat->insert();
	$msginfo = 'Image bien ajoutée';
	$a = 0;
	break;
	
case 5 : // Modifier 1
	if(!empty($_GET['id'])) $id = $_GET['id'];
	$timg 		= new CTableImage(array('id'=>$id));
	$img  		= $timg->select_row();
	$etat  		= $img['etat'];
	$image  	= $img['image'];
	break;
		
case 55 : // Modifier 2
	if(!empty($_POST['id'])) 		$id 		= $_POST['id'];
	if(!empty($_POST['etat'])) 		$etat 		= $_POST['etat'];
	
	if ($error_type > 0) {
		//erreur de type champ non valide
		$msginfo = 'Champ non valide';
		break;
	}
	
Пример #2
0
	
	break;
case 7:
	if(!empty($_GET['id'])) $id = $_GET['id'];
	$timg  = new CTableImage(array('id'=>$id));
	$image   = $timg->select_row();
	
	CBdd::update('UPDATE image SET defaut = 0 WHERE defaut = 1 AND idgal = '.$image['idgal']);
	CBdd::update('UPDATE image SET defaut = 1 WHERE id = '.$id.' AND idgal = '.$image['idgal']);
	
	$a = 0;
	
	break;
case 8 : // Modifier etat diaporama
	if(!empty($_GET['id'])) $id = $_GET['id'];
	$pag = new CTableImage(array('id'=>$id));
	$pag ->reverse_cmtr();
	break;
}
/*------------------------------------------------------
		A FAIRE DANS TOUS LES CAS
--------------------------------------------------------*/
if(!isset($_SESSION['idgal'])) {
	$_SESSION['idgal'] = 0;
}
$r_image = CTableImage::select('*', "idgal = ".$_SESSION['idgal'], $order);

?>
<!-- InstanceEndEditable -->
<div id="mainwrap">
  <div id="header"><?php include("../nav/header.php"); ?></div>