The central control attendance machine software can download the attendance machine records to the local database in real time. What is annoying is that the attendance machine software is often disconnected from the device and will not be automatically reconnected after the disconnection, which is too bad before the test, there are no other solutions available. After painstaking efforts, I thought of using the attendance machine IP address to access a Web page. So with the above Code. Cross the attendance machine software.
As long as your attendance machine is a central control series and you can use the IP address of the attendance machine to open the web interface, you can use the following method to ensure stability and efficiency. We strongly recommend that you use this method!
Usage:
1. Replace 192.168.1.202 with your attendance Server IP address.
2. Back up the original file and overwrite the following content: myoa \ webroot \ task \ sync_duty_machine.php
3. Choose System Management> scheduled task management> enable data synchronization on the attendance machine. OK!
<? $ Start = microtime (true); $ con = mysql_connect (127.0.0.1: 3336 "," root "," myoa888 "); If (! $ Con) echo "unable to connect to MySQL"; mysql_select_db ("td_oa"); mysql_query ("set names gb2312 "); // get OA user data $ rs = mysql_query ("select user_id, user_name from user"); While ($ ROW = mysql_fetch_array ($ RS) $ duty_user [] = $ row; $ rs = mysql_query ("select register_time from attend_duty order by register_time DESC limit 1"); $ ROW = mysql_fetch_array ($ RS); $ startdate = $ row [0]; // obtain all user IDs and names on the attendance machine $ websource = file_get_contents ("H Ttp: // 192.168.1.202/CSL/query "); preg_match_all ("/uid value = (\ D {1,})>/", $ websource, $ user ); foreach ($ user [1] as $ U) $ userstr. = $ U. ","; // obtain the attendance record ****.................. // update the attendance record $ CNT = 0 ;/*...... hidden part of business cooperation q | 343828881 */$ end = microtime (true); $ time = $ end-$ start; if ($ CNT) {$ open = @ fopen ("log.txt", "A"); $ add = "updated {$ CNT} data records, time consumed :". number_format ($ time, 2 ,'. ',""). "seconds ". date ("Y-m-d h: I: s "). "\ r \ n"; @ fwrite ($ open, $ Dd); fclose ($ open) ;}?>