Changeset 2961353
- Timestamp:
- 08/31/2023 08:31:47 PM (11 months ago)
- Location:
- gerador-de-certificados-devapps/trunk
- Files:
-
- 5 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
gerador-de-certificados-devapps/trunk/README.txt
r2961302 r2961353 4 4 Requires at least: 5.0 5 5 Tested up to: 6.3.1 6 Stable tag: 1. 0.36 Stable tag: 1. 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 42 42 == Changelog == 43 43 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 47 56 48 57 = 1.0.1 = … … 50 59 * Correção nos downloads 51 60 52 = 1.0.2 = 53 * Atualização do dominio de texto 61 = 1.0.0 = 62 * Estrutura inicial 63 * Correções nos modelos 54 64 55 = 1.0.3 =56 * Correção de upload de modelos57 * Compatibilidade com 6.3.1 do Wordpress58 * Correção na geração dos certificados -
gerador-de-certificados-devapps/trunk/admin/class-devapps-certificate-generator-admin.php
r2961302 r2961353 214 214 ); 215 215 } 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 217 232 private function save_certificate(array $data): bool 218 233 { … … 240 255 { 241 256 try { 257 258 259 242 260 $image = imagecreatefromjpeg($data['model']); 243 261 $image_width = imagesx($image); … … 247 265 $font_regular = DEVAPPS_CERTIFICATE_GENERATOR_PATH . "fonts/Poppins-Regular.ttf"; 248 266 $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 250 277 $person = $data['person']['fullname']; 251 278 $person_font_size = 30; -
gerador-de-certificados-devapps/trunk/admin/views/tabs/models.php
r2961302 r2961353 15 15 <li>Tamanho de <b>1811x1299px</b> (paisagem). Este é o tamanho recomendável para que seu certificado A4 fique melhor configurado;</li> 16 16 <li>Caso deseje incluir logo e assinatura nos certificados, as mesmas devem fazer parte da imagem de modelo que você vai enviar.</li> 17 17 18 </ul> 18 19 <form method="POST" enctype="multipart/form-data" id="form_upload_model_file"> -
gerador-de-certificados-devapps/trunk/devapps-certificate-generator.php
r2961302 r2961353 10 10 * 11 11 * @link https://devapps.com.br 12 * @since 1. 0.312 * @since 1. 13 13 * @package Devapps_Certificate_Generator 14 14 * … … 17 17 * Plugin URI: https://devapps.com.br/plugins/devapps-certificate-generator 18 18 * Description: Gerador de certificados para cursos e eventos. 19 * Version: 1. 0.319 * Version: 1. 20 20 * Author: DevApps Consultoria e Desenvolvimento de Sistemas 21 21 * Author URI: https://devapps.com.br … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define('DEVAPPS_CERTIFICATE_GENERATOR_VERSION', '1. 0.3');38 define('DEVAPPS_CERTIFICATE_GENERATOR_VERSION', '1.'); 39 39 40 40 -
gerador-de-certificados-devapps/trunk/includes/class-devapps-certificate-generator.php
r2865262 r2961353 182 182 $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); 183 183 $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); 184 185 186 184 187 } 185 188 -
gerador-de-certificados-devapps/trunk/public/class-devapps-certificate-generator-public.php
r2865262 r2961353 98 98 99 99 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/devapps-certificate-generator-public.js', array( 'jquery' ), $this->version, false ); 100 100 101 101 102 } 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 102 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 103 137 } -
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 2 2 'use strict'; 3 3 4 /**5 * All of the code for your public-facing JavaScript source6 * 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 }); 31 31 32 32 })( jQuery );
Note: See TracChangeset
for help on using the changeset viewer.