Esempio n. 1
0
                <button type="button" class="close" data-dismiss="modal"><i class="fa fa-times"></i>
                </button>
                <?php 
if (!(ae_get_option('invited_to_bid') && !fre_check_invited($user_ID, $post->ID))) {
    ?>
                    <h4 class="modal-title"><?php 
    _e('Set your bid:', 'modal-add-bid');
    ?>
</h4>
                <?php 
}
?>
            </div>
            <div class="modal-body">
                <?php 
if (ae_get_option('invited_to_bid') && !fre_check_invited($user_ID, $post->ID)) {
    echo '<p class="lead  warning">';
    _e("Oops, You must be invited to bid this project", 'modal-add-bid');
    echo '</p>';
} else {
    ?>

                    <form id="bid_form" class="bid-form">
                        <div class="form-group">
                            <label for="bid_budget">
                                <?php 
    if (get_post_meta($post->ID, 'type_budget', true) == 'hourly_rate') {
        _e('Hourly rate', 'modal-add-bid');
    } else {
        _e('Budget', 'modal-add-bid');
    }
Esempio n. 2
0
 /**
  * invite a freelancer to work on current user project
  * @param int $user_id The user will be invite
  * @param int $project_id The project will be send
  * @since 1.0
  * @author Dakachi
  */
 function invite_mail($user_id, $project_id)
 {
     global $current_user, $user_ID;
     if ($user_id && $project_id) {
         // $user = new WP_User($user_id);
         // get user email
         $user_email = get_the_author_meta('user_email', $user_id);
         // mail subject
         $subject = sprintf(__("You have a new invitation to join project from %s.", 'mailing-backend'), get_option('blogname'));
         // build list of project send to freelancer
         $project_info = '';
         foreach ($project_id as $key => $value) {
             // check invite this project or not
             if (fre_check_invited($user_id, $value)) {
                 continue;
             }
             $project_link = get_permalink($value);
             $project_tile = get_the_title($value);
             // create a invite message
             fre_create_invite($user_id, $value);
             $project_info .= '<li><p>' . $project_tile . '</p><p>' . $project_link . '</p></li>';
         }
         if ($project_info == '') {
             return false;
         }
         $project_info = '<ul>' . $project_info . '</ul>';
         // get mail template
         $message = '';
         if (ae_get_option('invite_mail_template_' . ICL_LANGUAGE_CODE)) {
             $message = ae_get_option('invite_mail_template_' . ICL_LANGUAGE_CODE);
         }
         // replace project list by placeholder
         $message = str_replace('[project_list]', $project_info, $message);
         // send mail
         return $this->wp_mail($user_email, $subject, $message, array('user_id' => $user_id, 'post' => $value));
     }
 }