<?PHP
$item = $_REQUEST["item"];
$fromnum = $_REQUEST["fromnum"];
$extid = $_REQUEST["extid"];
$sum = '2.40';
$mobio_remote_addr = "194.12.244.114";
$servID = 1234;
$db_serv = '127.0.0.1';
$db_user = 'sa';
$db_pass = 'password';
$db_name = 'MuOnline';
$credits_to_add = '600';
$sms = '1';
function NOW() {
return date('Y-m-d H:i:s');
}
if($_SERVER['REMOTE_ADDR'] == $mobio_remote_addr || 1) {
$sms_reply = 'Greshka. Spazvaite to4no instrukciite';
$conn = mssql_connect($db_serv, $db_user, $db_pass);
if($conn) {
mssql_select_db($db_name);
mssql_query("UPDATE MEMB_CREDITS SET credits=credits+'$credits_to_add' WHERE memb___id='$item'");
/*$time = NOW();
$res = mssql_query("INSERT INTO SMSLOG (memb___id, fromnum, time, sum) VALUES
('$item', '$fromnum', '$time', '$sum')");*/
$res = mssql_query("SELECT credits FROM MEMB_CREDITS WHERE memb___id='$item'");
if(mssql_num_rows($res)>0) {
$row = mssql_fetch_row($res);
$sms_reply = "Vashite krediti sa uspeshno zakupeni. Imate {$row[0]} crediti.";
}
}
file("http://mobio.bg/paynotify/pnsendsms.php?servID=$servID&tonum=$fromnum&extid=$extid&message=".urlencode($sms_reply));
}
?>