<?php
// ACTION ADD CONFIG
// $champs = array()
function tep_add_conf($p,$_GET,$_POST,$prefix, $champs, $table,$link_retour){
	if(DEBUG) if(!tep_not_null($_GET['module'])) return "var absente";
	foreach ($champs as $value)
		if (!empty($leschamps)){
			$leschamps .= ", ".$value;
			$lesvalues .= ", ".$_POST[$value];
		}
		else  {
			$leschamps .= $value;
			$lesvalues .= $_POST[$value];
		}
	require_once("include/class/class.configfile.php");
	if (!etat_files(ADD_PATH_ADMIN.$table)) return "<p class='erreur'>".ERROR.THE_FILES.DOES_NOT_EXIST." ". WRITE_NOT_POSSIBLE."</p>";

			$query =" INSERT INTO ".$table
			 .' ( '.$leschamps.' )'
			 .' VALUES  ( '.$lesvalues.' ) ';

		$g.=sql ('INSERT',ADD_PATH_ADMIN.$table,$prefix,$query,'');
	$g.='<a href="'.$link_retour.'" alt="'.RETOUR.'" >'.RETOUR.'</a>';
	return $g;
}
?>
