<?php

class SMS
{
	static public function send($text, $to = FALSE)
	{
		if (!App::getConfig('disableSMS')) {

			$to = $to ? $to : '79046106141, 79046106144';

			$ch = curl_init("http://sms.ru/sms/send");
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
			curl_setopt($ch, CURLOPT_TIMEOUT, 10);
			curl_setopt($ch, CURLOPT_POSTFIELDS, array(
				"api_id" => "2c2af6a7-a935-0e84-5952-599f5cd61905",
				"to" => $to,
				"text" => $text,
				"from" => "WIKIPOINTS",
			));
			curl_exec($ch);
			curl_close($ch);
		}
	}
}

