File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ require "baseInfo.php " ;
4+ require "config.php " ;
5+
6+ $ stmt = $ connection ->prepare ("SELECT * FROM `server_plans` WHERE (`type` IS NULL OR `type` = '') AND `inbound_id` != 0 " );
7+ $ stmt ->execute ();
8+ $ list = $ stmt ->get_result ();
9+ $ stmt ->close ();
10+
11+ if ($ list ->num_rows > 0 ){
12+ while ($ row = $ list ->fetch_assoc ()){
13+ $ serverId = $ row ['server_id ' ];
14+ $ inboundId = $ row ['inbound_id ' ];
15+ $ rowId = $ row ['id ' ];
16+
17+ $ response = getJson ($ serverId );
18+ $ response = $ response ->obj ;
19+ foreach ($ response as $ config ){
20+ if ($ config ->id == $ inboundId ) {
21+ $ netType = json_decode ($ config ->streamSettings )->network ;
22+ break ;
23+ }
24+ }
25+
26+ if (!is_null ($ netType )){
27+ $ stmt = $ connection ->prepare ("UPDATE `server_plans` SET `type` = ? WHERE `id` = ? " );
28+ $ stmt ->bind_param ("si " , $ netType , $ rowId );
29+ $ stmt ->execute ();
30+ $ stmt ->close ();
31+ }
32+ }
33+ echo "REFRESH PAGE " ;
34+ }else echo "DONE " ;
You can’t perform that action at this time.
0 commit comments