File indexing completed on 2025-05-04 05:29:29

0001 
0002 <?php
0003 
0004 $options = array(1 => 'ugh', 2=>'really bad',3=>'bad',4=>'soso',5=>'average', 6=>'okay',7=>'good', 8=>'great', 9=>'excellent',10=>'the best');
0005 krsort($options);
0006 
0007 $userRateData = $this->fetchRate($this->file->project_id, $this->member_id);
0008 $userrate ="data-userrate='-1'";
0009 $comment="data-comment=''";
0010 if($userRateData){
0011   $userrate ="data-userrate='".$userRateData['score']."'";    
0012   $comment="data-comment='".$userRateData['comment_text']."'";    
0013 }   
0014 $formproject="data-project='".$this->file->project_id."'";
0015 $creator="data-creator='".$this->file->project_member_id."'";
0016 $attrhistory = $userrate.' '.$comment.' '.$formproject.' '.$creator;
0017 
0018 if($this->counter==0){
0019 ?>
0020 <div class="row smaller header" >
0021   <div class="col-lg-5 col-md-5">
0022     <figure>
0023         <img src="<?php echo $this->Image($this->file->image_small, array('width' => 80, 'height' => 80)); ?>" class="downloadhistory-image" />
0024     </figure> 
0025     <div>
0026       <a href="<?= $this->buildProductUrl($this->file->project_id) ?>"><?=$this->file->title?></a>
0027       <p><?=$this->file->catTitle?> 
0028     </div>
0029   </div>    
0030   <div class="col-lg-2 nowrap">
0031     <?php /*$this->file->max_downloaded_timestamp */?> 
0032   </div>            
0033   <div class="col-lg-2 col-md-2"> 
0034     
0035     <div class="rating text-center" > 
0036         
0037         <?php            
0038             $model = new Default_Model_DbTable_ProjectRating();
0039           $score = $model->getScore($this->file->project_id);      
0040                 $this->widgetRating = new stdClass();
0041                 $this->widgetRating->project_id =$this->file->project_id;
0042                 $this->widgetRating->laplace_score = $score;
0043                 $this->widgetRating->count_likes =$this->file->count_likes; 
0044                 $this->widgetRating->count_dislikes =$this->file->count_dislikes;
0045                 echo $this->render('partials/widgetRating.phtml'); 
0046         ?>        
0047     </div>
0048     
0049   </div>
0050   
0051   <div class="col-lg-2" >
0052 
0053     <?php
0054     if($userRateData){
0055       ?>
0056       <span class="score label" style="line-height:30px;background-color:<?=$this->fetchScoreColor($userRateData['score'])?>;">
0057                 <?=$userRateData['score']?>
0058             </span>
0059     <?php
0060     }
0061     ?>
0062 
0063     <?php if($this->file->project_member_id<> $this->authMember->member_id){
0064       ?>
0065        <select <?=$attrhistory ?> id="ratingoptions<?=$this->file->project_id?>" 
0066           class="rating-select" name="ratingoptions<?=$this->file->project_id?>">
0067           <?php
0068             $sc = null;
0069             if($userRateData){ 
0070               $sc = $userRateData['score'];     
0071                echo '<option value="-1">Remove Rating</option>';        
0072             }
0073             else{
0074                     echo '<option value="0">Add Rating</option>';
0075                  }
0076                   foreach ($options as $key => $value) {
0077                      $selected = '';                    
0078                      if($sc==$key){
0079                        $selected=' selected';                    
0080                      } 
0081                     
0082                     echo '<option value="'.$key.'"'.$selected.'>'.$key.' '.$value.'</option>';                
0083                  }
0084           ?>
0085       </select> 
0086     <?php }?>
0087 
0088 
0089 
0090 
0091   <?php           
0092     if($userRateData){
0093       echo '<div class="rate-comment">';
0094       echo $userRateData['comment_text'].'   '.$this->printDate($userRateData['created_at']);
0095       echo '</div>';
0096     }
0097     ?>
0098 
0099   </div>
0100   <div class="col-lg-1" >
0101     <div id="container-follow<?=$this->file->project_id?>" style="display: block;float:left;margin-right: 3px">   
0102     <?php 
0103     if($this->file->project_member_id<> $this->authMember->member_id){
0104       echo $this->partial(
0105           '/product/follow.phtml',
0106           array(
0107               "authMember"  => $this->authMember,
0108               "project_id" => $this->file->project_id
0109           )
0110       );
0111     }
0112     ?>
0113 
0114     
0115     </div>  
0116 
0117       
0118   </div>
0119 </div>
0120 
0121 <div class="row smaller">
0122   <div class="col-lg-3 paddingLeft80" style="overflow: hidden">
0123   <?=$this->file->file_name?>     
0124   </div>
0125   <div class="col-lg-2 " >
0126   <?=$this->humanFilesize($this->file->file_size)?>     
0127   </div>  
0128   <div class="col-lg-2 nowrap">
0129 
0130   <?=$this->file->downloaded_timestamp?> 
0131        
0132   </div>
0133   <div class="col-lg-3 " >
0134   <?=$this->file->file_type?>     
0135   </div>    
0136       
0137 </div>
0138 
0139 <?php
0140 }else{
0141 ?>
0142 <div class="row smaller">
0143   <div class="col-lg-3 paddingLeft80" style="overflow: hidden">
0144   <?=$this->file->file_name?>     
0145   </div>
0146   <div class="col-lg-2 " >
0147   <?=$this->humanFilesize($this->file->file_size)?>     
0148   </div>
0149   
0150   <div class="col-lg-2 nowrap">
0151 
0152   <?=$this->file->downloaded_timestamp?> 
0153        
0154   </div>
0155   <div class="col-lg-3 " >
0156   <?=$this->file->file_type?>     
0157   </div>
0158         
0159       
0160 </div>
0161 <?php
0162 }
0163 ?>