Ejemplo n.º 1
0
 public function fire()
 {
     /*$tables = DB::select('SHOW TABLES');
     
     		foreach ($tables as $key => $table) {
     			$old_table_name = $table->Tables_in_oodoo_current;
     
     			$new_table_name = "old_" . $old_table_name;
     
     			Schema::rename($old_table_name,$new_table_name);
     		}*/
     //First Migrate Cust Det Table
     $old_cust_det = OldCustDet::all();
     foreach ($old_cust_det as $key => $value) {
         var_dump($value->Account_ID);
     }
     foreach ($old_cust_det as $ocd) {
         $cust_det = CusDet::where('account_no', '=', $ocd->Account_No)->get()->first();
         //check if data already exists
         if (is_null($cust_det)) {
             DB::table('cust_det')->insert(array('account_no' => $ocd->Account_No, 'account_id' => $ocd->Account_ID));
             var_dump("inserted");
         }
     }
     //Then Alter the columns based on Upgrade!!
 }
Ejemplo n.º 2
0
 public function sendEmailPaymentSuccess($params)
 {
     $user = CusDet::where('account_id', '=', $this->account_id)->get()->first();
     //var_dump($params);die;
     if (!is_null($user)) {
         $bill = Bill::where('bill_no', '=', $this->bill_no)->get()->first();
         if (!is_null($bill)) {
             $email = Config::get('custom_config.email');
             if (is_null($email)) {
                 $email = $user->email;
             }
             $data = array();
             $data['email'] = $email;
             $data['transaction'] = $this;
             $data['user'] = $user;
             $data['bill'] = $bill;
             $data['payer_email'] = $params['email'];
             $data['payer_name'] = $params['firstname'];
             $data['payer_phone'] = $params['phone'];
             if (!empty($data['email']) && !empty($data['payer_email'])) {
                 if ($email == $data['payer_email']) {
                     if ($this->transaction_type == "cheque") {
                         Mail::send('emails.payment_success_cheque', $data, function ($message) use($data) {
                             $message->to($data['email'], $data['user']->first_name)->subject("Payment Successfull");
                         });
                     } else {
                         Mail::send('emails.payment_success_cash', $data, function ($message) use($data) {
                             $message->to($data['email'], $data['user']->first_name)->subject("Payment Successfull");
                         });
                     }
                 } else {
                     if ($this->transaction_type == "cheque") {
                         Mail::send('emails.payment_success_cheque', $data, function ($message) use($data) {
                             $message->to($data['email'], $data['user']->first_name)->subject("Payment Successfull");
                         });
                         Mail::send('emails.payment_success_to_payer_cheque', $data, function ($message) use($data) {
                             $message->to($data['payer_email'], $data['payer_name'])->subject("Payment Successfull");
                         });
                     } else {
                         Mail::send('emails.payment_success_cash', $data, function ($message) use($data) {
                             $message->to($data['email'], $data['user']->first_name)->subject("Payment Successfull");
                         });
                         Mail::send('emails.payment_success_to_payer_cash', $data, function ($message) use($data) {
                             $message->to($data['payer_email'], $data['payer_name'])->subject("Payment Successfull");
                         });
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
 public function feasible()
 {
     $crf_no = CusDet::where('account_id', '=', $this->account_id)->get()->first();
     if ($crf_no) {
         $feasiable = PreActivationStatus::where('crf_no', '=', $crf_no->crf_no)->get()->first();
         return $feasiable;
     }
     return null;
 }