Category Archives: Uncategorized

Change Log of e-Punch Card

v. 1.2 2025-08-18 Kaizen Completed for PunchCard.phpr

Add the attendance list page to display all attendance record by “employee_name”

BEFORE AFTER

MODIFICATION in PHPRunner or cPanel or PHPMyAdmin

  1. Go to “Tables” tab and enable “attendance”.
  2. Delete “Attendance” in the “Menu editor”.

  3. Go to “Query” tab, select “attendance” in Table list, click on “SQL” tab and paste below query:-
    SELECT
        record_id,
        `date`,
        time_in,
        time_out_lunch,
        time_in_lunch,
        time_out,
        time_in_overtime,
        time_out_overtime,
        remark,
        employee_id
    FROM attendance
    ORDER BY `date` DESC
  4. Go to “Pages” tab, select “attendance” in Tables list and set as below:-
  5. Go to “Designer” tab, select “attendance” in Tables list, click on “list” tab, click “employee_id” field, click “View As/Edit As” and edit as below:-

  6. Select “punchcard” in Tables list, click on “list” tab and insert a new “Custom Button”. Name it as “View_Attendance”.

  7. Paste below code in “Client Before” tab:-

    var employee_id = row.getFieldValue("employee_id");
    var employee_name = row.getFieldValue("employee_name");
    var valueToPass = employee_id;
    var popupUrl = "attendance_list.php?q=(employee_id~equals~" + valueToPass + ")";
    
    var childPopup = Runner.displayPopup({
        url: popupUrl,
        header: "Attendance Record for " + employee_name,
        width: 1200,
        height: 650,
        afterCreate: function(childPopup) {
            window.parent.popup.close();
        }
    });
    
    return false;
  8. Click on “View Attendance” and edit its properties like below:-
  9. Go to “Editor” tab, double-click on the logo and rename it to version “1.2”.

 

Display only active employee in “E-Punch Card”

MODIFICATION in PHPRunner or cPanel or PHPMyAdmin

  1. Go to “Query” tab, select “punchcard” in Tables list, click on “SQL” tab and paste below query:-
    SELECT
        e.employee_id,
        e.employee_name,
        (SELECT time_in FROM attendance WHERE employee_id = e.employee_id AND `date` = CURDATE()) AS time_in,
        (SELECT time_out_lunch FROM attendance WHERE employee_id = e.employee_id AND `date` = CURDATE()) AS time_out_lunch,
        (SELECT time_in_lunch FROM attendance WHERE employee_id = e.employee_id AND `date` = CURDATE()) AS time_in_lunch,
        (SELECT time_out FROM attendance WHERE employee_id = e.employee_id AND `date` = CURDATE()) AS time_out,
        (SELECT time_in_overtime FROM attendance WHERE employee_id = e.employee_id AND `date` = CURDATE()) AS time_in_overtime,
        (SELECT time_out_overtime FROM attendance WHERE employee_id = e.employee_id AND `date` = CURDATE()) AS time_out_overtime,
        (SELECT `remark` FROM attendance WHERE employee_id = e.employee_id AND `date` = CURDATE()) AS `remark`
    FROM employee e
    WHERE e.active = 1
    ORDER BY e.employee_name ASC

 

v. 1.2 2025-08-18 Beta Testing Complete for PunchCard.phpr

TEST OBJECTIVE: Can user view their attendance record by their own name?

TESTING METHODOLOGY TEST RESULT
  1. Open “E-PUNCH CARD VERSION 1.2”, click on any “view” icon beside the “Employee Name” field to view the employee’s attendance record.

 


 

v. 1.1 2025-06-10 Kaizen Completed for PunchCard.phpr

To add tabs 1 to 31 in http://hpc-6305/punchcard/punchcard_list.php?orderby=aemployee_name in order to  view the date of attendance

The “Select” button will only work when the date is on today. On other dates, the button will be disabled.

