- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
$sql_color =
"IF(PsaleCharge.payed = " . TSALE_CONTRACTOR_INIT . ", 'red', IF(PsaleCharge.payed = " . TSALE_CONTRACTOR_PARTIAL . ", 'silver', 'green'))";
$sql_title =
"IF(PsaleCharge.payed = " . TSALE_CONTRACTOR_INIT . ", 'Не оплачено', IF(PsaleCharge.payed = " . TSALE_CONTRACTOR_PARTIAL . ", 'Оплачено частично', 'Оплачено'))";
if($allow_pay) {
$sql_allow_pay = "";
} else {
$sql_allow_pay = "OR TRUE";
}
$sql_contractor_name =
"GROUP_CONCAT(" .
"'<tr>\r\n<td>', " .
"IF(PsaleCharge.tcontractor_id IS NULL, " .
"IF(PsaleCharge.recipient IS NULL OR PsaleCharge.recipient = '', '', CONCAT(PsaleCharge.recipient, ' ')), " .
"CONCAT('<a href=\"../tcontractors/view?id=', Tcontractor.id, '\" target=\"_blank\">', HTMLSPECIALCHARS(Tcontractor.company), '</a> ')" .
"), " .
"'</td>\r\n<td style=\'text-align:right;\'>', " .
"IF(Psale.status = " . PSALE_STATUS_CLOSE . " $sql_allow_pay, CONCAT('<span style=\'color:', $sql_color, ';\' title=\'', $sql_title, '\'>', PsaleCharge.amount, '</span>'), " .
"CONCAT(" .
"'<a style=\'color:', $sql_color, ';\' title=\'', $sql_title, '\' href=\'#\' onclick=\'onPsaleChargeEdit(', PsaleCharge.id, ', ', PsaleCharge.psale_id, ', false); return false;\'>', " .
"PsaleCharge.amount, " .
"'</a>'" .
")), " .
"'</td>\r\n</tr>\r\n'" .
"SEPARATOR ' ')";
$sql_contractors =
"SELECT $sql_contractor_name " .
"FROM psale_charges PsaleCharge " .
"LEFT JOIN tcontractors Tcontractor ON PsaleCharge.tcontractor_id = Tcontractor.id " .
"WHERE PsaleCharge.psale_id = Psale.id ";
Vasiliy 21.05.2014 10:07 # +2
guest 21.05.2014 12:03 # +1
gost 21.05.2014 12:03 # +1
>> $sql_allow_pay = "";
>>} else {
>> $sql_allow_pay = "OR TRUE";
>>}
lolz
guest6 09.09.2023 02:18 # 0