function apply($s) { $id = intval($_REQUEST['id']); if ($id!=$_SESSION['last_commercial_id']) { //header("Location: /index.html"); echo "$id!={$_SESSION['last_commercial_id']}"; exit(); } $commercial = new Commercial(); $status = ($_GET['status']!=REALTY_STATUS_RENT_APPLY) ? REALTY_STATUS_APPLY : REALTY_STATUS_RENT_APPLY; $user_cond = (isset($_SESSION['user_id'])) ? ' AND user_id='.$_SESSION['user_id'] : ''; $commercial->updateBy("id=$id",array('status'=>$status)); $block_html = Html::getBlock('Сообщение',"Ваше объявление отправлено на проверку администратором."); $s->assign("block_html",$block_html); $s->display("msg.tpl"); }