Reseller Domain Murah dan termurah di Indonesia? ya di ResellerCamp.
         
 

Forum PHP Indonesia

 
Advanced Search
   
 
Home Register FAQ Memberlist Usergroups  
 
 

Forum PHP Indonesia Forum Index PHP Ajax Function Ajax.
Display posts from previous:   
      All times are GMT + 7 Hours  

Function Ajax.

Post new topic  Reply to topic

Sat Jul 17, 2010 08:56
Author Message
asri
PHPnewbie
PHPnewbie


Joined: 02 Jul 2010
Posts: 11

Post subject: Function Ajax. Reply with quote

Saya mempunyai script fungsi ajax sebagai berikut.

Code:
<?php <?php <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class 
Ajax extends Controller {

    function 
Ajax ()
    {
        
parent::Controller();
        
$this->load->model('tbltransaction');
        
$this->load->model('tblsaldo');
    }
    
    function 
listTransaction() {
        
$valid_fields = array('tanggal','mitra_name','saldo_awal','cash_in','nama_bank','amount','trx','destination_fee','gateway_fee','switching_fee','ppn','saldo_akhir');
        
        
$this->flexigrid->validate_post('tanggal','desc',$valid_fields);

        
$records $this->tbltransaction->getList();
        
        
$this->output->set_header($this->config->item('json_header'));

        if (
$records['record_count']!=0) {
            
$qry $this->db->query("SELECT * FROM config");
            
$obj $qry->result();
            foreach (
$records['records']->result() as $row)
            {
                
$gateway $row->ttx*$obj[0]->config_value;
                
$aquirer $row->ttx*$obj[1]->config_value;
                
$switching $row->ttx*$obj[2]->config_value;
                
$ppn $row->ttx*$obj[3]->config_value;
                
$destination $row->ttx*$obj[4]->config_value;
                
$totalfee $gateway+$aquirer+$switching+$ppn+$destination;
                
                if (
$row->mitraref_id==NULL
                    
$qry $this->db->query("SELECT * FROM saldoawal WHERE mitraref_id=0");
                else 
                    
$qry $this->db->query("SELECT * FROM saldoawal WHERE mitraref_id=".$row->mitraref_id);

                
$obj2 $qry->result();
                
$saldoakhir $obj2[0]->saldo_awal $row->amount $totalfee;

                
$record_items[] = array($row->id,
                    
date('d F Y',strtotime($row->tanggal)),
                    
$row->mitra_name,
                    
"Rp".number_format($obj2[0]->saldo_awal,2,',','.'),
                    
$row->cashin,
                    
$row->nama_bank,
                    
"Rp".number_format($row->amount,2,',','.'),
                    
$row->ttx,
                    
"Rp".number_format($destination,2,',','.'),
                    
"Rp".number_format($gateway,2,',','.'),
                    
"Rp".number_format($aquirer,2,',','.'),
                    
"Rp".number_format($switching,2,',','.'),
                    
"Rp".number_format($ppn,2,',','.'),
                    
"Rp".number_format($saldoakhir,2,',','.'),
                    
"<a href=\"".site_url('transaction/dgAction/edit/'.$row->id)."\" title=\"edit data\"><img border=\"0\" src=\"".base_url()."images/flexgrid/b_edit.png\" /></a>"
                
);
            }
        } else {
            
$record_items[] = array(NULL);
        }

        
$this->output->set_output($this->flexigrid->json_build($records['record_count'],$record_items));
    } 
?> ?>


Bagaimana membuat saldo awal = saldo akhir tanggal sebelumnya.
Dimana saldo awal itu berdasarkan mitraref_id. Helppp!! Helppp!! Helppp!! Cry
 
View user's profile Send private message Yahoo Messenger
      Back To Top  
Post new topic  Reply to topic

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


      Back To Top  

Page 1 of 1
Jump to:  
Powered by phpBB © 2001, 2002 phpBB Group
Toko Kaos Couple | Avalanche style by What Is Real © 2004 | Toko Baju Butik Online | Cara Pedia | Busana Baju Muslim