public function index() { $this->load->helper('text'); $this->load->model('Dashboard_m'); $id = user_meta('id'); $data['posted_jobs'] = $this->Dashboard_m->query("select count(*)as total from job where user_id = {$id}"); $data['hourlies_data'] = $this->Dashboard_m->get_trending_hourlies(); $this->jobdesk->view('dashboard', $data); }
public function get_trending_hourlies() { $id = user_meta('id'); $this->db->select('users.id as uid, users.first_name, users.profile_image, hourlies.*'); $this->db->from('hourlies'); $this->db->join('users', 'users.id = hourlies.user_id'); $this->db->where('users.id !=', $id); $this->db->limit(6); $query = $this->db->get(); $result = $query->result_object(); return $result; }
function role() { $ci =& get_instance(); $role = $ci->session->userdata('role'); if (empty($role)) { $id = $_COOKIE['logined']; $role = user_meta('role'); } if ($role == 1) { return 'admin'; } elseif ($role == 2) { return 'seller'; } elseif ($role == 3) { return 'buyer'; } }
public function view($file, $data = array()) { $role = $this->ci->session->userdata('role'); if (empty($role)) { $id = isset($_COOKIE['logined']) ? $_COOKIE['logined'] : ''; $role = user_meta('role'); } if ($role == '2') { $folder = 'user/seller/'; } elseif ($role == '3') { $folder = 'user/buyer/'; } else { $folder = ''; } //print_r($_SESSION); die; $loader = $folder . $file; $header = $folder . "header"; $footer = $folder . "footer"; $this->ci->load->view($header, $data); $this->ci->load->view($loader, $data); $this->ci->load->view($footer, $data); }
<div class="col-md-2"> <div class="pull-left"> <?php $dp = user_meta('profile_image'); $image_path = !empty($dp) ? assets_path('uploads/profile/' . $dp) : assets_path('images/default_profile.jpg'); ?> <img src="<?php echo $image_path; ?> " width="100" class="img-responsive"> </div> </div> <div class="col-md-10"> <div class="media-body"> <h3 class="media-heading">Hi <?php echo user_meta('first_name'); ?> </h3> <p>It's Admin here, the founder and CEO of Jobdesk. I'd like to personally welcome you to our community of high quality freelance talent online.</p> <p>Here's some tips on how to get started:</p> <ol class="clearfix" style="padding: 0"> <li> <a class="call-to-action" href="#">Post an Hourlie</a> - Let Buyers know what you can deliver for a fixed price </li> <li> <a class="call-to-action" href="#">Send Proposals</a> - Bid for relevant Jobs when you receive notifications or browse the Jobs listings </li> <li> <a class="call-to-action" href="#">Get Endorsed</a> - Reach out to your network, ask them for an endorsement and move up the ranks </li> <li>
public function cover_image() { if ($_FILES) { $config['upload_path'] = './assets/uploads/cover/'; $config['allowed_types'] = 'gif|jpg|png'; // $config['max_size'] = '1024'; // $config['max_width'] = '1024'; // $config['max_height'] = '768'; $this->load->library('upload', $config); if (!$this->upload->do_upload('cover_image')) { print_r($this->upload->display_errors()); } else { $data = $this->upload->data(); echo './assets/uploads/cover/' . $data['file_name']; $this->global_m->update('users', array('cover_image' => $data['file_name']), 'id', user_meta('id')); } } }
<?php echo user_meta('is_active');
public function view($slug = '') { $this->load->helper('text'); if (!empty($_POST['user_id'])) { $user_id = $_POST['user_id']; $this->Job_m->insert('notifications', array('type' => 1, 'url' => base_url('job/view/' . $this->input->post('job_slug') . '?rel=seller'), 'msg' => 'Your proposal has been accepted', 'user_id' => $user_id)); $job_id = $_POST['job_id']; $this->Job_m->update('job', array('status' => 'ongoing', 'assign_to' => $user_id), 'id', $job_id); } if (!empty($slug)) { $job = $this->Job_m->query('select * from job where slug = "' . $slug . '"'); if (!empty($job)) { $id = user_meta('id'); if ($job->assign_to == $id) { $rel = 'seller'; } elseif ($job->user_id == $id) { $rel = 'buyer'; } $workstream = $this->Job_m->get_workstreams($job->id); $this->Job_m->update('workstreams', ['is_read' => 1], 'job_id', $job->id); $proposals = $this->Job_m->get_proposals($slug); $this->jobdesk->view('job/view', compact('job', 'proposals', 'rel', 'workstream')); } } }
public function get_worked_job() { $this->db->where('assign_to', user_meta('id')); $this->db->order_by('id', 'DESC'); $query = $this->db->get('job'); $result = $query->result_object(); if (!empty($result)) { return $result; } else { return false; } }
echo base_url('works'); ?> ">HOW IT WORKS</a></li> <li><a href="<?php echo base_url(''); ?> " class="btn btn-default color-black">POST JOB</a></li> <?php $ci =& get_instance(); $user_id = is_logged_in(); if ($user_id) { ?> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php $name = user_meta('first_name'); echo !empty($name) ? 'Hi ' . $name : 'Hi User'; ?> <i class="fa fa-angle-down"></i></a> <ul class="dropdown-menu dashboard_dropdown"> <li><a href="<?php echo base_url('dashboard'); ?> "><i class="fa fa-tachometer"></i>DASHBOARD</a></li> <li><a href="<?php echo base_url('profile'); ?> "><i class="fa fa-user"></i>PROFILE</a></li> <li><a href="404.html"><i class="fa fa-credit-card"></i>PAYMENT</a></li> <li><a href="shortcodes.html"><i class="fa fa-user"></i>MY BUYER ACTIVITY</a></li> <li><a href="shortcodes.html"><i class="fa fa-user"></i>MY SELLER ACTIVITY</a></li>
echo base_url(); ?> assets/css/style.css"> </head> <body> <?php @dprint($header['sample']); ?> <div> <div> <?php if (is_logged()) { ?> <p>Hello <strong><?php echo user_meta('username'); ?> </strong></p> <?php } ?> <ul> <li><a href="<?php echo base_url(); ?> ">home</a></li> <?php if (!is_logged()) { ?> <li><a href="<?php echo base_url();