BEFORE AFTER
http://hpc-6305/ams/attendance_list.php  

MODIFICATION in PHPRunner or cPanel or PHPMyAdmin

  1. Go to “Tables” tab and click “Create custom View”. Name the custom view as “1”.
  2. Go to “Query” tab and add below query:-
    SELECT 
         e.employee_name, 
         a.`date`, 
         a.time_in, 
         a.time_out_lunch, 
         a.time_in_lunch, 
         a.time_out, 
         a.time_in_overtime, 
         a.time_out_overtime 
    FROM attendance AS a 
    LEFT OUTER JOIN employee AS e ON a.employee_id = e.employee_id 
    WHERE (YEAR(a.`date`) = YEAR(CURRENT_DATE()) && 
          MONTH(a.`date`) = MONTH(CURRENT_DATE()) && 
          DAY(a.`date`) = "01") 
    ORDER BY e.employee_name
  3. Go to “Pages” tab and check only “List page”.
  4. Go to “Designer” tab and remove “timestamp_snippet” and “SELECT” button.
  5. Go to “Events” tab and click “Erase event code” in “Before display” and “JavaScript OnLoad event”.
  6. Create another 30 custom views and change the custom view’s name and the query in the red text below accordingly:-
    SELECT 
         e.employee_name, 
         a.`date`, 
         a.time_in, 
         a.time_out_lunch, 
         a.time_in_lunch, 
         a.time_out, 
         a.time_in_overtime, 
         a.time_out_overtime 
    FROM attendance AS a 
    LEFT OUTER JOIN employee AS e ON a.employee_id = e.employee_id 
    WHERE (YEAR(a.`date`) = YEAR(CURRENT_DATE()) && 
          MONTH(a.`date`) = MONTH(CURRENT_DATE()) && 
          DAY(a.`date`) = "01") 
    ORDER BY e.employee_name
  7. Go to “Tables” tab and click “Menu editor” button.
  8. Add a new group called “Day”.

  9. Move all 31 custom views inside “Day” group.
  10. Go to “Designer” tab, select “punchcard” in Tables list and set the page layout as below:-
  11. Click “apply to…” button and select “All list pages in the project”.


 

To rename “PUNCH CARD VERSION 1.0.1” to “E-Punch Card version 1.1”

BEFORE AFTER

MODIFICATION in PHPRunner or cPanel or PHPMyAdmin

  1. Go to “Editor” tab, double-click on “PUNCH CARD VERSION 1.0.1” and rename it to “E-Punch Card version 1.1”.
    Note: Due to the theme setting, the name of the logo will be all uppercase.

 

v. 1.1 2025-06-10 Beta Testing Completed for PunchCard.phpr

TEST OBJECTIVE: Do all 31 custom views only shows the attendance list without “SELECT” button?

TESTING METHODOLOGY TEST RESULT
  1. Expand “Day” menu and check for each date.
  2. All pages should not have the “SELECT” button inside it except the main page of punchcard.
 


 

v. 1.0 2025-02-25 Kaizen Completed for PunchCard.phpr

Create a separate project for punch card

BEFORE AFTER

MODIFICATION in PHPRunner or cPanel or PHPMyAdmin

  1. Create a new project and name it as “PunchCard”.
  2. Enable only “attendance” table in “Tables” tab.
  3. Go to “Pages” tab and enable only “Add new” page.
  4. Go to “Events” tab -> “attendance” -> “Add page” -> “JavaScript OnLoad event” and paste below code:-

 

Add a Dashboard

  • Add a dashboard (main page), showing list of employee with their time in and out in grid view.
  • Each employee can click on his name on the list and will load the “attendance_add.php” web page to punch card.
  • After employee click on “Save” button”, the web page will return to the grid view and showing the latest time in or time out.
