Change Log of Support Management (Help Desk)

Database Structure

TABLE COLUMN
tickets
ticket_replies
products
uggroups
ugmembers
ugrights
users

 

Live URL

https://helpdesk.mobitek.my/


 

v. 1.0 Kaizen Completed on 2025-11-20

Replicate the ticketing system in “https://test.mobitek-system.com/helpdeskz/staff/login”:-

  • Admin Username: mobitek-admin
  • Admin Password: 2022@A32@w

The support case management will be able to record these additional information:-

  • PROBLEM
  • STEPS TO REPLICATE THE ERROR
  • SUGGESTED  SOLUTION
  • FINAL SOLUTION

 

MODIFICATION in PHPRunner or cPanel or PHPMyAdmin

  1. In phpMyAdmin, create a new database “mobiteks_helpdesk”. Add 3 new tables:-
    • tickets
      • ticket_id – int(11)
      • date – datetime
      • user_id – int(11)
      • requestor – varchar(100)
      • email – varchar(255)
      • subject – varchar(255)
      • problem – longtext
      • product_id – id(11)
      • last_update – datetime
      • status – varchar(50)
    • ticket_replies
      • id – int(11)
      • date – datetime
      • staff_id – int(11)
      • staff_name – varchar(100)
      • steps_to_replicate – longtext
      • suggested_solution – longtext
      • final_solution – longtext
      • ticket_id – int(11)
    • products
      • id – int(11)
      • product_name – varchar(255)
  2. Assign “mobiteks_phprunner” to “mobiteks_helpdesk” database.
  3. Create a new domain “helpdesk.mobitek.my”.
  4. Set the PHP version for “helpdesk.sweetco.com.my” to “PHP 7.4 (ea-php74)” in “MultiPHP Manager”.
  5. Create a new project “HelpDesk” in PHPRunner and connect to “mobiteks_helpdesk” database.
  6. In “Tables” tab, enable below tables.
  7. Add relation between “tickets” and “ticket_replies” tables.
  8. In “Pages” tab, set as below:-
    • ticket_replies
    • tickets
    • products
  9. In “Misc” tab, set as below:-
    • Landing page
  10. In “Designer” tab, edit as below:-
    • ticket_replies
      • date
      • staff_id
      • staff_name
      • steps_to_replicate
      • suggested_solution
      • final_solution
    • tickets
      • user_id
      • requestor
      • email
      • date
      • problem
      • last_update
      • product_id
      • status
  11. In “Events” tab, edit as below:-
    • “Login page” -> “After successful login”

      $_SESSION["username"] = $username;
      $_SESSION["userID"] = $data["ID"];
      $_SESSION["email"] = $data["email"];
      
      // Note: Security::isAdmin() is not working, so need to find a way to identify Admin
      $ugData["UserName"] = $_SESSION["username"];
      $check = DB::SELECT("ugmembers", $ugData);
      $result = $check->fetchAssoc();
      
      if ($result) {
          header("Location: tickets_list.php");
          $_SESSION["admin"] = true;
      } else {
          header("Location: tickets_add.php");
          $_SESSION["nonAdmin"] = true;
      }
      exit();
    • tickets
      • List page
        • JavaScript OnLoad event

          window.listPage = pageObj;
      • Add page
        • JavaScript OnLoad event

          // To refresh the list page withoud reloading the page after record added
          this.on('afterSave', function() {
              var pageObj = window.listPage;
              Runner.runnerAJAX(Runner.pages.getUrl(pageObj.tName, pageObj.pageType)+"?a=return",
              pageObj.ajaxBaseParams,
              function(respObj){
                  pageObj.pageReloadHn.call(pageObj, respObj)
              });
          });
      • Edit page
        • JavaScript OnLoad event

          // To refresh the list page withoud reloading the page after record edited
          this.on('afterSave', function() {
              var pageObj = window.listPage;
              Runner.runnerAJAX(Runner.pages.getUrl(pageObj.tName, pageObj.pageType)+"?a=return",
              pageObj.ajaxBaseParams,
              function(respObj){
                  pageObj.pageReloadHn.call(pageObj, respObj)
              });
          });
      • View page
        • Before display

          if (isset($_SESSION["nonAdmin"]))
              $pageObject->hideItem("view_back_list");
    • ticket_replies
      • Add page
        • Before record added

          // Update "last_update" field in "Tickets" table
          $fieldValues = array();
          $keyValues = array();
          $fieldValues["last_update"] = $values["date"];
          $keyValues["id"] = $values["ticket_id"];
          DB::Update("tickets", $fieldValues, $keyValues);
        • JavaScript OnLoad event

          / To refresh the list page withoud reloading the page after record added
          this.on('afterSave', function() {
              var pageObj = window.listPage;
              Runner.runnerAJAX(Runner.pages.getUrl(pageObj.tName, pageObj.pageType)+"?a=return",
              pageObj.ajaxBaseParams,
              function(respObj){
                  pageObj.pageReloadHn.call(pageObj, respObj)
              });
          });
      • Edit page
        • Before record updated

          // Update "last_update" field in "Tickets" table
          $fieldValues = array();
          $keyValues = array();
          $fieldValues["last_update"] = $values["date"];
          $keyValues["id"] = $values["ticket_id"];
          DB::Update("tickets", $fieldValues, $keyValues);
        • JavaScript OnLoad event

          // To refresh the list page withoud reloading the page after record added
          this.on('afterSave', function() {
              var pageObj = window.listPage;
              Runner.runnerAJAX(Runner.pages.getUrl(pageObj.tName, pageObj.pageType)+"?a=return",
              pageObj.ajaxBaseParams,
              function(respObj){
                  pageObj.pageReloadHn.call(pageObj, respObj)
              });
          });

 

