?> " /></span> <span data-toggle="modal" data-target="#share-product" class="share-section"><i class="fa fa-share-alt " id="<?php echo $product_list['id']; ?> "></i></span> </div> </a> <div class="products-view-info"> <?php $onclick_array_view = array('user_id' => $this->session->userdata('user_logged'), 'section_title' => $product_list['title_p'], 'section_type' => '1', 'section_type_action' => 'upvote', 'section_action_id' => $product_list['id']); ?> <button type="button" <?php echo onclick_upvote($onclick_array_view); ?> class="votes-col-count active" > <i class="fa fa-caret-up"></i> <span id="number_1_<?php echo $product_list['id']; ?> "> <?php echo vote_count_by_id('1', $product_list['id']); ?> </span> </button> <h4><?php echo $product_list['title_p']; ?> </h4> </div>
public function ajax_product_index() { $data['title'] = 'Products'; $date = date("Y-m-d H:i:s"); $where = "p.updated_at <= '" . $date . "'"; $param = array('id' => '', 'orderby' => 'updated_at desc', 'where' => $where); $res_array = $this->Products->get_product($param); $vote = '0'; $vote_html = ''; //trace($res_array); $result_array = array(); $date_array = array(); foreach ($res_array as $res_val) { $updated_at1 = $res_val['updated_at']; $updated_at = explode(' ', $res_val['updated_at']); if (in_array($updated_at[0], $date_array)) { } else { $date_array[] = $updated_at[0]; } if ($res_val['file_name'] != '') { $res_val['image_path'] = base_url() . 'upload/products/' . $res_val['file_name']; } else { $res_val['image_path'] = base_url() . 'upload/no_image.jpeg'; } $collection_list1 = $this->Products->get_product_wise_collection($res_val['id']); $res_val['collection_title'] = $this->Products->collection_title(@$collection_list1[0]->col_id); $res_val['vote'] = $vote = vote_count_by_id('1', $res_val['id']); $onclick_array = array('user_id' => $this->session->userdata('user_logged'), 'section_title' => $res_val['title_p'], 'section_type' => '1', 'section_type_action' => 'upvote', 'section_action_id' => $res_val['id']); $vote_html = '<a href="javascript:;" ' . onclick_upvote($onclick_array) . ' ><span class="vote-count"><i class="fa fa-caret-up"></i><span id="numberpop_1_' . $res_val['id'] . '">' . $vote . '</span></span></a>'; $res_val['vote_html'] = $vote_html; $result_array[$updated_at[0]][] = $res_val; } $html = "<script>" . "var sliderData={products:''}; " . 'sliderData.products=' . json_encode($result_array) . ';' . 'console.log(sliderData.products);' . '</script>'; return $html; }
foreach ($res as $val) { $story_user = user_allinfo_id($val['user_id']); $twitter_url = base_url() . 'stories/show/' . $val['url_slug']; ?> <div class="stories-list-content common-new" id="story-<?php echo $r; ?> "> <div class="stories-content-top common-new"> <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 voting-css pro-right"> <?php $onclick_right = array('user_id' => $this->session->userdata('user_logged'), 'section_title' => $val['title'], 'section_type' => '2', 'section_type_action' => 'upvote', 'section_action_id' => $val['id']); ?> <a href="javascript:;" <?php echo onclick_upvote($onclick_right); ?> class="vote-box" > <i class="fa fa-caret-up"></i> <span id="numbers_2_<?php echo $val['id']; ?> "><?php echo vote_count_by_id('2', $val['id']); ?> </span></a> </div> <div class="col-lg-11 col-md-11 col-sm-10 col-xs-10 top-short-story-css pro-left"> <h4 class="see-more-story" id="<?php echo $val['id'] . '_' . $val['url_slug']; ?> "> <?php
usersinfo/<?php echo $res['user_id']; ?> " target="_blank"> <?php echo $sd_user['first_name'] . ' ' . $sd_user['last_name']; ?> </a></p> <p> <span class="meta-left voting-css"> <?php $onclick_pop = array('user_id' => $this->session->userdata('user_logged'), 'section_title' => $res['title'], 'section_type' => '2', 'section_type_action' => 'upvote', 'section_action_id' => $res['id']); ?> <a href="javascript:;" class="vote-box active" <?php echo onclick_upvote($onclick_pop); ?> > <i class="fa fa-caret-up"></i> <span id="numberpop_2_<?php echo $res['id']; ?> "><?php echo vote_count_by_id('2', $res['id']); ?> </span></a></span> <span class="meta-right date-css"><i class="fa fa-calendar"></i><?php echo getDateFormat($res['created_date'], '1', ' '); ?> </span> </p> </div>
function comments_data_id_col($story_id, $comment_id, $limit = '0') { $ci =& get_instance(); $pop = ''; if ($limit > 0) { $limit_data = 'LIMIT ' . $limit; } else { $limit_data = ''; } $html2 = ' <div id="comment_show_' . $comment_id . '">'; $comment_reply = $ci->db->query("select * from comments where section_type_id='" . $story_id . "' and section_type='0' and parent_comment_id='" . $comment_id . "' order by id desc {$limit_data}")->result_array(); foreach ($comment_reply as $comment_reply_val) { $user_link1 = base_url() . 'usersinfo/' . $comment_reply_val['user_id']; $comment_reply_user = user_allinfo_id($comment_reply_val['user_id']); $onclick_comment2 = array('user_id' => $ci->session->userdata('user_logged'), 'section_title' => $comment_reply_val['comments'], 'section_type' => '3', 'section_type_action' => 'upvote', 'section_action_id' => $comment_reply_val['id']); $vote2 = vote_count_by_id('3', $comment_reply_val['id']); $vote_msg2 = $vote2 > 0 ? '<span id="comment_3_' . $comment_reply_val['id'] . '">' . $vote2 . '</span>' : '<span id="comment_3_' . $comment_reply_val['id'] . '">Upvote</span>'; $html2 .= '<div class="comment-box-css-reply"> <div class="col-lg-1 col-md-2 col-sm-2"> <a href="' . $user_link1 . '" class="avatar-image-css" target="_blank">' . username_photo_by_id($comment_reply_val['user_id']) . ' </a> </div> <div class="col-lg-11 col-md-10 col-sm-10"> <div class="comment-main-box"> <div class="name-user"><a href="' . base_url() . 'usersinfo/' . $comment_reply_user['id'] . '" target="_blank" >' . $comment_reply_user['first_name'] . ' ' . $comment_reply_user['last_name'] . '</a><span class="color-grey"> ' . $comment_reply_user['professional_skills'] . ' </span></div> <p>' . $comment_reply_val['comments'] . '</p> <div class="share-list"> <a ' . onclick_upvote($onclick_comment2) . ' href="javascript:;" ><i class="fa fa-caret-up"></i>' . $vote_msg2 . '</a> <a href="javascript:;" class="days-after">' . get_days_count_from_dates($comment_reply_val['created_date'], date('Y-m-d')) . '</a> </div> </div> </div> </div> '; } $html2 .= ' </div> '; return $html2; }