Some applications may require to provide users with quick editing capabilities. While Inline Edit does just that entering inline edit mode for multiple records can be painful. It would be much easier is some or all fields appear as edit controls when page is loaded.

While PHPRunner/ASPRunner.NET/ASPRunnerPro do not have such functionality built-in it’s fairly easy to implement it in your project. In this sample project we’ll show how to make fields ProductName, UnitPrice and Discontinued editable automatically. For now we only support text boxes and check boxes. Data is saved automatically once you leave the text box or check off check box. To see that data is actually saved in the database simply reload the page.

You can also see how server-side validation works. Enter Unit Price that is less than $20 and move to the next field to see it in action. Record won’t be saved until you enter $20 or more price value.

Live demo

Continue Reading "Excel like grid in PHPRunner applications"

In recent Using Google Docs Viewer to preview documents online article we reviewed the use of Google Docs Viewer for document preview purposes. While this is a viable approach two main concerns arise:

  • dependency on third party service
  • security issues

For those who is looking for another solution there is a brilliant Javascript library named ViewerJS that supports PDF files as well as Open Office formats (.odp, .odt, .ods). This library can display documents right in the web browser, no need to install any additional software. Documents can be displayed either in full page mode or embedded into other pages. See some examples.

Continue Reading "Adding PDF preview support to your web application"

The latest version of Runner family products comes with several improvements in mapping area like support of Bing and OpenStreet maps, maps in dashboards, custom map markers etc. In this article I want to show a couple more mapping features that you can use in your apps, heat maps and clustered maps.

Live demo

Both those features can help you visualize large amounts of mapping data. It gives your users a better insight on your data. For instance, those maps tell you that if you are a taxi driver in NYC, your chances to pickup a passenger are higher if you are nearby Trump Tower.

Continue Reading "New mapping features"

Some web applications like forum or Q&A website may benefit from the list of active users displayed somewhere on the page. In this article we’ll show how to add such functionality to PHPRunner application. ASPRunnerPro/ASPRunner.NET code to follow.

We need to remember that sometimes in web application we can not determine if user is still active or left his computer or even closed his browser. What we actually going to do is to find the list of users that performed some action on the website in last 10 minutes.

We assume that login table is named users and username field is username. We are going to add one more datetime field to the login table named lastaccess.

Continue Reading "Displaying a list of users that are currently logged in"

Fairly often we want to split long forms into several steps letting users fill a few fields on each step. Besides making a long form easier to fill out for your users you can also save partial results between pages.

Here is how this can be done in PHPRunner, ASPRunnerPro and ASPRunner.NET.

Lets assume we have Cars table with about 20 fields and we want to split Add/Edit pages into three steps.

1. Create two custom views

Create two custom views (Cars1 and Cars2) based on Cars table

Continue Reading "How to split Add/Edit pages into several subpages"

Most popular websites like Facebook, Twitter, Dropbox, LinkedIn etc provide an API that allows to retrieve or post data programmatically. API examples come in many programming languages and PHP is usually one of them. In this article we’ll show how easy is to add API calls to your PHPRunner project.

Lets start by adding Twitter posting functionality. We’ll be using a lightweight twitter-php library for this purpose. Similar libraries exist for other languages as well.

1. Setup a developer account with Twitter.

A quote from twitter-php usage page:

Sign in to the http://twitter.com and register an application from the http://dev.twitter.com/apps page. Remember to never reveal your consumer secrets. Click on My Access Token link from the sidebar and retrieve your own access token. Now you have consumer key, consumer secret, access token and access token secret.

Continue Reading "Using third party API in PHPRunner apps. Playing with Twitter."

Date/time calculations can be perform either on database side or in your server side language (PHP, ASP, C#) or even in Javascript. We’ll try to cover all those scenarios.

When copying and pasting code from this article to your application replace table name (mytable) and field names (posted, dob).

MySQL

Calculating age

SELECT DATE_FORMAT(NOW(), '%Y') - DATE_FORMAT(dob, '%Y') - 
(DATE_FORMAT(NOW(), '00-%m-%d') < DATE_FORMAT(dob, '00-%m-%d')) 
from mytable AS age

30 days before date

select posted, DATE_SUB(posted, INTERVAL 30 DAY) from mytable

Date plus 30 days

select posted, DATE_ADD(posted, INTERVAL 30 DAY) from mytable

Difference between two dates in days

select posted, DATEDIFF(now(), posted) from mytable
Continue Reading "Date/time handling in web applications"

Happy Halloween everyone! Just a little Halloween fun project. To make your website more interesting you can choose to display a random background image for each visitor. Here is how it’s going to look: How to add this functionality to your project. 1. Download a set of sample images and unzip it to the output folder keeping directory structure. This should create a folder named backgrounds with a few images in there. You are free to add more images or to remove any you don’t…Continue Reading “Random page background: Halloween edition”