Add email notification to “support@mobitek.my” for each support case created.

MODIFICATION in PHPRunner or cPanel or PHPMyAdmin

  1. Go to “Misc” tab -> “Email settings…” and set as below:-
  2. Go to “Events” tab -> “tickets” -> “Add page” -> “After record added” and add below code:-

    // Get the record values from the $values array
    $newRecordData = $values; // $values contains the data of the newly added record
    // Get the produdct name
    $query = DB::Query("SELECT product_name FROM products WHERE id = " . $values["product_id"]);
    $data = $query->fetchAssoc();
    $productName = $data["product_name"];
    
    // Define email parameters
    $from = $newRecordData['email'];
    $to = "support@mobitek.my";
    $subject = "[Ticket ID: #" . $newRecordData['ticket_id'] . " ] --> " . $newRecordData['subject'];
    $body = "A new ticket has been raised.\n\n";
    $body .= "Requestor: " . $newRecordData['requestor'] . "\n";
    $body .= "Product: " . $productName . "\n";
    $body .= "Link: https://" . $_SERVER[HTTP_HOST] . "/v.1.0/tickets_list.php?q=%28ticket_id~equals~" .
                        $newRecordData['ticket_id'] . "%29&orderby=dticket_id\n";
    
    // Send the email
    $ret = runner_mail(array(
            'from' => $from,
        'to' => $to,
        'subject' => $subject,
        'body' => $body
    ));
    
    // Optional: Display an error message if the email failed to send
    if (!$ret["mailed"]) {
        echo $ret["message"];
    }
    
    // Redirect to view page if not logged in using "Big-Boss"
    if (isset($_SESSION["nonAdmin"])) {
        header("Location: tickets_view.php");
        exit();
    }

 

Implement “Database” Security Method.

MODIFICATION in PHPRunner or cPanel or PHPMyAdmin

  1. Go to “Security” tab:-
    • set the “JWT secret key” in “Session keys…” to “YaaBF0qi8Wy7X9Wns2Ci” to match the key in “SSO”.
    • use “Database” to store login information
    • add a new user “Big-Boss”.
    • set “Dynamic Permissions”.

    • build and upload the project. Login using the “Big-Boss” account.
    • go back to the project, use the encryption for password.
    • build and upload the project again and change the password for “Big-Boss”.


 

Set permission to all users.

MODIFICATION in PHPRunner or cPanel or PHPMyAdmin

  1. Log in  to “helpdesk.mobitek.my” as “Big-Boss”.
  2. Go to “Admin Area”.
  3. Set the permission for all groups as below:-
    • <Admin>
    • <Default>

 

Add “Show/hide columns” button.

BEFORE AFTER

MODIFICATION in PHPRunner or cPanel or PHPMyAdmin

  1. Go to”Designer” tab, select “tickets” in Tables list and click on “list” tab. Under the “Options” section, click on the button next to the “list”.
  2. Check “Allow show/hide fields on page”.

 

Rename “Problem” to “Description of Problem” in the UI (there is no need to rename it in database).

BEFORE AFTER

MODIFICATION in PHPRunner or cPanel or PHPMyAdmin

  1. Go to “Designer” tab, select “tickets” in Tables list, click on “Problem” label and rename it to “Description of Problem”.

 

Rename “HelpDesk” to “Help Desk”.

BEFORE AFTER

MODIFICATION in PHPRunner or cPanel or PHPMyAdmin

  1. Go to “Editor” tab, double-click on “HelpDesk Version 1.0” logo and rename it to “Help Desk Version 1.0”.

 

Add these information (column) into the message body of e-mail notification:-

  • Product
  • Requestor
BEFORE AFTER

MODIFICATION in PHPRunner or cPanel or PHPMyAdmin

  1. Go to “Events” tab, click on “tickets” -> “Add page” -> “After record added” and add code as below:-

 

