print certificates (something like "creating a printable invoice" in appgini udemy course.

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
fgazza
Veteran Member
Posts: 205
Joined: 2019-04-30 17:37

print certificates (something like "creating a printable invoice" in appgini udemy course.

Post by fgazza » 2019-05-10 19:31

Hello! I'm trying to create something like the printable bill explained by Ahmad in the udemy course.

Specifically, I would like to generate time sheets with the list of people who register for an activity.

My activity table is called "appuntamenti" but has an alias and in the database is called appuntamenti1

The field with the primary key of the appuntamenti table is called pri_key

I tried to write this code but it doesn't work. Can anyone help me figure out where I'm wrong?

Thanks a lot!

Fabiano

<?php
$currDir = dirname(__FILE__);
include("$currDir/defaultLang.php");
include("$currDir/language.php");
include("$currDir/lib.php");
include_once("$currDir/header.php");
/* grant access to all users who have access to the appuntamenti table */
$appuntamenti1_from = get_sql_from('appuntamenti1');
if(!$appuntamenti1_from) exit(error_message('Accesso Negato!', false));

(NOTE: if I comment last two line my site give me the error "ID appuntamento non valido!" otherwise the error is Accesso Negato!)

/* get invoice */
$appuntamenti1_id = intval($_REQUEST['pri_key']);
if(!$appuntamenti1_id) exit(error_message('ID appuntamento non valido!', false));

/* retrieve appuntamenti info */
$appuntamenti1_fields = get_sql_fields('appuntamenti1');
$res = sql("select {$appuntamenti1_fields} from {$appuntamenti1_from} and pri_key={$appuntamenti1_id}", $eo);
$appuntamenti1 = db_fetch_assoc($res);

var_dump($appuntamenti1);

include_once("$currDir/footer.php");
?>

Post Reply