<?php

/**
 * Make sure sort $param is valid value and won't create SQL injections
 */
function sanitizeSortParam ($param) {
    if ($param !== 'ID' && $param !== 'Name' && $param !== 'Created on' && $param !== 'Status') {
        return 'ID';
    } else {
        return $param;
    }
}

/**
 * Make sure order $param is valid value and won't create SQL injections
 */
function sanitizeOrderParam ($param) {
    if ($param !== 'ASC' && $param !== 'DESC') {
        return 'ASC';
    } else {
        return $param;
    }
}