Add border for the “ticket_replies” list page.

BEFORE AFTER

MODIFICATION in PHPRunner or cPanel or PHPMyAdmin

  1. Go to “Designer” tab and select “ticket_replies” in the Tables list.
  2. Select all cells in “ticket_replies” grid and set the border to black 1px.

 

v. 1.0 Beta Testing Completed on 2025-11-20

TEST OBJECTIVE: Does other users except “Big-Boss” can only see the ticket’s add page and not the ticket’s list page?

TESTING METHODOLOGY TEST RESULT
  1. Log in to “helpdesk.mobitek.my” as:-
    • Username = Test
    • Password = test
  2. The page should redirected to “Tickets” -> “Add new” page.
  3. Enter the ticket details and click “Save”.
  4. The page will redirected to the “Tickets” -> “View” page.
Page redirected to “https://helpdesk.mobitek.my/v.1.0/tickets_add.php” after logged in

 

The page redirected to “https://helpdesk.mobitek.my/v.1.0/tickets_view.php” after the ticket has been added


 

TEST OBJECTIVE: Does an email send to “support@mobitek.my” for each new ticket created?

TESTING METHODOLOGY TEST RESULT
  1. Add a new ticket.
  2. Fill up all details and click “Save”.
  3. A new email should be sent to “support@mobitek.my”.
 

 

How To Automatically Run MySQL Dump in Windows and Linux to Backup MySQL Database

Windows

  1. Create a batch file “sweetcoc_ams_backup.bat” for mysqldump. Copy below code into the batch file:-
    @echo off
    REM set mysqldump path
    SET mysqldump_path="C:\wamp64\bin\mysql\mysql5.7.26\bin\mysqldump.exe"
    REM credentials to connect to MySQL server
    SET mysql_user=root
    SET mysql_password=
    REM backup storage location
    SET backup_folder="C:\wamp64\www\database_backups"
    REM backup file name
    SET backup_name=%backup_folder%\sweetcoc_ams_%DATE:~-4%-%DATE:~7,2%-%DATE:~4,2%.sql
    REM create backup
    "C:\wamp64\bin\mysql\mysql5.7.26\bin\mysqldump.exe" -u %mysql_user%
    sweetcoc_ams > %backup_name%
  2. Create a new Task Scheduler that executes the batch file.

 

Linux

  1. Create a new PHP file and copy below code into it.
    <?php
    
    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);
    
    $database = '*****';
    $user = '*****';
    $pass = '*****';
    $host = '*****';
    //$dir = dirname(__FILE__) . '/dump.sql';
    $dir = dirname(__FILE__);
    
    echo "Backing up database to {$dir}.";
    echo "\n";
    
    exec("mysqldump --user={$user} --password={$pass} --host={$host} --no-tablespaces {$database} | zip > \${HOME}/database_backup/{$database}_`date '+%Y-%m-%d_%H:%M'`.sql.zip", $output);
    
    echo "\n";
    echo "Backup completed.";
    
    ?>
  2. Create a new Cron Job and point to the path where the PHP file is saved.
    /usr/local/bin/php
    /home4/sweetcoc/database_backup/mysqldump.php
  3. The Cron Job will save the database as below:-

 

Restoring a Back-Up Database

  1. Go to “D:\” drive in UBS-SERVER.
  2. Compress “AMS Back-Up” folder to “AMS Back-Up.zip”.
  3. Copy “AMS Back-Up.zip” into “C:\wamp64\www\” folder in HP-6305-W7PRO and extract it.
  4. After extracted, move all folders inside “AMS Back-Up” folder to the root folder of “C:\wamp64\www\”. The folder hierarchy should be as below:-
  5. Go to “Start”, search for “wampserver” and run “Wampserver64”.
  6. Wait and ensure the icon is green in “System Tray” that indicates all services are running.
  7. If not then click on “Wampserver64” icon and select “Restart All Services”.
  8. Click on Windows “System Tray” dropdown -> click “Wamserver64” icon -> click “phpMyAdmin”. “phpMyAdmin” will be opened on the browser.
  9. Enter the “username = root” and leave the password empty. Click “Go”.
  10. Click on “sweetcoc_ams” database -> click “Import”.
  11. Click “Choose file”.
  12. Browse “C:\wamp64\www\database_backups”, sort the files by “Date modified” and open the latest SQL file.
  13. Leave everything as it is and click “Go”.
  14. Go to browser and open “http://localhost/punchcard”.
  15. Finally HP-6305-W7PRO” will have the latest version of “E-Punch Card” and “sweetcoc_ams” database.

