Ejemplo n.º 1
0
 /**
  * Store a newly created resource in storage.
  * POST /rated
  *
  * @return Response
  */
 public function store()
 {
     $rate = Input::all();
     $array = array('users_id' => Auth::user()->id);
     $rater = Rater::create($array);
     $rate['raters_id'] = $rater->id;
     Rated::create($rate);
     return Redirect::back();
 }
Ejemplo n.º 2
0
 /**
  * Output the rating percentage in the column
  *
  * @param $column_name
  * @param $post_id
  */
 public function column_content($column_name, $post_id)
 {
     if ($column_name !== 'wpkb-rating') {
         return;
     }
     $rating = $this->rating->get_post_rating_perc($post_id);
     if ($rating === 0) {
         echo '-';
         return;
     }
     $color = $this->percent2Color($rating, 200);
     echo sprintf('<span style="color: #%s">%s%%</span> (%d)', $color, $rating, count($this->rating->get_post_ratings($post_id)));
 }
Ejemplo n.º 3
0
echo "<div id=\"cont\" style=\"margin-left:0px;\">";
//Format the meeting date
$dispmdt = date('l, F jS, Y \\a\\t g A', strtotime($meetdt));
//Format the due date
$dd = date('l, F jS, Y \\a\\t g A', strtotime($duedate));
//All cases
$case1 = $meetdt != 0 && $duedate < time() && $duedate != 0;
//And the item is on a return basis
$case2 = $meetdt != 0 && $meetdt < time() && $duedate == 0;
//If the exchange is permanent
$case3 = $meetdt != 0 && $meetdt < time() && $duedate != 0;
//And the item is due for exchange
//If the exchange is over (case1 or case2)
if ($case1 || $case2) {
    //Print out the rating tool
    $newRating = new Rater($other_id);
    $newRating->output();
} else {
    if ($case3) {
        //Show the pickup countdown
        $newPickup = new Pickup($duedate);
        $newPickup->output();
    } else {
        //If the meeting date has not been determined...
        if ($meetdt == 0) {
            //...show the calender
            $newCal = new Calender(trim($oid));
            $newCal->output();
        } else {
            //...print out the countdown to the meetup
            $newMeetup = new Meetup($meetdt);