Tips and tutorials

How to automatically detect the country of a user?

Using the free API service provided by ipinfo.io, you can add code into hooks for detecting the country of the current user, given his IP address. Here is how this code looks like:

  $country = 'Unknown'; // default in case country can't be detected
  $ip = $_SERVER['REMOTE_ADDR'];
  $udata_json = @file_get_contents("https://ipinfo.io/{$ip}");
  if($udata_json){
    $udata = json_decode($udata_json, true);
    $country = $udata['country'];
  }
  // you can now use $country in your code ...

Here is a demonstration that shows your country!

Your country is US

Country info retrieved from this service is ISO Alpha-2 abbreviation.

Using lookup fields in calculations


When customizing the before_insert, after_insert, before_update or after_update hooks to make a calculation, you might encounter a case where one or more fields in the formula you're calculating is a lookup field (foreign key). In this case, the value of $data['fieldname'] (where fieldname is the name of the concerned lookup field) is probably NOT the value you'd like to use for your calculation.

Step by step: hosting your AppGini application on Bluehost


Bluehost is a widely-used website hosting service that offers a friendly interface and good technical support at a reasonable price. Due to its popularity, we've wrote this detailed page describing step-by-step how to publish your AppGini-generated web application there.

Download free open source web applications


All the applications listed here are MIT-licensed free open source web applications generated by AppGini. You can easily customize them by editing the source code, or by editing the accompanying project files in AppGini (both the trial and full version of AppGini can be used).

Install AppGini on Ubuntu Linux

Mac users heads up! You can follow very similar steps to install AppGini on MacOS using PlayOnMac :)

1- Install "PlayOnLinux" from the Ubuntu Software Center

Creating an auto-updating balance field


In the Online Inventory Management application, the items table has a balance column (see the screenshot below) that keeps track of the current inventory balance for each item. It gets updated automatically whenever a transaction is made. Outgoing transactions decrease the item balance, while incoming transaction increase it.

Installing a local testing environment (xampp)



You can test your AppGini-generated web applications on a local machine before deploying them online. To do so, you need to install a web server, MySQL, and PHP. Of course, installing and configuring all of these programs is a lot of headache. Fortunately, there is an easier way: download and install Xampp, a single download that takes care of all the necessary work in one shot.

Note: All of the above tools are free and open source software.

Limiting user input to pre-defined options in AppGini

Some data fields in your application might allow users to select among only a limited set of options. We can set up fields this way using "option lists" ... Let's see how AppGini makes this possible in a few simple steps.

Video tour: Changing your application theme

In this screencast, we'll learn how to change the application theme. As of AppGini 5.20, you can choose a Bootstrap 3 based theme for your generated application. AppGini comes with 12 themes. All of them are responsive, meaning that they automatically look great on any screen size.

Syndicate content