I am trying to return a different status for a property based on the department it is in. There are Sales and Lettings department, and each has a numeric system denoting the property's status.
I have tried to use if functions to query the department and status of each property, and to return a different text string for each status, but all of the properties are marked as 'On hold' (i.e. the first option)
The code is as follows. It's not particularly elegant, apologies.
function prop_status( $dept = null, $availability = null) {
if ( $dept = "Lettings" and $availability = "1") {
return "On hold";
}
if ( $dept = "Lettings" and $availability = "2") {
return "For rent";
}
if ( $dept = "Lettings" and $availability = "3") {
return "References pending";
}
if ( $dept = "Lettings" and $availability = "4") {
return "Let agreed";
}
if ( $dept = "Lettings" and $availability = "5") {
return "Let";
}
if ( $dept = "Sales" and $availability = "1") {
return "On hold";
}
if ( $dept = "Sales" and $availability = "2") {
return "For sale";
}
if ( $dept = "Sales" and $availability = "3") {
return "Under offer";
}
if ( $dept = "Sales" and $availability = "4") {
return "Sold STC";
}
if ( $dept = "Sales" and $availability = "5") {
return "Sold";
}
if ( $dept = "Sales" and $availability = "7") {
return "Withdrawn";
}
Any help on getting this working would be much appreciated.