query("SELECT attachment_type from ".RES_ATTACHMENTS_TABLE." where res_id = ? and status <> 'DEL'", array($_REQUEST['res_id'])); $infos = $stmt->fetchObject(); $type = $infos->attachment_type; if ($type == 'signed_response'){ echo "{status:1}"; } else echo "{status:0, type:'".$type."'}"; ?>