38 |
$langs->load("commercial"); |
$langs->load("commercial"); |
39 |
$langs->load("orders"); |
$langs->load("orders"); |
40 |
|
|
41 |
// Securité accès client |
// Sécurité accés client |
42 |
$socidp=''; |
$socidp=''; |
43 |
if ($user->societe_id > 0) |
if ($_GET["socidp"]) { $socidp=$_GET["socidp"]; } |
44 |
|
if ($user->societe_id > 0) |
45 |
{ |
{ |
46 |
|
$action = ''; |
47 |
$socidp = $user->societe_id; |
$socidp = $user->societe_id; |
48 |
} |
} |
49 |
|
|
128 |
*/ |
*/ |
129 |
if ($conf->propal->enabled && $user->rights->propale->lire) |
if ($conf->propal->enabled && $user->rights->propale->lire) |
130 |
{ |
{ |
131 |
$sql = "SELECT p.rowid, p.ref, p.price, s.idp, s.nom"; |
$sql = "SELECT p.rowid, p.ref, p.price, s.idp, s.nom"; |
132 |
$sql .= " FROM ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."societe as s"; |
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."societe as s"; |
133 |
$sql .= " WHERE p.fk_statut = 0 and p.fk_soc = s.idp"; |
$sql.= " WHERE p.fk_statut = 0 and p.fk_soc = s.idp"; |
134 |
|
$sql.= " AND s.idp = ".$socidp; |
135 |
$resql=$db->query($sql); |
|
136 |
if ($resql) |
$resql=$db->query($sql); |
137 |
|
if ($resql) |
138 |
{ |
{ |
139 |
$total = 0; |
$total = 0; |
140 |
$num = $db->num_rows($resql); |
$num = $db->num_rows($resql); |
141 |
if ($num > 0) |
if ($num > 0) |
142 |
{ |
{ |
143 |
print '<table class="noborder" width="100%">'; |
print '<table class="noborder" width="100%">'; |
144 |
print "<tr class=\"liste_titre\">"; |
print "<tr class=\"liste_titre\">"; |
145 |
print "<td colspan=\"3\">".$langs->trans("ProposalsDraft")."</td></tr>"; |
print "<td colspan=\"3\">".$langs->trans("ProposalsDraft")."</td></tr>"; |
146 |
|
|
147 |
$i = 0; |
$i = 0; |
148 |
$var=true; |
$var=true; |
149 |
while ($i < $num) |
while ($i < $num) |
150 |
{ |
{ |
151 |
$obj = $db->fetch_object($resql); |
$obj = $db->fetch_object($resql); |
152 |
$var=!$var; |
$var=!$var; |
153 |
print '<tr '.$bc[$var].'><td nowrap>'."<a href=\"".DOL_URL_ROOT."/comm/propal.php?propalid=".$obj->rowid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$obj->ref.'</a></td>'; |
print '<tr '.$bc[$var].'><td nowrap>'."<a href=\"".DOL_URL_ROOT."/comm/propal.php?propalid=".$obj->rowid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$obj->ref.'</a></td>'; |
154 |
print '<td><a href="fiche.php?socid='.$obj->idp.'">'.dolibarr_trunc($obj->nom,18).'</a></td><td align="right">'.price($obj->price).'</td></tr>'; |
print '<td><a href="fiche.php?socid='.$obj->idp.'">'.dolibarr_trunc($obj->nom,18).'</a></td><td align="right">'.price($obj->price).'</td></tr>'; |
155 |
$i++; |
$i++; |
156 |
$total += $obj->price; |
$total += $obj->price; |
157 |
} |
} |
158 |
if ($total>0) |
if ($total>0) |
159 |
{ |
{ |
160 |
$var=!$var; |
$var=!$var; |
161 |
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" align="right">'.price($total)."</td></tr>"; |
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" align="right">'.price($total)."</td></tr>"; |
162 |
} |
} |
163 |
print "</table><br>"; |
print "</table><br>"; |
164 |
} |
} |
165 |
$db->free($resql); |
$db->free($resql); |
166 |
} |
} |
167 |
} |
} |
168 |
|
|