1
0
www.mikescher.com/www/pages/api_stats.php

33 lines
897 B
PHP
Raw Normal View History

2017-12-04 17:45:10 +01:00
<?php
global $OPTIONS;
require_once (__DIR__ . '/../internals/base.php');
require_once (__DIR__ . '/../internals/database.php');
2018-02-03 17:53:25 +01:00
$nam = $OPTIONS['name'];
$cid = $OPTIONS['clientid'];
$ver = $OPTIONS['version'];
$prv = $OPTIONS['providerstr'];
$pid = $OPTIONS['providerid'];
$tnc = $OPTIONS['notecount'];
2017-12-04 17:45:10 +01:00
if ($nam === 'AlephNote')
{
Database::connect();
2018-02-03 14:53:30 +01:00
Database::sql_exec_prep('INSERT INTO an_statslog (ClientID, Version, ProviderStr, ProviderID, NoteCount) VALUES (:cid, :ver, :prv, :pid, :tnc) ON DUPLICATE KEY UPDATE Version=:v,ProviderStr=:pstr,ProviderID=:pid,NoteCount=:nc',
2017-12-04 17:45:10 +01:00
[
[':cid', $cid, PDO::PARAM_STR],
[':ver', $ver, PDO::PARAM_STR],
[':prv', $prv, PDO::PARAM_STR],
[':pid', $pid, PDO::PARAM_STR],
[':tnc', $tnc, PDO::PARAM_INT],
]);
print('{"success":true}');
}
else
{
print('{"success":false, "message":"Unknown AppName"}');
}