if (isset($_POST['city']) && !empty($_POST['city'])) {
а это
$where = implode(' AND ', $where);
напиши так
$where = isset($where) ? implode(' AND ', $where) . ' and ' : '';
_____________
HTML, CSS (Bootstrap), JS(JQuery, ExtJS), PHP, MySQL, MSSql, Posgres, (TSql, BI OLAP, MDX), Mongo, Git, SVN, CodeIgnater, Symfony, Yii 2, JiRA, Redmine, Bitbucket, Composer, Rabbit MQ, Amazon (SQS, S3, Transcribe), Docker