dolibarr/htdocs/comm/projet/fiche.php3
Rodolphe Quiedeville e2269d5bbf Initial release
2002-04-29 18:01:16 +00:00

137 lines
3.6 KiB
PHP

<?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
require("./pre.inc.php3");
require("../../lib/functions.inc.php3");
require("./project.class.php3");
require("../propal.class.php3");
llxHeader("","../");
print "<table width=\"100%\">";
print "<tr><td>Projets</td>";
print "</table>";
$bc[0]="bgcolor=\"#90c090\"";
$bc[1]="bgcolor=\"#b0e0b0\"";
$db = new Db();
if ($sortfield == "") {
$sortfield="lower(p.label)";
}
if ($sortorder == "") {
$sortorder="ASC";
}
$yn["t"] = "oui";
$yn["f"] = "non";
if ($page == -1) { $page = 0 ; }
$limit = 26;
$offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
if ($action == 'create') {
?>
<form action="index.php3" method="post">
<table border=1 cellpadding="1" cellspacing="0">
<input type="hidden" name="action" value="create">
<tr><td>Société</td><td>
<?PHP print '<input type="text" name="socidp" value="'.$socidp.'">'; ?>
</td></tr>
<?PHP
print '<tr><td>Créateur</td><td>'.$user->fullname.'</td></tr>';
?>
<tr><td>Ref</td><td><input type="text" name="ref"></td></tr>
<tr><td>Titre</td><td><input type="text" name="title"></td></tr>
<tr><td colspan="2"><input type="submit"></td></tr>
</table>
</form>
<?PHP
} else {
$propales = array();
$projet = new Project();
$projet->fetch($db, $id);
print '<table border=1 cellpadding="1" cellspacing="0">';
print '<tr><td>Société</td><td></td></tr>';
print '<tr><td>Ref</td><td>'.$projet->ref.'</td></tr>';
print '<tr><td>Titre</td><td>'.$projet->title.'</td></tr>';
print '</table>';
$propales = $projet->get_propal_list($db);
if (sizeof($propales)>0 && is_array($propales)) {
print '<p>Listes des propales associées au projet';
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
print "<TR bgcolor=\"#e0e0e0\">";
print "<TD>Réf</TD>";
print '<TD>Date</TD>';
print '<TD align="right">Prix</TD>';
print '<TD align="center">Statut</TD>';
print '</TR>';
for ($i = 0; $i<sizeof($propales);$i++){
$propale = new Propal();
$propale->fetch($db, $propales[$i]);
$var=!$var;
print "<TR $bc[$var]>";
print "<TD><a href=\"../propal.php3?propalid=$propale->id\">$propale->ref</a></TD>\n";
print '<TD>'.strftime("%d %B %Y",$propale->datep).'</a></TD>';
print '<TD align="right">'.price($propale->price).'</TD>';
print '<TD align="center">statut</TD>';
print '</TR>';
$total = $total + $propale->price;
}
print '<tr><td>'.$i.' propales</td>';
print '<td align="right"><small>Soit : '.francs($total).' FF HT</small></td>';
print '<td colspan="1" align="right"><b>Total : '.price($total).'</b></td>';
print '<td align="left"><b>Euros HT</b></td></tr>';
print "</TABLE>";
} else {
print "pas de propales";
}
}
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>