Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter webbymonkeys

    (@webbymonkeys)

    Ok, thank you for your answer.

    Please let me know if it you decide to do it.

    Kind regards,

    Thread Starter webbymonkeys

    (@webbymonkeys)

    Thank you very much.

    I’ll do as suggested.

    Kind regards,

    Guilhem

    Thread Starter webbymonkeys

    (@webbymonkeys)

    Thank you for your answer.
    I’ve installed the latest version with the option to activate the script on admin dashboard.
    Now I’ve the print icon with a link but when I click on it nothing happen.
    When i inspect the element I can see that not even is attached…
    Let me know if you need an access to this admin page and I will create a user profile for you.
    Many thanks for your kind help.
    Guilhem

    Thread Starter webbymonkeys

    (@webbymonkeys)

    the defaut print target is : #a_imprimer and yes this element exist on the page.

    The page is an administration page that i’ve created for my client where he can view some usermetadata details.

    I’m doing the do_shortcode in the page like this :

    <?php
    
    /**
     * The plugin area to view the usermeta
     */
    
    	if( current_user_can('edit_users' ) ) { ?>
    <div id="a_imprimer">
    		<h2> <?php echo __('Détail sur la personne inscrite : ' . $inscrit . ' (' . $user->user_login . ')', $this->plugin_text_domain ); ?> </h2>
                    <a href="<?php echo esc_url( add_query_arg( array( 'page' => wp_unslash( $_REQUEST['page'] ) ) , admin_url( 'users.php' ) ) ); ?>"><?php _e( 'Retour', $this->plugin_text_domain ) ?></a>
                    
                    
    <?php echo do_shortcode('[print-me target ="#a_imprimer"]' ); ?>
    
                    <div class="details_inscrit">
    <?php
    
    		//$usermeta = get_user_meta( $user_id );
                    $bool_seul_resp=false;
                    $bool_conjoint_resp=false;
    		foreach( $array_infos as $key => $value ) {
                            if($key == 'info_perso'){
                                echo '<div class="card">';
                                echo '<h2>Informations personnelles</h2>';
                                echo '<table style="width:100%"><tbody>';
                                foreach($value as $key_data => $data){
                                    if($key_data == 'Date de naissance'){
                                        $datatodisplay = get_user_meta($user_id, 'wpuef_cid_'.$data,true);
                                        $d = new DateTime($datatodisplay);
                                        $datatodisplay = $d->format('d/m/Y');
                                    } else if ($key_data == 'Peut partir seul' || $key_data == 'Droit à l\'image'){
                                       $datatodisplay = get_user_meta($user_id, 'wpuef_cid_'.$data,true); 
                                       if($datatodisplay == 1){
                                           $datatodisplay = 'Non';
                                       } else {
                                           $datatodisplay = 'Oui';
                                       }
                                    } else {
                                        $datatodisplay = get_user_meta($user_id, 'wpuef_cid_'.$data,true);
                                    }
                                    echo '<tr><td style="width:50%">'. $key_data . '</td><td style="width:50%">' . $datatodisplay. '</td></tr>';
                                }
                                echo '</tbody></table>';
                                echo '</div><br>';
                            }
                            if(isset($enfant)){
                                if($key == 'responsable_legal1'){
                                    echo '<div class="card">';
                                    echo '<h2>1er responsable légal</h2>';
                                    echo '<table style="width:100%"><tbody>';
                                    foreach($value as $key_data => $data){
                                        echo '<tr><td style="width:50%">'. $key_data . '</td><td style="width:50%">' . get_user_meta( $user_id, 'wpuef_cid_'.$data,true). '</td></tr>';
                                    }
                                    echo '</tbody></table>';
                                    echo '</div><br>';
                                }
                                //test si seul responsable
                                if($key == 'responsables'){
                                    foreach($value as $key_data => $data){
                                        if($key_data=='seul_responsable'){
                                            $seul_responsable=get_user_meta( $user_id, 'wpuef_cid_'.$data,true);
                                        }
                                        if($key_data=='conjoint_responsable'){
                                            $conjoint_responsable=get_user_meta( $user_id, 'wpuef_cid_'.$data,true);
                                        }
    //                                    var_dump($seul_responsable);
    //                                    var_dump($conjoint_responsable);
                                    }    
                                        if($seul_responsable==0){
                                            $bool_seul_resp=true;
                                        }if($conjoint_responsable==0){
                                            $bool_conjoint_resp=true;
    
                                        }
                                    }
                                    if($key == 'responsable_legal2'&&$bool_conjoint_resp&&!$bool_seul_resp){
                                                echo '<div class="card">';
                                                echo '<h2>Conjoint et 2ème responsable légal</h2>';
                                                echo '<table style="width:100%"><tbody>';
                                                foreach($value as $key_data => $data){
                                                    echo '<tr><td style="width:50%">'. $key_data . '</td><td style="width:50%">' . get_user_meta( $user_id, 'wpuef_cid_'.$data,true). '</td></tr>';
                                                }
                                                echo '</tbody></table>';
                                                echo '</div><br>';
                                    }else if($key == 'responsable_legal2'&&!$bool_conjoint_resp&&!$bool_seul_resp){
                                                echo '<div class="card">';
                                                echo '<h2>Conjoint sans responsabilité légale</h2>';
                                                echo '<table style="width:100%"><tbody>';
                                                foreach($value as $key_data => $data){
                                                    echo '<tr><td style="width:50%">'. $key_data . '</td><td style="width:50%">' . get_user_meta( $user_id, 'wpuef_cid_'.$data,true). '</td></tr>';
                                                }
                                                echo '</tbody></table>';
                                                echo '</div><br>';
                                    }
                                    if($key == 'responsable_legal3'&&!$bool_conjoint_resp&&!$bool_seul_resp){
                                                if(!empty(get_user_meta( $user_id, 'wpuef_cid_'.$value['Nom - Prenom'],true))){
                                                    echo '<div class="card">';
                                                    echo '<h2>Responsable légal ne vivant pas au foyer</h2>';
                                                    echo '<table style="width:100%"><tbody>';
                                                    foreach($value as $key_data => $data){
                                                        echo '<tr><td style="width:50%">'. $key_data . '</td><td style="width:50%">' . get_user_meta( $user_id, 'wpuef_cid_'.$data,true). '</td></tr>';
                                                    }
                                                    echo '</tbody></table>';
                                                    echo '</div><br>';
                                                }
                                    }                                
                                } 
                            if(isset($adulte)){
                                if($key == 'conjoint'){
                                    echo '<div class="card">';
                                    echo '<h2>Conjoint</h2>';
                                    echo '<table style="width:100%"><tbody>';
                                    foreach($value as $key_data => $data){
                                        echo '<tr><td style="width:50%">'. $key_data . '</td><td style="width:50%">' . get_user_meta( $user_id, 'wpuef_cid_'.$data,true). '</td></tr>';
                                    }
                                    echo '</tbody></table>';
                                    echo '</div><br>';
                                }
                            }
                            if($key == 'personne_prev'){
                                echo '<div class="card">';
                                echo '<h2>Liste des personnes à contacter en cas d\'urgence</h2>';
                                $index = 1;
                                $datatodisplay = '';
                                foreach($value as $data){
                                    $datatodisplay = '';
                                    if(!empty(get_user_meta( $user_id, 'wpuef_cid_'.$data['Nom - Prenom'],true))){
                                         echo '<h2>Contact n° '.$index.'</h2>';
                                        echo '<table style="width:100%"><tbody>';
                                        foreach($data as $key_d => $d){
                                            $datatodisplay = '';
                                           if($key_d == 'Autorisations'){
                                              $auto= get_user_meta( $user_id, 'wpuef_cid_'.$d,true);
                                               if($auto[0]){
                                                   $datatodisplay = 'A prévenir en cas d\'urgence';
                                               }
                                               if(!empty($datatodisplay)){
                                                   $datatodisplay .= '<br>';
                                               }
                                               if($auto[1]){
                                                   $datatodisplay .= 'Peut récupérer un enfant';
                                               }
                                           } else {
                                               $datatodisplay = get_user_meta( $user_id, 'wpuef_cid_'.$d,true);
                                           }
                                           echo '<tr><td style="width:50%">'. $key_d . '</td><td style="width:50%">' .$datatodisplay . '</td></tr>'; 
                                        }
                                        echo '</tbody></table>';
                                    }
                                    $index++;
                                }
                                echo '</div><br>';
                            }
    		}
    		
    ?>
    		<a href="<?php echo esc_url( add_query_arg( array( 'page' => wp_unslash( $_REQUEST['page'] ) ) , admin_url( 'users.php' ) ) ); ?>"><?php _e( 'Retour', $this->plugin_text_domain ) ?></a>
    <?php
    	}
    	else {  
    ?>
    		<p> <?php echo __( 'You are not authorized to perform this operation.', $this->plugin_text_domain ) ?> </p>
    <?php   
    	}?>
    </div>
    </div>
Viewing 4 replies - 1 through 4 (of 4 total)