Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- class Projects extends CI_Controller {
- public function __construct() {
- parent::__construct();
- error_reporting(E_ALL);
- $this->load->model('Managers');
- $this->Managers->auth();
- $this->load->library('pagination');
- $this->load->helper('common');
- //$this->load->library('session');
- }
- public function index() {
- $projects = $this->Managers->get_table_data('tbl_projects')->result();
- //echo "<pre/>"; print_r($projects); die;
- $content = $this->load->view('admin/projects/index.php', array('data' => $projects), TRUE);
- $this->load->view('admin/templete', array('content' => $content));
- }
- public function add($id = false) {
- //echo '<pre>'; print_r($_POST); die;
- $project_data = array(
- 'id' => $id,
- 'name' => '',
- 'slug' => '',
- 'time' => '',
- 'start_date' => '',
- 'end_date' => '',
- 'client_id' => '',
- 'services' => '',
- 'currency_id' => '',
- 'ammount' => '',
- 'description' => '',
- 'status' => '',
- 'client_project_id' => ''
- );
- if($id){
- $this->form_validation->set_rules('name', 'Project Name', 'trim|required');
- $this->form_validation->set_rules('ammount', 'Project Amount', 'trim|required');
- $this->form_validation->set_rules('client_id', 'Client Name', 'trim|required');
- $this->form_validation->set_rules('client_project_id', 'Client Project Id', 'trim|required');
- }else{
- $this->form_validation->set_rules('name', 'Project Name', 'trim|required|is_unique[tbl_projects.name]');
- $this->form_validation->set_rules('ammount', 'Project Amount', 'trim|required');
- $this->form_validation->set_rules('client_id', 'Client Name', 'trim|required');
- $this->form_validation->set_rules('client_project_id', 'Client Project Id', 'trim|required');
- }
- $first_data = $this->Managers->get_table_data('tbl_projects')->last_row();
- if($id){
- $project_id = trim($this->input->post('project_id'));
- $invoice = trim($this->input->post('invoice'));
- $date1 = new DateTime($this->input->post('start_date'));
- $date2 = new DateTime($this->input->post('end_date'));
- $diff = $date2->diff($date1)->format("%a");
- }else{
- $project_unique_string = strtotime(date("h:i:sa"));
- $project_unique_word = substr($project_unique_string, -8);
- $project_unique_number = substr($project_unique_word, -4);
- if(!empty($first_data)){
- $val_time = $first_data->project_id;
- $latest_value = substr($val_time, -1);
- $current_value = $latest_value+1;
- $project_id = 'EPM-'.date('y').''.$project_unique_number.''.$current_value;
- }else{
- $project_id = 'EPM-'.date('y').''.$project_unique_number.'1';
- }
- $unixTimestamp = strtotime(date("Y-m-d h:i:sa"));
- $invoice = 'ES-'.$unixTimestamp;
- $date1 = new DateTime($this->input->post('start_date'));
- $date2 = new DateTime($this->input->post('end_date'));
- $diff = $date2->diff($date1)->format("%a");
- }
- if ($this->form_validation->run() == TRUE) {
- if($this->input->post('translation') == 'true'){
- $translation = array(
- 'translation' => array(
- 'name' => 'translation',
- 'value' => trim($this->input->post('translation_word'))
- )
- );
- }else{
- $translation = array(
- 'translation' => array(
- 'name' => '',
- 'value' => ''
- )
- );
- }
- if($this->input->post('editing') == 'true'){
- $editing = array(
- 'editing' => array(
- 'name' => 'editing',
- 'value' => trim($this->input->post('editing_word'))
- )
- );
- }else{
- $editing = array(
- 'editing' => array(
- 'name' => '',
- 'value' => ''
- )
- );
- }
- if($this->input->post('proofread') == 'true'){
- $proofread = array(
- 'proofread' => array(
- 'name' => 'proofread',
- 'value' => trim($this->input->post('proofread_word'))
- )
- );
- }else{
- $proofread = array(
- 'proofread' => array(
- 'name' => '',
- 'value' => ''
- )
- );
- }
- if($this->input->post('transcription') == 'true'){
- $transcription = array(
- 'transcription' => array(
- '0' => array(
- 'name' => 'transcription_audio',
- 'value' => trim($this->input->post('transcription_audio'))
- ),
- '1' => array(
- 'name' => 'transcription_video',
- 'value' => trim($this->input->post('transcription_video'))
- )
- )
- );
- }else{
- $transcription = array(
- 'transcription' => array(
- '0' => array(
- 'name' => '',
- 'value' => ''
- ),
- '1' => array(
- 'name' => '',
- 'value' => ''
- )
- )
- );
- }
- if($this->input->post('subtitling') == 'true'){
- $subtitling = array(
- 'subtitling' => array(
- 'name' => 'checked',
- 'value' => 'checked'
- )
- );
- }else{
- $subtitling = array(
- 'subtitling' => array(
- 'name' => '',
- 'value' => ''
- )
- );
- }
- if($this->input->post('creation') == 'true'){
- $creation = array(
- 'creation' => array(
- 'name' => 'creation',
- 'value' => trim($this->input->post('creation_video'))
- )
- );
- }else{
- $creation = array(
- 'creation' => array(
- 'name' => '',
- 'value' => ''
- )
- );
- }
- if($this->input->post('translator') == 'true'){
- $translator = array(
- 'translator' => array(
- 'name' => 'translator',
- 'value' => trim($this->input->post('translator_video'))
- )
- );
- }else{
- $translator = array(
- 'translator' => array(
- 'name' => '',
- 'value' => ''
- )
- );
- }
- if($this->input->post('voiceover') == 'true'){
- $first_voiceover = array(
- 'first_voiceover' => array(
- 'name' => ucwords(trim($this->input->post('voice_language_1'))),
- 'value' => trim($this->input->post('cost_language_1'))
- )
- );
- $second_voiceover = array(
- 'second_voiceover' => array(
- 'name' => ucwords(trim($this->input->post('voice_language_2'))),
- 'value' => trim($this->input->post('cost_language_2'))
- )
- );
- $third_voiceover = array(
- 'third_voiceover' => array(
- 'name' => ucwords(trim($this->input->post('voice_language_3'))),
- 'value' => trim($this->input->post('cost_language_3'))
- )
- );
- $studio = array(
- 'studio' => array(
- 'name' => 'studio',
- 'value' => trim($this->input->post('studio'))
- )
- );
- }else{
- $first_voiceover = array(
- 'first_voiceover' => array(
- 'name' => '',
- 'value' => ''
- )
- );
- $second_voiceover = array(
- 'second_voiceover' => array(
- 'name' => '',
- 'value' => ''
- )
- );
- $third_voiceover = array(
- 'third_voiceover' => array(
- 'name' => '',
- 'value' => ''
- )
- );
- $studio = array(
- 'studio' => array(
- 'name' => '',
- 'value' => ''
- )
- );
- }
- if(!empty($this->input->post('translation_word'))){
- $translation_1 = 1;
- }else{
- $translation_1 = 0;
- }
- if(!empty($this->input->post('editing_word'))){
- $editing_1 = 1;
- }else{
- $editing_1 = 0;
- }
- if(!empty($this->input->post('proofread_word'))){
- $proofread_1 = 1;
- }else{
- $proofread_1 = 0;
- }
- if(!empty($this->input->post('transcription_audio'))){
- $transcription_audio_1 = 1;
- }else{
- $transcription_audio_1 = 0;
- }
- if(!empty($this->input->post('transcription_video'))){
- $transcription_video_1 = 1;
- }else{
- $transcription_video_1 = 0;
- }
- if(!empty($this->input->post('creation_video'))){
- $creation_video_1 = 1;
- }else{
- $creation_video_1 = 0;
- }
- if(!empty($this->input->post('translator_video'))){
- $translator_video_1 = 1;
- }else{
- $translator_video_1 = 0;
- }
- if(!empty($this->input->post('voice_language_1'))){
- $voice_over_1 = 1;
- }else{
- $voice_over_1 = 0;
- }
- if(!empty($this->input->post('voice_language_2'))){
- $voice_over_2 = 1;
- }else{
- $voice_over_2 = 0;
- }
- if(!empty($this->input->post('voice_language_3'))){
- $voice_over_3 = 1;
- }else{
- $voice_over_3 = 0;
- }
- $total_service = $translation_1 + $editing_1 + $proofread_1 + $transcription_audio_1 + $transcription_video_1 + $creation_video_1 + $translator_video_1 + $voice_over_1 + $voice_over_2 + $voice_over_3;
- //echo $total_service; die;
- $services = array_merge($translation,$editing,$proofread,$transcription,$subtitling,$creation,$translator,$first_voiceover,$second_voiceover,$third_voiceover,$studio);
- //echo '<pre>'; print_r($_POST).'<br>';
- //echo '<pre>'; print_r($services).'<br>';
- $test = json_encode($services);
- //echo '<pre>'; print_r($test); die;
- $project_data['name'] = trim($this->input->post('name'));
- $project_data['slug'] = str_replace(' ', '-', strtolower ($project_data['name']));
- $project_data['time'] = $diff;
- $project_data['start_date'] = trim($this->input->post('start_date'));
- $project_data['end_date'] = trim($this->input->post('end_date'));
- $project_data['client_id'] = trim($this->input->post('client_id'));
- if(!empty($this->input->post('member_id'))){
- $project_data['member_id'] = trim($this->input->post('member_id'));
- }else{
- $project_data['member_id'] = '0';
- }
- $project_data['currency_id'] = trim($this->input->post('currency_id'));
- $project_data['client_project_id'] = trim($this->input->post('client_project_id'));
- $project_data['ammount'] = trim($this->input->post('ammount'));
- $project_data['services'] = $test;
- $project_data['project_id'] = $project_id;
- $project_data['invoice'] = $invoice;
- $project_data['total_service'] = $total_service;
- $project_data['description'] = trim($this->input->post('content'));
- $project_data['status'] = trim($this->input->post('status'));
- //echo '<pre>'; print_r($_POST).'<br>';
- //echo '<pre>'; print_r($project_data); die;
- if(!empty($_POST['mobileCompany'])){
- $company_data['name'] = trim($this->input->post('clinetCompany'));
- $company_data['phone'] = trim($this->input->post('mobileCompany'));
- $company_data['address'] = trim($this->input->post('addresCompany'));
- $company_data[' country'] = trim($this->input->post('countryCompany'));
- $date = strtotime(date("Y-m-d h:i:sa"));
- $arr = explode(' ',trim(strtolower($company_data['name'])));
- $company_data['client_id'] = $arr['0'].''.$date;
- $company_data['type'] = '1';
- $project_data['client_id'] = $this->Managers->insert_data('tbl_clients', $company_data);
- }else{
- }
- $result = $this->Managers->insert_data_and_update($id, 'tbl_projects', $project_data);
- ($result) ? $this->session->set_flashdata('inserted', TRUE) : $this->session->set_flashdata('error', TRUE);
- redirect('admin/projects');
- }
- if ($id) {
- $client_data = $this->Managers->get_clients_tiered();
- $currency_data = $this->Managers->get_currency_tiered();
- $data = $this->Managers->get_data_where('tbl_projects', array('id' => $id));
- $project_data = $this->Managers->get_data_where('tbl_projects', array('id' => $id))->row();
- $company_data = $this->Managers->get_data_where('tbl_clients', array('id' => $project_data->client_id))->row();
- if(!empty($company_data->client_id)){
- $company_client_data = $this->Managers->get_company_clients_tiered($company_data->client_id);
- }else{
- $company_client_data = '';
- }
- $content = $this->load->view('admin/projects/add', array('data' => $data, 'id' => $id, 'clients' => $client_data, 'currency' => $currency_data, 'company_clients' => $company_client_data), TRUE);
- $this->load->view('admin/templete', array('content' => $content));
- } else {
- $client_data['clients'] = $this->Managers->get_clients_tiered();
- $client_data['currency'] = $this->Managers->get_currency_tiered();
- $content = $this->load->view('admin/projects/add', $client_data, TRUE);
- $this->load->view('admin/templete', array('content' => $content));
- }
- }
- public function updatestaus() {
- $id = $this->input->post('id');
- $type = $this->input->post('status');
- if($type == 0){
- $status = 1;
- }else{
- $status = 0;
- }
- $project_status = $this->Managers->updateDataWhere('tbl_projects', array('status' => $status), array('id' => $id));
- }
- public function currencyDetails(){
- $currency = $this->Managers->get_table_data('tbl_currnecy')->result();
- //echo "<pre/>"; print_r($currency); die;
- $content = $this->load->view('admin/projects/currency_details.php', array('data' => $currency), TRUE);
- $this->load->view('admin/templete', array('content' => $content));
- }
- public function currency_add($id = false) {
- //echo '<pre>'; print_r($_POST); die;
- $curency_data = array(
- 'id' => $id,
- 'USD' => '',
- 'EURO' => '',
- 'AED' => '',
- 'GBP' => '',
- 'created' => ''
- );
- if($id){
- $this->form_validation->set_rules('currency_1', 'Currency Data', 'trim|required');
- }else{
- $this->form_validation->set_rules('date', 'Currency Date', 'trim|required|is_unique[tbl_currnecy.created]');
- }
- if ($this->form_validation->run() == TRUE) {
- $curency_data['USD'] = trim($this->input->post('currency_1'));
- $curency_data['EURO'] = trim($this->input->post('currency_2'));
- $curency_data['AED'] = trim($this->input->post('currency_3'));
- $curency_data['GBP'] = trim($this->input->post('currency_4'));
- if($id){
- $curency_data['created'] = trim($this->input->post('date'));
- }else{
- $curency_data['created'] = strtotime($this->input->post('date'));
- }
- $result = $this->Managers->insert_data_and_update($id, 'tbl_currnecy', $curency_data);
- ($result) ? $this->session->set_flashdata('inserted', TRUE) : $this->session->set_flashdata('error', TRUE);
- redirect('admin/projects/currencyDetails');
- }
- if ($id) {
- $data = $this->Managers->get_data_where('tbl_currnecy', array('id' => $id));
- $content = $this->load->view('admin/projects/currency_add', array('data' => $data, 'id' => $id), TRUE);
- $this->load->view('admin/templete', array('content' => $content));
- } else {
- $content = $this->load->view('admin/projects/currency_add', $curency_data, TRUE);
- $this->load->view('admin/templete', array('content' => $content));
- }
- }
- public function currencyPopupDetails($id) {
- $where = array( 'id' => $id );
- $data = $this->Managers->get_data_where('tbl_currnecy', $where);
- $content = $this->load->view('admin/projects/currency_popup_details', array('data' => $data));
- }
- public function deleteProject(){
- $id = $this->input->post('id');
- if($id)
- $query = $this->db->delete('tbl_projects', array('id' => $id));
- ($query) ? $response = TRUE : $response = FALSE;
- return $response;
- return false;
- }
- public function assignments(){
- $projects = $this->Managers->get_data_where('tbl_projects', array('status' => '1'))->result();
- //echo "<pre/>"; print_r($projects); die;
- $content = $this->load->view('admin/projects/assignments.php', array('data' => $projects), TRUE);
- $this->load->view('admin/templete', array('content' => $content));
- }
- public function assign($id = false) {
- //echo $id; die;
- // init params
- $params = array();
- $limit_per_page = 50;
- $start_index = ($this->uri->segment(5)) ? $this->uri->segment(5) : 0;
- $total_records = $this->Managers->get_total();
- if ($total_records > 0)
- {
- // get current page records
- $params["results"] = $this->Managers->get_current_page_records($limit_per_page, $start_index);
- $config['base_url'] = base_url() . 'admin/projects/assign/'.$id.'/';
- $config['total_rows'] = $total_records;
- $config['per_page'] = $limit_per_page;
- $config["uri_segment"] = 5;
- // custom paging configuration
- $config['first_link'] = 'First';
- $config['first_tag_open'] = '<li>';
- $config['first_tag_close'] = '</li>';
- $config['last_link'] = 'Last';
- $config['last_tag_open'] = '<li>';
- $config['last_tag_close'] = '</li>';
- $config['full_tag_open'] = '<nav><ul class="pagination">';
- $config['full_tag_close'] = '</ul></nav>';
- $config['cur_tag_open'] = '<li class="active"><a href="#">';
- $config['cur_tag_close'] = '</a></li>';
- $config['num_tag_open'] = '<li>';
- $config['num_tag_close'] = '</li>';
- $config['prev_link'] = '«';
- $config['prev_tag_open'] = '<li>';
- $config['prev_tag_close'] = '</li>';
- $config['next_link'] = '»';
- $config['next_tag_open'] = '<li>';
- $config['next_tag_close'] = '</li>';
- $this->pagination->initialize($config);
- // build paging links
- $params["links"] = $this->pagination->create_links();
- }
- //echo '<pre>'; print_r($params); die;
- $data = $this->Managers->get_data_where('tbl_projects', array('id' => $id));
- $content = $this->load->view('admin/projects/assign', array('data' => $data, 'id' => $id, 'users' => $params), TRUE);
- $this->load->view('admin/templete', array('content' => $content));
- }
- public function getServiceValue(){
- // echo '<pre>'; print_r($_POST).'<br>';die;
- $service_value = $_POST['val'];
- $projectUID = $_POST['project_id'];
- $project_service_value = $this->Managers->get_data_where('tbl_projects', array('project_id' => $_POST['project_id']))->row();
- $services_values = json_decode($project_service_value->services);
- if($service_value == 'first_voiceover'){
- $latest_service_value = $services_values->first_voiceover->name .' (voice Over)';
- }elseif($service_value == 'second_voiceover'){
- $latest_service_value = $services_values->second_voiceover->name .' (voice Over)';
- }elseif($service_value == 'third_voiceover'){
- $latest_service_value = $services_values->third_voiceover->name .' (voice Over)';
- }else{
- $latest_service_value = $_POST['val'];
- }
- //echo $latest_service_value.'<br>';
- $worker_denied_users = $this->Managers->get_data_where('tbl_project_assignments', array('service' => $latest_service_value, 'denied' => '1', 'project_id' => $projectUID))->result();
- //echo '<pre>'; print_r($worker_denied_users).'<br>';die;
- if(!empty($worker_denied_users)){
- foreach ($worker_denied_users as $worker_denied_user) {
- $filter_data[] = $worker_denied_user->user_id;
- }
- $workers = $this->Managers->get_table_data_not('tbl_users', $filter_data, 70)->result();
- }else{
- $workers = $this->Managers->get_table_data('tbl_users', 70)->result();
- }
- $last_workers = $this->Managers->get_table_data('tbl_users', 70)->last_row();
- //$count_all_workers = count($this->Managers->get_table_data('tbl_users')->result());
- //echo count($count_load_workers); die;
- //echo '<pre>'; print_r($last_workers); die;
- if($_POST['val'] == 'first_voiceover'){
- $vals = $services_values->first_voiceover->value;
- $name = $services_values->first_voiceover->name;
- }elseif($_POST['val'] == 'second_voiceover'){
- $vals = $services_values->second_voiceover->value;
- $name = $services_values->second_voiceover->name;
- }elseif($_POST['val'] == 'third_voiceover'){
- $vals = $services_values->third_voiceover->value;
- $name = $services_values->third_voiceover->name;
- }else{
- $vals = '';
- $name = '';
- }
- //echo $vals.'====>'.$name.'<br>';
- //$workers_data = $this->Managers->getVoiceServiceData('tbl_users', $name);
- //echo '<pre>'; print_r($services_values).'<br>'; die;
- $count_load_workers = $this->Managers->getLimitUserData('tbl_users', 69, $service_value, $name);
- $project_service = $this->Managers->get_data_where('tbl_project_assignments', array('return_type' => 1, 'service' => $latest_service_value, 'project_id' => $_POST['project_id']))->row();
- //echo '<pre>'; print_r($project_service); die;
- if(!empty($project_service) && $project_service->service == $latest_service_value){
- $service_type = 'yes';
- }else{
- $service_type = 'no';
- }
- if($service_value == 'transcription_audio' || $service_value == 'transcription_video'){
- $users = [];
- $i = 0;
- foreach($workers as $worker):
- $services = json_decode($worker->services);
- $arr = explode('_',trim($service_value));
- foreach($services as $key => $service){
- if($key == $arr[0]){
- if($service[0]->name == 'transcription_audio'){
- $users[$i]['id'] = $worker->id;
- $users[$i]['value'] = $service[0]->value;
- }elseif($service[1]->name == 'transcription_video'){
- $users[$i]['id'] = $worker->id;
- $users[$i]['value'] = $service[1]->value;
- }else{
- }
- }
- $i++;
- }
- endforeach;
- }elseif($service_value == 'translation' || $service_value == 'editing' || $service_value == 'proofread' || $service_value == 'creation' || $service_value == 'translator'){
- $users = [];
- $j = 0;
- foreach($workers as $worker):
- $services = json_decode($worker->services);
- //echo '<pre> service '; print_r($services).'<br>';
- foreach($services as $key => $service){
- if($key == $service_value){
- if(!empty($service->value)){
- $users[$j]['id'] = $worker->id;
- $users[$j]['value'] = $service->value;
- }
- }
- $j++;
- }
- endforeach;
- }else{
- $users = [];
- $k = 0;
- foreach($workers as $worker):
- $services = json_decode($worker->services);
- foreach($services as $key => $service){
- if($key == 'first_voiceover'){
- if($service->name == $name){
- $users[$k]['id'] = $worker->id;
- $users[$k]['value'] = $service->value;
- }else{
- }
- }elseif($key == 'second_voiceover'){
- if($service->name == $name){
- $users[$k]['id'] = $worker->id;
- $users[$k]['value'] = $service->value;
- }else{
- }
- }elseif($key == 'third_voiceover'){
- if($service->name == $name){
- $users[$k]['id'] = $worker->id;
- $users[$k]['value'] = $service->value;
- }else{
- }
- }else{
- }
- $k++;
- }
- endforeach;
- }
- //echo count($users).'<br>';
- //echo $count_load_workers.'<br>';
- //echo '<pre>'; print_r($users); die;
- $this->load->view('admin/projects/assignment_users.php', array('data' => $users, 'project_id' => $_POST['project_id'], 'service_type' => $service_type, 'id' => $service_value, 'cost' => $_POST['cost'], 'last_id' => $last_workers->id, 'translators' => count($count_load_workers), 'all_translators' => count($users), 'project_currency' => $_POST['project_currency'], 'project_ammount' => $_POST['project_ammount'], 'project_start_date' => $_POST['project_start_date']));
- }
- public function getAnotherServiceValue(){
- //echo '<pre>'; print_r($_POST); die;
- $service_value = $_POST['val'];
- $currentId = $_POST['current_id'];
- $assignment = $this->Managers->get_data_where('tbl_project_assignments', array('service' => $service_value, 'id' => $currentId))->row();
- $workers = $this->Managers->get_data_where('tbl_users', array('id != ' => $assignment->user_id), 70)->result();
- $last_workers = $this->Managers->get_data_where('tbl_users' , array('id != ' => $assignment->user_id), 70)->last_row();
- $count_load_workers = $this->Managers->getAnotherServiceLimitUserData('tbl_users', 69, $assignment->user_id, $service_value);
- if($service_value == 'transcription_audio' || $service_value == 'transcription_video'){
- $users = [];
- $i = 0;
- foreach($workers as $worker):
- $services = json_decode($worker->services);
- $arr = explode('_',trim($service_value));
- foreach($services as $key => $service){
- if($key == $arr[0]){
- if($service[0]->name == 'transcription_audio'){
- $users[$i]['id'] = $worker->id;
- $users[$i]['value'] = $service[0]->value;
- }elseif($service[1]->name == 'transcription_video'){
- $users[$i]['id'] = $worker->id;
- $users[$i]['value'] = $service[1]->value;
- }else{
- }
- }
- $i++;
- }
- endforeach;
- }else{
- $users = [];
- $j = 0;
- foreach($workers as $worker):
- $services = json_decode($worker->services);
- foreach($services as $key => $service){
- if($key == $service_value){
- if(!empty($service->value)){
- $users[$j]['id'] = $worker->id;
- $users[$j]['value'] = $service->value;
- }
- }
- $j++;
- }
- endforeach;
- }
- //echo '<pre>'; print_r($users); die;
- $this->load->view('admin/projects/assignment_another_users.php', array('data' => $users, 'service_name' => $service_value, 'current_id' => $currentId, 'task_cost' => $assignment->task_cost, 'project_id' => $_POST['project_id'], 'project_cost' => $_POST['project_cost'], 'last_id' => $last_workers->id, 'translators' => count($count_load_workers), 'all_translators' => count($users), 'user_id' => $assignment->user_id));
- }
- public function projectAssigns(){
- // echo '<pre>'; print_r($_POST).'<br>';
- $response = 0;
- if ($this->input->post()) {
- parse_str($this->input->post()['assignment'], $searcharray);
- // echo '<pre>'; print_r($searcharray).'<br>';
- $project_id_service = $this->Managers->get_data_where('tbl_projects', array('project_id' => $_POST['project_id']))->row();
- //echo '<pre>'; print_r($project_id_service).'<br>'; die;
- $id_services = json_decode($project_id_service->services);
- if($_POST['service'] == 'first_voiceover'){
- $vals = $id_services->first_voiceover->name.' (voice Over)';
- }elseif($_POST['service'] == 'second_voiceover'){
- $vals = $id_services->second_voiceover->name.' (voice Over)';
- }elseif($_POST['service'] == 'third_voiceover'){
- $vals = $id_services->third_voiceover->name.' (voice Over)';
- }else{
- $vals = $_POST['service'];
- }
- $user_id = $searcharray['users_id'];
- $task_cost = $searcharray['cost'];
- $currency_id = $searcharray['currency'];
- $start_date = $searcharray['start_date'];
- $end_date = $searcharray['end_date'];
- $temp = $_POST['total'];
- $first_data = $this->Managers->get_data_where('tbl_project_assignments', array('project_id' => $_POST['project_id']))->last_row();
- for($i=0; $i < $temp; $i++){
- if(!empty($first_data)){
- $val_time = $first_data->purchase_order;
- $latest_value = substr($val_time, -1);
- $current_value = $i+($latest_value+1);
- $purchase_order = $_POST['project_id'].'-0'.$current_value;
- }else{
- if($i == 0){
- $purchase_order = $_POST['project_id'].'-01';
- }
- $purchase_order = $_POST['project_id'].'-0'.($i+1);
- // echo '<pre>'; print_r($purchase_order); die;
- }
- $data2 = array(
- 'project_id' => $_POST['project_id'],
- 'service' => $vals,
- 'service_cost' => $_POST['project_cost'],
- 'user_id' =>$user_id[$i],
- 'task_cost' => $task_cost[$i],
- 'currency_id' => $currency_id[$i],
- 'start_date' => $start_date[$i],
- 'end_date' => $end_date[$i],
- 'purchase_order' => $purchase_order
- );
- // $this->db->insert('tbl_project_assignments', $data2);
- ////////////// PDF ///////////////
- $user_data = $this->Managers->get_data_where('tbl_users', array('id' => $user_id[$i]))->row();
- $admin_data = $this->Managers->get_data_where('tbl_admin', array('id_admin' => '1'))->row();
- $project_data = $this->Managers->get_data_where('tbl_projects', array('id' => $user_id[$i]))->row();
- $currency_name = $this->Managers->get_data_where('tbl_change_currency', array('id' => $currency_id[$i]))->row();
- $total_cost = $_POST['user_value'] * $_POST['project_cost'];
- $user_data_currency = $this->Managers->get_data_where('tbl_change_currency', array('id' => $user_data->currency_id))->row();
- $startDates = $start_date[$i];
- $endDates = $end_date[$i];
- $interval = $endDates - $startDates;
- $days = floor($interval / (60 * 60 * 24));
- $html = $this->load->view('form.php', array('user_data' => $user_data, 'admin_data' => $admin_data, 'data' => $data2, 'project_data' => $project_data, 'days' => $days, 'currency_name' => $currency_name, 'total_cost' => $total_cost, 'user_value' => $_POST['user_value'], 'user_data_currency' => $user_data_currency, 'project_cost' => $_POST['project_cost']), true);
- // echo '<pre>'; print_r($html); die;
- require_once APPPATH . 'third_party/mpdf/mpdf.php';
- $pdf_name = $purchase_order. '.pdf';
- $pdfFilePath = ROOT_PATH . "ekitai_project_management/uploads/invoices/$pdf_name";
- $html2pdf = new \mPDF();
- $html2pdf->WriteHTML($html);
- $html2pdf->Output($pdfFilePath, 'F');
- chmod($pdfFilePath, 0777);
- ///////////// PDF //////////////
- }
- //echo $vals.'<br>';
- //echo '<pre>'; print_r($id_services).'<br>'; die;
- $currency_ammont = $this->Managers->get_data_where('tbl_change_currency', array('id' => $_POST['project_currency']))->row();
- // Project Start Date Currency Ammount
- $project_date_currency = $this->Managers->get_data_where('tbl_currnecy', array('created' => $_POST['project_start_date']))->row();
- $assign_date_currency = $this->Managers->get_data_where('tbl_currnecy', array('created' => strtotime($searcharray['start_date'])))->row();
- $assign_currency_name = $this->Managers->get_data_where('tbl_change_currency', array('id' => $searcharray['currency']))->row();
- $a_currency_name = $assign_currency_name->name;
- //echo '<pre>'; print_r($assign_currency_name).'<br>';
- //echo '<pre>'; print_r($assign_date_currency).'<br>';
- //if(empty($assign_date_currency)){
- //echo $response = 2; exit;
- //}else{
- if(!empty($assign_date_currency)){
- $user_ammount = $_POST['user_value'] * $_POST['project_cost'] * $assign_date_currency->$a_currency_name;
- if($currency_ammont->name == 'USD'){
- $project_ammount = $project_date_currency->USD * $_POST['project_ammount'];
- $assign_ammount = $assign_date_currency->USD * $searcharray['cost'];
- }elseif($currency_ammont->name == 'EURO'){
- $project_ammount = $project_date_currency->EURO * $_POST['project_ammount'];
- $assign_ammount = $assign_date_currency->EURO * $searcharray['cost'];
- }elseif($currency_ammont->name == 'AED'){
- $project_ammount = $project_date_currency->AED * $_POST['project_ammount'];
- $assign_ammount = $assign_date_currency->AED * $searcharray['cost'];
- }else{
- $project_ammount = $project_date_currency->GBP * $_POST['project_ammount'];
- $assign_ammount = $assign_date_currency->GBP * $searcharray['cost'];
- }
- }else{
- $user_ammount = $_POST['user_value'] * $_POST['project_cost'] * 0;
- $project_ammount = 0;
- $assign_ammount = 0;
- }
- //echo $user_ammount.'<br>';
- //echo $project_ammount.'====>'.$assign_ammount; die;
- $first_data = $this->Managers->get_data_where('tbl_project_assignments', array('project_id' => $_POST['project_id']))->last_row();
- if(!empty($first_data)){
- $val_time = $first_data->purchase_order;
- $latest_value = substr($val_time, -1);
- $current_value = $latest_value+1;
- $purchase_order = $_POST['project_id'].'-0'.$current_value;
- }else{
- $purchase_order = $_POST['project_id'].'-01';
- }
- $profit = $user_ammount;
- $data = array(
- 'project_id' => $_POST['project_id'],
- 'user_id' => $_POST['user_id'],
- 'currency_id' => $searcharray['currency'],
- 'start_date' => strtotime($searcharray['start_date']),
- 'end_date' => strtotime($searcharray['end_date']),
- 'task_cost' => $searcharray['cost'],
- 'service' => $vals,
- 'service_cost' => $_POST['project_cost'],
- 'profit' => $profit,
- 'purchase_order' => $purchase_order,
- );
- //echo '<pre>'; print_r($data); die;
- $project_assign = $this->Managers->updateDataWhere('tbl_projects', array('assign' => '1'), array('project_id' => $_POST['project_id']));
- $result = $this->Managers->insert_data('tbl_project_assignments',$data);
- if($result){
- $user_data = $this->Managers->get_data_where('tbl_users', array('id' => $_POST['user_id']))->row();
- $admin_data = $this->Managers->get_data_where('tbl_admin', array('id_admin' => '1'))->row();
- $project_data = $this->Managers->get_data_where('tbl_projects', array('project_id' => $_POST['project_id']))->row();
- $currency_name = $this->Managers->get_data_where('tbl_change_currency', array('id' => $searcharray['currency']))->row();
- $total_cost = $_POST['user_value'] * $_POST['project_cost'];
- $user_data_currency = $this->Managers->get_data_where('tbl_change_currency', array('id' => $user_data->currency_id))->row();
- $startDate = $data['start_date'];
- $endDate = $data['end_date'];
- $interval = $endDate - $startDate;
- $days = floor($interval / (60 * 60 * 24));
- $html = $this->load->view('form.php', array('user_data' => $user_data, 'admin_data' => $admin_data, 'data' => $data, 'project_data' => $project_data, 'days' => $days, 'currency_name' => $currency_name, 'total_cost' => $total_cost, 'user_value' => $_POST['user_value'], 'user_data_currency' => $user_data_currency, 'project_cost' => $_POST['project_cost']), true);
- require_once APPPATH . 'third_party/mpdf/mpdf.php';
- $pdf_name = $purchase_order. '.pdf';
- $pdfFilePath = ROOT_PATH . "ekitai_project_management/uploads/invoices/$pdf_name";
- $html2pdf = new \mPDF();
- $html2pdf->WriteHTML($html);
- $html2pdf->Output($pdfFilePath, 'F');
- chmod($pdfFilePath, 0777);
- //echo '<pre>'; print_r($html2pdf); die;
- // $from = $admin_data->email;
- // $url = "https://api.sendgrid.com/";
- // $user = 'devendra775123';
- // $pass = '9928387298q123';
- // $to = $user_data->email;
- // //$to = 'greatdeveloper002@gmail.com';
- // $messege = 'Project Invoice';
- // $params = array(
- // 'api_user' => $user,
- // 'api_key' => $pass,
- // 'to' => $to,
- // 'fromname' => 'Ekitai Solutions',
- // 'from' => $from,
- // 'subject' => 'Project Invoice',
- // 'html' => $messege,
- // 'files[' . $pdf_name . ']' => new \CurlFile($pdfFilePath)
- // );
- // $request = $url . 'api/mail.send.json';
- // $session = curl_init($request);
- // curl_setopt($session, CURLOPT_POST, true);
- // curl_setopt($session, CURLOPT_POSTFIELDS, $params);
- // curl_setopt($session, CURLOPT_HEADER, false);
- // curl_setopt($session, CURLOPT_SSL_VERIFYPEER, false);
- // curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
- // $responsed = curl_exec($session);
- // curl_close($session);
- echo $response = 1; exit;
- }
- }
- }
- public function projectAssignsAnotherUser(){
- //echo '<pre>'; print_r($_POST).'<br>';
- $response = 0;
- if ($this->input->post()) {
- parse_str($this->input->post()['assignment'], $searcharray);
- //echo '<pre>'; print_r($searcharray).'<br>';
- $project_currency = $this->Managers->get_data_where('tbl_projects', array('project_id' => $_POST['project_id']))->row();
- $currency_ammont = $this->Managers->get_data_where('tbl_change_currency', array('id' => $project_currency->currency_id))->row();
- $assign_date_currency = $this->Managers->get_data_where('tbl_currnecy', array('created' => strtotime($searcharray['start_date'])))->row();
- //echo '<pre>'; print_r($currency_ammont).'<br>';
- //echo '<pre>'; print_r($assign_date_currency).'<br>'; die;
- if(empty($assign_date_currency)){
- echo $response = 2; exit;
- }else{
- $user_ammount = $_POST['user_value'] * $_POST['project_cost'] * $assign_date_currency->USD;
- $profit = $user_ammount;
- //echo '<pre>'; print_r($assign_date_currency).'<br>';
- //echo '<pre>'; print_r($searcharray).'<br>'; die;
- $project_assign = $this->Managers->updateDataWhere('tbl_project_assignments', array('profit' => $profit,'user_id' => $_POST['user_id'], 'start_date' => strtotime($searcharray['start_date']), 'end_date' => strtotime($searcharray['end_date'])), array('id' => $_POST['current_id'], 'service' => $_POST['service'], 'project_id' => $_POST['project_id']));
- echo $response = 1; exit;
- }
- }
- }
- public function assigned_users($projectid = false){
- $projects_users = $this->Managers->get_data_where('tbl_project_assignments', array('project_id' => $projectid))->result();
- //echo "<pre/>"; print_r($projects_users); die;
- $content = $this->load->view('admin/projects/assigned_users.php', array('data' => $projects_users), TRUE);
- $this->load->view('admin/templete', array('content' => $content));
- }
- public function editAssignedUser($id = false) {
- $assignment = $this->Managers->get_data_where('tbl_project_assignments', array('id' => $id))->row();
- $service_value = $assignment->service;
- $workers = $this->Managers->get_data_where('tbl_users', array('id != ' => $assignment->user_id))->result();
- if($service_value == 'transcription_audio' || $service_value == 'transcription_video'){
- $users = [];
- $i = 0;
- foreach($workers as $worker):
- $services = json_decode($worker->services);
- $arr = explode('_',trim($service_value));
- foreach($services as $key => $service){
- if($key == $arr[0]){
- if($service[0]->value == 'transcription_audio'){
- $users[$i]['id'] = $worker->id;
- $users[$i]['value'] = $service[0]->value;
- }elseif($service[1]->value == 'transcription_video'){
- $users[$i]['id'] = $worker->id;
- $users[$i]['value'] = $service[1]->value;
- }else{
- }
- }
- $i++;
- }
- endforeach;
- }else{
- $users = [];
- $j = 0;
- foreach($workers as $worker):
- $services = json_decode($worker->services);
- foreach($services as $key => $service){
- if($key == $service_value){
- if(!empty($service->value)){
- $users[$j]['id'] = $worker->id;
- $users[$j]['value'] = $service->value;
- }
- }
- $j++;
- }
- endforeach;
- }
- //echo '<pre>'; print_r($users); die;
- if ($id) {
- $data = $this->Managers->get_data_where('tbl_project_assignments', array('id' => $id));
- $content = $this->load->view('admin/projects/edit_assigned_users', array('data' => $assignment, 'id' => $id, 'users' => $users), TRUE);
- $this->load->view('admin/templete', array('content' => $content));
- }
- }
- public function viewAssignedUser($id){
- $where = array(
- 'id' => $id
- );
- $data = $this->Managers->get_data_where('tbl_project_assignments', $where);
- //echo '<pre>'; print_r($data->row()); die;
- $content = $this->load->view('admin/projects/view_assigned_user_details', array('data' => $data));
- }
- public function returnProjectDate() {
- $project_id = $this->input->post('project_id');
- $id = $this->input->post('id');
- $service = $this->input->post('service');
- $where = array(
- 'project_id' => $project_id
- );
- $date = $this->Managers->get_data_where('tbl_projects', $where)->row();
- $this->load->view('admin/projects/popup_return_date', array('project_id' => $project_id, 'id' => $id, 'start_date' => $date->start_date, 'service' => $service));
- }
- public function userDenied(){
- $project_id = $this->input->post('project_id');
- $id = $this->input->post('id');
- //echo $project_id.'====>'.$id; die;
- $project_status = $this->Managers->updateDataWhere('tbl_projects', array('assign' => '0'), array('project_id' => $project_id));
- $project_assignmnet_denied = $this->Managers->updateDataWhere('tbl_project_assignments', array('denied' => '1'), array('project_id' => $project_id, 'id' => $id));
- }
- public function returnProjects(){
- $responsed = 0;
- if ($this->input->post()) {
- parse_str($this->input->post()['data'], $searcharray);
- //echo '<pre>'; print_r($searcharray).'<br>'; die;
- $curdate = strtotime($searcharray['project_start_date']);
- $mydate = strtotime($searcharray['return_date']);
- if($curdate > $mydate){
- $response = 2;
- }else{
- $date = strtotime($searcharray['return_date']);
- $project_assign = $this->Managers->updateDataWhere('tbl_projects', array('assign' => '0'), array('project_id' => $searcharray['project_id']));
- $project_return_date = $this->Managers->updateDataWhere('tbl_project_assignments', array('return_type' => '1', 'return_date' => $date, 'denied' => '1'), array('project_id' => $searcharray['project_id'], 'service' => $searcharray['service_name']));
- $response = 1;
- }
- }
- echo $response; exit;
- }
- public function reports(){
- $projects = $this->Managers->get_table_data('tbl_projects')->result();
- //echo "<pre/>"; print_r($projects); die;
- $content = $this->load->view('admin/projects/reports.php', array('data' => $projects), TRUE);
- $this->load->view('admin/templete', array('content' => $content));
- }
- public function reports_edit($id = false) {
- $projects = $this->Managers->get_data_where('tbl_projects', array('id' => $id))->row();
- $data = $this->Managers->getReports($projects->project_id);
- //echo '<pre>'; print_r($data); die;
- $content = $this->load->view('admin/projects/reports_check', array('data' => $data, 'id' => $id, 'project_name' => $projects->name), TRUE);
- $this->load->view('admin/templete', array('content' => $content));
- }
- public function loadUsers(){
- //echo '<pre>'; print_r($_POST).'<br>';
- $service_value = $_POST['service'];
- $workers = $this->Managers->get_data_where('tbl_users', array('id >' => $_POST['id']), 70)->result();
- $last_workers = $this->Managers->get_data_where('tbl_users', array('id >' => $_POST['id']), 70)->last_row();
- $project_service_value = $this->Managers->get_data_where('tbl_projects', array('project_id' => $_POST['project_id']))->row();
- $services_values = json_decode($project_service_value->services);
- if($_POST['service'] == 'first_voiceover'){
- $vals = $services_values->first_voiceover->value;
- $name = $services_values->first_voiceover->name;
- }elseif($_POST['service'] == 'second_voiceover'){
- $vals = $services_values->second_voiceover->value;
- $name = $services_values->second_voiceover->name;
- }elseif($_POST['service'] == 'third_voiceover'){
- $vals = $services_values->third_voiceover->value;
- $name = $services_values->third_voiceover->name;
- }else{
- $vals = '';
- $name = '';
- }
- //echo $vals.'====>'.$name.'<br>'; die;
- $count_load_workers_another = $this->Managers->getLimitLoadUserData('tbl_users', $_POST['id'], 69, $service_value, $name);
- //echo '<pre>'; print_r($count_load_workers_another); die;
- if(!empty($workers)){
- if($service_value == 'transcription_audio' || $service_value == 'transcription_video'){
- $users = array();
- $i = 0;
- foreach($workers as $worker):
- $services = json_decode($worker->services);
- $arr = explode('_',trim($service_value));
- foreach($services as $key => $service){
- if($key == $arr[0]){
- if($service[0]->name == 'transcription_audio'){
- $users[$i]['id'] = $worker->id;
- $users[$i]['value'] = $service[0]->value;
- }elseif($service[1]->name == 'transcription_video'){
- $users[$i]['id'] = $worker->id;
- $users[$i]['value'] = $service[1]->value;
- }else{
- }
- }
- $i++;
- }
- endforeach;
- }elseif($service_value == 'translation' || $service_value == 'editing' || $service_value == 'proofread' || $service_value == 'creation' || $service_value == 'translator'){
- $users = [];
- $j = 0;
- foreach($workers as $worker):
- $services = json_decode($worker->services);
- foreach($services as $key => $service){
- if($key == $service_value){
- if(!empty($service->value)){
- $users[$j]['id'] = $worker->id;
- $users[$j]['value'] = $service->value;
- }
- }
- $j++;
- }
- endforeach;
- }else{
- $users = [];
- $k = 0;
- foreach($workers as $worker):
- $services = json_decode($worker->services);
- foreach($services as $key => $service){
- if($key == 'first_voiceover'){
- if($service->name == $name){
- $users[$k]['id'] = $worker->id;
- $users[$k]['value'] = $service->value;
- }else{
- }
- }elseif($key == 'second_voiceover'){
- if($service->name == $name){
- $users[$k]['id'] = $worker->id;
- $users[$k]['value'] = $service->value;
- }else{
- }
- }elseif($key == 'third_voiceover'){
- if($service->name == $name){
- $users[$k]['id'] = $worker->id;
- $users[$k]['value'] = $service->value;
- }else{
- }
- }else{
- }
- $k++;
- }
- endforeach;
- }
- //echo '<pre>'; print_r($users);
- $this->load->view('admin/projects/view_more_assignment_users.php', array('data' => $users, 'j' => $_POST['val'], 'id' => $service_value, 'project_id' => $_POST['project_id'], 'cost' => $_POST['cost'], 'last_id' => $last_workers->id, 'translators' => count($count_load_workers_another), 'all_translators' => count($users), 'project_currency' => $_POST['project_currency'], 'project_ammount' => $_POST['project_ammount'], 'project_start_date' => $_POST['project_start_date']));
- }else{
- echo '<p style="color:red;">No Data Found</p>'; die;
- }
- }
- public function loadRelatedServiceUsers(){
- //echo '<pre>'; print_r($_POST).'<br>'; die;
- $service_value = $_POST['service'];
- $workers = $this->Managers->get_data_where('tbl_users', array('id >' => $_POST['id'], 'id !=' => $_POST['user_id']), 70)->result();
- $last_workers = $this->Managers->get_data_where('tbl_users', array('id >' => $_POST['id'], 'id !=' => $_POST['user_id']), 70)->last_row();
- $count_load_workers_another = $this->Managers->getLimitLoadUserData('tbl_users', $_POST['id'], 69, $service_value, $_POST['user_id']);
- //echo '<pre>'; print_r($workers).'<br>';
- //echo '<pre>'; print_r($count_load_workers_another).'<br>';
- //echo count($workers).'<br>';
- //echo count($count_load_workers_another).'<br>';
- if(!empty($workers)){
- if($service_value == 'transcription_audio' || $service_value == 'transcription_video'){
- $users = array();
- $i = 0;
- foreach($workers as $worker):
- $services = json_decode($worker->services);
- $arr = explode('_',trim($service_value));
- foreach($services as $key => $service){
- if($key == $arr[0]){
- if($service[0]->name == 'transcription_audio'){
- $users[$i]['id'] = $worker->id;
- $users[$i]['value'] = $service[0]->value;
- }elseif($service[1]->name == 'transcription_video'){
- $users[$i]['id'] = $worker->id;
- $users[$i]['value'] = $service[1]->value;
- }else{
- }
- }
- $i++;
- }
- endforeach;
- }else{
- $users = [];
- $j = 0;
- foreach($workers as $worker):
- $services = json_decode($worker->services);
- foreach($services as $key => $service){
- if($key == $service_value){
- if(!empty($service->value)){
- $users[$j]['id'] = $worker->id;
- $users[$j]['value'] = $service->value;
- }
- }
- $j++;
- }
- endforeach;
- }
- //echo '<pre>'; print_r($users);
- $this->load->view('admin/projects/view_more_assignment_another_users.php', array('data' => $users, 'j' => $_POST['val'], 'id' => $service_value, 'project_id' => $_POST['project_id'], 'last_id' => $last_workers->id, 'translators' => count($count_load_workers_another), 'all_translators' => count($users), 'task_cost' => $_POST['task_cost'], 'current_id' => $_POST['current_id'], 'project_cost' => $_POST['project_cost'], 'user_id' => $_POST['user_id']));
- }else{
- echo '<p style="color:red;">No Data Found</p>'; die;
- }
- }
- public function checkDatewiseCurrency(){
- $response = 0;
- $result = $this->Managers->get_data_where('tbl_currnecy', array('created' => strtotime($_POST['selected'])))->row();
- if(!empty($result)){
- $response = 1;
- }else{
- $response = 2;
- }
- echo $response; exit;
- }
- public function filterByDate(){
- $response = 0;
- if ($this->input->post()) {
- parse_str($this->input->post()['postform'], $searcharray);
- $filter_data = $this->Managers->get_data_where('tbl_projects', array('start_date <=' => $searcharray['start_date'], 'end_date >=' => $searcharray['end_date']))->result();
- $this->load->view('admin/projects/filter_datewise_reports.php', array('data' => $filter_data));
- }
- }
- public function searchCompany(){
- $value = $_POST['value'];
- $data= $this->Managers->get_company_clinet('tbl_clients',$value, 1);
- $this->load->view('admin/projects/search_company.php', array('data' => $data, 'name' => $value));
- }
- public function searchIndividusal(){
- $value = $_POST['value'];
- $data= $this->Managers->get_company_clinet('tbl_clients',$value, 2);
- $this->load->view('admin/projects/search_company_client.php', array('data' => $data, 'name' => $value));
- }
- // public function searchCompany(){
- // $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
- // $pos = strpos($actual_link, "?");
- // $filter = explode("?term=", $actual_link);
- // $filters = explode('&types=',$actual_link);
- // $filter_term = substr($filters[0],77,120);
- // $data= $this->Managers->get_company_clinet('tbl_clients',$filter_term,$filters[1]);
- // $types = $filters[1];
- // echo'<pre>'; print_r($filter).'<br>';
- // echo $types.'<br>';
- // echo '<pre>'; print_r($filter_term).'<br>';
- // echo '<pre>'; print_r($data); die;
- // $this->load->view('admin/projects/search_company.php', array('data' => $data,'type'=>$types));
- // }
- public function companyClinet(){
- $dataCompanyDb = $this->Managers->get_data_where('tbl_clients',array('id'=>$_POST['id']))->row();
- if($_POST['type'] == 'edit'){
- $dataCompany = $this->Managers->get_company_clients_tiered($dataCompanyDb->client_id);
- $this->load->view('admin/projects/company_edit_client.php', array('data' => $dataCompany, 'companyname' => $dataCompanyDb));
- }else{
- $dataCompany = $this->Managers->get_data_where('tbl_company_clients',array('company_id'=>$dataCompanyDb->client_id))->result();
- $this->load->view('admin/projects/company_client.php', array('data' => $dataCompany, 'companyname' => $dataCompanyDb));
- }
- }
- }
Add Comment
Please, Sign In to add comment