Je fourni la base de données, si ça peut aider / éclaircir.
-- phpMyAdmin SQL Dump
-- version 2.11.5
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Dim 05 Octobre 2008 à 21:04
-- Version du serveur: 5.0.51
-- Version de PHP: 5.2.5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Base de données: `tempstravaux`
--
-- --------------------------------------------------------
--
-- Structure de la table `agent`
--
CREATE TABLE `agent` (
`id_agent` int(11) NOT NULL auto_increment,
`nomAgent` varchar(25) NOT NULL,
PRIMARY KEY (`id_agent`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Contenu de la table `agent`
--
INSERT INTO `agent` (`id_agent`, `nomAgent`) VALUES
(1, 'M. Fegnoux'),
(2, 'M. Duval');
-- --------------------------------------------------------
--
-- Structure de la table `client`
--
CREATE TABLE `client` (
`id_client` int(11) NOT NULL auto_increment,
`nomClient` varchar(25) NOT NULL,
PRIMARY KEY (`id_client`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
--
-- Contenu de la table `client`
--
INSERT INTO `client` (`id_client`, `nomClient`) VALUES
(1, ' '),
(2, 'M. Hughes'),
(3, 'M. Goury');
-- --------------------------------------------------------
--
-- Structure de la table `sous_type`
--
CREATE TABLE `sous_type` (
`id_sstype` int(11) NOT NULL auto_increment,
`STdesignation` varchar(25) NOT NULL,
PRIMARY KEY (`id_sstype`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
--
-- Contenu de la table `sous_type`
--
INSERT INTO `sous_type` (`id_sstype`, `STdesignation`) VALUES
(1, 'Suivi individuel'),
(2, 'Au bureau'),
(3, 'Chez l''adhérent'),
(4, 'Demande renseignements'),
(5, 'Actualités'),
(6, 'Fiche de gestion'),
(7, 'Dépannage té');
-- --------------------------------------------------------
--
-- Structure de la table `taxe`
--
CREATE TABLE `taxe` (
`id_taxe` int(11) NOT NULL auto_increment,
`taux` float NOT NULL,
PRIMARY KEY (`id_taxe`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
--
-- Contenu de la table `taxe`
--
INSERT INTO `taxe` (`id_taxe`, `taux`) VALUES
(1, 2.1),
(2, 5.5),
(3, 19.6);
-- --------------------------------------------------------
--
-- Structure de la table `travaux`
--
CREATE TABLE `travaux` (
`id` int(11) NOT NULL auto_increment,
`id_agent` int(11) NOT NULL,
`date_d` datetime NOT NULL,
`nbr_min` int(11) NOT NULL,
`id_type` int(11) NOT NULL,
`id_sstype` int(11) NOT NULL,
`id_client` int(11) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
--
-- Contenu de la table `travaux`
--
INSERT INTO `travaux` (`id`, `id_agent`, `date_d`, `nbr_min`, `id_type`, `id_sstype`, `id_client`) VALUES
(1, 1, '1999-03-02 08:00:00', 240, 1, 1, 2),
(2, 1, '1999-03-02 14:00:00', 60, 5, 4, 2),
(3, 1, '1999-03-02 15:00:00', 180, 2, 2, 3),
(4, 1, '1999-03-03 08:00:00', 150, 1, 1, 3),
(5, 1, '1999-03-03 10:30:00', 105, 3, 5, 1),
(6, 1, '1999-03-03 13:30:00', 270, 4, 6, 1);
-- --------------------------------------------------------
--
-- Structure de la table `type`
--
CREATE TABLE `type` (
`id_type` int(11) NOT NULL auto_increment,
`Tdesignation` varchar(25) NOT NULL,
`prix_h` int(11) NOT NULL,
`id_taxe` int(11) NOT NULL,
`facturable` int(11) NOT NULL,
PRIMARY KEY (`id_type`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
--
-- Contenu de la table `type`
--
INSERT INTO `type` (`id_type`, `Tdesignation`, `prix_h`, `id_taxe`, `facturable`) VALUES
(1, 'Suivi J.A', 20, 3, 1),
(2, 'Comptabilité', 15, 3, 1),
(3, 'Lecture / autoformation', 0, 3, 0),
(4, 'Méthodologie', 0, 3, 0),
(5, 'Autre', 20, 3, 1),
(6, 'Maintenance logiciel', 0, 3, 0);