How to display image in printing page
How to display image in printing page
Hello
I am creating custom printing page and I want to display the image on it. I try this code
<div class="col-sm-6">
<!-- customer info -->
<h5> : <?php echo $order['description']; ?></h5>
<?php echo $order['logo']; ?>
</div>
but the image do not display, only the name of the image is showing. Please any help will be appreciated.
Thank you
I am creating custom printing page and I want to display the image on it. I try this code
<div class="col-sm-6">
<!-- customer info -->
<h5> : <?php echo $order['description']; ?></h5>
<?php echo $order['logo']; ?>
</div>
but the image do not display, only the name of the image is showing. Please any help will be appreciated.
Thank you
Re: How to display image in printing page
Hi,
you need to add the image tag to the html code. The $order['logo'] will go to the src.
you need to add the image tag to the html code. The $order['logo'] will go to the src.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: How to display image in printing page
Thank you for support, will give a try
Re: How to display image in printing page
Unfortunately I have try all these code below but no one works for me ! I am missing something...
<img src="images/<?php echo $order['logo']['name'] ?>"/>
<img src="images/<?php echo $_FILES['logo']['name'] ?>"/>
<img src="<?php echo images .'/' . $logo; ?>">
<?php echo $order['logo']; ?>
<?php echo '<img src="' .$logo.'">;' ?>
<?php echo "<img src='images/".$order['logo'].">"; ?>
<?php
echo'
<img src="images/'.$order['logo'].'" />
';
?>
<img src="<?php echo '".$order['logo'];"' ?>"
<?php echo '<img src=\'' . $order['logo'] . '\'>';?>
<img src="images/<?php echo $order['logo']['name'] ?>"/>
<img src="images/<?php echo $_FILES['logo']['name'] ?>"/>
<img src="<?php echo images .'/' . $logo; ?>">
<?php echo $order['logo']; ?>
<?php echo '<img src="' .$logo.'">;' ?>
<?php echo "<img src='images/".$order['logo'].">"; ?>
<?php
echo'
<img src="images/'.$order['logo'].'" />
';
?>
<img src="<?php echo '".$order['logo'];"' ?>"
<?php echo '<img src=\'' . $order['logo'] . '\'>';?>
Re: How to display image in printing page
Hi,
as far as I can see the path is missing.
Can you please try:
Regards,
Jan
as far as I can see the path is missing.
Can you please try:
Code: Select all
<?php
$logo_src = getUploadDir("") .$order["logo"];
echo "<img src=\"{$logo_src}\" />";
?>
Jan
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: How to display image in printing page
Yes, works absolutely fine. Thank you a lot for time and kind support.
All my best
All my best
Re: How to display image in printing page
Great, I'm happy to hear that the problem is solved now!
Best,
Jan
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: How to display image in printing page
Hello.
I need to do the same thing but since the jpg file I want to display on the page is not in the same table but in a table called "pictures" I can't get the url of the image but only the primary key of the record of the "pictures" table (the url is in the "picture" field of the "pictures" table). More precisely I would like to insert the url saved in the "picture" field of the "pictures" table in the dv of the "subscriptions" table which contains an "image" field which is a lookup field of the "graphics" field of the "activity" table. The "graphics" field of the "activity" table is in turn a lookup field of the "picture" field of the "graphics" table.
In the image I try to better describe the problem
I need to do the same thing but since the jpg file I want to display on the page is not in the same table but in a table called "pictures" I can't get the url of the image but only the primary key of the record of the "pictures" table (the url is in the "picture" field of the "pictures" table). More precisely I would like to insert the url saved in the "picture" field of the "pictures" table in the dv of the "subscriptions" table which contains an "image" field which is a lookup field of the "graphics" field of the "activity" table. The "graphics" field of the "activity" table is in turn a lookup field of the "picture" field of the "graphics" table.
In the image I try to better describe the problem
Re: How to display image in printing page
Hi,
well if you get the primary key of the pictures table (let call the variable key).
Then you can use
Assuming that the pictures table has the url field to hold the url of the image.
well if you get the primary key of the pictures table (let call the variable key).
Then you can use
Code: Select all
$url = sqlvalue("SELECT url from pictures where pri_key = '{$key}'");
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: How to display image in printing page
Thank you very much pböttcher,
unfortunately it doesn't work:
I wrote like this:
________________________
$url = sqlvalue ("SELECT picture from pictures where pri_key = '{$key}'");
/* to test if work: */
echo $url;
________________________
but nothing appears!
I hope you can help me.
Thanks!
Fabiano
unfortunately it doesn't work:
I wrote like this:
________________________
$url = sqlvalue ("SELECT picture from pictures where pri_key = '{$key}'");
/* to test if work: */
echo $url;
________________________
but nothing appears!
I hope you can help me.
Thanks!
Fabiano
Re: How to display image in printing page
Hi,
did you check that $key contains the correct primary key of the pictures table? Can you check the query on the DB directly?
did you check that $key contains the correct primary key of the pictures table? Can you check the query on the DB directly?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: How to display image in printing page
hello!
the strange thing is that if I look in the tables of my database the image column of the subscritpions table is empty (null)
if I run SELECT picture from pictures where pri_key = '1'
the result is the name of the jpg file loaded in the pictures table with pri_key = 1 but if I run the query
SELECT picture from pictures where pri_key = '{$ key}'
the result is that no table row is found and this message appears:
Warning: # 1292 Truncated incorrect DOUBLE value: '{$ key}'
could the problem depend on the use of multiple nested lookup fields?
In fact in the pictures table there are the description and picture fields.
In the activity table there are the title, the picture_description fields (which is a lookup that points to the description field of the pictures table) and the graphic field which is an auto-filled lookup* that points to the picture field of the pictures table).
Finally in the table subscriptions there are the activity field (which is a lookup that points to the title field of the activity table and the image field which is an auto-filled lookup that points to the graphic field of the activity table.
the strange thing is that in phpmyadmin looking at the table subscriptions I see that the lookup activity field with the value 2 (the pri_key of the record in the activity table) but the lookup image field remains empty (null).
* when I say "auto-filled" I refer to the "auto fill" option of the software appgini.
I enclose some screenshots to better illustrate the problem
the strange thing is that if I look in the tables of my database the image column of the subscritpions table is empty (null)
if I run SELECT picture from pictures where pri_key = '1'
the result is the name of the jpg file loaded in the pictures table with pri_key = 1 but if I run the query
SELECT picture from pictures where pri_key = '{$ key}'
the result is that no table row is found and this message appears:
Warning: # 1292 Truncated incorrect DOUBLE value: '{$ key}'
could the problem depend on the use of multiple nested lookup fields?
In fact in the pictures table there are the description and picture fields.
In the activity table there are the title, the picture_description fields (which is a lookup that points to the description field of the pictures table) and the graphic field which is an auto-filled lookup* that points to the picture field of the pictures table).
Finally in the table subscriptions there are the activity field (which is a lookup that points to the title field of the activity table and the image field which is an auto-filled lookup that points to the graphic field of the activity table.
the strange thing is that in phpmyadmin looking at the table subscriptions I see that the lookup activity field with the value 2 (the pri_key of the record in the activity table) but the lookup image field remains empty (null).
* when I say "auto-filled" I refer to the "auto fill" option of the software appgini.
I enclose some screenshots to better illustrate the problem
Re: How to display image in printing page
Hi,
in the phpmyadmin you cannot run
SELECT picture from pictures where pri_key = '{$ key}' (anyway there is a blank between the $ and key which should not be there).
So you need to check the value of the variable $key at the time you call the SQL statement.
Try to add
echo "Key = ".$key;
exit;
and have a look at the output. Does it provide the expected primary key value for your image?
in the phpmyadmin you cannot run
SELECT picture from pictures where pri_key = '{$ key}' (anyway there is a blank between the $ and key which should not be there).
So you need to check the value of the variable $key at the time you call the SQL statement.
Try to add
echo "Key = ".$key;
exit;
and have a look at the output. Does it provide the expected primary key value for your image?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: How to display image in printing page
sorry pböttcher can you tell me exactly what i have to write in sql query of phpmyadmin? sorry but i'm not expert with the code
Thanks!
Thanks!
Re: How to display image in printing page
Hi,
not in phpmyadmin,
write the code
echo "Key = ".$key;
exit;
in you php file where you wil call
$url = sqlvalue ("SELECT picture from pictures where pri_key = '{$key}'");
afterwards.
This shall display the Key that you would use in the SQL statement.
not in phpmyadmin,
write the code
echo "Key = ".$key;
exit;
in you php file where you wil call
$url = sqlvalue ("SELECT picture from pictures where pri_key = '{$key}'");
afterwards.
This shall display the Key that you would use in the SQL statement.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: How to display image in printing page
hi. Putting echo "Key = ".$key; the output is
Key =
Key =
Re: How to display image in printing page
ok, so that explains why your SQL statement fails.
Now you need to figure out how to populate the $key with the value of primary key that you have according to your description.
Now you need to figure out how to populate the $key with the value of primary key that you have according to your description.
I need to do the same thing but since the jpg file I want to display on the page is not in the same table but in a table called "pictures" I can't get the url of the image but only the primary key of the record of the "pictures" table
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: How to display image in printing page
Yes but I have no idea how to do it!
I'm trying to auto copy content of llokup field in another field so i made another help request in the forum (see my post viewtopic.php?f=7&t=3254#p11162
but I have problem with this work too.
Hope you or someone will help me again to solve!
Thank you so much
Fabiano
I'm trying to auto copy content of llokup field in another field so i made another help request in the forum (see my post viewtopic.php?f=7&t=3254#p11162
but I have problem with this work too.
Hope you or someone will help me again to solve!
Thank you so much
Fabiano
Re: How to display image in printing page
ok, can you post the code you have currently.
Are you making your own page, or using a page generated by AppGini?
Are you making your own page, or using a page generated by AppGini?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: How to display image in printing page
Hi and Thank you so much for the help of the forum and specially to you pböttcher!
In the forum I spoke to simplify, of three tables "image", "activity" and "subscription" (tables that I actually used to do the tests). In reality, my tables are called "intestazioni_grafiche", "appuntamenti" and "partecipazione_evento_pubblico".
In the table "intestazioni_grafiche" I have a field "ig_ID" (primary key), a field "descrizione" (txt) and a field "grafica" (image upload).
In the table "appuntamenti" I have a field "pri_key", a field "intest_attestato_descr" (lookup to the field "descrizione" of the table "intestazioni_grafiche") and a field "intest_attestato_graph" (lookup to the field "grafica" of the table "headers_grafiche", set as "auto-fill") and a "url_intest_att_graph" field that I tried to use to copy on the fly (on change) the name of the image selected with the "url_intest_att_graph" field but with the following code (*see below) remains empty.
In the table "Partecipazione_evento_pubblico" I have a field "pri_key", a field "pri_key_appuntamento" (lookup that points to the field "pri_key" of the table "appuntamenti") and a field "int_attestato_graph" (lookup to the field "intest_attestato_graph" of the table "intestazioni_grafiche" , set as "auto-fill"),
* code where I try to copy and save the image name but it doesn't work (it’s in the file appuntamenti-dv.js):
function updateUrl() {
var intest_attestato_graph = $j( '#intest_attestato_graph' ).val(),
$j( '#url_intest_att_graph' ).text(intest_attestato_graph);
$j( '#url_intest_att_graph' ).val(intest_attestato_graph);
}
$j('#url_intest_att_graph').on('change', function() {
updateUrl();
});
Below there is the code inserted in the hook file of the partecipazione_evento_pubblico.php table to generate a "stampa attestato" button:
function partecipazione_evento_pubblico_dv($selectedID, $memberInfo, &$html, &$args){
/* if this is the print preview, don't modify the detail view */
if(isset($_REQUEST['dvprint_x'])) return;
ob_start(); ?>
<script>
$j(function(){
<?php if($selectedID){ ?>
$j('#partecipazione_evento_pubblico_dv_action_buttons .btn-toolbar').append(
'<div class="btn-group-vertical btn-group-lg" style="width: 100%;">' +
'<button type="button" class="btn btn-info btn-lg" onclick="stampa_attestato()">' +
'<i class="glyphicon glyphicon-print"></i> Stampa Attestato</button>' +
'</div>'
);
<?php } ?>
});
function stampa_attestato(){
var selectedID = '<?php echo urlencode($selectedID); ?>';
window.location = 'attestato_evento_pubblico.php?pri_key=' + selectedID;
}
</script>
<?php
$form_code = ob_get_contents();
ob_end_clean();
$html .= $form_code;
}
And finally here is the code I inserted in the "attestato_evento_pubblico.php" file that I created in the rott directory:
<?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 partecipazione_evento_pubblico table */
$evento_from = get_sql_from('partecipazione_evento_pubblico');
if(!$evento_from) exit(error_message('Non sei autorizzato a visualizzare questa risorsa!', false));
/* grant access to all logged users
$mi = getMemberInfo();
if(!$mi['username'] || $mi['username'] == 'guest'){
echo "Access denied";
exit;
}*/
/* get evento */
$evento_id = intval($_REQUEST['pri_key']);
if(!$evento_id) exit(error_message('Identificativo Evento non valido!', false));
/* retrieve evento info */
$evento_fields = get_sql_fields('partecipazione_evento_pubblico');
$res = sql("select {$evento_fields} from {$evento_from} and partecipazione_evento_pubblico.pri_key={$evento_id}", $eo);
if(!($evento = db_fetch_assoc($res))) exit(error_message('evento non trovato', false));
/*var_dump($evento);*/
/* elimina i primi 11 caratteri dal campo riunione_evento in modo da eliminare la data che precede il campo stesso e i "due punti" che seguono la data */
$riunione_evento = $evento['riunione_evento'];
$riunione_evento_no_data = substr($riunione_evento, 11);
/* prendi la prima lettera dal nome del partecipante*/
$nome_partecipante = $evento['nome'];
$iniziale_nome_partecipante = $nome_partecipante{0};
/* prendi la prima lettera dal cognome del partecipante*/
$cognome_partecipante = $evento['cognome'];
$iniziale_cognome_partecipante = $cognome_partecipante{0};
/* prendi le ultime due cifre dell'anno dal campo data_evento*/
$data_evento = $evento['data_evento'];
$anno_evento_aa = substr($data_evento, 8, 2);
/* togli i secondi dal campo orario */
$orario_evento = $evento['orario'];
$ora_inizio_no_sec = substr($orario_evento, 0, 5);
$ora_fine_no_sec = substr($orario_evento, 8, 6);
/* prendi il nome dell'immagine dell'intestazione grafica dell'attestato */
$url = sqlvalue("SELECT grafica from intestazioni_grafiche where ig_ID = '{$key}'");
echo "Key = ".$key;
exit;
?>
Thank you so much!
Fabiano
In the forum I spoke to simplify, of three tables "image", "activity" and "subscription" (tables that I actually used to do the tests). In reality, my tables are called "intestazioni_grafiche", "appuntamenti" and "partecipazione_evento_pubblico".
In the table "intestazioni_grafiche" I have a field "ig_ID" (primary key), a field "descrizione" (txt) and a field "grafica" (image upload).
In the table "appuntamenti" I have a field "pri_key", a field "intest_attestato_descr" (lookup to the field "descrizione" of the table "intestazioni_grafiche") and a field "intest_attestato_graph" (lookup to the field "grafica" of the table "headers_grafiche", set as "auto-fill") and a "url_intest_att_graph" field that I tried to use to copy on the fly (on change) the name of the image selected with the "url_intest_att_graph" field but with the following code (*see below) remains empty.
In the table "Partecipazione_evento_pubblico" I have a field "pri_key", a field "pri_key_appuntamento" (lookup that points to the field "pri_key" of the table "appuntamenti") and a field "int_attestato_graph" (lookup to the field "intest_attestato_graph" of the table "intestazioni_grafiche" , set as "auto-fill"),
* code where I try to copy and save the image name but it doesn't work (it’s in the file appuntamenti-dv.js):
function updateUrl() {
var intest_attestato_graph = $j( '#intest_attestato_graph' ).val(),
$j( '#url_intest_att_graph' ).text(intest_attestato_graph);
$j( '#url_intest_att_graph' ).val(intest_attestato_graph);
}
$j('#url_intest_att_graph').on('change', function() {
updateUrl();
});
Below there is the code inserted in the hook file of the partecipazione_evento_pubblico.php table to generate a "stampa attestato" button:
function partecipazione_evento_pubblico_dv($selectedID, $memberInfo, &$html, &$args){
/* if this is the print preview, don't modify the detail view */
if(isset($_REQUEST['dvprint_x'])) return;
ob_start(); ?>
<script>
$j(function(){
<?php if($selectedID){ ?>
$j('#partecipazione_evento_pubblico_dv_action_buttons .btn-toolbar').append(
'<div class="btn-group-vertical btn-group-lg" style="width: 100%;">' +
'<button type="button" class="btn btn-info btn-lg" onclick="stampa_attestato()">' +
'<i class="glyphicon glyphicon-print"></i> Stampa Attestato</button>' +
'</div>'
);
<?php } ?>
});
function stampa_attestato(){
var selectedID = '<?php echo urlencode($selectedID); ?>';
window.location = 'attestato_evento_pubblico.php?pri_key=' + selectedID;
}
</script>
<?php
$form_code = ob_get_contents();
ob_end_clean();
$html .= $form_code;
}
And finally here is the code I inserted in the "attestato_evento_pubblico.php" file that I created in the rott directory:
<?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 partecipazione_evento_pubblico table */
$evento_from = get_sql_from('partecipazione_evento_pubblico');
if(!$evento_from) exit(error_message('Non sei autorizzato a visualizzare questa risorsa!', false));
/* grant access to all logged users
$mi = getMemberInfo();
if(!$mi['username'] || $mi['username'] == 'guest'){
echo "Access denied";
exit;
}*/
/* get evento */
$evento_id = intval($_REQUEST['pri_key']);
if(!$evento_id) exit(error_message('Identificativo Evento non valido!', false));
/* retrieve evento info */
$evento_fields = get_sql_fields('partecipazione_evento_pubblico');
$res = sql("select {$evento_fields} from {$evento_from} and partecipazione_evento_pubblico.pri_key={$evento_id}", $eo);
if(!($evento = db_fetch_assoc($res))) exit(error_message('evento non trovato', false));
/*var_dump($evento);*/
/* elimina i primi 11 caratteri dal campo riunione_evento in modo da eliminare la data che precede il campo stesso e i "due punti" che seguono la data */
$riunione_evento = $evento['riunione_evento'];
$riunione_evento_no_data = substr($riunione_evento, 11);
/* prendi la prima lettera dal nome del partecipante*/
$nome_partecipante = $evento['nome'];
$iniziale_nome_partecipante = $nome_partecipante{0};
/* prendi la prima lettera dal cognome del partecipante*/
$cognome_partecipante = $evento['cognome'];
$iniziale_cognome_partecipante = $cognome_partecipante{0};
/* prendi le ultime due cifre dell'anno dal campo data_evento*/
$data_evento = $evento['data_evento'];
$anno_evento_aa = substr($data_evento, 8, 2);
/* togli i secondi dal campo orario */
$orario_evento = $evento['orario'];
$ora_inizio_no_sec = substr($orario_evento, 0, 5);
$ora_fine_no_sec = substr($orario_evento, 8, 6);
/* prendi il nome dell'immagine dell'intestazione grafica dell'attestato */
$url = sqlvalue("SELECT grafica from intestazioni_grafiche where ig_ID = '{$key}'");
echo "Key = ".$key;
exit;
?>
Thank you so much!
Fabiano
Re: How to display image in printing page
Hi,
you mention a table headers_grafiche, but you didn't discribe it.
In the appuntamenti-dv.js, what are you trying to catch? Is it, if the intest_attestato_descr changes, you want to have what?
In the attestato_evento_pubblico.php
what is the relation between the partecipazione_evento_pubblico and the intestazioni_grafiche table?
if it is based on the $evento_id, then you should try
$url = sqlvalue("SELECT grafica from intestazioni_grafiche where ig_ID = '{$evento_id}'");
echo "Key = ".$evento_id;
echo "Url= ".$url ;
to verify if that is correct.
you mention a table headers_grafiche, but you didn't discribe it.
In the appuntamenti-dv.js, what are you trying to catch? Is it, if the intest_attestato_descr changes, you want to have what?
In the attestato_evento_pubblico.php
what is the relation between the partecipazione_evento_pubblico and the intestazioni_grafiche table?
if it is based on the $evento_id, then you should try
$url = sqlvalue("SELECT grafica from intestazioni_grafiche where ig_ID = '{$evento_id}'");
echo "Key = ".$evento_id;
echo "Url= ".$url ;
to verify if that is correct.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: How to display image in printing page
sorry I accidentally translated the name of the table "intestazioni_grafiche" into "header_grafiche" but the table "header_grafiche" does not exist. Instead of "header_grafiche" I wanted to write "intestazioni_grafiche".
Now I try the query you suggested and let you know.
Now I try the query you suggested and let you know.
Re: How to display image in printing page
the result is:
Key = 10Url=
I try to answer to your question:
what is the relation between the partecipazione_evento_pubblico and the intestazioni_grafiche table?
In the table "appuntamenti" i select an image uploaded with the table "intestazioni_grafiche" so there is a lookup field to choose the image in the appuntamenti table from "intestazioni_grafiche" table. In this way when i create an appointment in the "appuntamenti" table i can select what image will appear in the certificate (attestato) of each user that subscribe to the appointment by the "partecipazione_evento_pubblico" table. When an user select an appointment by the appuntamenti table the appointment is associated with an image stored in the "intestazioni_grafiche" table So in partecipazione_evento_pubblico a subscriber can print his certificate launching the file attestato_evento_pubblico.php in witch i want to display the image selected from the "intestazioni_grafiche" table in the "appuntamenti" table.
In summary:
I have a table intestazioni_grafiche in which I upload images
I have another table appuntamenti which I decide which image of the previous table is associated with that appointment.
I have a last table partecipazione_evento_pubblico where by signing up for an appointment I also want to take the image associated with that appointment.
In the table .... there is a button that allows you to open the "attestato_evento_pubblico" file where I see some data of the registration (practically a certificate of participation in the appointment) and I want to see also the image originally chosen.
Thank you!
Fabiano
Key = 10Url=
I try to answer to your question:
what is the relation between the partecipazione_evento_pubblico and the intestazioni_grafiche table?
In the table "appuntamenti" i select an image uploaded with the table "intestazioni_grafiche" so there is a lookup field to choose the image in the appuntamenti table from "intestazioni_grafiche" table. In this way when i create an appointment in the "appuntamenti" table i can select what image will appear in the certificate (attestato) of each user that subscribe to the appointment by the "partecipazione_evento_pubblico" table. When an user select an appointment by the appuntamenti table the appointment is associated with an image stored in the "intestazioni_grafiche" table So in partecipazione_evento_pubblico a subscriber can print his certificate launching the file attestato_evento_pubblico.php in witch i want to display the image selected from the "intestazioni_grafiche" table in the "appuntamenti" table.
In summary:
I have a table intestazioni_grafiche in which I upload images
I have another table appuntamenti which I decide which image of the previous table is associated with that appointment.
I have a last table partecipazione_evento_pubblico where by signing up for an appointment I also want to take the image associated with that appointment.
In the table .... there is a button that allows you to open the "attestato_evento_pubblico" file where I see some data of the registration (practically a certificate of participation in the appointment) and I want to see also the image originally chosen.
Thank you!
Fabiano
Re: How to display image in printing page
Hi Fabiano,
please try in attestato_evento_pubblico.php:
$url=sqlvalue("select i.grafica from partecipazione_evento_pubblico p left join appuntamenti a on p.riunione_evento=a.pri_key left join intestazioni_grafiche i on a.intest_attestato_descr=i.ig_ID where p.pri_key='{$evento_id}'");
$intestazione_src = getUploadDir("") .$url;
echo "<img src=\"{$intestazione_src}\" />";
please try in attestato_evento_pubblico.php:
$url=sqlvalue("select i.grafica from partecipazione_evento_pubblico p left join appuntamenti a on p.riunione_evento=a.pri_key left join intestazioni_grafiche i on a.intest_attestato_descr=i.ig_ID where p.pri_key='{$evento_id}'");
$intestazione_src = getUploadDir("") .$url;
echo "<img src=\"{$intestazione_src}\" />";
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: How to display image in printing page
it works great!
Thank you so much!!!!
Fabiano
Thank you so much!!!!
Fabiano