<?php
/**
 * Created by PhpStorm.
 * User: jaskokoyn
 * Date: 2/16/2015
 * Time: 9:13 PM
 */

include( '../../inc/db.php' );
include( '../../inc/functions.php' );

if(!isset($_SESSION['loggedin']) || $user['mem_level'] != 2){
    die("AYYYYYY");
}

if( !isReady($_POST, array( "cid" ) ) ){
    die( "EMPTY" );
}

$cid  =   secure($_POST['cid']);

$delChatQuery    =   $db->prepare("DELETE FROM chats WHERE id = :id");
$delChatQuery->execute(array(
    ":id"        =>  $cid
));

die("SUCCESS");