EMPLOYEE NAME MORNING IN MORNING OUT AFTERNOON IN AFTERNOON OUT EVEINING IN EVEINING OUT
Wati 08:32:00 12:35:00 14:00:00      
Mazura 08:31:00 12:31:00 14:02:00      
Ms. Wong 08:30:00 12:30:00      

 

BEFORE AFTER

MODIFICATION in PHPRunner or cPanel or PHPMyAdmin

  1. Modify “attendance” table in phpMyAdmin as below:-
  2. Go to “Tables” tab and create a new custom view for “punchcard”.
  3. Go to “Query” tab and paste below query:-
    SELECT 
         e.employee_id, 
         e.employee_name, 
         (SELECT time_in FROM attendance WHERE employee_id = e.employee_id AND `date` = CURDATE()) AS time_in, 
         (SELECT time_out_lunch FROM attendance WHERE employee_id = e.employee_id AND `date` = CURDATE()) AS time_out_lunch, 
         (SELECT time_in_lunch FROM attendance WHERE employee_id = e.employee_id AND `date` = CURDATE()) AS time_in_lunch, 
         (SELECT time_out FROM attendance WHERE employee_id = e.employee_id AND `date` = CURDATE()) AS time_out, 
         (SELECT time_in_overtime FROM attendance WHERE employee_id = e.employee_id AND `date` = CURDATE()) AS time_in_overtime, 
         (SELECT time_out_overtime FROM attendance WHERE employee_id = e.employee_id AND `date` = CURDATE()) AS time_out_overtime 
    FROM employee e 
    ORDER BY e.employee_name ASC
  4. Go to “Pages” tab and enable only “List page” and “Add new” page.
  5. Go to “Misc” tab and set the landing page to punchcard’s “list” page.
  6. Rename “Time In Lunch” field to “Time In After Lunch”.
  7. Add custom button “Punch”.
    • go to “Designer” tab, select “list” tab, click “Insert…” dropdown and select “Custom Button” and name it as “SELECT”.
    • change the tri-part events for the “Select” button as below:-
      • Client Before
        params["employee_id"] = row.getFieldValue("employee_id"); 
         params["employee_name"] = row.getFieldValue("employee_name");

      • Server
        $_SESSION["employee_id"] = $params["employee_id"]; 
        $_SESSION["employee_name"] = $params["employee_name"];

      • Client After
        var popup = Runner.displayPopup({ 
              url: Runner.pages.getUrl("punchcard","add"), 
              width: 450, 
              height: 315, 
              header: 'Punch In' 
        });

    • Go to “Events” tab:-
      • click on “Add page” -> After record added” and paste below code:
        $pageObject->setProxyValue('saved', true); 
        echo "<!doctype html>";

      • click on “Add page” -> JavaScript OnLoad event” and paste below code:
        if((proxy['saved'])) { 
             // close popup 
             window.parent.close(); 
             // refresh list page 
             window.parent.location.reload(); 
        }

  8. Display date and time in “list” page.
    • go to “Designer” tab and insert a new “Code Snippet”, name it as “timestamp_snippet” and paste below code:

      echo "<div><span class='btn btn-info' style='font-size:25px; font-weight:bold; cursor:default !important;'>".date('l, d-m-Y')."</span>". 
      " <span class='timestamp btn btn-info' style='font-size:25px; font-weight:bold; cursor:default !important;'>".date('h:i:s a')."</span></div>";

    • go to “Events” tab -> “List page” -> “JavaScript OnLoad event” and paste below code:
      setInterval(clock, 1000); 
      function clock() { 
           var clockDiv = document.querySelector(".timestamp"); 
           var date = new Date(); 
           var tick = date.toLocaleTimeString(); 
           clockDiv.textContent = tick; 
      }

  9. Add “Status” dropdown.
    • go to “Designer” tab -> “Add” tab, add a new “Code Snippet” name “status_snippet” and paste below code:

      $str= "<select id='status' name='status' style='width:380px; display:inline-block;' class='form-control'>". 
      "<option value=\"\">Please select</option>"; 
      
      $strSQL = "SELECT * FROM attendance WHERE employee_id=".$_SESSION["employee_id"]. " AND `date`=CURDATE()"; 
      $rs = db_query($strSQL); 
      
      if (!mysqli_num_rows($rs)) { 
           $str.="<option value='time_in'>Time In</option>"; 
           $str.="<option value='time_out_lunch'>Time Out Lunch</option>"; 
           $str.="<option value='time_in_lunch'>Time In After Lunch</option>"; 
           $str.="<option value='time_out'>Time Out</option>"; 
           $str.="<option value='time_in_overtime'>Time In Overtime</option>"; 
           $str.="<option value='time_out_overtime'>Time Out Overtime</option>"; 
      } else { 
           while ($data = db_fetch_array($rs)) { 
                if ($data["time_in"] == "") 
                     $str.="<option value='time_in'>Time In</option>"; 
                if ($data["time_out_lunch"] == "") 
                     $str.="<option value='time_out_lunch'>Time Out Lunch</option>"; 
                if ($data["time_in_lunch"] == "") 
                     $str.="<option value='time_in_lunch'>Time In After Lunch</option>"; 
                if ($data["time_out"] == "") 
                     $str.="<option value='time_out'>Time Out</option>"; 
                if ($data["time_in_overtime"] == "") 
                     $str.="<option value='time_in_overtime'>Time In Overtime</option>"; 
                if ($data["time_out_overtime"] == "") 
                     $str.="<option value='time_out_overtime'>Time Out Overtime</option>";
           } 
      } 
      
      $str.="</select>"; 
      echo $str;

    • go to “Events” tab -> “Add page” -> “JavaScript OnLoad event” and paste below code:
      this.on('beforeSave', function(formObj, fieldControlsArr, pageObj) { 
           var val = $("#status").val(); 
           formObj.baseParams['status'] = val; 
      });

  10. Display “Employee Name” in “Add” page.
    • go to “Events” tab -> “Add page” -> “Process record values” and paste below code:
      $values['employee_name'] = $_SESSION["employee_name"];

  11. Create a “Custom add”.
    • go to “Events” tab -> “Add page” -> “Custom add” and paste below code:
      $attSQL = DB::Query("SELECT * FROM attendance WHERE `date` = CURDATE() AND employee_id = " . $_SESSION["employee_id"]); 
      $data = $attSQL->fetchAssoc(); 
      $status = strtolower($_POST["status"]); 
      
      // If user already add a record, update the record 
      if ($data) { 
           $update = array(); 
           $update[$status] = strftime("%H:%M:%S"); 
           DB::Update("attendance", $update, "record_id=" . $data["record_id"]); 
      // Else insert a new record 
      } else { 
           $data = array(); 
           $data["date"] = strftime("%Y-%m-%d"); 
           $data[$status] = strftime("%H:%M:%S"); 
           $data["employee_id"] = 
           $_SESSION["employee_id"]; 
           DB::Insert("attendance", $data); 
      } 
      
      // Place event code here. 
      // Use "Add Action" button to add code snippets. 
      
      return false;

  12. Add highlight for absentees and late punch.
    • go to “Events” tab -> “List page” -> “List page: After record processed” and paste below code:
      if ($data["time_in"] == "" && $data["time_in_lunch"] == "") 
           $record["employee_name_css"] = 'background:#fc4f37;color:#ffffff;'; 
      
      if($data['time_in'] > "08:30:59") 
           $record["time_in_css"] = 'color:red;'; 
      
      if($data['time_in_lunch'] > "13:30:59") 
           $record["time_in_lunch_css"] = 'color:red;';


 

