Exemple #1
0
function save_media($data)
{
    return save_picture($data);
}
        if (empty($json->{'CoPromotionId'})) {
            echo_invalid_param($json);
        }
        save_accept_co_promotion($json);
        break;
    case OPCODE::SERVICE_SAVE_COMMENT_REQUEST:
        if (empty($json->{'ShopId'}) || empty($json->{'CommentText'})) {
            echo_invalid_param($json);
        }
        save_comment($json);
        break;
    case OPCODE::SERVICE_SAVE_PICTURE_REQUEST:
        if (empty($json->{'Name'}) || empty($json->{'ShopId'}) || empty($_FILES['file']['name'])) {
            echo_invalid_param($json);
        }
        save_picture($json);
        break;
}
function register_owner($json)
{
    $database = new Database();
    $userTbl = $database->getUserTbl();
    $ownerTbl = $database->getOwnerTbl();
    $exist = $userTbl->isExisted($json->{'Email'});
    if ($exist) {
        echo_dup_email_msg();
    }
    $user = new User();
    $user->Firstname = $json->{'Firstname'};
    $user->Lastname = $json->{'Lastname'};
    $user->PhoneNumber = $json->{'PhoneNumber'};