public function vote() { $this->check_login(); if (isset($_GET['id'])) { $id = $_GET['id']; $this->load->model('mcurrency'); $v4p_link = $this->mcurrency->get_v4p_links($id); if (null != $v4p_link) { $account_id = $this->session->userdata('account_id'); if (null != $account_id) { $link_avail = vote_avail_check($id, $account_id, $v4p_link[0]->cooldown); if (true == $link_avail['is_avail']) { //Add Points, set last vote $vote = $this->mcurrency->update_log($id, $account_id, $v4p_link[0]->value); if ($vote) { $url = $v4p_link[0]->url; $this->load->model('mlogs'); $log_data = array('type' => 'Vote', 'user1' => $account_id, 'date' => date("Y-m-d H:i:s"), 'ip' => $_SERVER['REMOTE_ADDR'], 'note' => $url); $log = $this->mlogs->add_log_tcp($log_data); } else { $url = base_url() . 'v4p?msgcode=402'; } //Error 402 - bad request } else { //Error 423 - Wait for cooldown $url = base_url() . 'v4p?msgcode=423'; } } else { $url = $v4p_link[0]->url; } } else { //Error 401 - Invalid/missing data $url = base_url() . 'v4p?msgcode=401'; } } else { //Error 401 - Invalid/missing data $url = base_url() . 'v4p?msgcode=401'; } redirect($url, 'refresh'); }
?> <tr> <td> <strong><?php echo $link->label; ?> </strong> </td> <td class="center"><?php echo $link->value; ?> </td> <td class="center"> <?php if (null != $this->session->userdata('account_id')) { $link_avail = vote_avail_check($link->v4p_id, $this->session->userdata('account_id'), $link->cooldown); if ('-' != $link_avail['next_vote']) { echo unix_to_human((int) $link_avail['next_vote'], TRUE); } else { echo '-'; } } else { echo 'N/A'; $link_avail['is_avail'] = 1; } ?> </td> <td class="center"><a href="<?php echo current_url() . '/vote?id=' . $link->v4p_id; ?> " class="btn btn-success<?php