Start a conversation

Programming

Programming Tips and Tutorials within Scriptcase

  • Calculating the difference between times

    Example of PHP code that get the difference between time: FUNCTION h2m($hours) {  $t = EXPLODE(:, $hours); $h = $t[0]; IF (ISSET($t[1])) { $m = $t[1];  } ELSE { $m = 00;  } $mm = ($h * 60)+$m; RETURN ...

  • Separating the date and time display in a field in a query DataTime

    Create a table in MySQL database with the code below CREATE TABLE `banking_bill` ( `id` int(11) NOT NULL auto_increment, `bill_value` varchar(10) NOT NULL, `expiration_date` datetime NOT NULL, `number...

  • Generate word document for download

    In any application, create a PhP button. Within the button place codes: [field_id] = {field_id}; [field_name_doc]={docname}; [field_name_file]={filename}; sc_redir(blank_2); Put the globals variables ...

  • Checking if a field exists in the database via ajax.

    For do this sample we use the idea of a Customers form,with field Cod, CPF and Name. As usual in my forms always use the field cod in auto-increment Name is editable and 100 positions  and CPF editabl...

  • Verifying if is running under a safe site(web server llS.)

    The Scriptcase provides the macro sc_site_ssl (https protocol) to see if the site is safe. Note: This macro works only for the IIS web server (Internet Information Server). Example 1: Using the affirm...

  • Eventos JavaScript

    JavaScript é uma linguagem interpretada pelo browser. Foi criada com o intuito de realizar interações no lado do cliente, sem a necessidade de passar scripts para o servidor, fazendo com que essas int...

  • Manipulating folders in PHP

    To create folders by the PHP should use the mkdir() function to remove should use rmdir() function. mkdir() function: In mkdir function you must indicate which way the folder and the security level is...

  • Criando métodos JavaScript

    Exemplo de criação de mestre/detalhe usando métodos javascript: 1. Primeiramente vamos criar uma aplicação Blank e inserir o seguinte código abaixo: Obs.: altere o nome da aplicação e pasta pelo nome ...

  • Text Import

    We can also use the code to perform the import other file types. For example import the tables and data from a text file (txt). First we should create two applications of the type Blank, let's call th...

  • ReportPDF with TCPDF library

    Is using TCPDF to generate PDF files. Started in 2002, TCPDF is now one of the most active open source projects in the world, used daily by millions of users and included in thousands of CMS and web a...