Profiles


{source}

<?php $year = 2021; ?>
   <?php
        #JHtml::_('jquery.framework', false);
    ?>


<script>
    // https://www.mysite4u.net/joomla-articles/jquery-ajax-call-joomla.html
// https://stackoverflow.com/questions/4545081/how-to-do-file-upload-using-jquery-serialization


   function query() { 
 
 /*
   if ( jQuery( ‘#event’).val() == “” ||
       jQuery( ‘#username’).val() == “” ||
       jQuery( ‘#secureToken ‘).val() == “” ||
       jQuery( ‘#caption’).val() == “” ||
       jQuery( ‘#fileToUpload’).val() == “”) {
    alert( “Required information is missing.\nPlease confirm your information.” );
    return;
   }
 */
   content = new FormData( document.getElementById( “userquery “) )
 
     jQuery.ajax( 
          { url: ‘/bin/getUserProfile.php’, 
             enctype: “multipart/form-data”,
             type: ‘POST’, 
             dataType: ‘JSON’,
             data: content, 
             async: true, 
             processData: false, 
             contentType: false,  
             success: function( response, status, jqXHR ){ 
                 $(‘#debug’).val( response ); 
 
                 //alert( response.imageMediumResolution );
 
                 if ( response.error != “” ) {
                     alert ( “Error saving file: ” + response.error + “\n\nPlease email info\@gxsa.org.uk );
                     return;
                 }
 
                 var d = new Date();
                 var n = d.getTime();
 
                 titleEnd = response.caption.indexOf(‘.’);
                 myCaption = ‘<span style=”font-weight: bold;color: blue;text-align:center;”>’;
                 if ( titleEnd >= 0 ) {
                    myCaption += response.caption.substring(0, titleEnd) + “</span>”;
                    if (response.caption.length > titleEnd)
                        myCaption += “<br/>” + response.caption.substring(titleEnd+1, response.caption.length);
                 } else
                    myCaption += response.caption + “</span>”;
 
                 jQuery(‘#myCategory’).text( response.category);
                 jQuery(‘#myCaption’).html( myCaption );

                 jQuery(‘#myAuthor’).html( ‘<span style=”text-align:right;color:SlateGray;”>[‘ + response.author + ‘]</span>’ );
 
                 html =  ‘<img width=100% style=”border:2px solid slateGray;” src=”‘ + response.imageMediumResolution + ‘?n=’ + n + ‘” alt=”‘ + response.basename + ‘” title=”‘ + response.basename + ‘” >’;
                 jQuery(‘#myImage’).html( html );
 
             }, 
             error: function (xhr, desc, err) { 
                 alert( “Error on ajax call: ” + err + ” ” + desc + “\n” + content + “\n\nCheck your file size < 2MB, then email info\@gxsa.org.uk”); 
             } 
          }
     );
     //alert (“Sent”); 
 } 
 
</script>
<div style="float:left;">

<form id=userquery method=”post” enctype=”multipart/form-data”>

{/source}

User Directory

Provide the name of the person you would like to find, then press the “Submit” button.

Forename

 {source} <input type=text id=forename name=forename required />

<input type=hidden id=secureToken name=secureToken value=”wesGTHf458905KJDFBNgbk” required/>

{/source}

Surname

{source}

<input type=text id=surname name=surname required />

{/source}

 

{source}

<input type=button onClick=query()>

{/source}

Cast-Off {source}<?php print $year; ?>{/source} Photo Competition Image Upload

 

Thanks for your entry to the Photo Competition.  To enter the competition, you just need to complete the following form, to upload your picture.

 

Debug

 {source} <span id=debug>{/source}

Forename {source} <span id=forename>{/source}

 

{source}

</form>

</div>

 

<div style=”clear:both;”/>

{/source}

 

 

 

 


Leave a Reply