v. 1.0 2025-02-25 Beta Testing Completed

TEST OBJECTIVE: Does the “Status” dropdown only shows the status with empty time?

TESTING METHODOLOGY TEST RESULT
  1. Click “SELECT” button for any employee.
  2. Select “Time In” and click “PUNCH”.
  3. Click “SELECT” button again. The “Time In” will not be displayed inside the dropdown anymore.

 

Dealing with 32-bit, 64-bit and Any CPU Compilation Options in .NET

  1. Refer to https://www.codeproject.com/Articles/1160645/Dealing-with-bit-bit-and-Any-CPU-Compilation-Optio
  2. Refer to https://stackoverflow.com/questions/516730/what-does-the-visual-studio-any-cpu-target-mean
    • I think most of the important stuff has been said, but I just thought I’d add one thing: If you compile as Any CPU and run on an x64 platform, then you won’t be able to load 32-bit DLL files, because your application wasn’t started in WoW64, but those DLL files need to run there.

      If you compile as x86, then the x64 system will run your application in WoW64, and you’ll be able to load 32-bit DLL files.

      So I think you should choose “Any CPU” if your dependencies can run in either environment, but choose x86 if you have 32-bit dependencies. This article from Microsoft explains this a bit:

Description of C60T’s Wireless Page

C60T-034Explanation:
On the basic page of wireless, ‘wireless enable’ can check or uncheck. The ‘802.11’ is the Wi-Fi standards provide the wireless counterpart to Ethernet and the Wi-Fi Alliance certifies products.
The IEEE 802.11 standard have the versions 11b,11g,11n and etc.
The SSID stands for Service Set Idenfier which is the name for wireless local area network. So, the name for C60T wireless is Wifi-Module-4A3D92. It can choose to broadcast SSID or not.
The every channel shows the differences frequency using IEEE 802.11 protocols.
Channel Bandwidth have 20MHz or 40MHz and the purpose is for the actual throughput.
Guard interval is the space between symbol (characters) being transmitted. It is to avoid an interference among them.
The 20/40 BSS Coexistence is enabled due to on the performance of wireless local area network.
(source: http://www.pcmag.com/encyclopedia/term/37204/802-11 , https://en.wikipedia.org/wiki/List_of_WLAN_channels, http://wifijedi.com/2009/02/11/how-stuff-works-short-guard-interval/ , http://ojs.academypublisher.com/index.php/jnw/article/view/03075663)

 


C60T-035Explanation:
Security is need to secure the network. WPA2-PSK stands for Wi-Fi Protected Access 2 – Pre-Shared Key or Personal, it is a method of securing the network using WPA2 with the use of the optional Pre-Shared Key (PSK) authentication, which was designed for home users without an enterprise authentication server.
(Source: http://www.webopedia.com/TERM/W/WPA2_PSK.html)

WPA-PSK have three types of encrypt. First, TKIP (Temporal Key Intergrity Protocol) is an encryption protocol that was designed to provided secure encryption in wirelss local area network. Second, AES (Advanced Encryption Standard) is a symmetric-key block cipher algorithm and U.S. government standard for secure and classified data encryption and decryption. Lastly, TKIPAES is the combination of TKIP and AES whiich allow you to run mixed system.
WPA-PSK Key need to fill in to secure the wireless network and rekey interval is the the default time of 3600 seconds.
(source: http://searchmobilecomputing.techtarget.com/definition/TKIP, https://www.techopedia.com/definition/1763/advanced-encryption-standard-aes)


C60T-036Explanation:
Fragment Threshold is used to specify the maximum size for a data packet before being fragmented into multiple packets and the default size is 2346 bytes.
RTS (Request to Send) Threshold function to control station access to the medium for packet transmission.
Beacon Interval is represent the amount of time between beacon transmission. Before a station enters power save mode, the station needs th beacon interval to know when to wake up to receive the beacon.
Data Beacon Rate is the delivery traffic indication message that specify the data beacon rate between 1-255 and 1 is the default.
TX Power is the strength of the signal that the router produces during the times it is transmitting.
Multicast is a transmission one-to-many broadcast in which wireless forwards all packets. Unicast is one-to-one basis that establishing individual sessions between the transmission server and each client.
(source: https://www.google.com/?gws_rd=ssl#q=RTS+threshold, http://resources.infosecinstitute.com/rts-threshold-configuration-improved-wireless-network-performance/, http://www.manualslib.com/manual/427373/3com-3crwe915075-Airconnect-9150-11n-2-4-Ghz-Poe-Access-Point.html?page=44, https://documentation.meraki.com/MR/Other_Topics/Multicast-Unicast_Conversion)


 

C60T-037

 

Explanation:
A wireless distribution system (WDS) is a system enabling the wireless interconnection of access points in an IEEE 802.11 network. It allows a wireless network to be expanded using multiple access points without the traditional requirement for a wired backbone to link them.
(source: https://www.google.com/search?q=Wireless+Distribution+System&ie=utf-8&oe=utf-8)


C60T-038Explanation:
Current Station List shows all the wireless clients who access the Access Point.


C60T-039Explanation:
Mac Access can set either to disable, allow, or deny. If allow or deny is choose, enter the mac address on the MAC Access list to allow or deny that mac address of client to access the AP.

 

Description of C60T’s Mode Page

C60T-008


C60T-009

Explanation:
The 3G/4G Wireless Router Mode is selected for device work mode. Just in case, the C60T connected to Local Area Network (LAN). The 3G/4G connect to the Internet through a mobile ISP which is Maxis. For the WAN connection, the mobile ISP (Maxis) is the gateway to  access the Internet.


C60T-009Explanation:
The 3G/4G Wireless Router Mode is selected for device work mode. Just in case, the C60T connected to Local Area Network (LAN). The 3G/4G connect to the Internet through a mobile ISP which is Maxis. For the WAN connection, the mobile ISP (Maxis) is the gateway to  access the Internet.


C60T-011Explanation:
The third mode is Standard Wireless AP and APClient Bridge Mode. This figure is same like the figure number two. For the AP Client bridge mode, it connect to a wireless network and share the connection to its client on WAN side. When the wireless station limits the number of clients or asks username/password to connect, AP Client is what you need.
(source: http://www.tp-link.us/faq-442.html)


C60T-012
Explanation:
The last mode is wireless AP Client. The Ethernet wirelessly connected to PC or local network. The client’s PC can access the Internet. There also another wireless interface work for a WAN port connected to other wireless AP or router.
(source: http://www.tp-link.us/faq-442.html)

MOBITEK Supports Wikimedia Foundation

MOBITEK Supports Wikimedia Foundation

MOBITEK Supports Wikimedia Foundation

From Jimmy Wales, Wikipedia Founder:

Thank you for helping keep Wikipedia online and ad-free. I’m sure you’re busy, so I’ll get right to it. We need your help again this year.

Please help us forget about fundraising and get back to improving Wikipedia.

We are the small non-profit that runs one of the top websites in the world. We only have about 200 staff but serve 450 million users, and have costs like any other top site: servers, power, programs, and people.

Wikipedia is something special. It is like a library or a public park. It is like a temple for the mind, a place we can all go to think and learn.

To protect our independence, we’ll never run ads. We survive on donations from our readers. Now is the time we ask.

If Wikipedia is useful to you, please take one minute to keep it online and ad-free another year.

https://donate.wikimedia.org

Thanks,
Jimmy Wales
Wikipedia Founder

Continue reading

New Year Greeting from AFP

AFP 2015 New Year Greeting

AFP 2015 New Year Greeting

 

Hi there my friends,

 

Many thanks for all your support and wishing you another great year ahead !

ALVIN CHEAH

Country Manager Sales and Marketing

Unit 24-03, Level 24, Menara Dion, – 27 Jalan Sultan Ismail – 50250 Kuala Lumpur
Tel:(603) 2028 5000 – Mob:(6019) 3847950 – Fax:(603) 2070 3031