Plugin Directory

Changeset 2961353

Timestamp:
08/31/2023 08:31:47 PM (11 months ago)
Author:
tidevapps
Message:

Correção da área publica e disponibilização do modelo PSD.

Location:
gerador-de-certificados-devapps/trunk
Files:
5 added
8 edited

Legend:

Unmodified
Added
Removed
  • gerador-de-certificados-devapps/trunk/README.txt

    r2961302 r2961353  
    44Requires at least: 5.0
    55Tested up to: 6.3.1
    6 Stable tag: 1.0.3
     6Stable tag: 1.
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    4242== Changelog ==
    4343
    44 = 1.0.0 =
    45 * Estrutura inicial
    46 * Correções nos modelos
     44= 1.1.0 =
     45* Inclusão do modelo PSD
     46* Inclusão do número unico do certificado
     47* Correação na área de consulta do certificado, via shortcode
     48
     49= 1.0.3 =
     50* Correção de upload de modelos
     51* Compatibilidade com 6.3.1 do Wordpress
     52* Correção na geração dos certificados
     53
     54= 1.0.2 =
     55* Atualização do dominio de texto
    4756
    4857= 1.0.1 =
     
    5059* Correção nos downloads
    5160
    52 = 1.0.2 =
    53 * Atualização do dominio de texto
     61= 1.0.0 =
     62* Estrutura inicial
     63* Correções nos modelos
    5464
    55 = 1.0.3 =
    56 * Correção de upload de modelos
    57 * Compatibilidade com 6.3.1 do Wordpress
    58 * Correção na geração dos certificados
  • gerador-de-certificados-devapps/trunk/admin/class-devapps-certificate-generator-admin.php

    r2961302 r2961353  
    214214        );
    215215    }
    216 
     216   
     217    private function get_next_id(){
     218        global $wpdb;
     219
     220        $table_name = "{$wpdb->prefix}devapps_certificates";
     221       
     222        $query = "SHOW TABLE STATUS LIKE '{$table_name}'";
     223        $result = $wpdb->get_results($query);
     224       
     225        if ($result && isset($result[0]->Auto_increment)) {
     226            return $result[0]->Auto_increment;
     227        } else {
     228            return 1;
     229        }
     230    }
     231   
    217232    private function save_certificate(array $data): bool
    218233    {
     
    240255    {
    241256        try {
     257
     258
     259
    242260            $image = imagecreatefromjpeg($data['model']);
    243261            $image_width = imagesx($image);
     
    247265            $font_regular = DEVAPPS_CERTIFICATE_GENERATOR_PATH . "fonts/Poppins-Regular.ttf";
    248266            $color = imagecolorallocate($image, 31, 41, 53);
    249 
     267           
     268            $cert_number = str_pad($next_id, 8, '0', STR_PAD_LEFT);
     269            $cert_number_font_size = 20;
     270            $cert_number_box = imagettfbbox($cert_number_font_size, 0, $font_bold, $cert_number);
     271            $cert_number_width = abs($cert_number_box[2]) - abs($$cert_number_box[0]);
     272            $cert_number_height = abs($cert_number_box[5]) - abs($$cert_number_box[3]);
     273            $cert_number_x = $image_width - 300;
     274            $cert_number_y = 150;
     275            imagettftext($image, $cert_number_font_size, 0, $cert_number_x, $cert_number_y, $color, $font_bold, $cert_number);
     276           
    250277            $person = $data['person']['fullname'];
    251278            $person_font_size = 30;
  • gerador-de-certificados-devapps/trunk/admin/views/tabs/models.php

    r2961302 r2961353  
    1515                    <li>Tamanho de <b>1811x1299px</b> (paisagem). Este é o tamanho recomendável para que seu certificado A4 fique melhor configurado;</li>
    1616                    <li>Caso deseje incluir logo e assinatura nos certificados, as mesmas devem fazer parte da imagem de modelo que você vai enviar.</li>
     17
    1718                </ul>
    1819                <form method="POST" enctype="multipart/form-data" id="form_upload_model_file">
  • gerador-de-certificados-devapps/trunk/devapps-certificate-generator.php

    r2961302 r2961353  
    1010 *
    1111 * @link              https://devapps.com.br
    12  * @since             1.0.3
     12 * @since             1.
    1313 * @package           Devapps_Certificate_Generator
    1414 *
     
    1717 * Plugin URI:        https://devapps.com.br/plugins/devapps-certificate-generator
    1818 * Description:       Gerador de certificados para cursos e eventos.
    19  * Version:           1.0.3
     19 * Version:           1.
    2020 * Author:            DevApps Consultoria e Desenvolvimento de Sistemas
    2121 * Author URI:        https://devapps.com.br
     
    3636 * Rename this for your plugin and update it as you release new versions.
    3737 */
    38 define('DEVAPPS_CERTIFICATE_GENERATOR_VERSION', '1.0.3');
     38define('DEVAPPS_CERTIFICATE_GENERATOR_VERSION', '1.');
    3939
    4040
  • gerador-de-certificados-devapps/trunk/includes/class-devapps-certificate-generator.php

    r2865262 r2961353  
    182182        $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles');
    183183        $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts');
     184
     185
     186
    184187    }
    185188
  • gerador-de-certificados-devapps/trunk/public/class-devapps-certificate-generator-public.php

    r2865262 r2961353  
    9898
    9999        wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/devapps-certificate-generator-public.js', array( 'jquery' ), $this->version, false );
     100
    100101
    101102    }
     103
     104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
     115
     116
     117
    102118
     119
     120
     121
     122
     123
     124
     125
     126
     127
     128
     129
     130
     131
     132
     133
     134
     135
     136
    103137}
  • gerador-de-certificados-devapps/trunk/public/css/devapps-certificate-generator-public.css

    r2865262 r2961353  
    1 /**
    2  * All of the CSS for your public-facing functionality should be
    3  * included in this file.
    4  */
     1.dagc-wrapper {
     2    position: relative;
     3    display: flex;
     4    flex-direction: column;
     5    width: 100%;
     6    align-items: center;
     7    padding: 2rem;
     8    border: 1px solid #e8e8e8;
     9    background-color: #efefef;
     10}
     11
     12.dagc-title {
     13    text-align: center;
     14    padding: 0;
     15    margin: 0;
     16    margin-bottom: 1rem;
     17    color: #555;
     18    font-size: 2rem;
     19}
     20
     21.dagc-form{
     22    position: relative;
     23    width: 100%;
     24    padding: 0;
     25    text-align: center;
     26}
     27
     28.dagc-form input{
     29    position: relative;
     30    display: block;
     31    width: -webkit-fill-available;
     32    height: 35px;
     33    border: 1px solid #ccc;
     34    border-radius: 1rem;
     35    font-size: 1rem;
     36    padding: 0 1rem;
     37    margin-bottom: 1rem;
     38}
     39
     40.dagc-button {
     41    position: relative;
     42    color: #ffffff;
     43    border-width: 0px;
     44    border-radius: 100px;
     45    letter-spacing: 1px;
     46    font-size: 12px;
     47    font-weight: 600;
     48    text-transform: uppercase;
     49    background-color: #379263;
     50    padding: .4rem 2rem;
     51    box-shadow: 0px 30px 40px -16px rgba(28,165,255,0.24);
     52    transition: all 300ms ease 0ms;
     53    line-height: 1.7rem;
     54    background-size: cover;
     55    background-position: 50%;
     56    background-repeat: no-repeat;
     57    border: 2px solid;
     58    cursor: pointer;
     59}
     60
     61#dagc-result {
     62    position: relative;
     63    display: block;
     64    width: 100%;
     65    margin: 1rem 0;
     66    text-align: center;
     67}
     68
     69#dagc-result img {
     70    max-width: 100%;
     71    height: auto;
     72    object-fit: cover;
     73    border: 1px solid #aaa;
     74}
  • gerador-de-certificados-devapps/trunk/public/js/devapps-certificate-generator-public.js

    r2865262 r2961353  
    22    'use strict';
    33
    4     /**
    5      * All of the code for your public-facing JavaScript source
    6      * should reside in this file.
    7      *
    8      * Note: It has been assumed you will write jQuery code here, so the
    9      * $ function reference has been prepared for usage within the scope
    10      * of this function.
    11      *
    12      * This enables you to define handlers, for when the DOM is ready:
    13      *
    14      * $(function() {
    15      *
    16      * });
    17      *
    18      * When the window is loaded:
    19      *
    20      * $( window ).load(function() {
    21      *
    22      * });
    23      *
    24      * ...and/or other possibilities.
    25      *
    26      * Ideally, it is not considered best practise to attach more than a
    27      * single DOM-ready or window-load handler for a particular page.
    28      * Although scripts in the WordPress core, Plugins and Themes may be
    29      * practising this, we should strive to set a better example in our own work.
    30      */
     4   
     5     
     6        $('#dagc_fetch_certificate_form').on('submit', function(e) {
     7            e.preventDefault();
     8           
     9            var certificate = $('#dagc_certificate').val();
     10            var fetch_certificate_nonce = $('#fetch_certificate_nonce').val();
     11           
     12            $.ajax({
     13                url: dagc.ajaxurl,
     14                type: 'POST',
     15                data: {
     16                    action: 'fetch_certificate',
     17                    certificate: certificate,
     18                    fetch_certificate_nonce: fetch_certificate_nonce
     19                },
     20) {
     21                    $('#dagc_certificate').val(null);
     22                    if (response.status && response.data) {
     23                        $('#dagc-result').html(`<img src="${response.data.certificate}" class="dagc-certificate">`);
     24                    } else {
     25                        $('#dagc-result').html('Nenhum certificado encontrado.');
     26                    }
     27                }
     28            });
     29        });
     30    });
    3131
    3232})( jQuery );
Note: See TracChangeset for help on using the changeset viewer.