public function index() { $this->load->file(FCPATH.'ajaxfw.php'); $this->load->model('Vendor_model'); $config['base_url'] = 'http://monstertke.zapto.org/vendors/index/'; $config['total_rows'] = $this->db->get('vendors')->num_rows; $config['per_page'] = 5; $this->pagination->initialize($config); $pagination_default = 0; if(is_numeric($this->uri->segment(3))) { $pagination_default = $this->uri->segment(3); } $data['page_title'] = "Vapelist (working title)"; $data['result'] = $this->Vendor_model->get_all_vendors($pagination_default); $data['session_info_ip'] = $this->session->userdata('ip_address'); $data['session_info_agent'] = $this->session->userdata('user_agent'); $ajax = ajax(); foreach ($data['result'] as $row) { $ajax->Exec("ajax_vote_call_down_{$row->id}", $ajax->overlay("/ajax/votes_comment/vote/{$row->id}/down")); $ajax->Exec("ajax_vote_call_up_{$row->id}", $ajax->overlay("/ajax/votes_comment/vote/{$row->id}/up")); } $this->load->view('templates/header', $data); $this->load->view('templates/navigation', $data); $this->load->view('vendors/vendor', $data); $this->load->view('templates/footer'); $this->output->enable_profiler(TRUE); }
<?php $this->load->helper('text');?> <div id="body_wrapper"> <?php foreach ($result as $row):?> <div class="listing_wrapper"> <div class="inner_listing_wrapper"> <div id ="vendor_juice"><h2><a href="<?php echo base_url(); echo">id?>"><?php echo $row->name?></a></h2></div> <div id ="vendor_name"><p><a href="<?php echo $row->url_link?>"><?php echo $row->vendor_name?></a></p></div> <div id ="vendor_desc"><p><?php $url_string = base_url(); $read_more = " ...<a >id}>\"read more\"</a>"; echo word_limiter($row->description, 20, $read_more);?></p></div> <div id ="vendor_catg"><?php echo $row->category?></div> <div class ="vendor_votes"> <div class="vote_box_u"><h3><a href="#">id}";?> title="Vote '<?php echo $row->name?>' up."><?php echo $row->votes_up?></a></h3></div> <div class="vote_box_d"><h3><a href="#">id}";?> title="Vote '<?php echo $row->name?>' down."><?php echo $row->votes_down?></a></h3></div> </div> </div> </div> <?php endforeach;?> <div id='pagination_links'><?php echo $this->pagination->create_links();?></div> </div>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xml:lang="en" lang="en"> <head> <title><?php echo $page_title ?></title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <link rel="stylesheet" href='<?=base_url()?>css/styles.css' type="text/css" media="screen, projection" /> <link rel="stylesheet" href='<?=base_url()?>css/typography.css' type="text/css" media="screen, projection" /> <link rel="stylesheet" href='<?=base_url()?>css/forms.css' type="text/css" media="screen, projection" /> <link rel="stylesheet" href='<?=base_url()?>css/list_layout.css' type="text/css" media="screen, projection" /> <link rel="stylesheet" type="text/css" href="<?=base_url()?>css/auth.css" /> <?php $ajax = ajax(); echo $ajax->init("http://monstertke.zapto.org/"); ?> </head> <html> <body>
class votes_comment extends CI_controller { function vote($juice_id, $vote_direction) { $this->load->model('Vendor_model'); $this->load->model('Rating_model'); $data['page_title'] = 'Add rating'; $data['user_data_id'] = $this->tank_auth->get_user_id(); $data['user_data_logged'] = $this->tank_auth->is_logged_in(); $user_name = $this->tank_auth->get_username(); $data['vote_result'] = 'good deal'; $data['ajax_message'] = ''; $data['switch_var'] = 1; $juice_result = $this->Vendor_model->get_individual_juice('vendors', 'id', $juice_id); foreach($juice_result as $jd) { $data['v_id'] = $jd->id; $data['v_j_name'] = $jd->name; $data['v_v_name'] = $jd->vendor_name; $data['v_url'] = $jd->url_link; $data['v_image'] = $jd->url_image; $data['v_desc'] = $jd->description; $data['v_created'] = $jd->created; $data['v_modified'] = $jd->modified; $data['v_user'] = $jd->user_id; $data['v_category'] = $jd->category; $data['v_votes_up'] = $jd->votes_up; $data['v_votes_down'] = $jd->votes_down; $data['v_banned'] = $jd->banned; } $data['vote_increment_model'] = ''; $data['vote_column'] = 'error'; // function can_vote($juice_id, $user_id if ($data['user_data_logged']) { $has_voted = $this->Rating_model->can_vote($juice_id, $data['user_data_id']); } else { redirect('/auth/login/'); }