<?php
$item = $_request["item"];
$fromnum = $_request["fromnum"];
$extid = $_request["extid"];
$mobio_remote_addr = "194.12.244.114";
$servid = 1101;
$db_serv = '10.0.2.10';
$db_user = 'sa';
$db_pass = 'password';
$db_name = 'muonline';
$credits_to_add = '500';
if($_server['remote_addr'] == $mobio_remote_addr) {
$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'");
$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));
}