Esempio n. 1
0
 public function sub()
 {
     $ca = $this->input->post('comment');
     //$pub =$this->input->post('box-body');
     //echo $ca;
     $this->load->helper('form');
     $this->load->model('entities/commentaire');
     $this->load->model('management/commentairemanagement');
     $this->load->model('management/profilmanagement');
     $this->load->library('session');
     $profilManagement = new ProfilManagement();
     $profil = $profilManagement->get_profil($this->session->userdata('id_profil'));
     $c = new Commentaire();
     $cm = new CommentaireManagement();
     $c = new Commentaire();
     $c->id_profil = $profil->id_profil;
     $c->date_commentaire = date('Y-m-d H:m:s');
     $c->id_publication = 1;
     $c->contenu_commentaire = $ca;
     $cm->add_comment($c);
     $date_comment = date('Y-m-d H:m:s');
     echo '
             <div class="box-footer box-comments" >
                  <div class="box-comment" >
                     <!--User image-->
                     <img class="img-circle img-sm" src = "dist/img/' . $profil->image_profil . '" alt = "user image" >
                  <div class="comment-text" >
                       <span class="username" >
                         ' . $profil->nom_profil . '
                         <span class="text-muted pull-right"> ' . $date_comment . ' </span >
                       </span ><!-- /.username-->
                         ' . $c->contenu_commentaire . '
                     </div ><!-- /.comment - text-->
                 </div ><!-- /.box - comment-->
             </div ><!-- /.box - footer-->
         ';
 }
Esempio n. 2
0
                            </div>

                            <br>
            <?php 
if (count($friends) > 0) {
    foreach ($friends as $key => $value) {
        $pubm = new PublicationManagement();
        $pubs = $pubm->get_publications($value->id_profil, 1);
        if (count($pubs) > 0) {
            $friend_ = new ProfilManagement();
            $friend_profil = $friend_->get_profil($value->id_profil);
            $this->load->model('management/commentairemanagement');
            foreach ($pubs as $keypub => $valuepub) {
                $comments = new CommentaireManagement();
                $c_user = new CommentaireManagement();
                $comments = $comments->get_comments($valuepub);
                echo '

                             <!-- Post -->
                            <div class="post">
                                <div class="user-block">
                                <img class="img-circle img-bordered-sm" src="dist/img/' . $friend_profil->image_profil . '" alt="user image">
                        <span class="username">
                          <a href="Home">' . $friend_profil->nom_profil . '.</a>
                          <a href="#" class="pull-right btn-box-tool"><i class="fa fa-times"></i></a>
                        </span>
                                    <span class="description">Public  - ' . $valuepub->date_ajout_publication . '</span>
                                </div><!-- /.user-block -->
                                <p>
                                    ' . $valuepub->contenu_publication . '