Posts

Pay using braintree

Hare is step how to pay using  Brain tree in code igniter First Download  library from  https://github.com/AeonDave/CodeIgniter-Braintree-Lib Now load Library in your constructor $CI->load->library("braintree_lib"); *********  create customer in brain tree $result = Braintree_Customer::create([                              'id'=>time(),                             'firstName' => $post['vName'],                             'lastName' => '',                             'company' => '',                             'email' => $post['vEmailId'],                             'phone' => '',                             'fax' => '',                             'website' => ''                         ]);                                                                         ($result->success)?$iBt

Connect multiple database and call in code igniter

Hello here is code for connecting multiple database in Code igniter - First Open database.php file and make below code For First Database $active_group = 'default'; $query_builder = TRUE; $db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'root', 'password' => '', 'database' => 'test', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => TRUE, 'cache_on' => FALSE, 'cachedir' => '', 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries'

Send push notification to Android and IOS from PHP

Hello here is code for sending push notification in android and IOS Php function for sending notification                                                                        $message="Your message";                                     $type='notification type';                                                                          $extra=array();                                     $extra['message']=$message;                                     $extra['type']=$type;                                     $extra['sound'] = 'default';                                     $this->common->sendPushNotification($receiverUserId,$extra); Send Notification in to android function sendNotificationToAndroid($deviceToken,$aps)          {             $apiKey = "4646464";                      $registrationIDs = array($deviceToken);             $url = 'https://android.googleapis.

Pay using ccavenue with webservice in php

- Here is code if you want to pay using cc avenue  with web service in php First Create function  in your controller                  public function paynow()              {                   if (isset($_REQUEST["pay_Request"]) &&                    trim($_REQUEST["pay_Request"]) != '')            {                         $register_request = $_REQUEST["pay_Request"];                         $register_request_decode = json_decode($register_request);                            if (isset($register_request_decode -> userid)                             && isset($register_request_decode->address)                             )                         {                             $data=array() //  if you want to pas custom parameters from                                                         controler                             $userId=$register_request_decode -> userid;                            $addre

Call CI controler functiona from View using ajax

Here is simple function through you can call controller function from view using ajax  $.ajax({              type: "POST",                      async:false,                     url: '<?php echo base_url('admin/editmodule')?>',                     data: {'id':id,'modulename':modulename},                     success: function(msg) {                         alert('Module edited');                         $('#modulename_'+id).text(modulename);                                              }                 });
Create dynamic controller and model - to reduce code , follow below way that reduce your time to right each time new function in model *****  calling function from controller   *****     $table="tablename";     $alias='*';     $joinArgument=array                 (                             array('tableName'=>'yourtablename',                               'joinCondition'=>'firsttable.column =                              secondtable.column',                               'joinType'=>'LEFT'                              ),                   );     $where=array('column1'=>'value');     $data=$this->commonmodel->getData($alias,$table,$where,$joinArgument); ************ code for model   function getData($alias='*',$table,$where='',$join='',$orderBy='',$groupby='',$limit='')     {              $this->db->selec
Paypal Integration in Codeigniter <form name="paypalFrm" id="paypalFrm_<?php echo $subscribe[$i]->subscriptionpackageID;?>" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">                                             <input type="hidden" name="cmd" value="_ext-enter">                                             <input type="hidden" name="redirect_cmd" value="_xclick"> //useful to get your custom variable back in response                                                                                         <input type="hidden" name="return" value="<?php echo base_url('clinic/paid');?>">                         //set url name where you can check for your response                                             <input type="hidden" name="cancel_return" value="<