How to Upgrade SERVERLINK

  1. Firstly, create a restore point.
  2. Open SERVERLINK, in “HOME”, click on the update.
  3. Let SERVERLINK download the update.
  4. After the download has been completed, a popup will appear. Click “Yes”.
  5. Click “Next” on each Setup.

    Note: if you choose “Only dowload setup (do not install)” , then the setup file is downloaded into this folder “C:\Users\…\AppData\Local\Temp\UpdateRelease.exe“. Run the “UpdateRelease.exe” at a later date.

  6. Restart UBS-SERVER.
  7. Finally, check the version displayed is the latest version (s.c.).

Comparison of E-mail API used in PHP

Runner_Mail() PHPMailer() PHP Mail()
SMTP, user name, password, port, etc. are set inside the PHPRunner UI

PHPMailer() is called by Runner_Mail()

SMTP is set inside the PHP code itself

SMTP is set in “PHP.ini”
<?php

require_once(“include/dbcommon.php”);

 

$email = “t1@mobitek.my”;

$msg = “”;

$subject = “New data record”;

 

$msg.= “Message: [Message]\r\n”;

$msg.= “Recipient: Recipient\r\n”;

$msg.= “Date/Time: DateTimeQueue\r\n”;

runner_mail(array(‘to’ => ‘$email’, ‘subject’ => $subject, ‘body’ => $msg));

?>

<?php
include_once(‘libs/phpmailer/class.phpmailer.php’);
include_once(‘libs/phpmailer/class.smtp.php’);$mail = new PHPMailer( true );
// Mail settings
$mail->isSMTP();   //Send using SMTP
$mail->Host = ‘mail.sweetco.com.my’;   //Set the SMTP server to send through
$mail->SMTPAuth = true;   //Enable SMTP authentication
$mail->Username = ‘factory@sweetco.com.my‘;   //SMTP username
$mail->Password = ‘2022@Beranang@Factory’;   //SMTP password
//$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;        //Enable implicit TLS encryption
$mail->Port = 587;   //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
$mail->setFrom(‘support@mobitek.my‘, ‘MOBITEK Support’);
$mail->isHTML(false);$mail->To = “t1@mobitek.my”;
$mail->Subject = “This is Subject”;
$mail->Body = “This the body”;
$mail->Send();?>
Open “php.ini” and search for “smtp” (there are no entries for no username and password)

 

[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from =“admin@wampserver.invalid”

; For Unix only.  You may supply arguments as well (default: “sendmail -t -i”).
; http://php.net/sendmail-path
;sendmail_path =

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail().
;mail.force_extra_parameters =

; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = On

; The path to a log file that will log all mail() calls. Log entries include
; the full path of the script, line number, To address and headers.
;mail.log =
; Log mail to syslog (Event Log on Windows).
;mail.log = syslog

MOBITEK Q25 4G Modem Can Use IP Address instead of COM Port Number

TEST OBJECTIVE TESTING METHODOLOGY TEST RESULT
Can hyper terminal connect to MOBITEK Q25 4G Modem via IP address instead of COM port and run “hyper terminal test“?
  1. Connect MOBITEK Q25 4G Modem  to LAN via LAN port.
  2. Assign IP address to Q25 using USR-TCP232 to be in the same subnet of the LAN. For this example:
    • the gateway is “192.168.10.1”
    • set the IP address for Q25 in this subnet “192.168.10.???”
    • Get the “Module port” of Q25 in USR-TCP232
  3. Run hyper terminal and connect using “TCP/IP (Winsock)”.
  4. Enter the “Host address” and “Port number”
  5. Type “AT” to Hyper Terminal to see if Q25 is responding
  • 860147050425139
  • 860147050425154

How to Implement Log-In Page using “Database” for a Web Application

  1. Edit “Email settings…” in “Misc” tab.
  2. Add new table “users” in “Security” tab.
  3. Set “Dynamic permissions” in “Security” tab. Add a new user.
  4. Build and run the PHPRunner project in localhost. Log in using the username and password added previously. Let the PHPRunner project open in localhost.
  5. Go to PHPRunner project again. Enable “Password hashing (encryption)” in “Registration and passwords…”.
  6. Build and run PHPRunner project again in localhost.
  7. Go to “Admin Area”.
  8. Go to “Add/Edit users”, edit the password. To use back the same password, first change the password to another password. Save it and then edit it back to change to the original password.

MOBITEK Q25 Can Use Internet Application and Send SMS at the Same Time

TEST OBJECTIVE TESTING METHODOLOGY TEST RESULT
Can MOBITEK Q25 connect to internet and send out SMS at the same time?
  1. Connect to internet, refer to https://mobitek-system.com/blog/category/iot/mobitek-q25-4g-modem/
  2. Use hyper terminal  to send out SMS (hyper-terminal test as per QC).
  3. Do not close the COM port in hyper terminal, keep it open (connected). Open web browser and visit www.mobitek.my
TEST 1

 

TEST 2