Parašė BloodKiller· 2007 Gru. 1 16:12:44
#4
Visu pirma padaryk, kad kai issiunti SMS zinute, ja uzskaitytu ir informacija apie zinute irasytu i
MySQL duomenu baze. O tada savo panele surisk su
MySQL ir gausi viska ko reikia. Va tavo laukeliai gali atrodyti pvz taip:
+-------+--------------+---------+
|sms_id|sms_number|sms_cost|
+-------+--------------+---------+
|1 |xxxxxxxxxx |2 |
+-------+--------------+---------+
|2 |xxxxxxxxxx |4 |
+-------+--------------+---------+
|3 |xxxxxxxxxx |5 |
+-------+--------------+---------+
O dabar galime nesunkiai sukurti kazka panasaus i tai:
$reikia = 10;
$data = dbarray(dbquery("SELECT SUM(sms_cost) FROM ".$db_prefix."sms"));
$percents = 100/$reikia*$data['SUM(sms_cost)'];
echo "Sukaupta: $precents%".($percents > 0 ? "<br>Perteklius: ".($percents-100) : "")."<br>\n";