Hello,
I am trying to make the computed field in my CCK settings fill in a hidden field's value, using the following code:
$price=trim($node->field_prop_price[0]['value']);
if ($price <= 250000) {
$node_field[0]['value'] = 'from 100,000 to 250,000';
}
if ($price > '250000' && $node->field_prop_price[0]['value'] <= 500000) {
$node_field[0]['value'] = 'from 250,000 to 500,000';
}
if ($price > '500000' && $node->field_prop_price[0]['value'] <= 750000) {
$node_field[0]['value'] = 'from 500,000 to 750,000';
}
if ($price > '750000' && $node->field_prop_price[0]['value'] <= 1000000) {
$node_field[0]['value'] = 'from 750,000 to 1,000,000';
}
if ($price > '1000000' && $node->field_prop_price[0]['value'] <= 1500000) {
$node_field[0]['value'] = 'from 1,000,000 to 1,500,000';
}
if ($price > '1500000' && $node->field_prop_price[0]['value'] <= 2000000) {
$node_field[0]['value'] = 'from 1,500,000 to 2,000,000';
}
if ($price > '2000000' && $node->field_prop_price[0]['value'] <= 2500000) {
$node_field[0]['value'] = 'from 2,000,000 to 2,500,000';
}
if ($price > '2500000' && $node->field_prop_price[0]['value'] <= 5000000) {
$node_field[0]['value'] = 'from 2,500,000 to 5,000,000';
}
else {$node_field[0]['value'] = 'from 5,000,000';}