Jump to content

Yohanne

Members
  • Posts

    216
  • Joined

  • Last visited

Posts posted by Yohanne

  1. here is my query 

    - trtpay.treatment_payment_id is already group_by

    - procedure_id is represent as item _id and  treatement_payment_id is payment_id

    but here i get error like syntax to use near 'distinct(treatement_payment_id)as.. 

    left join (select procedure_id, distinct(treatement_payment_id)as tp from episode_payment) as episode 
    on episode.tp = trtpay.treatment_payment_id

     

  2. im not the creator of this db. im a second user actually.  i am now creating a report and i found this case.. and im stock here.  but do you think theres is no  way to achieve this case. since the client want that case...   

  3. Hi coders,

    this is not the actual of my table but the scenario is the same..  i cannot get the list of the item  because  conflict, im not sure.,  i try it many time  10hrs  but failed.  now i decided to get help from you guys..

     

    Table1
    +-----------------------------------------+  
    |   id  |  item_id  | paymen | payment_id | 
    +-----------------------------------------+
    |  1    |     1     |  25    |     11     |
    +-----------------------------------------+
    |  2    |     3     |  15    |     11     |
    +-----------------------------------------+
    |  3    |     2     |  75    |     11     |
    +-----------------------------------------+
    |  4    |     5     |  100   |     2      |
    +-----------------------------------------+
    |  5    |     1     |  88    |     1      |
    +-----------------------------------------+
    |  6    |     1     |  25    |     2      |
    +-----------------------------------------+
    
    table2
    +-------------------------+
    |  item_id  |  item_name  | 
    +-------------------------+
    |     1     |  RH Beer    |    
    +-------------------------+
    |     3     |  22Wine     |     
    +-------------------------+
    |     2     |  Iphone4    | 
    +-------------------------+
    |     5     |  Nokia3210  |    
    +-------------------------+
    
    table3
    +-----------------------------------+  
    |   id  |   name       | payment_id | 
    +-----------------------------------+
    |  1    |   Lim        |     11     |
    +-----------------------------------+
    |  2    |   Lim        |     11     |  
    +-----------------------------------+
    |  3    |   Lim        |     11     |   
    +-----------------------------------+
    |  4    |   Jhon       |     2      | 
    +-----------------------------------+
    |  5    |   Leo        |     1      |  
    +-----------------------------------+
    |  6    |   Jhon       |     2      |  
    +-----------------------------------+
    
    
    
    
    out put should be like this if possible 
    +-----------------------------------------------------------+  
    |   payment total  |   name    |           item             | 
    +-----------------------------------------------------------+
    |       115        |   Lim     |   RH Beer, 22Wine, Iphone4 |
    +-----------------------------------------------------------+
    |       125        |   Jhon    |   RH Beer, Nokia3210       |  
    +-----------------------------------------------------------+
    |       88         |   Leo     |   RH Beer                  |   
    +-----------------------------------------------------------+

     

  4. i have foreach loop for payment list of a client if they fully paid or have a balance, my problem is client has two receipt like payment in cash and payment in card. he/she paid by different date but don't mind the date.. here is my table

    dbtable scenario 

    uid | name | payment_type | cost     | payment  |
    1    |  kim    |   card                |    100   |   100    |
    2    |  lee     |   cash               |    95      |   95     |
    3    |  kent   |   cash              |   100      |   50     |   
    3    |  kent   |   card               |   100      |   50     |
    4    |  iya      |   cash              |    80       |   40     |
    4    |  iya      |  card                |   80        |   20     |


    its should be the output

    uid | name   | cash   |  card  | cost   | balance |
    1    | kim       |  0        |   100  |  100   |  0            |
    2    | lee        |  95      |   0      |  95      |  0            |
    3    | kent      |  50      |   0     |  100    |  50          |<-this part 100-50 = 50 balance   
    3    | kent      |  0       |   50    |  100   |  0             |<-balance 50-50 = 0 balnce
    4    | iya        |  40      |   0      |  80     |  40         |<-this part 80-40 = 40 balance 
    4    | iya        |  0        |   20    |  80     |  20         |<-balance 40-20 = 20 balnce


    need your assistance newbe here for this scenario but i try to resolve but i got failed. i did not get the correct output.. 

  5. when i add two text field below, branchname and pickdate i got the error message.

    if (!$json) {
    $this->session->data['shipping_method'] = $this->session->data['shipping_methods'][$shipping[0]]['quote'][$shipping[1]];
    $this->session->data['branchnamed'] = $this->request->post['branchname'];
    $this->session->data['pickup_dated'] = $this->request->post['pickup_date'];
    $this->session->data['comment'] = strip_tags($this->request->post['comment']);
    		}
    
    		$this->response->addHeader('Content-Type: application/json');
    		$this->response->setOutput(json_encode($json));
    

    error..

    SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
    
    OK
    
    <b>Notice</b>: Undefined index: branchname in <b>/home/octagon/public_html/ocs_shop/upload/catalog/controller/checkout/shipping_method.php
    
  6. view

    <div id="pagination">
    <?php echo $pages; ?>
    </div>
    

    controller

    $config["base_url"] = base_url() . "index.php?dir-move=public&switch=branch_reports&task=branch_report_por";
    $config["total_rows"] = $this->model_ho_por->page_count_for_br_por_sr_report(); //return $this->db->count_all('por_ho_request_compile');
    $config["per_page"] = 3;
    $config["uri_segment"] = 3;
    $config['num_links'] = 2;
    $config['page_query_string'] = true;
    $config['full_tag_open'] = '<ul class="pagination">';
    $config['full_tag_close'] = '</ul>';
    config['prev_link'] = '<';
    $config['prev_tag_open'] = '<li>';
    $config['prev_tag_close'] = '';
    $config['first_link'] = 'First';
    $config['first_tag_open'] = '<li>';
    $config['first_tag_close'] = '';
    $config['next_link'] = '>';
    $config['next_tag_open'] = '<li>';
    $config['next_tag_close'] = '';
    $config['cur_tag_open'] = '<li class="active"><a href="">';
    $config['cur_tag_close'] = '</a></li>';
    $config['num_tag_open'] = '<li>';
    $config['num_tag_close'] = '';
    $config['last_link'] = 'Last';
    $config['last_tag_open'] = '<li>';
    $config['last_tag_close'] = '';
    $this->pagination->initialize($config);
    $page = ($this->uri->segment(3))? $this->uri->segment(3) : 0;
    $data["load_rs_report"] = $this->model_ho_por->branch_ho_sr($config["per_page"], $page);
    $data["pages"] = $this->pagination->create_links();
    
    $this->load->view('public/branch_reports/por_sr',$data);
    

    model

    $data = array();
    $this->db->limit($limit, $start);
    $this->db->select('por_ho_request_compile.*,stocks.*,users.*,smr_request_subject.*,por_ho_received_compile.*');
    $this->db->select('ufrom.branch_name as branch_from,ufrom.branch_code as from_brc');
    $this->db->select('uto.branch_name as branch_to,uto.branch_code as to_brc');
    $this->db->select('ho_received.uid,ho_received.first_Name as ho_received_by_fname');
    $this->db->select('branch_served.uid,branch_served.first_Name as branch_served_fname');
    $this->db->from('por_ho_request_compile');
    $this->db->join('stocks','por_ho_request_compile.por_ho_sid = stocks.stock_id','left');
    $this->db->join('por_ho_received_compile','por_ho_request_compile.por_id = por_ho_received_compile.por_id','left');
    $this->db->join('users','por_ho_request_compile.por_ho_by = users.uid','left');
    $this->db->join('users as ufrom','por_ho_request_compile.por_ho_from = ufrom.branch_code','left');
    $this->db->join('users as uto','por_ho_request_compile.por_ho_to = uto.branch_code','left');
    $this->db->join('users as ho_received','por_ho_received_compile.por_received_uid = ho_received.uid','left');
    $this->db->join('users as branch_served','por_ho_request_compile.br_by = branch_served.uid','left');
    $this->db->join('smr_request_subject','por_ho_request_compile.por_ho_sbj = smr_request_subject.id_subject', 'left');
    $this->db->where('por_ho_request_compile.por_ho_from', $bc);
    $this->db->where('por_ho_request_compile.por_ho_temp',4);
    $this->db->group_by('por_ho_request_compile.por_id');
    $this->db->order_by('por_ho_request_compile.br_sr','desc');
    $this->db->order_by('por_ho_request_compile.por_ho_from','asc');
    $query = $this->db->get();
    				
    
    foreach ($query->result_array() as $row) {
    	$data[] = $row;
    	}
    	return $data;
    
  7. Hi Coders,

    i just wanna know on how to set-up pagination while enable_query_strings is enable or set to true. i tried in many ways but im failed.  and i just get the link work but the data cannot retrieved for the next page.

    $config["base_url"] = base_url() . "index.php?dir-move=public&switch=branch_reports&task=branch_report_por";
    $config["total_rows"] = $this->model_ho_por->page_count_for_br_por_sr_report();
    $config["per_page"] = 3;
    $config["uri_segment"] = 3;
    $config['num_links'] = 2;
    $config['page_query_string'] = true;
    $config['full_tag_open'] = '<ul class="pagination">';
    $config['full_tag_close'] = '</ul>';
    config['prev_link'] = '<';
    $config['prev_tag_open'] = '<li>';
    $config['prev_tag_close'] = '';
    $config['first_link'] = 'First';
    $config['first_tag_open'] = '<li>';
    $config['first_tag_close'] = '';
    $config['next_link'] = '>';
    $config['next_tag_open'] = '<li>';
    $config['next_tag_close'] = '';
    $config['cur_tag_open'] = '<li class="active"><a href="">';
    $config['cur_tag_close'] = '</a></li>';
    $config['num_tag_open'] = '<li>';
    $config['num_tag_close'] = '';
    $config['last_link'] = 'Last';
    $config['last_tag_open'] = '<li>';
    $config['last_tag_close'] = '';
    $this->pagination->initialize($config);
    $page = ($this->uri->segment(3))? $this->uri->segment(3) : 0;
    $data["load_rs_report"] = $this->model_ho_por->branch_ho_sr($config["per_page"], $page);
    $data["pages"] = $this->pagination->create_links(); 
    

    and got link below but the data are not change,

    ?dir-move=public&switch=branch_reports&task=branch_report_por&per_page=1
    ?dir-move=public&switch=branch_reports&task=branch_report_por&per_page=2
    ?dir-move=public&switch=branch_reports&task=branch_report_por&per_page=3
    ?dir-move=public&switch=branch_reports&task=branch_report_por&per_page=4
    ?dir-move=public&switch=branch_reports&task=branch_report_por&per_page=5

  8. hope it could give you an idea.

                    if(date( 'M') == 'Jan' || date( 'M') == 1)
    			{ echo "month"; }
    		elseif(date( 'M') == 'Feb' || date( 'M') == 2)	
    			{ echo "month"; }
    		elseif(date( 'M') == 'Mar' || date( 'M') == 3)	
    			{ echo "month"; }
    		elseif(date( 'M') == 'Apr' || date( 'M') == 4)	
    			{ echo "month"; } 
    		elseif(date( 'M') == 'May' || date( 'M') == 5)	
    			{ echo "month"; }
    		elseif(date( 'M') == 'Sep' || date( 'M') == 9)	
    			{ echo "month"; }
    		else 
    			{
    				return false;
    			}
    
  9. Hi coders,

     

    i just want to display the each value of input text but i don't get it, any advice where i go wrong.. no database required.

    <input type='text' name = 'val1[]' value='asasas'>
    <input type='text' name = 'val2[]' value='asasas'>
    
    <input type='text' name = 'val1[]' value='sdsddd'>
    <input type='text' name = 'val2[]' value='sdsdsd'>
    
    $value1 = $this->input->post('val1');
    $value2 = $this->input->post('val2');
    								
    $array = array(value1, value2);
    echo $comma_separated = implode(",", $array);
    
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.