+ Change dashboard for Hyperviseur ilink
This commit is contained in:
		
							parent
							
								
									d9cf56359e
								
							
						
					
					
						commit
						52d6cd5cea
					
				|  | @ -1690,19 +1690,9 @@ class Gestion extends CI_Controller | ||||||
| 
 | 
 | ||||||
| 					}else if ($type == 'ilink'){ | 					}else if ($type == 'ilink'){ | ||||||
| 						$idConfig = $_POST['id_config']; | 						$idConfig = $_POST['id_config']; | ||||||
| 						$plr_user_wallet_wallet = isset($_POST['plr_user_wallet_wallet']) ? $_POST['plr_user_wallet_wallet'] : null ; | 						$config = $_POST['config']; | ||||||
| 						$plr_user_wallet_cash = isset($_POST['plr_user_wallet_cash']) ? $_POST['plr_user_wallet_cash'] : null ; | 						$fields = isset($_POST['fields']) ? $_POST['fields'] : []; | ||||||
| 						$plr_agent_depot_wallet_ilink = isset($_POST['plr_agent_depot_wallet_ilink']) ? $_POST['plr_agent_depot_wallet_ilink'] : null; |  | ||||||
| 						$plr_agent_depot_autre_wallet = isset($_POST['plr_agent_depot_autre_wallet']) ? $_POST['plr_agent_depot_autre_wallet'] : null; |  | ||||||
| 						$plr_agent_cash_cash  = isset($_POST['plr_agent_cash_cash']) ? $_POST['plr_agent_cash_cash'] : null ; |  | ||||||
| 
 | 
 | ||||||
| 						$plr_user_wallet_wallet_national = isset($_POST['plr_user_wallet_wallet_national']) ? $_POST['plr_user_wallet_wallet_national'] : null ; |  | ||||||
| 						$plr_user_wallet_cash_national = isset($_POST['plr_user_wallet_cash_national']) ? $_POST['plr_user_wallet_cash_national'] : null ; |  | ||||||
| 						$plr_agent_depot_wallet_ilink_national = isset($_POST['plr_agent_depot_wallet_ilink_national']) ? $_POST['plr_agent_depot_wallet_ilink_national'] : null; |  | ||||||
| 						$plr_agent_depot_autre_wallet_national = isset($_POST['plr_agent_depot_autre_wallet_national']) ? $_POST['plr_agent_depot_autre_wallet_national'] : null; |  | ||||||
| 						$plr_agent_cash_cash_national  = isset($_POST['plr_agent_cash_cash_national']) ? $_POST['plr_agent_cash_cash_national'] : null ; |  | ||||||
| 
 |  | ||||||
| 						$fields = $_POST['fields']; |  | ||||||
| 						$rows = []; | 						$rows = []; | ||||||
| 						//Convert fields to simple array
 | 						//Convert fields to simple array
 | ||||||
| 						foreach ($fields as $field) { | 						foreach ($fields as $field) { | ||||||
|  | @ -1711,28 +1701,64 @@ class Gestion extends CI_Controller | ||||||
| 							$name = ""; | 							$name = ""; | ||||||
| 							foreach ($array as $key => $value){ | 							foreach ($array as $key => $value){ | ||||||
| 								if($i == 0) | 								if($i == 0) | ||||||
| 								  $name = $value; | 									$name = $value; | ||||||
| 								else | 								else | ||||||
| 									$rows[$name] = $value; | 									$rows[$name] = $value; | ||||||
| 								$i++; | 								$i++; | ||||||
| 							} | 							} | ||||||
| 						} | 						} | ||||||
| 
 | 
 | ||||||
| 						$this->insertPalier($plr_user_wallet_wallet,"user_wallet_wallet_international", $idConfig); | 						switch ($config){ | ||||||
| 						$this->insertPalier($plr_user_wallet_cash,"user_wallet_cash_international", $idConfig); | 							case 'user_wallet_wallet': | ||||||
| 						$this->insertPalier($plr_agent_depot_wallet_ilink,"agent_depot_wallet_ilink_international", $idConfig); | 								$plr_user_wallet_wallet = isset($_POST['plr_user_wallet_wallet']) ? $_POST['plr_user_wallet_wallet'] : null ; | ||||||
| 						$this->insertPalier($plr_agent_depot_autre_wallet,"agent_depot_autre_wallet_international", $idConfig); | 								$plr_user_wallet_wallet_national = isset($_POST['plr_user_wallet_wallet_national']) ? $_POST['plr_user_wallet_wallet_national'] : null ; | ||||||
| 						$this->insertPalier($plr_agent_cash_cash,"agent_cash_cash_international", $idConfig); | 								$this->insertPalier($plr_user_wallet_wallet,"user_wallet_wallet_international", $idConfig); | ||||||
|  | 								$this->insertPalier($plr_user_wallet_wallet_national,"user_wallet_wallet_national", $idConfig); | ||||||
|  | 								break; | ||||||
|  | 							case 'user_wallet_carte': | ||||||
|  | 								$this->user_model->updateConfigWalletIlink_u_w_cart($rows['taux_u_w_cart'],$rows['taux_hyp_s_wallet_cart_ilink'],$rows['taux_bq_s_wallet_cart_ilink'],$idConfig); | ||||||
|  | 								break; | ||||||
|  | 							case 'user_wallet_cash': | ||||||
|  | 								$plr_user_wallet_cash = isset($_POST['plr_user_wallet_cash']) ? $_POST['plr_user_wallet_cash'] : null ; | ||||||
|  | 								$plr_user_wallet_cash_national = isset($_POST['plr_user_wallet_cash_national']) ? $_POST['plr_user_wallet_cash_national'] : null ; | ||||||
|  | 								$this->insertPalier($plr_user_wallet_cash,"user_wallet_cash_international", $idConfig); | ||||||
|  | 								$this->insertPalier($plr_user_wallet_cash_national,"user_wallet_cash_national", $idConfig); | ||||||
|  | 								break; | ||||||
|  | 							case 'user_carte_wallet': | ||||||
|  | 								$this->user_model->updateConfigWalletIlink_u_c_w($rows['taux_u_c_w'],$rows['taux_u_c_c'], $rows['taux_hyp_r_cart_ilink'],$rows['taux_bq_r_cart_ilink'],$idConfig); | ||||||
|  | 								break; | ||||||
|  | 							case 'agent_remove_cash': | ||||||
|  | 								$this->user_model->updateConfigWalletIlink_a_r_c($rows['taux_ag_r_c'],$rows['taux_sup_r_c'], | ||||||
|  | 									$rows['taux_hyp_r_c'],$idConfig); | ||||||
|  | 								break; | ||||||
|  | 							case 'agent_remove_carte_cash': | ||||||
|  | 								$this->user_model->updateConfigWalletIlink_a_r_cart($rows['taux_ag_cart_c'], $rows['taux_ag_r_cart'],$rows['taux_sup_r_cart'], | ||||||
|  | 									$rows['taux_hyp_r_cart'],$rows['taux_bq_r_cart'],$idConfig); | ||||||
|  | 								break; | ||||||
|  | 							case 'agent_send_cash_carte': | ||||||
|  | 								$this->user_model->updateConfigWalletIlink_a_s_cc($rows['taux_ag_d_c_c'],$rows['taux_ag_d_c'],$rows['taux_sup_d_c'],$rows['taux_hyp_d_c'],$rows['taux_bq_d_c'],$idConfig); | ||||||
|  | 								break; | ||||||
|  | 							case 'agent_send_cash_canal': | ||||||
|  | 								$plr_agent_depot_wallet_ilink = isset($_POST['plr_agent_depot_wallet_ilink']) ? $_POST['plr_agent_depot_wallet_ilink'] : null; | ||||||
|  | 								$plr_agent_depot_autre_wallet = isset($_POST['plr_agent_depot_autre_wallet']) ? $_POST['plr_agent_depot_autre_wallet'] : null; | ||||||
|  | 								$plr_agent_cash_cash  = isset($_POST['plr_agent_cash_cash']) ? $_POST['plr_agent_cash_cash'] : null ; | ||||||
| 
 | 
 | ||||||
| 						$this->insertPalier($plr_user_wallet_wallet_national,"user_wallet_wallet_national", $idConfig); | 								$plr_agent_depot_wallet_ilink_national = isset($_POST['plr_agent_depot_wallet_ilink_national']) ? $_POST['plr_agent_depot_wallet_ilink_national'] : null; | ||||||
| 						$this->insertPalier($plr_user_wallet_cash_national,"user_wallet_cash_national", $idConfig); | 								$plr_agent_depot_autre_wallet_national = isset($_POST['plr_agent_depot_autre_wallet_national']) ? $_POST['plr_agent_depot_autre_wallet_national'] : null; | ||||||
| 						$this->insertPalier($plr_agent_depot_wallet_ilink_national,"agent_depot_wallet_ilink_national", $idConfig); | 								$plr_agent_cash_cash_national  = isset($_POST['plr_agent_cash_cash_national']) ? $_POST['plr_agent_cash_cash_national'] : null ; | ||||||
| 						$this->insertPalier($plr_agent_depot_autre_wallet_national,"agent_depot_autre_wallet_national", $idConfig); |  | ||||||
| 						$this->insertPalier($plr_agent_cash_cash_national,"agent_cash_cash_national", $idConfig); |  | ||||||
| 
 | 
 | ||||||
| 						$this->user_model->updateConfigWalletIlink($rows['taux_u_w_cart'],$rows['taux_u_c_w'],$rows['taux_u_c_c'],$rows['taux_ag_d_c_c'],$rows['taux_ag_cart_c'],$rows['taux_ag_cash_c'],$rows['taux_ag_s_c'],$rows['taux_sup_s_c'],$rows['taux_hyp_s_c'],$rows['taux_ag_r_c'],$rows['taux_sup_r_c'], | 								$this->insertPalier($plr_agent_depot_wallet_ilink,"agent_depot_wallet_ilink_international", $idConfig); | ||||||
| 							$rows['taux_hyp_r_c'],$rows['taux_ag_d_c'],$rows['taux_sup_d_c'],$rows['taux_hyp_d_c'],$rows['taux_bq_d_c'], $rows['taux_ag_r_cart'],$rows['taux_sup_r_cart'],$rows['taux_hyp_r_cart'],$rows['taux_bq_r_cart'], | 								$this->insertPalier($plr_agent_depot_autre_wallet,"agent_depot_autre_wallet_international", $idConfig); | ||||||
| 							$rows['taux_hyp_r_cart_ilink'],$rows['taux_bq_r_cart_ilink'],$rows['taux_hyp_s_wallet_cart_ilink'],$rows['taux_bq_s_wallet_cart_ilink'],$idConfig); | 								$this->insertPalier($plr_agent_cash_cash,"agent_cash_cash_international", $idConfig); | ||||||
|  | 
 | ||||||
|  | 								$this->insertPalier($plr_agent_depot_wallet_ilink_national,"agent_depot_wallet_ilink_national", $idConfig); | ||||||
|  | 								$this->insertPalier($plr_agent_depot_autre_wallet_national,"agent_depot_autre_wallet_national", $idConfig); | ||||||
|  | 								$this->insertPalier($plr_agent_cash_cash_national,"agent_cash_cash_national", $idConfig); | ||||||
|  | 
 | ||||||
|  | 								$this->user_model->updateConfigWalletIlink_a_s_c($rows['taux_ag_s_c'],$rows['taux_sup_s_c'],$rows['taux_hyp_s_c'],$idConfig); | ||||||
|  | 
 | ||||||
|  | 								break; | ||||||
|  | 						} | ||||||
| 
 | 
 | ||||||
| 						$res = true; | 						$res = true; | ||||||
| 					} | 					} | ||||||
|  |  | ||||||
|  | @ -370,45 +370,8 @@ class Hyperviseur_dash extends CI_Controller | ||||||
| 						$data["totalCommissionBanque"] = $totalCommissionBanque; | 						$data["totalCommissionBanque"] = $totalCommissionBanque; | ||||||
| 
 | 
 | ||||||
| 					} elseif ($data['hasWallet']->first_row()->type == 'ilink') { | 					} elseif ($data['hasWallet']->first_row()->type == 'ilink') { | ||||||
| 						$data['plr_user_wallet_wallet'] = $this->user_model->getPalierConfigWallet("user_wallet_wallet_international", $data['idConfig']); |  | ||||||
| 						$data['plr_user_wallet_cash'] = $this->user_model->getPalierConfigWallet("user_wallet_cash_international", $data['idConfig']); |  | ||||||
| 						$data['plr_agent_depot_wallet_ilink'] = $this->user_model->getPalierConfigWallet("agent_depot_wallet_ilink_international" , $data['idConfig']); |  | ||||||
| 						$data['plr_agent_depot_autre_wallet'] = $this->user_model->getPalierConfigWallet("agent_depot_autre_wallet_international" , $data['idConfig']); |  | ||||||
| 						$data['plr_agent_cash_cash'] = $this->user_model->getPalierConfigWallet("agent_cash_cash_international", $data['idConfig']); |  | ||||||
| 
 |  | ||||||
| 						$data['plr_user_wallet_wallet_national'] = $this->user_model->getPalierConfigWallet("user_wallet_wallet_national", $data['idConfig']); |  | ||||||
| 						$data['plr_user_wallet_cash_national'] = $this->user_model->getPalierConfigWallet("user_wallet_cash_national", $data['idConfig']); |  | ||||||
| 						$data['plr_agent_depot_wallet_ilink_national'] = $this->user_model->getPalierConfigWallet("agent_depot_wallet_ilink_national" , $data['idConfig']); |  | ||||||
| 						$data['plr_agent_depot_autre_wallet_national'] = $this->user_model->getPalierConfigWallet("agent_depot_autre_wallet_national" , $data['idConfig']); |  | ||||||
| 						$data['plr_agent_cash_cash_national'] = $this->user_model->getPalierConfigWallet("agent_cash_cash_national", $data['idConfig']); |  | ||||||
| 
 | 
 | ||||||
| 						$data['taxes'] = $this->user_model->getTaxes($data['idConfig']); | 						$data['taxes'] = $this->user_model->getTaxes($data['idConfig']); | ||||||
| 
 |  | ||||||
| 						$data['taux_u_w_cart'] = $taux->taux_com_user_wallet_carte; |  | ||||||
| 						$data['taux_u_c_w'] = $taux->taux_com_user_carte_wallet; |  | ||||||
| 						$data['taux_u_c_c'] = $taux->taux_com_user_carte_cash; |  | ||||||
| 						$data['taux_ag_d_c_c'] = $taux->taux_com_wallet_ag_envoi_cash_carte; |  | ||||||
| 						$data['taux_ag_cart_c'] = $taux->taux_com_wallet_ag_carte_cash; |  | ||||||
| 						$data['taux_ag_cash_c'] = $taux->taux_com_wallet_ag_depot_carte; |  | ||||||
| 						$data['taux_ag_s_c'] = $taux->taux_com_ag_envoi_cash; |  | ||||||
| 						$data['taux_sup_s_c'] = $taux->taux_com_sup_envoi_cash; |  | ||||||
| 						$data['taux_hyp_s_c'] = $taux->taux_com_hyp_envoi_cash; |  | ||||||
| 						$data['taux_ag_r_c'] = $taux->taux_com_ag_retrait_cash; |  | ||||||
| 						$data['taux_sup_r_c'] = $taux->taux_com_sup_retrait_cash; |  | ||||||
| 						$data['taux_hyp_r_c'] = $taux->taux_com_hyp_retrait_cash; |  | ||||||
| 						$data['taux_ag_d_c'] = $taux->taux_com_ag_depot_cash_carte; |  | ||||||
| 						$data['taux_sup_d_c'] = $taux->taux_com_sup_depot_cash_carte; |  | ||||||
| 						$data['taux_hyp_d_c'] = $taux->taux_com_hyp_depot_cash_carte; |  | ||||||
| 						$data['taux_bq_d_c'] = $taux->taux_com_banque_depot_cash_carte; |  | ||||||
| 						$data['taux_ag_r_cart'] = $taux->taux_com_ag_retrait_carte_cash; |  | ||||||
| 						$data['taux_sup_r_cart'] = $taux->taux_com_sup_retrait_carte_cash; |  | ||||||
| 						$data['taux_hyp_r_cart'] = $taux->taux_com_hyp_retrait_carte_cash; |  | ||||||
| 						$data['taux_bq_r_cart'] = $taux->taux_com_banque_retrait_carte_cash; |  | ||||||
| 						$data['taux_hyp_r_cart_ilink'] = $taux->taux_com_hyp_retrait_carte_cash_ilink; |  | ||||||
| 						$data['taux_bq_r_cart_ilink'] = $taux->taux_com_banque_retrait_carte_cash_ilink; |  | ||||||
| 						$data['taux_hyp_s_wallet_cart_ilink'] = $taux->taux_com_hyp_envoi_wallet_carte_ilink; |  | ||||||
| 						$data['taux_bq_s_wallet_cart_ilink'] = $taux->taux_com_banque_envoi_wallet_carte_ilink; |  | ||||||
| 
 |  | ||||||
| 						$transactions = $this->user_model->getNetworkIlinTransactions($id_network); | 						$transactions = $this->user_model->getNetworkIlinTransactions($id_network); | ||||||
| 						$data["transactions"] = array(); | 						$data["transactions"] = array(); | ||||||
| 						$totalCommissionBanque = 0; | 						$totalCommissionBanque = 0; | ||||||
|  | @ -1019,6 +982,7 @@ class Hyperviseur_dash extends CI_Controller | ||||||
| 		$data['country'] = $this->session->userdata('current_pays'); | 		$data['country'] = $this->session->userdata('current_pays'); | ||||||
| 		$data['category'] = $this->session->userdata('category'); | 		$data['category'] = $this->session->userdata('category'); | ||||||
| 		$data['idConfig'] = $data['hasWallet']->first_row()->id; | 		$data['idConfig'] = $data['hasWallet']->first_row()->id; | ||||||
|  | 		$data['network_id'] = $this->session->userdata('network_id'); | ||||||
| 		if (isset($country)) { | 		if (isset($country)) { | ||||||
| 			$data['country_id'] = $country; | 			$data['country_id'] = $country; | ||||||
| 			$data['country'] = $this->user_model->getCountry($country)->first_row(); | 			$data['country'] = $this->user_model->getCountry($country)->first_row(); | ||||||
|  | @ -1055,11 +1019,80 @@ class Hyperviseur_dash extends CI_Controller | ||||||
| 				$data['countries'][] = $country; | 				$data['countries'][] = $country; | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		$this->load->view('header_hyp', $data); | 		$taux = $data['hasWallet']->first_row(); | ||||||
| //		if ($type == 'transaction')
 | 		switch($config){ | ||||||
| //			$this->load->view('historique_transactions');
 | 			case 'paying_networks': | ||||||
| //		else
 | 				$this->load->view('header_hyp', $data); | ||||||
| 			$this->load->view('gestion_wallet_ilink_config_paying_networks'); | 				$this->load->view('gestion_wallet_ilink_config_paying_networks'); | ||||||
|  | 				break; | ||||||
|  | 			case 'user_wallet_wallet': | ||||||
|  | 				$data['plr_user_wallet_wallet'] = $this->user_model->getPalierConfigWallet("user_wallet_wallet_international", $data['idConfig']); | ||||||
|  | 				$data['plr_user_wallet_wallet_national'] = $this->user_model->getPalierConfigWallet("user_wallet_wallet_national", $data['idConfig']); | ||||||
|  | 				$this->load->view('header_hyp', $data); | ||||||
|  | 				$this->load->view('config_wallet_ilink_hyp/user_wallet_wallet'); | ||||||
|  | 				break; | ||||||
|  | 			case 'user_wallet_carte': | ||||||
|  | 				$data['taux_u_w_cart'] = $taux->taux_com_user_wallet_carte; | ||||||
|  | 				$data['taux_hyp_s_wallet_cart_ilink'] = $taux->taux_com_hyp_envoi_wallet_carte_ilink; | ||||||
|  | 				$data['taux_bq_s_wallet_cart_ilink'] = $taux->taux_com_banque_envoi_wallet_carte_ilink; | ||||||
|  | 				$this->load->view('header_hyp', $data); | ||||||
|  | 				$this->load->view('config_wallet_ilink_hyp/user_wallet_carte'); | ||||||
|  | 				break; | ||||||
|  | 			case 'user_wallet_cash': | ||||||
|  | 				$data['plr_user_wallet_cash'] = $this->user_model->getPalierConfigWallet("user_wallet_cash_international", $data['idConfig']); | ||||||
|  | 				$data['plr_user_wallet_cash_national'] = $this->user_model->getPalierConfigWallet("user_wallet_cash_national", $data['idConfig']); | ||||||
|  | 				$this->load->view('header_hyp', $data); | ||||||
|  | 				$this->load->view('config_wallet_ilink_hyp/user_wallet_cash'); | ||||||
|  | 				break; | ||||||
|  | 			case 'user_carte_wallet': | ||||||
|  | 				$data['taux_u_c_w'] = $taux->taux_com_user_carte_wallet; | ||||||
|  | 				$data['taux_u_c_c'] = $taux->taux_com_user_carte_cash; | ||||||
|  | 				$data['taux_hyp_r_cart_ilink'] = $taux->taux_com_hyp_retrait_carte_cash_ilink; | ||||||
|  | 				$data['taux_bq_r_cart_ilink'] = $taux->taux_com_banque_retrait_carte_cash_ilink; | ||||||
|  | 				$this->load->view('header_hyp', $data); | ||||||
|  | 				$this->load->view('config_wallet_ilink_hyp/user_carte_wallet'); | ||||||
|  | 				break; | ||||||
|  | 			case 'agent_remove_cash': | ||||||
|  | 				$data['taux_ag_r_c'] = $taux->taux_com_ag_retrait_cash; | ||||||
|  | 				$data['taux_sup_r_c'] = $taux->taux_com_sup_retrait_cash; | ||||||
|  | 				$data['taux_hyp_r_c'] = $taux->taux_com_hyp_retrait_cash; | ||||||
|  | 				$this->load->view('header_hyp', $data); | ||||||
|  | 				$this->load->view('config_wallet_ilink_hyp/agent_remove_cash'); | ||||||
|  | 				break; | ||||||
|  | 			case 'agent_remove_carte_cash': | ||||||
|  | 				$data['taux_ag_cart_c'] = $taux->taux_com_wallet_ag_carte_cash; | ||||||
|  | 				$data['taux_ag_r_cart'] = $taux->taux_com_ag_retrait_carte_cash; | ||||||
|  | 				$data['taux_sup_r_cart'] = $taux->taux_com_sup_retrait_carte_cash; | ||||||
|  | 				$data['taux_hyp_r_cart'] = $taux->taux_com_hyp_retrait_carte_cash; | ||||||
|  | 				$data['taux_bq_r_cart'] = $taux->taux_com_banque_retrait_carte_cash; | ||||||
|  | 				$this->load->view('header_hyp', $data); | ||||||
|  | 				$this->load->view('config_wallet_ilink_hyp/agent_remove_carte_cash'); | ||||||
|  | 				break; | ||||||
|  | 			case 'agent_send_cash_carte': | ||||||
|  | 				$data['taux_ag_d_c_c'] = $taux->taux_com_wallet_ag_envoi_cash_carte; | ||||||
|  | 				$data['taux_ag_d_c'] = $taux->taux_com_ag_depot_cash_carte; | ||||||
|  | 				$data['taux_sup_d_c'] = $taux->taux_com_sup_depot_cash_carte; | ||||||
|  | 				$data['taux_hyp_d_c'] = $taux->taux_com_hyp_depot_cash_carte; | ||||||
|  | 				$data['taux_bq_d_c'] = $taux->taux_com_banque_depot_cash_carte; | ||||||
|  | 				$this->load->view('header_hyp', $data); | ||||||
|  | 				$this->load->view('config_wallet_ilink_hyp/agent_send_cash_carte'); | ||||||
|  | 				break; | ||||||
|  | 			case 'agent_send_cash_canal': | ||||||
|  | 				$data['taux_ag_s_c'] = $taux->taux_com_ag_envoi_cash; | ||||||
|  | 				$data['taux_sup_s_c'] = $taux->taux_com_sup_envoi_cash; | ||||||
|  | 				$data['taux_hyp_s_c'] = $taux->taux_com_hyp_envoi_cash; | ||||||
|  | 
 | ||||||
|  | 				$data['plr_agent_depot_wallet_ilink'] = $this->user_model->getPalierConfigWallet("agent_depot_wallet_ilink_international" , $data['idConfig']); | ||||||
|  | 				$data['plr_agent_depot_autre_wallet'] = $this->user_model->getPalierConfigWallet("agent_depot_autre_wallet_international" , $data['idConfig']); | ||||||
|  | 				$data['plr_agent_cash_cash'] = $this->user_model->getPalierConfigWallet("agent_cash_cash_international", $data['idConfig']); | ||||||
|  | 
 | ||||||
|  | 				$data['plr_agent_depot_wallet_ilink_national'] = $this->user_model->getPalierConfigWallet("agent_depot_wallet_ilink_national" , $data['idConfig']); | ||||||
|  | 				$data['plr_agent_depot_autre_wallet_national'] = $this->user_model->getPalierConfigWallet("agent_depot_autre_wallet_national" , $data['idConfig']); | ||||||
|  | 				$data['plr_agent_cash_cash_national'] = $this->user_model->getPalierConfigWallet("agent_cash_cash_national", $data['idConfig']); | ||||||
|  | 				$this->load->view('header_hyp', $data); | ||||||
|  | 				$this->load->view('config_wallet_ilink_hyp/agent_send_cash_canal'); | ||||||
|  | 				break; | ||||||
|  | 		} | ||||||
| 		$this->load->view('footer'); | 		$this->load->view('footer'); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -405,4 +405,17 @@ $lang ['fees'] = 'Fees'; | ||||||
| $lang ['tax'] = 'Tax'; | $lang ['tax'] = 'Tax'; | ||||||
| $lang ['customer_net_amount_init'] = 'Net customer amount from the country of departure'; | $lang ['customer_net_amount_init'] = 'Net customer amount from the country of departure'; | ||||||
| $lang ['customer_net_amount_final'] = 'Net customer amount from the country of arrival'; | $lang ['customer_net_amount_final'] = 'Net customer amount from the country of arrival'; | ||||||
|  | $lang ['issuer_id'] = 'Issuer ID'; | ||||||
|  | $lang ['recipient_id'] = 'Recipient ID'; | ||||||
|  | $lang ['commission_paying_network'] = 'Commission of the paying hypervisor'; | ||||||
|  | $lang ['config_ilink_user_wallet_wallet'] = 'Sending from wallet to wallet'; | ||||||
|  | $lang ['config_ilink_user_wallet_carte'] = 'Sending wallet to card'; | ||||||
|  | $lang ['config_ilink_user_wallet_cash'] = 'Sending wallet in cash for others and Removing wallet in cash'; | ||||||
|  | $lang ['config_ilink_user_carte_wallet'] = 'Card withdrawal to wallet and cash'; | ||||||
|  | $lang ['config_ilink_agent_remove_cash'] = 'Cash withdrawal'; | ||||||
|  | $lang ['config_ilink_agent_remove_carte_cash'] = 'Withdrawal of the card to cash'; | ||||||
|  | $lang ['config_ilink_agent_send_cash_carte'] = 'Sending cash to a visa card'; | ||||||
|  | $lang ['config_ilink_agent_send_cash_canal'] = 'Sending cash to another channel (Wallet or cash)'; | ||||||
|  | $lang ['config_user'] = 'User configuration'; | ||||||
|  | $lang ['config_agent'] = 'Configuration agent'; | ||||||
| ?>
 | ?>
 | ||||||
|  |  | ||||||
|  | @ -420,5 +420,14 @@ $lang['customer_net_amount_final'] = 'Montant net client du pays d\'arrivée'; | ||||||
| $lang['issuer_id'] = 'ID émetteur'; | $lang['issuer_id'] = 'ID émetteur'; | ||||||
| $lang['recipient_id']= 'ID destinataire'; | $lang['recipient_id']= 'ID destinataire'; | ||||||
| $lang['commission_paying_network'] = 'Commission de l\'hyperviseur payeur'; | $lang['commission_paying_network'] = 'Commission de l\'hyperviseur payeur'; | ||||||
| 
 | $lang['config_ilink_user_wallet_wallet'] = 'Envoi de wallet à wallet'; | ||||||
|  | $lang['config_ilink_user_wallet_carte'] = 'Envoi de wallet à carte'; | ||||||
|  | $lang['config_ilink_user_wallet_cash'] = 'Envoi de wallet en cash pour autrui et Retrait de wallet en cash'; | ||||||
|  | $lang['config_ilink_user_carte_wallet'] = 'Retrait de carte vers wallet et cash'; | ||||||
|  | $lang['config_ilink_agent_remove_cash'] = 'Retrait d’argent'; | ||||||
|  | $lang['config_ilink_agent_remove_carte_cash'] = 'Retrait de la carte vers cash'; | ||||||
|  | $lang['config_ilink_agent_send_cash_carte'] = 'Envoi de cash vers une carte visa'; | ||||||
|  | $lang['config_ilink_agent_send_cash_canal'] = 'Envoi de cash vers un autre canal ( Wallet ou cash)'; | ||||||
|  | $lang['config_user'] = 'Configuration utilisateur'; | ||||||
|  | $lang['config_agent'] = 'Configuration agent'; | ||||||
| ?>
 | ?>
 | ||||||
|  |  | ||||||
|  | @ -2299,13 +2299,44 @@ class User_model extends CI_Model | ||||||
| 
 | 
 | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	public function updateConfigWalletIlink($taux_u_w_cart,$taux_u_c_w,$taux_u_c_c,$taux_ag_d_c_c,$taux_ag_cart_c,$taux_ag_cash_c,$taux_ag_s_c,$taux_sup_s_c,$taux_hyp_s_c,$taux_ag_r_c,$taux_sup_r_c,$taux_hyp_r_c, | 	public function updateConfigWalletIlink_a_s_c($taux_ag_s_c,$taux_sup_s_c,$taux_hyp_s_c,$idConfig){ | ||||||
| 											$taux_ag_d_c,$taux_sup_d_c,$taux_hyp_d_c,$taux_bq_d_c ,$taux_ag_r_cart,$taux_sup_r_cart,$taux_hyp_r_cart,$taux_bq_r_cart ,$taux_hyp_r_cart_ilink,$taux_bq_r_cart_ilink ,$taux_hyp_s_wallet_cart_ilink,$taux_bq_s_wallet_cart_ilink, $idConfig){ | 		$sql = "UPDATE `configWallet` SET  `taux_com_ag_envoi_cash` = ?, `taux_com_sup_envoi_cash` = ?, `taux_com_hyp_envoi_cash` = ? WHERE (`id` = ?);"; | ||||||
| 		$sql = "UPDATE `configWallet` SET `taux_com_user_wallet_carte` = ?, `taux_com_user_carte_wallet` = ?, `taux_com_user_carte_cash` = ?, `taux_com_wallet_ag_envoi_cash_carte` = ?,`taux_com_wallet_ag_carte_cash` = ?, `taux_com_wallet_ag_depot_carte` = ?, `taux_com_ag_envoi_cash` = ?, `taux_com_sup_envoi_cash` = ?, `taux_com_hyp_envoi_cash` = ?, `taux_com_ag_retrait_cash` = ?, `taux_com_sup_retrait_cash` = ?, `taux_com_hyp_retrait_cash` = ?,
 | 		$query = $this->db->query($sql , array($taux_ag_s_c,$taux_sup_s_c,$taux_hyp_s_c,$idConfig)); | ||||||
|  			  `taux_com_ag_depot_cash_carte` = ?, `taux_com_sup_depot_cash_carte` = ?, `taux_com_hyp_depot_cash_carte` = ?, `taux_com_banque_depot_cash_carte` = ?, `taux_com_ag_retrait_carte_cash` = ?, `taux_com_sup_retrait_carte_cash` = ?, `taux_com_hyp_retrait_carte_cash` = ?, `taux_com_banque_retrait_carte_cash` = ?, `taux_com_hyp_retrait_carte_cash_ilink` = ?, `taux_com_banque_retrait_carte_cash_ilink` = ? , | 		return $query; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	public function updateConfigWalletIlink_u_w_cart($taux_u_w_cart,$taux_hyp_s_wallet_cart_ilink,$taux_bq_s_wallet_cart_ilink, $idConfig){ | ||||||
|  | 		$sql = "UPDATE `configWallet` SET `taux_com_user_wallet_carte` = ?,
 | ||||||
|  			  `taux_com_hyp_envoi_wallet_carte_ilink` = ?, `taux_com_banque_envoi_wallet_carte_ilink` = ? WHERE (`id` = ?);";
 |  			  `taux_com_hyp_envoi_wallet_carte_ilink` = ?, `taux_com_banque_envoi_wallet_carte_ilink` = ? WHERE (`id` = ?);";
 | ||||||
| 		$query = $this->db->query($sql , array($taux_u_w_cart,$taux_u_c_w,$taux_u_c_c, $taux_ag_d_c_c,$taux_ag_cart_c,$taux_ag_cash_c,$taux_ag_s_c,$taux_sup_s_c,$taux_hyp_s_c,$taux_ag_r_c,$taux_sup_r_c,$taux_hyp_r_c, | 		$query = $this->db->query($sql , array($taux_u_w_cart,$taux_hyp_s_wallet_cart_ilink,$taux_bq_s_wallet_cart_ilink,$idConfig)); | ||||||
| 			$taux_ag_d_c,$taux_sup_d_c,$taux_hyp_d_c,$taux_bq_d_c , $taux_ag_r_cart,$taux_sup_r_cart,$taux_hyp_r_cart, $taux_bq_r_cart , $taux_hyp_r_cart_ilink,$taux_bq_r_cart_ilink,$taux_hyp_s_wallet_cart_ilink,$taux_bq_s_wallet_cart_ilink,$idConfig)); | 		return $query; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	public function updateConfigWalletIlink_u_c_w($taux_u_c_w,$taux_u_c_c,$taux_hyp_r_cart_ilink,$taux_bq_r_cart_ilink , $idConfig){ | ||||||
|  | 		$sql = "UPDATE `configWallet` SET `taux_com_user_carte_wallet` = ?, `taux_com_user_carte_cash` = ?, `taux_com_hyp_retrait_carte_cash_ilink` = ?, `taux_com_banque_retrait_carte_cash_ilink` = ?
 | ||||||
|  |  			  WHERE (`id` = ?);";
 | ||||||
|  | 		$query = $this->db->query($sql , array($taux_u_c_w,$taux_u_c_c,$taux_hyp_r_cart_ilink,$taux_bq_r_cart_ilink,$idConfig)); | ||||||
|  | 		return $query; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	public function updateConfigWalletIlink_a_r_c($taux_ag_r_c,$taux_sup_r_c,$taux_hyp_r_c,$idConfig){ | ||||||
|  | 		$sql = "UPDATE `configWallet` SET `taux_com_ag_retrait_cash` = ?, `taux_com_sup_retrait_cash` = ?, `taux_com_hyp_retrait_cash` = ? WHERE (`id` = ?);"; | ||||||
|  | 		$query = $this->db->query($sql , array($taux_ag_r_c,$taux_sup_r_c,$taux_hyp_r_c,$idConfig)); | ||||||
|  | 		return $query; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	public function updateConfigWalletIlink_a_r_cart($taux_ag_cart_c,$taux_ag_r_cart,$taux_sup_r_cart,$taux_hyp_r_cart,$taux_bq_r_cart ,$idConfig){ | ||||||
|  | 		$sql = "UPDATE `configWallet` SET `taux_com_wallet_ag_carte_cash` = ?, `taux_com_ag_retrait_carte_cash` = ?, `taux_com_sup_retrait_carte_cash` = ?, 
 | ||||||
|  | 				`taux_com_hyp_retrait_carte_cash` = ?, `taux_com_banque_retrait_carte_cash` = ? WHERE (`id` = ?);";
 | ||||||
|  | 		$query = $this->db->query($sql , array($taux_ag_cart_c,$taux_ag_r_cart,$taux_sup_r_cart,$taux_hyp_r_cart, $taux_bq_r_cart ,$idConfig)); | ||||||
|  | 		return $query; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	public function updateConfigWalletIlink_a_s_cc($taux_ag_d_c_c,$taux_ag_d_c,$taux_sup_d_c,$taux_hyp_d_c,$taux_bq_d_c , $idConfig){ | ||||||
|  | 		$sql = "UPDATE `configWallet` SET `taux_com_wallet_ag_envoi_cash_carte` = ?,
 | ||||||
|  |  			  `taux_com_ag_depot_cash_carte` = ?, `taux_com_sup_depot_cash_carte` = ?, `taux_com_hyp_depot_cash_carte` = ?, `taux_com_banque_depot_cash_carte` = ? | ||||||
|  |  			  WHERE (`id` = ?);";
 | ||||||
|  | 		$query = $this->db->query($sql , array($taux_ag_d_c_c, $taux_ag_d_c,$taux_sup_d_c,$taux_hyp_d_c,$taux_bq_d_c ,$idConfig)); | ||||||
| 		return $query; | 		return $query; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -0,0 +1,311 @@ | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>"> | ||||||
|  | <link rel="stylesheet" | ||||||
|  | 	  href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" | ||||||
|  | 	  href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round|Open+Sans"> | ||||||
|  | <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | ||||||
|  | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> | ||||||
|  | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | ||||||
|  | 
 | ||||||
|  | <?php | ||||||
|  | 
 | ||||||
|  | use Brick\Money\Context\CustomContext; | ||||||
|  | use Brick\Money\Money; | ||||||
|  | 
 | ||||||
|  | $context = new \Brick\Money\Context\AutoContext(); | ||||||
|  | 
 | ||||||
|  | $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); | ||||||
|  | ?>
 | ||||||
|  | 
 | ||||||
|  | <div class="content-wrapper"> | ||||||
|  | 	<!-- Content Header (Page header) --> | ||||||
|  | 	<section class="content-header"> | ||||||
|  | 
 | ||||||
|  | 		<h1> | ||||||
|  | 			<?php echo $this->lang->line('config_agent').' - '.$this->lang->line('config_ilink_agent_remove_carte_cash'); ?>
 | ||||||
|  | 		</h1> | ||||||
|  | 		<?php | ||||||
|  | 		$site_url = base_url(); | ||||||
|  | 
 | ||||||
|  | 		if ($alert == "ok") { | ||||||
|  | 
 | ||||||
|  | 			if (!$success == "ok") { | ||||||
|  | 				?>
 | ||||||
|  | 				<div class='alert alert-danger alert-dismissible col-xs-6'> | ||||||
|  | 					<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button> | ||||||
|  | 					<h4><i class='icon fa fa-ban'></i> Erreur!</h4> | ||||||
|  | 					<?php echo $message; ?>
 | ||||||
|  | 				</div> | ||||||
|  | 
 | ||||||
|  | 				<?php | ||||||
|  | 			} else { | ||||||
|  | 				?>
 | ||||||
|  | 				<div class="alert alert-success alert-dismissible col-xs-6"> | ||||||
|  | 					<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | ||||||
|  | 					<h4><i class="icon fa fa-check"></i> Success!</h4> | ||||||
|  | 					<?php echo $message; ?>
 | ||||||
|  | 				</div> | ||||||
|  | 
 | ||||||
|  | 				<?php | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 		?>
 | ||||||
|  | 
 | ||||||
|  | 	</section> | ||||||
|  | 
 | ||||||
|  | 	<section class="content"> | ||||||
|  | 		<div class="row"> | ||||||
|  | 			<div class="col-lg-12"> | ||||||
|  | 				<div class="margin"> | ||||||
|  | 					<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-update" | ||||||
|  | 							style="width: 100%"><?php echo $this->lang->line('Modifier la configuration') ?></button>
 | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 		<div class="row"> | ||||||
|  | 			<div class="col-lg-2 col-lg-offset-5 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-green"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_ag_cart_c; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_agent_cart_cash') ?></p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-up"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 		<div class="row"> | ||||||
|  | 			<!--Taux  commission wallet agent carte client et Taux  commission wallet agent carte client--> | ||||||
|  | 			<div class="col-lg-2 col-lg-offset-2 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-orange"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_ag_r_cart; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_agent_remove_cart') ?> </p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-up"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 
 | ||||||
|  | 			<div class="col-lg-2 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-orange"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_sup_r_cart; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_sup_remove_cart') ?> </p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-up"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 			<div class="col-lg-2 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-orange"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_hyp_r_cart; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_hyp_remove_cart') ?> </p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-up"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 
 | ||||||
|  | 			<div class="col-lg-2 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-orange"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_bq_r_cart; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_bq_remove_cart') ?> </p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-up"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 		<div class="modal fade" id="modal-update"> | ||||||
|  | 			<div class="modal-dialog modal-lg"> | ||||||
|  | 				<div class="modal-content"> | ||||||
|  | 					<div class="modal-header"> | ||||||
|  | 						<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||||||
|  | 							<span aria-hidden="true">×</span> | ||||||
|  | 						</button> | ||||||
|  | 						<h3 class="modal-title"><?php echo $this->lang->line('Configuration du wallet'); ?></h3>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="modal-body"> | ||||||
|  | 						<form id="walletForm"> | ||||||
|  | 							<div class="row"> | ||||||
|  | 								<div class="col-lg-6"> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_ag_cart_c" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_agent_cart_cash') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01"  max="100" required class="form-control" | ||||||
|  | 											   id="taux_ag_cart_c" name="taux_ag_cart_c" value="<?= $taux_ag_cart_c ?>"> | ||||||
|  | 									</div> | ||||||
|  | 								</div> | ||||||
|  | 								<div class="col-lg-6"> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_ag_r_cart" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_agent_remove_cart') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" required class="form-control" | ||||||
|  | 											   name="taux_ag_r_cart" id="taux_ag_r_cart" value="<?= $taux_ag_r_cart ?>"> | ||||||
|  | 									</div> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_sup_r_cart" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_sup_remove_cart') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" required class="form-control" | ||||||
|  | 											   name="taux_sup_r_cart" id="taux_sup_r_cart" value="<?= $taux_sup_r_cart ?>"> | ||||||
|  | 									</div> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_hyp_r_cart" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_hyp_remove_cart') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" required class="form-control" | ||||||
|  | 											   name="taux_hyp_r_cart" id="taux_hyp_r_cart" value="<?= $taux_hyp_r_cart ?>"> | ||||||
|  | 									</div> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_bq_r_cart" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_bq_remove_cart') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" required class="form-control" | ||||||
|  | 											   name="taux_bq_r_cart" id="taux_bq_r_cart" value="<?= $taux_bq_r_cart ?>"> | ||||||
|  | 									</div> | ||||||
|  | 								</div> | ||||||
|  | 							</div> | ||||||
|  | 						</form> | ||||||
|  | 					</div> | ||||||
|  | 					<div class="modal-footer"> | ||||||
|  | 						<button type="button" class="btn btn-default pull-left" | ||||||
|  | 								data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
 | ||||||
|  | 						<button type="button" id="updateWallet" data-network-id="<?= $network_id ?>" | ||||||
|  | 								data-id-config="<?= $idConfig ?>" | ||||||
|  | 								class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
 | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 	</section> | ||||||
|  | </div> | ||||||
|  | <!-- jQuery 3 --> | ||||||
|  | <script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script> | ||||||
|  | <!-- Bootstrap 3.3.7 --> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script> | ||||||
|  | <!-- DataTables --> | ||||||
|  | <script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script> | ||||||
|  | <!-- Slimscroll --> | ||||||
|  | <script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script> | ||||||
|  | <!-- FastClick --> | ||||||
|  | <script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script> | ||||||
|  | <!-- AdminLTE App --> | ||||||
|  | <script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script> | ||||||
|  | <!-- AdminLTE for demo purposes --> | ||||||
|  | <script src="<?php echo base_url('dist/js/demo.js') ?>"></script> | ||||||
|  | 
 | ||||||
|  | <script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script> | ||||||
|  | <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script> | ||||||
|  | 
 | ||||||
|  | <script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script> | ||||||
|  | 
 | ||||||
|  | <script> | ||||||
|  | 	var serializeArray = function (form) { | ||||||
|  | 		// Setup our serialized data
 | ||||||
|  | 		var serialized = []; | ||||||
|  | 
 | ||||||
|  | 		// Loop through each field in the form
 | ||||||
|  | 		var elements = document.getElementById(form).elements; | ||||||
|  | 		for (var i = 0, field; field = elements[i++];) { | ||||||
|  | 
 | ||||||
|  | 			// Don't serialize fields without a name, submits, buttons, file and reset inputs, and disabled fields
 | ||||||
|  | 			if (!field.name || field.disabled || field.type === 'file' || field.type === 'reset' || field.type === 'submit' || field.type === 'button') continue; | ||||||
|  | 
 | ||||||
|  | 			// If a multi-select, get all selections
 | ||||||
|  | 			if (field.type === 'select-multiple') { | ||||||
|  | 				for (var n = 0; n < field.options.length; n++) { | ||||||
|  | 					if (!field.options[n].selected) continue; | ||||||
|  | 					serialized.push({ | ||||||
|  | 						name: field.name, | ||||||
|  | 						value: field.options[n].value | ||||||
|  | 					}); | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 
 | ||||||
|  | 			// Convert field data to a query string
 | ||||||
|  | 			else if ((field.type !== 'checkbox' && field.type !== 'radio') || field.checked) { | ||||||
|  | 				serialized.push({ | ||||||
|  | 					name: field.name, | ||||||
|  | 					value: field.value | ||||||
|  | 				}); | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 		return serialized; | ||||||
|  | 	}; | ||||||
|  | 
 | ||||||
|  | </script> | ||||||
|  | <script> | ||||||
|  | 	toastr.options.closeButton = true; | ||||||
|  | 	toastr.options.closeMethod = 'fadeOut'; | ||||||
|  | 	toastr.options.closeDuration = 5000; | ||||||
|  | 	toastr.options.closeEasing = 'swing'; | ||||||
|  | 
 | ||||||
|  | 	$('#updateWallet').click(function () { | ||||||
|  | 		const network_id = $(this).data('network-id'); | ||||||
|  | 		const id_config = $(this).data('id-config'); | ||||||
|  | 
 | ||||||
|  | // total répartition commission réseau retrait carte-cash  chez agent (retrait)
 | ||||||
|  | 		const total4 = parseFloat($('#taux_ag_r_cart').val()) + parseFloat($('#taux_sup_r_cart').val()) + parseFloat($('#taux_hyp_r_cart').val()) | ||||||
|  | 				+ parseFloat($('#taux_bq_r_cart').val()); | ||||||
|  | 
 | ||||||
|  | 		if (total4 != 100) { | ||||||
|  | 			toastr.error("<?php echo $this->lang->line('ilink_fourth_rule')?>", "<?php echo $this->lang->line('management_rule')?>"); | ||||||
|  | 		}else { | ||||||
|  | 			if ($('#walletForm')[0].checkValidity()) { | ||||||
|  | 				$.ajax({ | ||||||
|  | 					url: '<?php echo base_url('index.php/Gestion/config_wallet/update')?>', | ||||||
|  | 					type: 'POST', | ||||||
|  | 					dataType: 'json', | ||||||
|  | 					data: { | ||||||
|  | 						"type": "ilink", | ||||||
|  | 						"config": "agent_remove_carte_cash", | ||||||
|  | 						"network_id": network_id, "id_config": id_config, | ||||||
|  | 						"fields": serializeArray('walletForm') | ||||||
|  | 					}, | ||||||
|  | 					success: function (data) { | ||||||
|  | 						if (data == '200') { | ||||||
|  | 							Swal.fire({ | ||||||
|  | 								icon: 'success', | ||||||
|  | 								title: "<?php echo $this->lang->line('wallet_update')?>", | ||||||
|  | 								text: "<?php echo $this->lang->line('informations_updated')?>", | ||||||
|  | 								timer: 3000 | ||||||
|  | 							}).then(() => { | ||||||
|  | 								location.reload(); | ||||||
|  | 							}); | ||||||
|  | 							// alert("Les informations ont été mises à jour.") ? "" :
 | ||||||
|  | 						} else { | ||||||
|  | 							toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>"); | ||||||
|  | 						} | ||||||
|  | 					}, | ||||||
|  | 
 | ||||||
|  | 					error: function (resultat, statut, error) { | ||||||
|  | 						console.log(resultat + " " + error); | ||||||
|  | 						toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>"); | ||||||
|  | 					} | ||||||
|  | 				}); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 			} else { | ||||||
|  | 				$('#walletForm')[0].reportValidity(); | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 	}); | ||||||
|  | </script> | ||||||
|  | @ -0,0 +1,272 @@ | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>"> | ||||||
|  | <link rel="stylesheet" | ||||||
|  | 	  href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" | ||||||
|  | 	  href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round|Open+Sans"> | ||||||
|  | <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | ||||||
|  | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> | ||||||
|  | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | ||||||
|  | 
 | ||||||
|  | <?php | ||||||
|  | 
 | ||||||
|  | use Brick\Money\Context\CustomContext; | ||||||
|  | use Brick\Money\Money; | ||||||
|  | 
 | ||||||
|  | $context = new \Brick\Money\Context\AutoContext(); | ||||||
|  | 
 | ||||||
|  | $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); | ||||||
|  | ?>
 | ||||||
|  | 
 | ||||||
|  | <div class="content-wrapper"> | ||||||
|  | 	<!-- Content Header (Page header) --> | ||||||
|  | 	<section class="content-header"> | ||||||
|  | 
 | ||||||
|  | 		<h1> | ||||||
|  | 			<?php echo $this->lang->line('config_agent').' - '.$this->lang->line('config_ilink_agent_remove_cash'); ?>
 | ||||||
|  | 		</h1> | ||||||
|  | 		<?php | ||||||
|  | 		$site_url = base_url(); | ||||||
|  | 
 | ||||||
|  | 		if ($alert == "ok") { | ||||||
|  | 
 | ||||||
|  | 			if (!$success == "ok") { | ||||||
|  | 				?>
 | ||||||
|  | 				<div class='alert alert-danger alert-dismissible col-xs-6'> | ||||||
|  | 					<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button> | ||||||
|  | 					<h4><i class='icon fa fa-ban'></i> Erreur!</h4> | ||||||
|  | 					<?php echo $message; ?>
 | ||||||
|  | 				</div> | ||||||
|  | 
 | ||||||
|  | 				<?php | ||||||
|  | 			} else { | ||||||
|  | 				?>
 | ||||||
|  | 				<div class="alert alert-success alert-dismissible col-xs-6"> | ||||||
|  | 					<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | ||||||
|  | 					<h4><i class="icon fa fa-check"></i> Success!</h4> | ||||||
|  | 					<?php echo $message; ?>
 | ||||||
|  | 				</div> | ||||||
|  | 
 | ||||||
|  | 				<?php | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 		?>
 | ||||||
|  | 
 | ||||||
|  | 	</section> | ||||||
|  | 
 | ||||||
|  | 	<section class="content"> | ||||||
|  | 		<div class="row"> | ||||||
|  | 			<div class="col-lg-12"> | ||||||
|  | 				<div class="margin"> | ||||||
|  | 					<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-update" | ||||||
|  | 							style="width: 100%"><?php echo $this->lang->line('Modifier la configuration') ?></button>
 | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 		<div class="row"> | ||||||
|  | 			<div class="col-lg-2 col-lg-offset-3 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-red-active"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_ag_r_c; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_agent_remove_cash') ?> </p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-down"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 			<div class="col-lg-2 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-red-active"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_sup_r_c; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_sup_remove_cash') ?> </p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-down"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 
 | ||||||
|  | 			<div class="col-lg-2 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-red-active"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_hyp_r_c; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_hyp_remove_cash') ?> </p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-down"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 
 | ||||||
|  | 		</div> | ||||||
|  | 		<div class="modal fade" id="modal-update"> | ||||||
|  | 			<div class="modal-dialog"> | ||||||
|  | 				<div class="modal-content"> | ||||||
|  | 					<div class="modal-header"> | ||||||
|  | 						<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||||||
|  | 							<span aria-hidden="true">×</span> | ||||||
|  | 						</button> | ||||||
|  | 						<h3 class="modal-title"><?php echo $this->lang->line('Configuration du wallet'); ?></h3>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="modal-body"> | ||||||
|  | 						<form id="walletForm"> | ||||||
|  | 							<div class="row"> | ||||||
|  | 								<div class="col-lg-12"> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_ag_r_c" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_agent_remove_cash') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" required class="form-control" | ||||||
|  | 											   id="taux_ag_r_c" | ||||||
|  | 											   name="taux_ag_r_c" value="<?= $taux_ag_r_c ?>"> | ||||||
|  | 									</div> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_sup_r_c" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_sup_remove_cash') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" required class="form-control" | ||||||
|  | 											   id="taux_sup_r_c" name="taux_sup_r_c" value="<?= $taux_sup_r_c ?>"> | ||||||
|  | 									</div> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_hyp_r_c" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_hyp_remove_cash') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" required class="form-control" id="taux_hyp_r_c" | ||||||
|  | 											   name="taux_hyp_r_c" value="<?= $taux_hyp_r_c ?>"> | ||||||
|  | 									</div> | ||||||
|  | 								</div> | ||||||
|  | 							</div> | ||||||
|  | 						</form> | ||||||
|  | 					</div> | ||||||
|  | 					<div class="modal-footer"> | ||||||
|  | 						<button type="button" class="btn btn-default pull-left" | ||||||
|  | 								data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
 | ||||||
|  | 						<button type="button" id="updateWallet" data-network-id="<?= $network_id ?>" | ||||||
|  | 								data-id-config="<?= $idConfig ?>" | ||||||
|  | 								class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
 | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 	</section> | ||||||
|  | </div> | ||||||
|  | <!-- jQuery 3 --> | ||||||
|  | <script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script> | ||||||
|  | <!-- Bootstrap 3.3.7 --> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script> | ||||||
|  | <!-- DataTables --> | ||||||
|  | <script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script> | ||||||
|  | <!-- Slimscroll --> | ||||||
|  | <script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script> | ||||||
|  | <!-- FastClick --> | ||||||
|  | <script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script> | ||||||
|  | <!-- AdminLTE App --> | ||||||
|  | <script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script> | ||||||
|  | <!-- AdminLTE for demo purposes --> | ||||||
|  | <script src="<?php echo base_url('dist/js/demo.js') ?>"></script> | ||||||
|  | 
 | ||||||
|  | <script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script> | ||||||
|  | <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script> | ||||||
|  | 
 | ||||||
|  | <script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script> | ||||||
|  | 
 | ||||||
|  | <script> | ||||||
|  | 	var serializeArray = function (form) { | ||||||
|  | 		// Setup our serialized data
 | ||||||
|  | 		var serialized = []; | ||||||
|  | 
 | ||||||
|  | 		// Loop through each field in the form
 | ||||||
|  | 		var elements = document.getElementById(form).elements; | ||||||
|  | 		for (var i = 0, field; field = elements[i++];) { | ||||||
|  | 
 | ||||||
|  | 			// Don't serialize fields without a name, submits, buttons, file and reset inputs, and disabled fields
 | ||||||
|  | 			if (!field.name || field.disabled || field.type === 'file' || field.type === 'reset' || field.type === 'submit' || field.type === 'button') continue; | ||||||
|  | 
 | ||||||
|  | 			// If a multi-select, get all selections
 | ||||||
|  | 			if (field.type === 'select-multiple') { | ||||||
|  | 				for (var n = 0; n < field.options.length; n++) { | ||||||
|  | 					if (!field.options[n].selected) continue; | ||||||
|  | 					serialized.push({ | ||||||
|  | 						name: field.name, | ||||||
|  | 						value: field.options[n].value | ||||||
|  | 					}); | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 
 | ||||||
|  | 			// Convert field data to a query string
 | ||||||
|  | 			else if ((field.type !== 'checkbox' && field.type !== 'radio') || field.checked) { | ||||||
|  | 				serialized.push({ | ||||||
|  | 					name: field.name, | ||||||
|  | 					value: field.value | ||||||
|  | 				}); | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 		return serialized; | ||||||
|  | 	}; | ||||||
|  | 
 | ||||||
|  | </script> | ||||||
|  | <script> | ||||||
|  | 	toastr.options.closeButton = true; | ||||||
|  | 	toastr.options.closeMethod = 'fadeOut'; | ||||||
|  | 	toastr.options.closeDuration = 5000; | ||||||
|  | 	toastr.options.closeEasing = 'swing'; | ||||||
|  | 
 | ||||||
|  | 	$('#updateWallet').click(function () { | ||||||
|  | 		const network_id = $(this).data('network-id'); | ||||||
|  | 		const id_config = $(this).data('id-config'); | ||||||
|  | 
 | ||||||
|  | 		// total répartition commission du réseau opération retrait-cash (les frais)
 | ||||||
|  | 		const total2 = parseFloat($('#taux_ag_r_c').val()) + parseFloat($('#taux_sup_r_c').val()) + parseFloat($('#taux_hyp_r_c').val()); | ||||||
|  | 
 | ||||||
|  | 		if (total2 != 100) { | ||||||
|  | 			toastr.error("<?php echo $this->lang->line('ilink_second_rule')?>", "<?php echo $this->lang->line('management_rule')?>"); | ||||||
|  | 		} else { | ||||||
|  | 			if ($('#walletForm')[0].checkValidity()) { | ||||||
|  | 				$.ajax({ | ||||||
|  | 					url: '<?php echo base_url('index.php/Gestion/config_wallet/update')?>', | ||||||
|  | 					type: 'POST', | ||||||
|  | 					dataType: 'json', | ||||||
|  | 					data: { | ||||||
|  | 						"type": "ilink", | ||||||
|  | 						"config": "agent_remove_cash", | ||||||
|  | 						"network_id": network_id, "id_config": id_config, | ||||||
|  | 						"fields": serializeArray('walletForm') | ||||||
|  | 					}, | ||||||
|  | 					success: function (data) { | ||||||
|  | 						if (data == '200') { | ||||||
|  | 							Swal.fire({ | ||||||
|  | 								icon: 'success', | ||||||
|  | 								title: "<?php echo $this->lang->line('wallet_update')?>", | ||||||
|  | 								text: "<?php echo $this->lang->line('informations_updated')?>", | ||||||
|  | 								timer: 3000 | ||||||
|  | 							}).then(() => { | ||||||
|  | 								location.reload(); | ||||||
|  | 							}); | ||||||
|  | 							// alert("Les informations ont été mises à jour.") ? "" :
 | ||||||
|  | 						} else { | ||||||
|  | 							toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>"); | ||||||
|  | 						} | ||||||
|  | 					}, | ||||||
|  | 
 | ||||||
|  | 					error: function (resultat, statut, error) { | ||||||
|  | 						console.log(resultat + " " + error); | ||||||
|  | 						toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>"); | ||||||
|  | 					} | ||||||
|  | 				}); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 			} else { | ||||||
|  | 				$('#walletForm')[0].reportValidity(); | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 	}); | ||||||
|  | </script> | ||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							|  | @ -0,0 +1,312 @@ | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>"> | ||||||
|  | <link rel="stylesheet" | ||||||
|  | 	  href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" | ||||||
|  | 	  href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round|Open+Sans"> | ||||||
|  | <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | ||||||
|  | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> | ||||||
|  | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | ||||||
|  | 
 | ||||||
|  | <?php | ||||||
|  | 
 | ||||||
|  | use Brick\Money\Context\CustomContext; | ||||||
|  | use Brick\Money\Money; | ||||||
|  | 
 | ||||||
|  | $context = new \Brick\Money\Context\AutoContext(); | ||||||
|  | 
 | ||||||
|  | $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); | ||||||
|  | ?>
 | ||||||
|  | 
 | ||||||
|  | <div class="content-wrapper"> | ||||||
|  | 	<!-- Content Header (Page header) --> | ||||||
|  | 	<section class="content-header"> | ||||||
|  | 
 | ||||||
|  | 		<h1> | ||||||
|  | 			<?php echo $this->lang->line('config_agent').' - '.$this->lang->line('config_ilink_agent_send_cash_carte'); ?>
 | ||||||
|  | 		</h1> | ||||||
|  | 		<?php | ||||||
|  | 		$site_url = base_url(); | ||||||
|  | 
 | ||||||
|  | 		if ($alert == "ok") { | ||||||
|  | 
 | ||||||
|  | 			if (!$success == "ok") { | ||||||
|  | 				?>
 | ||||||
|  | 				<div class='alert alert-danger alert-dismissible col-xs-6'> | ||||||
|  | 					<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button> | ||||||
|  | 					<h4><i class='icon fa fa-ban'></i> Erreur!</h4> | ||||||
|  | 					<?php echo $message; ?>
 | ||||||
|  | 				</div> | ||||||
|  | 
 | ||||||
|  | 				<?php | ||||||
|  | 			} else { | ||||||
|  | 				?>
 | ||||||
|  | 				<div class="alert alert-success alert-dismissible col-xs-6"> | ||||||
|  | 					<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | ||||||
|  | 					<h4><i class="icon fa fa-check"></i> Success!</h4> | ||||||
|  | 					<?php echo $message; ?>
 | ||||||
|  | 				</div> | ||||||
|  | 
 | ||||||
|  | 				<?php | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 		?>
 | ||||||
|  | 
 | ||||||
|  | 	</section> | ||||||
|  | 
 | ||||||
|  | 	<section class="content"> | ||||||
|  | 		<div class="row"> | ||||||
|  | 			<div class="col-lg-12"> | ||||||
|  | 				<div class="margin"> | ||||||
|  | 					<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-update" | ||||||
|  | 							style="width: 100%"><?php echo $this->lang->line('Modifier la configuration') ?></button>
 | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 		<div class="row centered"> | ||||||
|  | 			<div class="col-lg-2 col-lg-offset-5 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-aqua-active"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_ag_d_c_c; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_agent_depot_cash_cart') ?> </p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-up"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 		<div class="row"> | ||||||
|  | 			<div class="col-lg-2 col-lg-offset-2 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-olive-active"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_ag_d_c; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_agent_depot_cart') ?> </p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-down"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 
 | ||||||
|  | 			<div class="col-lg-2 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-olive-active"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_sup_d_c; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_sup_depot_cart') ?> </p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-down"></i> | ||||||
|  | 					</div> | ||||||
|  | 					<!--					<a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_sup_d" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>--> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 			<div class="col-lg-2 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-olive-active"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_hyp_d_c; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_hyp_depot_cart') ?> </p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-down"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 
 | ||||||
|  | 			<div class="col-lg-2 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-olive-active"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_bq_d_c; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_bq_depot_cart') ?> </p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-down"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 
 | ||||||
|  | 		</div> | ||||||
|  | 		<div class="modal fade" id="modal-update"> | ||||||
|  | 			<div class="modal-dialog modal-lg"> | ||||||
|  | 				<div class="modal-content"> | ||||||
|  | 					<div class="modal-header"> | ||||||
|  | 						<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||||||
|  | 							<span aria-hidden="true">×</span> | ||||||
|  | 						</button> | ||||||
|  | 						<h3 class="modal-title"><?php echo $this->lang->line('Configuration du wallet'); ?></h3>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="modal-body"> | ||||||
|  | 						<form id="walletForm"> | ||||||
|  | 							<div class="row"> | ||||||
|  | 								<div class="col-lg-6"> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_ag_d_c_c" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_agent_depot_cash_cart') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" max="100" required class="form-control" | ||||||
|  | 											   name="taux_ag_d_c_c" id="taux_ag_d_c_c" value="<?=$taux_ag_d_c_c?>"> | ||||||
|  | 									</div> | ||||||
|  | 								</div> | ||||||
|  | 								<div class="col-lg-6"> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_ag_d_c" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_agent_depot_cart') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" required class="form-control" | ||||||
|  | 											   id="taux_ag_d_c" name="taux_ag_d_c" value="<?=$taux_ag_d_c?>"> | ||||||
|  | 									</div> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_sup_d_c" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_sup_depot_cart') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" required class="form-control" | ||||||
|  | 											   name="taux_sup_d_c" id="taux_sup_d_c" value="<?= $taux_sup_d_c?>"> | ||||||
|  | 									</div> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_hyp_d_c" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_hyp_depot_cart') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" required class="form-control" | ||||||
|  | 											   name="taux_hyp_d_c" id="taux_hyp_d_c" value="<?= $taux_hyp_d_c?>"> | ||||||
|  | 									</div> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_bq_d_c" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_bq_depot_cart') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" required class="form-control" | ||||||
|  | 											   name="taux_bq_d_c" id="taux_bq_d_c" value="<?= $taux_bq_d_c ?>"> | ||||||
|  | 									</div> | ||||||
|  | 								</div> | ||||||
|  | 							</div> | ||||||
|  | 						</form> | ||||||
|  | 					</div> | ||||||
|  | 					<div class="modal-footer"> | ||||||
|  | 						<button type="button" class="btn btn-default pull-left" | ||||||
|  | 								data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
 | ||||||
|  | 						<button type="button" id="updateWallet" data-network-id="<?= $network_id ?>" | ||||||
|  | 								data-id-config="<?= $idConfig ?>" | ||||||
|  | 								class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
 | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 	</section> | ||||||
|  | </div> | ||||||
|  | <!-- jQuery 3 --> | ||||||
|  | <script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script> | ||||||
|  | <!-- Bootstrap 3.3.7 --> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script> | ||||||
|  | <!-- DataTables --> | ||||||
|  | <script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script> | ||||||
|  | <!-- Slimscroll --> | ||||||
|  | <script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script> | ||||||
|  | <!-- FastClick --> | ||||||
|  | <script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script> | ||||||
|  | <!-- AdminLTE App --> | ||||||
|  | <script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script> | ||||||
|  | <!-- AdminLTE for demo purposes --> | ||||||
|  | <script src="<?php echo base_url('dist/js/demo.js') ?>"></script> | ||||||
|  | 
 | ||||||
|  | <script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script> | ||||||
|  | <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script> | ||||||
|  | 
 | ||||||
|  | <script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script> | ||||||
|  | 
 | ||||||
|  | <script> | ||||||
|  | 	var serializeArray = function (form) { | ||||||
|  | 		// Setup our serialized data
 | ||||||
|  | 		var serialized = []; | ||||||
|  | 
 | ||||||
|  | 		// Loop through each field in the form
 | ||||||
|  | 		var elements = document.getElementById(form).elements; | ||||||
|  | 		for (var i = 0, field; field = elements[i++];) { | ||||||
|  | 
 | ||||||
|  | 			// Don't serialize fields without a name, submits, buttons, file and reset inputs, and disabled fields
 | ||||||
|  | 			if (!field.name || field.disabled || field.type === 'file' || field.type === 'reset' || field.type === 'submit' || field.type === 'button') continue; | ||||||
|  | 
 | ||||||
|  | 			// If a multi-select, get all selections
 | ||||||
|  | 			if (field.type === 'select-multiple') { | ||||||
|  | 				for (var n = 0; n < field.options.length; n++) { | ||||||
|  | 					if (!field.options[n].selected) continue; | ||||||
|  | 					serialized.push({ | ||||||
|  | 						name: field.name, | ||||||
|  | 						value: field.options[n].value | ||||||
|  | 					}); | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 
 | ||||||
|  | 			// Convert field data to a query string
 | ||||||
|  | 			else if ((field.type !== 'checkbox' && field.type !== 'radio') || field.checked) { | ||||||
|  | 				serialized.push({ | ||||||
|  | 					name: field.name, | ||||||
|  | 					value: field.value | ||||||
|  | 				}); | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 		return serialized; | ||||||
|  | 	}; | ||||||
|  | 
 | ||||||
|  | </script> | ||||||
|  | <script> | ||||||
|  | 	toastr.options.closeButton = true; | ||||||
|  | 	toastr.options.closeMethod = 'fadeOut'; | ||||||
|  | 	toastr.options.closeDuration = 5000; | ||||||
|  | 	toastr.options.closeEasing = 'swing'; | ||||||
|  | 
 | ||||||
|  | 	$('#updateWallet').click(function () { | ||||||
|  | 		const network_id = $(this).data('network-id'); | ||||||
|  | 		const id_config = $(this).data('id-config'); | ||||||
|  | 
 | ||||||
|  | // total répartition commission réseau dépôt cash-carte chez agent (frais)
 | ||||||
|  | 		const total3 = parseFloat($('#taux_ag_d_c').val()) + parseFloat($('#taux_sup_d_c').val()) + parseFloat($('#taux_hyp_d_c').val()) | ||||||
|  | 				+ parseFloat($('#taux_bq_d_c').val()); | ||||||
|  | 
 | ||||||
|  | 		if (total3 != 100) { | ||||||
|  | 			toastr.error("<?php echo $this->lang->line('ilink_third_rule')?>", "<?php echo $this->lang->line('management_rule')?>"); | ||||||
|  | 		} else { | ||||||
|  | 			if ($('#walletForm')[0].checkValidity()) { | ||||||
|  | 				$.ajax({ | ||||||
|  | 					url: '<?php echo base_url('index.php/Gestion/config_wallet/update')?>', | ||||||
|  | 					type: 'POST', | ||||||
|  | 					dataType: 'json', | ||||||
|  | 					data: { | ||||||
|  | 						"type": "ilink", | ||||||
|  | 						"config": "agent_send_cash_carte", | ||||||
|  | 						"network_id": network_id, "id_config": id_config, | ||||||
|  | 						"fields": serializeArray('walletForm') | ||||||
|  | 					}, | ||||||
|  | 					success: function (data) { | ||||||
|  | 						if (data == '200') { | ||||||
|  | 							Swal.fire({ | ||||||
|  | 								icon: 'success', | ||||||
|  | 								title: "<?php echo $this->lang->line('wallet_update')?>", | ||||||
|  | 								text: "<?php echo $this->lang->line('informations_updated')?>", | ||||||
|  | 								timer: 3000 | ||||||
|  | 							}).then(() => { | ||||||
|  | 								location.reload(); | ||||||
|  | 							}); | ||||||
|  | 							// alert("Les informations ont été mises à jour.") ? "" :
 | ||||||
|  | 						} else { | ||||||
|  | 							toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>"); | ||||||
|  | 						} | ||||||
|  | 					}, | ||||||
|  | 
 | ||||||
|  | 					error: function (resultat, statut, error) { | ||||||
|  | 						console.log(resultat + " " + error); | ||||||
|  | 						toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>"); | ||||||
|  | 					} | ||||||
|  | 				}); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 			} else { | ||||||
|  | 				$('#walletForm')[0].reportValidity(); | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 	}); | ||||||
|  | </script> | ||||||
|  | @ -0,0 +1,292 @@ | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>"> | ||||||
|  | <link rel="stylesheet" | ||||||
|  | 	  href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" | ||||||
|  | 	  href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round|Open+Sans"> | ||||||
|  | <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | ||||||
|  | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> | ||||||
|  | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | ||||||
|  | 
 | ||||||
|  | <?php | ||||||
|  | 
 | ||||||
|  | use Brick\Money\Context\CustomContext; | ||||||
|  | use Brick\Money\Money; | ||||||
|  | 
 | ||||||
|  | $context = new \Brick\Money\Context\AutoContext(); | ||||||
|  | 
 | ||||||
|  | $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); | ||||||
|  | ?>
 | ||||||
|  | 
 | ||||||
|  | <div class="content-wrapper"> | ||||||
|  | 	<!-- Content Header (Page header) --> | ||||||
|  | 	<section class="content-header"> | ||||||
|  | 
 | ||||||
|  | 		<h1> | ||||||
|  | 			<?php echo $this->lang->line('config_user').' - '.$this->lang->line('config_ilink_user_carte_wallet'); ?>
 | ||||||
|  | 		</h1> | ||||||
|  | 		<?php | ||||||
|  | 		$site_url = base_url(); | ||||||
|  | 
 | ||||||
|  | 		if ($alert == "ok") { | ||||||
|  | 
 | ||||||
|  | 			if (!$success == "ok") { | ||||||
|  | 				?>
 | ||||||
|  | 				<div class='alert alert-danger alert-dismissible col-xs-6'> | ||||||
|  | 					<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button> | ||||||
|  | 					<h4><i class='icon fa fa-ban'></i> Erreur!</h4> | ||||||
|  | 					<?php echo $message; ?>
 | ||||||
|  | 				</div> | ||||||
|  | 
 | ||||||
|  | 				<?php | ||||||
|  | 			} else { | ||||||
|  | 				?>
 | ||||||
|  | 				<div class="alert alert-success alert-dismissible col-xs-6"> | ||||||
|  | 					<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | ||||||
|  | 					<h4><i class="icon fa fa-check"></i> Success!</h4> | ||||||
|  | 					<?php echo $message; ?>
 | ||||||
|  | 				</div> | ||||||
|  | 
 | ||||||
|  | 				<?php | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 		?>
 | ||||||
|  | 
 | ||||||
|  | 	</section> | ||||||
|  | 
 | ||||||
|  | 	<section class="content"> | ||||||
|  | 		<div class="row"> | ||||||
|  | 			<div class="col-lg-12"> | ||||||
|  | 				<div class="margin"> | ||||||
|  | 					<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-update" | ||||||
|  | 							style="width: 100%"><?php echo $this->lang->line('Modifier la configuration') ?></button>
 | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 		<div class="row centered"> | ||||||
|  | 			<div class="col-lg-2 col-lg-offset-4 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-aqua-active"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_u_c_w; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_user_cart_wallet') ?></p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-up"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 
 | ||||||
|  | 			<div class="col-lg-2 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-aqua-active"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_u_c_c; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_user_cart_cash') ?></p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-up"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 		<div class="row"> | ||||||
|  | 			<div class="col-lg-2 col-lg-offset-4 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-teal-active"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_hyp_r_cart_ilink; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_hyp_remove_cart_ilink') ?> </p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-up"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 
 | ||||||
|  | 			<div class="col-lg-2 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-teal-active"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_bq_r_cart_ilink; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_bq_remove_cart_ilink') ?> </p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-up"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 		<div class="modal fade" id="modal-update"> | ||||||
|  | 			<div class="modal-dialog modal-lg"> | ||||||
|  | 				<div class="modal-content"> | ||||||
|  | 					<div class="modal-header"> | ||||||
|  | 						<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||||||
|  | 							<span aria-hidden="true">×</span> | ||||||
|  | 						</button> | ||||||
|  | 						<h3 class="modal-title"><?php echo $this->lang->line('Configuration du wallet'); ?></h3>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="modal-body"> | ||||||
|  | 						<form id="walletForm"> | ||||||
|  | 							<div class="row"> | ||||||
|  | 								<div class="col-lg-6"> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_u_c_w" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_user_cart_wallet') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" max="100" required class="form-control" | ||||||
|  | 											   id="taux_u_c_w" name="taux_u_c_w" value="<?= $taux_u_c_w ?>"> | ||||||
|  | 									</div> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_u_c_c" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_user_cart_cash') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" max="100" required class="form-control" | ||||||
|  | 											   name="taux_u_c_c" id="taux_u_c_c" value="<?= $taux_u_c_c ?>"> | ||||||
|  | 									</div> | ||||||
|  | 								</div> | ||||||
|  | 								<div class="col-lg-6"> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_hyp_r_cart_ilink" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_hyp_remove_cart_ilink') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" required class="form-control" | ||||||
|  | 											   name="taux_hyp_r_cart_ilink" id="taux_hyp_r_cart_ilink" | ||||||
|  | 											   value="<?= $taux_hyp_r_cart_ilink ?>"> | ||||||
|  | 									</div> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_bq_r_cart_ilink" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_bq_remove_cart_ilink') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" required class="form-control" | ||||||
|  | 											   name="taux_bq_r_cart_ilink" id="taux_bq_r_cart_ilink" | ||||||
|  | 											   value="<?= $taux_bq_r_cart_ilink ?>"> | ||||||
|  | 									</div> | ||||||
|  | 								</div> | ||||||
|  | 							</div> | ||||||
|  | 						</form> | ||||||
|  | 					</div> | ||||||
|  | 					<div class="modal-footer"> | ||||||
|  | 						<button type="button" class="btn btn-default pull-left" | ||||||
|  | 								data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
 | ||||||
|  | 						<button type="button" id="updateWallet" data-network-id="<?= $network_id ?>" | ||||||
|  | 								data-id-config="<?= $idConfig ?>" | ||||||
|  | 								class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
 | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 	</section> | ||||||
|  | </div> | ||||||
|  | <!-- jQuery 3 --> | ||||||
|  | <script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script> | ||||||
|  | <!-- Bootstrap 3.3.7 --> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script> | ||||||
|  | <!-- DataTables --> | ||||||
|  | <script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script> | ||||||
|  | <!-- Slimscroll --> | ||||||
|  | <script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script> | ||||||
|  | <!-- FastClick --> | ||||||
|  | <script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script> | ||||||
|  | <!-- AdminLTE App --> | ||||||
|  | <script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script> | ||||||
|  | <!-- AdminLTE for demo purposes --> | ||||||
|  | <script src="<?php echo base_url('dist/js/demo.js') ?>"></script> | ||||||
|  | 
 | ||||||
|  | <script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script> | ||||||
|  | <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script> | ||||||
|  | 
 | ||||||
|  | <script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script> | ||||||
|  | 
 | ||||||
|  | <script> | ||||||
|  | 	var serializeArray = function (form) { | ||||||
|  | 		// Setup our serialized data
 | ||||||
|  | 		var serialized = []; | ||||||
|  | 
 | ||||||
|  | 		// Loop through each field in the form
 | ||||||
|  | 		var elements = document.getElementById(form).elements; | ||||||
|  | 		for (var i = 0, field; field = elements[i++];) { | ||||||
|  | 
 | ||||||
|  | 			// Don't serialize fields without a name, submits, buttons, file and reset inputs, and disabled fields
 | ||||||
|  | 			if (!field.name || field.disabled || field.type === 'file' || field.type === 'reset' || field.type === 'submit' || field.type === 'button') continue; | ||||||
|  | 
 | ||||||
|  | 			// If a multi-select, get all selections
 | ||||||
|  | 			if (field.type === 'select-multiple') { | ||||||
|  | 				for (var n = 0; n < field.options.length; n++) { | ||||||
|  | 					if (!field.options[n].selected) continue; | ||||||
|  | 					serialized.push({ | ||||||
|  | 						name: field.name, | ||||||
|  | 						value: field.options[n].value | ||||||
|  | 					}); | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 
 | ||||||
|  | 			// Convert field data to a query string
 | ||||||
|  | 			else if ((field.type !== 'checkbox' && field.type !== 'radio') || field.checked) { | ||||||
|  | 				serialized.push({ | ||||||
|  | 					name: field.name, | ||||||
|  | 					value: field.value | ||||||
|  | 				}); | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 		return serialized; | ||||||
|  | 	}; | ||||||
|  | 
 | ||||||
|  | </script> | ||||||
|  | <script> | ||||||
|  | 	toastr.options.closeButton = true; | ||||||
|  | 	toastr.options.closeMethod = 'fadeOut'; | ||||||
|  | 	toastr.options.closeDuration = 5000; | ||||||
|  | 	toastr.options.closeEasing = 'swing'; | ||||||
|  | 
 | ||||||
|  | 	$('#updateWallet').click(function () { | ||||||
|  | 		const network_id = $(this).data('network-id'); | ||||||
|  | 		const id_config = $(this).data('id-config'); | ||||||
|  | 
 | ||||||
|  | // total répartition commission réseau retrait carte-cash  utilisateur ilink (retrait)
 | ||||||
|  | 		const total5 = parseFloat($('#taux_hyp_r_cart_ilink').val()) + parseFloat($('#taux_bq_r_cart_ilink').val()); | ||||||
|  | 
 | ||||||
|  | 		if (total5 != 100) { | ||||||
|  | 			toastr.error("<?php echo $this->lang->line('ilink_fifth_rule')?>", "<?php echo $this->lang->line('management_rule')?>"); | ||||||
|  | 		} else { | ||||||
|  | 			if ($('#walletForm')[0].checkValidity()) { | ||||||
|  | 				$.ajax({ | ||||||
|  | 					url: '<?php echo base_url('index.php/Gestion/config_wallet/update')?>', | ||||||
|  | 					type: 'POST', | ||||||
|  | 					dataType: 'json', | ||||||
|  | 					data: { | ||||||
|  | 						"type": "ilink", | ||||||
|  | 						"config": "user_carte_wallet", | ||||||
|  | 						"network_id": network_id, "id_config": id_config, | ||||||
|  | 						"fields": serializeArray('walletForm') | ||||||
|  | 					}, | ||||||
|  | 					success: function (data) { | ||||||
|  | 						if (data == '200') { | ||||||
|  | 							Swal.fire({ | ||||||
|  | 								icon: 'success', | ||||||
|  | 								title: "<?php echo $this->lang->line('wallet_update')?>", | ||||||
|  | 								text: "<?php echo $this->lang->line('informations_updated')?>", | ||||||
|  | 								timer: 3000 | ||||||
|  | 							}).then(() => { | ||||||
|  | 								location.reload(); | ||||||
|  | 							}); | ||||||
|  | 							// alert("Les informations ont été mises à jour.") ? "" :
 | ||||||
|  | 						} else { | ||||||
|  | 							toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>"); | ||||||
|  | 						} | ||||||
|  | 					}, | ||||||
|  | 
 | ||||||
|  | 					error: function (resultat, statut, error) { | ||||||
|  | 						console.log(resultat + " " + error); | ||||||
|  | 						toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>"); | ||||||
|  | 					} | ||||||
|  | 				}); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 			} else { | ||||||
|  | 				$('#walletForm')[0].reportValidity(); | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 	}); | ||||||
|  | </script> | ||||||
|  | @ -0,0 +1,279 @@ | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>"> | ||||||
|  | <link rel="stylesheet" | ||||||
|  | 	  href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" | ||||||
|  | 	  href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round|Open+Sans"> | ||||||
|  | <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | ||||||
|  | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> | ||||||
|  | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | ||||||
|  | <?php | ||||||
|  | 
 | ||||||
|  | use Brick\Money\Context\CustomContext; | ||||||
|  | use Brick\Money\Money; | ||||||
|  | 
 | ||||||
|  | $context = new \Brick\Money\Context\AutoContext(); | ||||||
|  | 
 | ||||||
|  | $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); | ||||||
|  | ?>
 | ||||||
|  | 
 | ||||||
|  | <div class="content-wrapper"> | ||||||
|  | 	<!-- Content Header (Page header) --> | ||||||
|  | 	<section class="content-header"> | ||||||
|  | 
 | ||||||
|  | 		<h1> | ||||||
|  | 			<?php echo $this->lang->line('config_user').' - '.$this->lang->line('config_ilink_user_wallet_carte'); ?>
 | ||||||
|  | 		</h1> | ||||||
|  | 		<?php | ||||||
|  | 		$site_url = base_url(); | ||||||
|  | 
 | ||||||
|  | 		if ($alert == "ok") { | ||||||
|  | 
 | ||||||
|  | 			if (!$success == "ok") { | ||||||
|  | 				?>
 | ||||||
|  | 				<div class='alert alert-danger alert-dismissible col-xs-6'> | ||||||
|  | 					<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button> | ||||||
|  | 					<h4><i class='icon fa fa-ban'></i> Erreur!</h4> | ||||||
|  | 					<?php echo $message; ?>
 | ||||||
|  | 				</div> | ||||||
|  | 
 | ||||||
|  | 				<?php | ||||||
|  | 			} else { | ||||||
|  | 				?>
 | ||||||
|  | 				<div class="alert alert-success alert-dismissible col-xs-6"> | ||||||
|  | 					<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | ||||||
|  | 					<h4><i class="icon fa fa-check"></i> Success!</h4> | ||||||
|  | 					<?php echo $message; ?>
 | ||||||
|  | 				</div> | ||||||
|  | 
 | ||||||
|  | 				<?php | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 		?>
 | ||||||
|  | 
 | ||||||
|  | 	</section> | ||||||
|  | 
 | ||||||
|  | 	<section class="content"> | ||||||
|  | 		<div class="row"> | ||||||
|  | 			<div class="col-lg-12"> | ||||||
|  | 				<div class="margin"> | ||||||
|  | 					<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-update" | ||||||
|  | 							style="width: 100%"><?php echo $this->lang->line('Modifier la configuration') ?></button>
 | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 		<div class="row centered"> | ||||||
|  | 			<div class="col-lg-2  col-lg-offset-5 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-aqua-active"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_u_w_cart; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_user_wallet_cart') ?> </p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-up"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 		<div class="row"> | ||||||
|  | 			<!--Taux  commission wallet agent carte client et Taux  commission wallet agent carte client--> | ||||||
|  | 			<div class="col-lg-2 col-lg-offset-4 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-light-blue-active"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_hyp_s_wallet_cart_ilink; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_hyp_send_wallet_cart_ilink') ?> </p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-up"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 
 | ||||||
|  | 			<div class="col-lg-2 col-xs-6"> | ||||||
|  | 				<div class="small-box bg-light-blue-active"> | ||||||
|  | 					<div class="inner"> | ||||||
|  | 						<h3><?php echo $taux_bq_s_wallet_cart_ilink; ?><sup style="font-size: 20px">%</sup></h3>
 | ||||||
|  | 						<p><?php echo $this->lang->line('rate_com_bq_send_wallet_cart_ilink') ?> </p>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="icon"> | ||||||
|  | 						<i class="ion ion-android-arrow-up"></i> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 		<div class="modal fade" id="modal-update"> | ||||||
|  | 			<div class="modal-dialog modal-lg"> | ||||||
|  | 				<div class="modal-content"> | ||||||
|  | 					<div class="modal-header"> | ||||||
|  | 						<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||||||
|  | 							<span aria-hidden="true">×</span> | ||||||
|  | 						</button> | ||||||
|  | 						<h3 class="modal-title"><?php echo $this->lang->line('Configuration du wallet'); ?></h3>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="modal-body"> | ||||||
|  | 						<form id="walletForm"> | ||||||
|  | 							<div class="row"> | ||||||
|  | 								<div class="col-lg-6"> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_u_w_cart" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_user_wallet_cart') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" required class="form-control" | ||||||
|  | 											   id="taux_u_w_cart" | ||||||
|  | 											   name="taux_u_w_cart" value="<?= $taux_u_w_cart ?>"> | ||||||
|  | 									</div> | ||||||
|  | 								</div> | ||||||
|  | 
 | ||||||
|  | 								<div class="col-lg-6"> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_hyp_s_wallet_cart_ilink" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_hyp_send_wallet_cart_ilink') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" required class="form-control" | ||||||
|  | 											   name="taux_hyp_s_wallet_cart_ilink" id="taux_hyp_s_wallet_cart_ilink" | ||||||
|  | 											   value="<?= $taux_hyp_s_wallet_cart_ilink ?>"> | ||||||
|  | 									</div> | ||||||
|  | 									<div class="form-group"> | ||||||
|  | 										<label for="taux_bq_s_wallet_cart_ilink" | ||||||
|  | 											   class="col-form-label"><?php echo $this->lang->line('rate_com_bq_send_wallet_cart_ilink') . ' (%)'; ?></label>
 | ||||||
|  | 										<input type="number" min="0" step=".01" required class="form-control" | ||||||
|  | 											   name="taux_bq_s_wallet_cart_ilink" id="taux_bq_s_wallet_cart_ilink" | ||||||
|  | 											   value="<?= $taux_bq_s_wallet_cart_ilink ?>"> | ||||||
|  | 									</div> | ||||||
|  | 								</div> | ||||||
|  | 							</div> | ||||||
|  | 						</form> | ||||||
|  | 					</div> | ||||||
|  | 					<div class="modal-footer"> | ||||||
|  | 						<button type="button" class="btn btn-default pull-left" | ||||||
|  | 								data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
 | ||||||
|  | 						<button type="button" id="updateWallet" data-network-id="<?= $network_id ?>" | ||||||
|  | 								data-id-config="<?= $idConfig ?>" | ||||||
|  | 								class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
 | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 	</section> | ||||||
|  | </div> | ||||||
|  | <!-- jQuery 3 --> | ||||||
|  | <script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script> | ||||||
|  | <!-- Bootstrap 3.3.7 --> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script> | ||||||
|  | <!-- DataTables --> | ||||||
|  | <script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script> | ||||||
|  | <!-- Slimscroll --> | ||||||
|  | <script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script> | ||||||
|  | <!-- FastClick --> | ||||||
|  | <script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script> | ||||||
|  | <!-- AdminLTE App --> | ||||||
|  | <script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script> | ||||||
|  | <!-- AdminLTE for demo purposes --> | ||||||
|  | <script src="<?php echo base_url('dist/js/demo.js') ?>"></script> | ||||||
|  | 
 | ||||||
|  | <script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script> | ||||||
|  | <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script> | ||||||
|  | <!-- ChartJS --> | ||||||
|  | <script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script> | ||||||
|  | 
 | ||||||
|  | <script> | ||||||
|  | 	var serializeArray = function (form) { | ||||||
|  | 		// Setup our serialized data
 | ||||||
|  | 		var serialized = []; | ||||||
|  | 
 | ||||||
|  | 		// Loop through each field in the form
 | ||||||
|  | 		var elements = document.getElementById(form).elements; | ||||||
|  | 		for (var i = 0, field; field = elements[i++];) { | ||||||
|  | 
 | ||||||
|  | 			// Don't serialize fields without a name, submits, buttons, file and reset inputs, and disabled fields
 | ||||||
|  | 			if (!field.name || field.disabled || field.type === 'file' || field.type === 'reset' || field.type === 'submit' || field.type === 'button') continue; | ||||||
|  | 
 | ||||||
|  | 			// If a multi-select, get all selections
 | ||||||
|  | 			if (field.type === 'select-multiple') { | ||||||
|  | 				for (var n = 0; n < field.options.length; n++) { | ||||||
|  | 					if (!field.options[n].selected) continue; | ||||||
|  | 					serialized.push({ | ||||||
|  | 						name: field.name, | ||||||
|  | 						value: field.options[n].value | ||||||
|  | 					}); | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 
 | ||||||
|  | 			// Convert field data to a query string
 | ||||||
|  | 			else if ((field.type !== 'checkbox' && field.type !== 'radio') || field.checked) { | ||||||
|  | 				serialized.push({ | ||||||
|  | 					name: field.name, | ||||||
|  | 					value: field.value | ||||||
|  | 				}); | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 		return serialized; | ||||||
|  | 	}; | ||||||
|  | 
 | ||||||
|  | </script> | ||||||
|  | <script> | ||||||
|  | 	toastr.options.closeButton = true; | ||||||
|  | 	toastr.options.closeMethod = 'fadeOut'; | ||||||
|  | 	toastr.options.closeDuration = 5000; | ||||||
|  | 	toastr.options.closeEasing = 'swing'; | ||||||
|  | 
 | ||||||
|  | 	$('#updateWallet').click(function () { | ||||||
|  | 		const network_id = $(this).data('network-id'); | ||||||
|  | 		const id_config = $(this).data('id-config'); | ||||||
|  | 
 | ||||||
|  | 		// total répartition commission réseau d'envoi de wallet vers carte  utilisateur ilink (retrait)
 | ||||||
|  | 		const total6 = parseFloat($('#taux_hyp_s_wallet_cart_ilink').val()) + parseFloat($('#taux_bq_s_wallet_cart_ilink').val()); | ||||||
|  | 
 | ||||||
|  | 		 if (total6 != 100) { | ||||||
|  | 			toastr.error("<?php echo $this->lang->line('ilink_sixth_rule')?>", "<?php echo $this->lang->line('management_rule')?>"); | ||||||
|  | 		} else { | ||||||
|  | 			if ($('#walletForm')[0].checkValidity()) { | ||||||
|  | 
 | ||||||
|  | 				$.ajax({ | ||||||
|  | 					url: '<?php echo base_url('index.php/Gestion/config_wallet/update')?>', | ||||||
|  | 					type: 'POST', | ||||||
|  | 					dataType: 'json', | ||||||
|  | 					data: { | ||||||
|  | 						"type": "ilink", | ||||||
|  | 						"config" : "user_wallet_carte", | ||||||
|  | 						"network_id": network_id, "id_config": id_config, | ||||||
|  | 						"fields": serializeArray('walletForm') | ||||||
|  | 					}, | ||||||
|  | 					success: function (data) { | ||||||
|  | 						if (data == '200') { | ||||||
|  | 							Swal.fire({ | ||||||
|  | 								icon: 'success', | ||||||
|  | 								title: "<?php echo $this->lang->line('wallet_update')?>", | ||||||
|  | 								text: "<?php echo $this->lang->line('informations_updated')?>", | ||||||
|  | 								timer: 3000 | ||||||
|  | 							}).then(() => { | ||||||
|  | 								location.reload(); | ||||||
|  | 							}); | ||||||
|  | 							// alert("Les informations ont été mises à jour.") ? "" :
 | ||||||
|  | 						} else { | ||||||
|  | 							toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>"); | ||||||
|  | 						} | ||||||
|  | 					}, | ||||||
|  | 
 | ||||||
|  | 					error: function (resultat, statut, error) { | ||||||
|  | 						console.log(resultat + " " + error); | ||||||
|  | 						toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>"); | ||||||
|  | 					} | ||||||
|  | 				}); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 			} else { | ||||||
|  | 				$('#walletForm')[0].reportValidity(); | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 	}); | ||||||
|  | 
 | ||||||
|  | </script> | ||||||
|  | @ -0,0 +1,625 @@ | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>"> | ||||||
|  | <link rel="stylesheet" | ||||||
|  | 	  href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" | ||||||
|  | 	  href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round|Open+Sans"> | ||||||
|  | <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | ||||||
|  | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> | ||||||
|  | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | ||||||
|  | <style type="text/css"> | ||||||
|  | 	.table-wrapper { | ||||||
|  | 		width: 700px; | ||||||
|  | 		margin: 30px auto; | ||||||
|  | 		background: #fff;
 | ||||||
|  | 		padding: 20px; | ||||||
|  | 		box-shadow: 0 1px 1px rgba(0, 0, 0, .05); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	.table-title { | ||||||
|  | 		padding-bottom: 10px; | ||||||
|  | 		margin: 0 0 10px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	.table-title h2 { | ||||||
|  | 		margin: 6px 0 0; | ||||||
|  | 		font-size: 22px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	.table-title .add-new { | ||||||
|  | 		float: right; | ||||||
|  | 		height: 30px; | ||||||
|  | 		font-weight: bold; | ||||||
|  | 		font-size: 12px; | ||||||
|  | 		text-shadow: none; | ||||||
|  | 		min-width: 100px; | ||||||
|  | 		border-radius: 50px; | ||||||
|  | 		line-height: 13px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	.table-title .add-new i { | ||||||
|  | 		margin-right: 4px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table { | ||||||
|  | 		table-layout: fixed; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table tr th, table.table tr td { | ||||||
|  | 		border-color: #e9e9e9;
 | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table th i { | ||||||
|  | 		font-size: 13px; | ||||||
|  | 		margin: 0 5px; | ||||||
|  | 		cursor: pointer; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table th:last-child { | ||||||
|  | 		width: 100px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table td a { | ||||||
|  | 		cursor: pointer; | ||||||
|  | 		display: inline-block; | ||||||
|  | 		margin: 0 5px; | ||||||
|  | 		min-width: 24px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table td a.add { | ||||||
|  | 		color: #27C46B;
 | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table td a.edit { | ||||||
|  | 		color: #FFC107;
 | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table td a.delete { | ||||||
|  | 		color: #E34724;
 | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table td i { | ||||||
|  | 		font-size: 19px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table td a.add i { | ||||||
|  | 		font-size: 24px; | ||||||
|  | 		margin-right: -1px; | ||||||
|  | 		position: relative; | ||||||
|  | 		top: 3px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table .form-control { | ||||||
|  | 		height: 32px; | ||||||
|  | 		line-height: 32px; | ||||||
|  | 		box-shadow: none; | ||||||
|  | 		border-radius: 2px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	/*table.table .form-control.error {*/ | ||||||
|  | 	/*	border-color: #f50000;*/ | ||||||
|  | 	/*}*/ | ||||||
|  | 	.error { | ||||||
|  | 		border-color: #f50000;
 | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table td .add { | ||||||
|  | 		display: none; | ||||||
|  | 	} | ||||||
|  | </style> | ||||||
|  | <?php | ||||||
|  | 
 | ||||||
|  | use Brick\Money\Context\CustomContext; | ||||||
|  | use Brick\Money\Money; | ||||||
|  | 
 | ||||||
|  | $context = new \Brick\Money\Context\AutoContext(); | ||||||
|  | 
 | ||||||
|  | $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); | ||||||
|  | ?>
 | ||||||
|  | 
 | ||||||
|  | <div class="content-wrapper"> | ||||||
|  | 	<!-- Content Header (Page header) --> | ||||||
|  | 	<section class="content-header"> | ||||||
|  | 
 | ||||||
|  | 		<h1> | ||||||
|  | 			<?php echo $this->lang->line('config_user').' - '.$this->lang->line('config_ilink_user_wallet_cash'); ?>
 | ||||||
|  | 		</h1> | ||||||
|  | 		<?php | ||||||
|  | 		$site_url = base_url(); | ||||||
|  | 
 | ||||||
|  | 		if ($alert == "ok") { | ||||||
|  | 
 | ||||||
|  | 			if (!$success == "ok") { | ||||||
|  | 				?>
 | ||||||
|  | 				<div class='alert alert-danger alert-dismissible col-xs-6'> | ||||||
|  | 					<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button> | ||||||
|  | 					<h4><i class='icon fa fa-ban'></i> Erreur!</h4> | ||||||
|  | 					<?php echo $message; ?>
 | ||||||
|  | 				</div> | ||||||
|  | 
 | ||||||
|  | 				<?php | ||||||
|  | 			} else { | ||||||
|  | 				?>
 | ||||||
|  | 				<div class="alert alert-success alert-dismissible col-xs-6"> | ||||||
|  | 					<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | ||||||
|  | 					<h4><i class="icon fa fa-check"></i> Success!</h4> | ||||||
|  | 					<?php echo $message; ?>
 | ||||||
|  | 				</div> | ||||||
|  | 
 | ||||||
|  | 				<?php | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 		?>
 | ||||||
|  | 
 | ||||||
|  | 	</section> | ||||||
|  | 
 | ||||||
|  | 	<section class="content"> | ||||||
|  | 		<div class="row"> | ||||||
|  | 			<div class="col-lg-12"> | ||||||
|  | 				<div class="margin"> | ||||||
|  | 					<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-update" | ||||||
|  | 							style="width: 100%"><?php echo $this->lang->line('Modifier la configuration') ?></button>
 | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 		<div class="row centered"> | ||||||
|  | 			<div class="col-lg-6 col-xs-12"> | ||||||
|  | 				<div class="box"> | ||||||
|  | 					<div class="box-header"> | ||||||
|  | 						<h3 class="box-title"><?php echo $this->lang->line('rate_com_user_wallet_cash_international'); ?></h3>
 | ||||||
|  | 					</div> | ||||||
|  | 					<!-- /.box-header --> | ||||||
|  | 					<div class="box-body table-responsive" style="overflow-x:auto;"> | ||||||
|  | 						<table class="table table-hover"> | ||||||
|  | 							<tbody> | ||||||
|  | 							<tr> | ||||||
|  | 								<th>Min</th> | ||||||
|  | 								<th>Max</th> | ||||||
|  | 								<th>Taux (%)</th> | ||||||
|  | 							</tr> | ||||||
|  | 							<?php | ||||||
|  | 							if ($plr_user_wallet_cash != false) { | ||||||
|  | 								foreach ($plr_user_wallet_cash->result() as $row) { | ||||||
|  | 									echo "<tr>
 | ||||||
|  | 																		<td>" . $fmt->format($row->min) . "</td> | ||||||
|  | 																		<td>" . $fmt->format($row->max) . "</td> | ||||||
|  | 																		  <td>" . $row->taux . "</td>" . '
 | ||||||
|  | 																		 </tr>'; | ||||||
|  | 								} | ||||||
|  | 							} | ||||||
|  | 							?>
 | ||||||
|  | 							</tbody> | ||||||
|  | 						</table> | ||||||
|  | 					</div> | ||||||
|  | 					<!-- /.box-body --> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 			<div class="col-lg-6 col-xs-12"> | ||||||
|  | 				<div class="box"> | ||||||
|  | 					<div class="box-header"> | ||||||
|  | 						<h3 class="box-title"><?php echo $this->lang->line('rate_com_user_wallet_cash_national'); ?></h3>
 | ||||||
|  | 					</div> | ||||||
|  | 					<!-- /.box-header --> | ||||||
|  | 					<div class="box-body table-responsive" style="overflow-x:auto;"> | ||||||
|  | 						<table class="table table-hover"> | ||||||
|  | 							<tbody> | ||||||
|  | 							<tr> | ||||||
|  | 								<th>Min</th> | ||||||
|  | 								<th>Max</th> | ||||||
|  | 								<th>Taux (%)</th> | ||||||
|  | 							</tr> | ||||||
|  | 							<?php | ||||||
|  | 							if ($plr_user_wallet_cash_national != false) { | ||||||
|  | 								foreach ($plr_user_wallet_cash_national->result() as $row) { | ||||||
|  | 									echo "<tr>
 | ||||||
|  | 																		<td>" . $fmt->format($row->min) . "</td> | ||||||
|  | 																		<td>" . $fmt->format($row->max) . "</td> | ||||||
|  | 																		  <td>" . $row->taux . "</td>" . '
 | ||||||
|  | 																		 </tr>'; | ||||||
|  | 								} | ||||||
|  | 							} | ||||||
|  | 							?>
 | ||||||
|  | 							</tbody> | ||||||
|  | 						</table> | ||||||
|  | 					</div> | ||||||
|  | 					<!-- /.box-body --> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 		<div class="row"> | ||||||
|  | 			<div class="modal fade" id="modal-update"> | ||||||
|  | 				<div class="modal-dialog" style="max-width: 1200px; width: 100%;"> | ||||||
|  | 					<div class="modal-content"> | ||||||
|  | 						<div class="modal-header"> | ||||||
|  | 							<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||||||
|  | 								<span aria-hidden="true">×</span> | ||||||
|  | 							</button> | ||||||
|  | 							<h3 class="modal-title"><?php echo $this->lang->line('Configuration du wallet'); ?></h3>
 | ||||||
|  | 						</div> | ||||||
|  | 						<div class="modal-body"> | ||||||
|  | 							<form id="walletForm"> | ||||||
|  | 								<div class="row"> | ||||||
|  | 									<div class="col-lg-6"> | ||||||
|  | 										<div class="form-group" style="overflow-x:auto;"> | ||||||
|  | 											<div class="table-title"> | ||||||
|  | 												<div class="row"> | ||||||
|  | 													<div class="col-sm-8"> | ||||||
|  | 														<label for="nom" | ||||||
|  | 															   class="col-form-label"><?php echo $this->lang->line('rate_com_user_wallet_cash_international'); ?></label>
 | ||||||
|  | 													</div> | ||||||
|  | 													<div class="col-sm-4"> | ||||||
|  | 														<button type="button" class="btn btn-info add-new new2"><i | ||||||
|  | 																	class="fa fa-plus"></i> <?php echo $this->lang->line('new_level'); ?>
 | ||||||
|  | 														</button> | ||||||
|  | 													</div> | ||||||
|  | 												</div> | ||||||
|  | 											</div> | ||||||
|  | 											<table id="user_wallet_cash" class="table table-bordered"> | ||||||
|  | 												<thead> | ||||||
|  | 												<tr> | ||||||
|  | 													<th>Min</th> | ||||||
|  | 													<th>Max</th> | ||||||
|  | 													<th><?php echo $this->lang->line('rate'); ?> (%)</th>
 | ||||||
|  | 													<th>Actions</th> | ||||||
|  | 												</tr> | ||||||
|  | 												</thead> | ||||||
|  | 												<tbody> | ||||||
|  | 												<?php | ||||||
|  | 												if ($plr_user_wallet_cash != false) { | ||||||
|  | 													foreach ($plr_user_wallet_cash->result() as $row) { | ||||||
|  | 														echo "<tr>
 | ||||||
|  | 																		<td>" . $row->min . "</td> | ||||||
|  | 																		<td>" . $row->max . "</td> | ||||||
|  | 																		  <td>" . $row->taux . "</td>" . '
 | ||||||
|  | 																		  <td> | ||||||
|  | 																			<a class="add add2" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>
 | ||||||
|  | 																			<a class="edit edit2" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>
 | ||||||
|  | 																			<a class="delete delete2" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>
 | ||||||
|  | 																		</td> | ||||||
|  | 																		 </tr>'; | ||||||
|  | 													} | ||||||
|  | 												} | ||||||
|  | 												?>
 | ||||||
|  | 												</tbody> | ||||||
|  | 											</table> | ||||||
|  | 										</div> | ||||||
|  | 									</div> | ||||||
|  | 									<div class="col-lg-6"> | ||||||
|  | 										<div class="form-group" style="overflow-x:auto;"> | ||||||
|  | 											<div class="table-title"> | ||||||
|  | 												<div class="row"> | ||||||
|  | 													<div class="col-sm-8"> | ||||||
|  | 														<label for="nom" | ||||||
|  | 															   class="col-form-label"><?php echo $this->lang->line('rate_com_user_wallet_cash_national'); ?></label>
 | ||||||
|  | 													</div> | ||||||
|  | 													<div class="col-sm-4"> | ||||||
|  | 														<button type="button" class="btn btn-info add-new new8"><i | ||||||
|  | 																	class="fa fa-plus"></i> <?php echo $this->lang->line('new_level'); ?>
 | ||||||
|  | 														</button> | ||||||
|  | 													</div> | ||||||
|  | 												</div> | ||||||
|  | 											</div> | ||||||
|  | 											<table id="user_wallet_cash_national" class="table table-bordered"> | ||||||
|  | 												<thead> | ||||||
|  | 												<tr> | ||||||
|  | 													<th>Min</th> | ||||||
|  | 													<th>Max</th> | ||||||
|  | 													<th><?php echo $this->lang->line('rate'); ?> (%)</th>
 | ||||||
|  | 													<th>Actions</th> | ||||||
|  | 												</tr> | ||||||
|  | 												</thead> | ||||||
|  | 												<tbody> | ||||||
|  | 												<?php | ||||||
|  | 												if ($plr_user_wallet_cash_national != false) { | ||||||
|  | 													foreach ($plr_user_wallet_cash_national->result() as $row) { | ||||||
|  | 														echo "<tr>
 | ||||||
|  | 																		<td>" . $row->min . "</td> | ||||||
|  | 																		<td>" . $row->max . "</td> | ||||||
|  | 																		  <td>" . $row->taux . "</td>" . '
 | ||||||
|  | 																		  <td> | ||||||
|  | 																			<a class="add add8" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>
 | ||||||
|  | 																			<a class="edit edit8" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>
 | ||||||
|  | 																			<a class="delete delete8" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>
 | ||||||
|  | 																		</td> | ||||||
|  | 																		 </tr>'; | ||||||
|  | 													} | ||||||
|  | 												} | ||||||
|  | 												?>
 | ||||||
|  | 												</tbody> | ||||||
|  | 											</table> | ||||||
|  | 										</div> | ||||||
|  | 									</div> | ||||||
|  | 								</div> | ||||||
|  | 							</form> | ||||||
|  | 						</div> | ||||||
|  | 						<div class="modal-footer"> | ||||||
|  | 							<button type="button" class="btn btn-default pull-left" | ||||||
|  | 									data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
 | ||||||
|  | 							<button type="button" id="updateWallet" data-network-id="<?= $network_id ?>" | ||||||
|  | 									data-id-config="<?= $idConfig ?>" | ||||||
|  | 									class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
 | ||||||
|  | 						</div> | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 	</section> | ||||||
|  | </div> | ||||||
|  | <!-- jQuery 3 --> | ||||||
|  | <script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script> | ||||||
|  | <!-- Bootstrap 3.3.7 --> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script> | ||||||
|  | <!-- DataTables --> | ||||||
|  | <script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script> | ||||||
|  | <!-- Slimscroll --> | ||||||
|  | <script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script> | ||||||
|  | <!-- FastClick --> | ||||||
|  | <script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script> | ||||||
|  | <!-- AdminLTE App --> | ||||||
|  | <script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script> | ||||||
|  | <!-- AdminLTE for demo purposes --> | ||||||
|  | <script src="<?php echo base_url('dist/js/demo.js') ?>"></script> | ||||||
|  | 
 | ||||||
|  | <script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script> | ||||||
|  | <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script> | ||||||
|  | <!-- ChartJS --> | ||||||
|  | <script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script> | ||||||
|  | 
 | ||||||
|  | <script> | ||||||
|  | 	toastr.options.closeButton = true; | ||||||
|  | 	toastr.options.closeMethod = 'fadeOut'; | ||||||
|  | 	toastr.options.closeDuration = 5000; | ||||||
|  | 	toastr.options.closeEasing = 'swing'; | ||||||
|  | 
 | ||||||
|  | 	$('#updateWallet').click(function () { | ||||||
|  | 		const network_id = $(this).data('network-id'); | ||||||
|  | 		const id_config = $(this).data('id-config'); | ||||||
|  | 		if ($('#walletForm')[0].checkValidity()) { | ||||||
|  | 
 | ||||||
|  | 			// Paliers
 | ||||||
|  | 			var plr_user_wallet_cash = []; | ||||||
|  | 
 | ||||||
|  | 			var plr_user_wallet_cash_national = []; | ||||||
|  | 
 | ||||||
|  | 			$('#user_wallet_cash tr').has('td').each(function () { | ||||||
|  | 				var arrayItem = {}; | ||||||
|  | 				$('td', $(this)).each(function (index, item) { | ||||||
|  | 					if (index < 3) | ||||||
|  | 						arrayItem[index] = parseFloat($(item).html()); | ||||||
|  | 				}); | ||||||
|  | 				plr_user_wallet_cash.push(arrayItem); | ||||||
|  | 			}); | ||||||
|  | 
 | ||||||
|  | 			$('#user_wallet_cash_national tr').has('td').each(function () { | ||||||
|  | 				var arrayItem = {}; | ||||||
|  | 				$('td', $(this)).each(function (index, item) { | ||||||
|  | 					if (index < 3) | ||||||
|  | 						arrayItem[index] = parseFloat($(item).html()); | ||||||
|  | 				}); | ||||||
|  | 				plr_user_wallet_cash_national.push(arrayItem); | ||||||
|  | 			}); | ||||||
|  | 
 | ||||||
|  | 			$.ajax({ | ||||||
|  | 				url: '<?php echo base_url('index.php/Gestion/config_wallet/update')?>', | ||||||
|  | 				type: 'POST', | ||||||
|  | 				dataType: 'json', | ||||||
|  | 				data: { | ||||||
|  | 					"type": "ilink", | ||||||
|  | 					"config": "user_wallet_cash", | ||||||
|  | 					"network_id": network_id, "id_config": id_config, | ||||||
|  | 					"plr_user_wallet_cash": plr_user_wallet_cash, | ||||||
|  | 					"plr_user_wallet_cash_national": plr_user_wallet_cash_national | ||||||
|  | 				}, | ||||||
|  | 				success: function (data) { | ||||||
|  | 					if (data == '200') { | ||||||
|  | 						Swal.fire({ | ||||||
|  | 							icon: 'success', | ||||||
|  | 							title: "<?php echo $this->lang->line('wallet_update')?>", | ||||||
|  | 							text: "<?php echo $this->lang->line('informations_updated')?>", | ||||||
|  | 							timer: 3000 | ||||||
|  | 						}).then(() => { | ||||||
|  | 							location.reload(); | ||||||
|  | 						}); | ||||||
|  | 						// alert("Les informations ont été mises à jour.") ? "" :
 | ||||||
|  | 					} else { | ||||||
|  | 						toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>"); | ||||||
|  | 					} | ||||||
|  | 				}, | ||||||
|  | 
 | ||||||
|  | 				error: function (resultat, statut, error) { | ||||||
|  | 					console.log(resultat + " " + error); | ||||||
|  | 					toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>"); | ||||||
|  | 				} | ||||||
|  | 			}); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 		} else { | ||||||
|  | 			$('#walletForm')[0].reportValidity(); | ||||||
|  | 		} | ||||||
|  | 	}); | ||||||
|  | 
 | ||||||
|  | </script> | ||||||
|  | <script type="text/javascript"> | ||||||
|  | 	// Paliers scripts
 | ||||||
|  | 	$(document).ready(function () { | ||||||
|  | 		$('[data-toggle="tooltip"]').tooltip(); | ||||||
|  | 		// Table 2
 | ||||||
|  | 		var actions2 = $("#user_wallet_cash td:last-child").html(); | ||||||
|  | 		// Append table with add row form on add new button click
 | ||||||
|  | 		$(".new2").click(function () { | ||||||
|  | 			if (!actions2) { | ||||||
|  | 				actions2 = '<a class="add add2" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>\n' + | ||||||
|  | 						'                            <a class="edit edit2" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>\n' + | ||||||
|  | 						'                            <a class="delete delete2" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>'; | ||||||
|  | 			} | ||||||
|  | 			$(this).attr("disabled", "disabled"); | ||||||
|  | 			var index = $("#user_wallet_cash tbody tr:last-child").index(); | ||||||
|  | 			var row = '<tr>' + | ||||||
|  | 					'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' + | ||||||
|  | 					'<td><input type="number" required class="form-control" name="max" id="max"></td>' + | ||||||
|  | 					'<td><input type="number" required class="form-control" name="taux" id="taux"></td>' + | ||||||
|  | 					'<td> ' + actions2 + '</td>' + | ||||||
|  | 					'</tr>'; | ||||||
|  | 			$("#user_wallet_cash").append(row); | ||||||
|  | 			$("#user_wallet_cash tbody tr").eq(index + 1).find(".add, .edit").toggle(); | ||||||
|  | 			$('[data-toggle="tooltip"]').tooltip(); | ||||||
|  | 		}); | ||||||
|  | 		// Add row on add button click
 | ||||||
|  | 		$(document).on("click", ".add2", function () { | ||||||
|  | 			var empty = false; | ||||||
|  | 			var input = $(this).parents("tr").find('input[type="number"]'); | ||||||
|  | 			var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val()); | ||||||
|  | 			var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val()); | ||||||
|  | 
 | ||||||
|  | 			input.each(function () { | ||||||
|  | 				if ($(this).attr('id') == 'min') { | ||||||
|  | 					if (min >= max) { | ||||||
|  | 						$(this).addClass("error"); | ||||||
|  | 						$(this)[0].reportValidity(); | ||||||
|  | 						empty = true; | ||||||
|  | 					} else { | ||||||
|  | 						$(this).removeClass("error"); | ||||||
|  | 					} | ||||||
|  | 				} else if ($(this).attr('id') == 'max') { | ||||||
|  | 					if (max <= min) { | ||||||
|  | 						$(this).addClass("error"); | ||||||
|  | 						$(this)[0].reportValidity(); | ||||||
|  | 						empty = true; | ||||||
|  | 					} else { | ||||||
|  | 						$(this).removeClass("error"); | ||||||
|  | 					} | ||||||
|  | 				} else { | ||||||
|  | 					if (!$(this)[0].checkValidity()) { | ||||||
|  | 						$(this).addClass("error"); | ||||||
|  | 						$(this)[0].reportValidity(); | ||||||
|  | 						empty = true; | ||||||
|  | 					} else { | ||||||
|  | 						$(this).removeClass("error"); | ||||||
|  | 					} | ||||||
|  | 				} | ||||||
|  | 			}); | ||||||
|  | 			$(this).parents("tr").find(".error").first().focus(); | ||||||
|  | 			if (!empty) { | ||||||
|  | 				input.each(function () { | ||||||
|  | 					$(this).parent("td").html($(this).val()); | ||||||
|  | 				}); | ||||||
|  | 				$(this).parents("tr").find(".add, .edit").toggle(); | ||||||
|  | 				$(".new2").removeAttr("disabled"); | ||||||
|  | 			} | ||||||
|  | 		}); | ||||||
|  | 		// Edit row on edit button click
 | ||||||
|  | 		$(document).on("click", ".edit2", function () { | ||||||
|  | 			$(this).parents("tr").find("td:not(:last-child)").each(function (index) { | ||||||
|  | 				if (index == 0) | ||||||
|  | 					$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">'); | ||||||
|  | 				if (index == 1) | ||||||
|  | 					$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">'); | ||||||
|  | 				if (index == 2) | ||||||
|  | 					$(this).html('<input type="number" required class="form-control"  min="0" value="' + $(this).text() + '">'); | ||||||
|  | 			}); | ||||||
|  | 			$(this).parents("tr").find(".add, .edit").toggle(); | ||||||
|  | 			$(".new2").attr("disabled", "disabled"); | ||||||
|  | 		}); | ||||||
|  | 		// Delete row on delete button click
 | ||||||
|  | 		$(document).on("click", ".delete2", function () { | ||||||
|  | 			$(this).parents("tr").remove(); | ||||||
|  | 			$(".new2").removeAttr("disabled"); | ||||||
|  | 		}); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 		// Table 8
 | ||||||
|  | 		var actions8 = $("#user_wallet_cash_national td:last-child").html(); | ||||||
|  | // Append table with add row form on add new button click
 | ||||||
|  | 		$(".new8").click(function () { | ||||||
|  | 			if (!actions8) { | ||||||
|  | 				actions8 = '<a class="add add8" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>\n' + | ||||||
|  | 						'                            <a class="edit edit8" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>\n' + | ||||||
|  | 						'                            <a class="delete delete8" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>'; | ||||||
|  | 			} | ||||||
|  | 			$(this).attr("disabled", "disabled"); | ||||||
|  | 			var index = $("#user_wallet_cash_national tbody tr:last-child").index(); | ||||||
|  | 			var row = '<tr>' + | ||||||
|  | 					'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' + | ||||||
|  | 					'<td><input type="number" required class="form-control" name="max" id="max"></td>' + | ||||||
|  | 					'<td><input type="number" required class="form-control" name="taux" id="taux"></td>' + | ||||||
|  | 					'<td> ' + actions8 + '</td>' + | ||||||
|  | 					'</tr>'; | ||||||
|  | 			$("#user_wallet_cash_national").append(row); | ||||||
|  | 			$("#user_wallet_cash_national tbody tr").eq(index + 1).find(".add, .edit").toggle(); | ||||||
|  | 			$('[data-toggle="tooltip"]').tooltip(); | ||||||
|  | 		}); | ||||||
|  | // Add row on add button click
 | ||||||
|  | 		$(document).on("click", ".add8", function () { | ||||||
|  | 			var empty = false; | ||||||
|  | 			var input = $(this).parents("tr").find('input[type="number"]'); | ||||||
|  | 			var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val()); | ||||||
|  | 			var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val()); | ||||||
|  | 
 | ||||||
|  | 			input.each(function () { | ||||||
|  | 				if ($(this).attr('id') == 'min') { | ||||||
|  | 					if (min >= max) { | ||||||
|  | 						$(this).addClass("error"); | ||||||
|  | 						$(this)[0].reportValidity(); | ||||||
|  | 						empty = true; | ||||||
|  | 					} else { | ||||||
|  | 						$(this).removeClass("error"); | ||||||
|  | 					} | ||||||
|  | 				} else if ($(this).attr('id') == 'max') { | ||||||
|  | 					if (max <= min) { | ||||||
|  | 						$(this).addClass("error"); | ||||||
|  | 						$(this)[0].reportValidity(); | ||||||
|  | 						empty = true; | ||||||
|  | 					} else { | ||||||
|  | 						$(this).removeClass("error"); | ||||||
|  | 					} | ||||||
|  | 				} else { | ||||||
|  | 					if (!$(this)[0].checkValidity()) { | ||||||
|  | 						$(this).addClass("error"); | ||||||
|  | 						$(this)[0].reportValidity(); | ||||||
|  | 						empty = true; | ||||||
|  | 					} else { | ||||||
|  | 						$(this).removeClass("error"); | ||||||
|  | 					} | ||||||
|  | 				} | ||||||
|  | 			}); | ||||||
|  | 			$(this).parents("tr").find(".error").first().focus(); | ||||||
|  | 			if (!empty) { | ||||||
|  | 				input.each(function () { | ||||||
|  | 					$(this).parent("td").html($(this).val()); | ||||||
|  | 				}); | ||||||
|  | 				$(this).parents("tr").find(".add, .edit").toggle(); | ||||||
|  | 				$(".new8").removeAttr("disabled"); | ||||||
|  | 			} | ||||||
|  | 		}); | ||||||
|  | // Edit row on edit button click
 | ||||||
|  | 		$(document).on("click", ".edit8", function () { | ||||||
|  | 			$(this).parents("tr").find("td:not(:last-child)").each(function (index) { | ||||||
|  | 				if (index == 0) | ||||||
|  | 					$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">'); | ||||||
|  | 				if (index == 1) | ||||||
|  | 					$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">'); | ||||||
|  | 				if (index == 2) | ||||||
|  | 					$(this).html('<input type="number" required class="form-control"  min="0" value="' + $(this).text() + '">'); | ||||||
|  | 			}); | ||||||
|  | 			$(this).parents("tr").find(".add, .edit").toggle(); | ||||||
|  | 			$(".new8").attr("disabled", "disabled"); | ||||||
|  | 		}); | ||||||
|  | // Delete row on delete button click
 | ||||||
|  | 		$(document).on("click", ".delete8", function () { | ||||||
|  | 			$(this).parents("tr").remove(); | ||||||
|  | 			$(".new8").removeAttr("disabled"); | ||||||
|  | 		}); | ||||||
|  | 
 | ||||||
|  | 	}); | ||||||
|  | 
 | ||||||
|  | </script> | ||||||
|  | @ -0,0 +1,621 @@ | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>"> | ||||||
|  | <link rel="stylesheet" | ||||||
|  | 	  href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" | ||||||
|  | 	  href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>"> | ||||||
|  | <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round|Open+Sans"> | ||||||
|  | <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | ||||||
|  | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> | ||||||
|  | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | ||||||
|  | <style type="text/css"> | ||||||
|  | 	.table-wrapper { | ||||||
|  | 		width: 700px; | ||||||
|  | 		margin: 30px auto; | ||||||
|  | 		background: #fff;
 | ||||||
|  | 		padding: 20px; | ||||||
|  | 		box-shadow: 0 1px 1px rgba(0, 0, 0, .05); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	.table-title { | ||||||
|  | 		padding-bottom: 10px; | ||||||
|  | 		margin: 0 0 10px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	.table-title h2 { | ||||||
|  | 		margin: 6px 0 0; | ||||||
|  | 		font-size: 22px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	.table-title .add-new { | ||||||
|  | 		float: right; | ||||||
|  | 		height: 30px; | ||||||
|  | 		font-weight: bold; | ||||||
|  | 		font-size: 12px; | ||||||
|  | 		text-shadow: none; | ||||||
|  | 		min-width: 100px; | ||||||
|  | 		border-radius: 50px; | ||||||
|  | 		line-height: 13px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	.table-title .add-new i { | ||||||
|  | 		margin-right: 4px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table { | ||||||
|  | 		table-layout: fixed; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table tr th, table.table tr td { | ||||||
|  | 		border-color: #e9e9e9;
 | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table th i { | ||||||
|  | 		font-size: 13px; | ||||||
|  | 		margin: 0 5px; | ||||||
|  | 		cursor: pointer; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table th:last-child { | ||||||
|  | 		width: 100px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table td a { | ||||||
|  | 		cursor: pointer; | ||||||
|  | 		display: inline-block; | ||||||
|  | 		margin: 0 5px; | ||||||
|  | 		min-width: 24px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table td a.add { | ||||||
|  | 		color: #27C46B;
 | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table td a.edit { | ||||||
|  | 		color: #FFC107;
 | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table td a.delete { | ||||||
|  | 		color: #E34724;
 | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table td i { | ||||||
|  | 		font-size: 19px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table td a.add i { | ||||||
|  | 		font-size: 24px; | ||||||
|  | 		margin-right: -1px; | ||||||
|  | 		position: relative; | ||||||
|  | 		top: 3px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table .form-control { | ||||||
|  | 		height: 32px; | ||||||
|  | 		line-height: 32px; | ||||||
|  | 		box-shadow: none; | ||||||
|  | 		border-radius: 2px; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	/*table.table .form-control.error {*/ | ||||||
|  | 	/*	border-color: #f50000;*/ | ||||||
|  | 	/*}*/ | ||||||
|  | 	.error { | ||||||
|  | 		border-color: #f50000;
 | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	table.table td .add { | ||||||
|  | 		display: none; | ||||||
|  | 	} | ||||||
|  | </style> | ||||||
|  | <?php | ||||||
|  | 
 | ||||||
|  | use Brick\Money\Context\CustomContext; | ||||||
|  | use Brick\Money\Money; | ||||||
|  | 
 | ||||||
|  | $context = new \Brick\Money\Context\AutoContext(); | ||||||
|  | $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); | ||||||
|  | ?>
 | ||||||
|  | 
 | ||||||
|  | <div class="content-wrapper"> | ||||||
|  | 	<!-- Content Header (Page header) --> | ||||||
|  | 	<section class="content-header"> | ||||||
|  | 
 | ||||||
|  | 		<h1> | ||||||
|  | 			<?php echo $this->lang->line('config_user').' - '.$this->lang->line('config_ilink_user_wallet_wallet'); ?>
 | ||||||
|  | 		</h1> | ||||||
|  | 		<?php | ||||||
|  | 		$site_url = base_url(); | ||||||
|  | 
 | ||||||
|  | 		if ($alert == "ok") { | ||||||
|  | 
 | ||||||
|  | 			if (!$success == "ok") { | ||||||
|  | 				?>
 | ||||||
|  | 				<div class='alert alert-danger alert-dismissible col-xs-6'> | ||||||
|  | 					<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button> | ||||||
|  | 					<h4><i class='icon fa fa-ban'></i> Erreur!</h4> | ||||||
|  | 					<?php echo $message; ?>
 | ||||||
|  | 				</div> | ||||||
|  | 
 | ||||||
|  | 				<?php | ||||||
|  | 			} else { | ||||||
|  | 				?>
 | ||||||
|  | 				<div class="alert alert-success alert-dismissible col-xs-6"> | ||||||
|  | 					<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | ||||||
|  | 					<h4><i class="icon fa fa-check"></i> Success!</h4> | ||||||
|  | 					<?php echo $message; ?>
 | ||||||
|  | 				</div> | ||||||
|  | 
 | ||||||
|  | 				<?php | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 		?>
 | ||||||
|  | 
 | ||||||
|  | 	</section> | ||||||
|  | 
 | ||||||
|  | 	<section class="content"> | ||||||
|  | 		<div class="row"> | ||||||
|  | 			<div class="col-lg-12"> | ||||||
|  | 				<div class="margin"> | ||||||
|  | 					<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-update" | ||||||
|  | 							style="width: 100%"><?php echo $this->lang->line('Modifier la configuration') ?></button>
 | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 		<div class="row centered"> | ||||||
|  | 			<div class="col-lg-6  col-xs-12"> | ||||||
|  | 				<div class="box"> | ||||||
|  | 					<div class="box-header"> | ||||||
|  | 						<h3 class="box-title"><?php echo $this->lang->line('rate_com_user_wallet_wallet_international'); ?></h3>
 | ||||||
|  | 					</div> | ||||||
|  | 					<!-- /.box-header --> | ||||||
|  | 					<div class="box-body table-responsive" style="overflow-x:auto;"> | ||||||
|  | 						<table class="table table-hover"> | ||||||
|  | 							<tbody> | ||||||
|  | 							<tr> | ||||||
|  | 								<th>Min</th> | ||||||
|  | 								<th>Max</th> | ||||||
|  | 								<th>Taux (%)</th> | ||||||
|  | 							</tr> | ||||||
|  | 							<?php | ||||||
|  | 							if ($plr_user_wallet_wallet != false) { | ||||||
|  | 								foreach ($plr_user_wallet_wallet->result() as $row) { | ||||||
|  | 									echo "<tr>
 | ||||||
|  | 																	<td>" . $fmt->format($row->min) . "</td> | ||||||
|  | 																	<td>" . $fmt->format($row->max) . "</td> | ||||||
|  | 																	  <td>" . $row->taux . "</td>" . '
 | ||||||
|  | 																	 </tr>'; | ||||||
|  | 								} | ||||||
|  | 							} | ||||||
|  | 							?>
 | ||||||
|  | 							</tbody> | ||||||
|  | 						</table> | ||||||
|  | 					</div> | ||||||
|  | 					<!-- /.box-body --> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 			<div class="col-lg-6  col-xs-12"> | ||||||
|  | 				<div class="box"> | ||||||
|  | 					<div class="box-header"> | ||||||
|  | 						<h3 class="box-title"><?php echo $this->lang->line('rate_com_user_wallet_wallet_national'); ?></h3>
 | ||||||
|  | 					</div> | ||||||
|  | 					<!-- /.box-header --> | ||||||
|  | 					<div class="box-body table-responsive" style="overflow-x:auto;"> | ||||||
|  | 						<table class="table table-hover"> | ||||||
|  | 							<tbody> | ||||||
|  | 							<tr> | ||||||
|  | 								<th>Min</th> | ||||||
|  | 								<th>Max</th> | ||||||
|  | 								<th>Taux (%)</th> | ||||||
|  | 							</tr> | ||||||
|  | 							<?php | ||||||
|  | 							if ($plr_user_wallet_wallet_national != false) { | ||||||
|  | 								foreach ($plr_user_wallet_wallet_national->result() as $row) { | ||||||
|  | 									echo "<tr>
 | ||||||
|  | 																	<td>" . $fmt->format($row->min) . "</td> | ||||||
|  | 																	<td>" . $fmt->format($row->max) . "</td> | ||||||
|  | 																	  <td>" . $row->taux . "</td>" . '
 | ||||||
|  | 																	 </tr>'; | ||||||
|  | 								} | ||||||
|  | 							} | ||||||
|  | 							?>
 | ||||||
|  | 							</tbody> | ||||||
|  | 						</table> | ||||||
|  | 					</div> | ||||||
|  | 					<!-- /.box-body --> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 
 | ||||||
|  | 		<div class="modal fade" id="modal-update"> | ||||||
|  | 			<div class="modal-dialog" style="max-width: 1200px; width: 100%;"> | ||||||
|  | 				<div class="modal-content"> | ||||||
|  | 					<div class="modal-header"> | ||||||
|  | 						<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||||||
|  | 							<span aria-hidden="true">×</span> | ||||||
|  | 						</button> | ||||||
|  | 						<h3 class="modal-title"><?php echo $this->lang->line('Configuration du wallet'); ?></h3>
 | ||||||
|  | 					</div> | ||||||
|  | 					<div class="modal-body"> | ||||||
|  | 						<form id="walletForm"> | ||||||
|  | 							<div class="row"> | ||||||
|  | 								<div class="col-lg-6"> | ||||||
|  | 									<div class="form-group" style="overflow-x:auto;"> | ||||||
|  | 										<div class="table-title"> | ||||||
|  | 											<div class="row"> | ||||||
|  | 												<div class="col-sm-8"> | ||||||
|  | 													<label for="nom" | ||||||
|  | 														   class="col-form-label"><?php echo $this->lang->line('rate_com_user_wallet_wallet_international'); ?></label>
 | ||||||
|  | 												</div> | ||||||
|  | 												<div class="col-sm-4"> | ||||||
|  | 													<button type="button" class="btn btn-info add-new new1"><i | ||||||
|  | 																class="fa fa-plus"></i> <?php echo $this->lang->line('new_level'); ?>
 | ||||||
|  | 													</button> | ||||||
|  | 												</div> | ||||||
|  | 											</div> | ||||||
|  | 										</div> | ||||||
|  | 										<table id="user_wallet_wallet" class="table table-bordered"> | ||||||
|  | 											<thead> | ||||||
|  | 											<tr> | ||||||
|  | 												<th>Min</th> | ||||||
|  | 												<th>Max</th> | ||||||
|  | 												<th><?php echo $this->lang->line('rate'); ?> (%)</th>
 | ||||||
|  | 												<th>Actions</th> | ||||||
|  | 											</tr> | ||||||
|  | 											</thead> | ||||||
|  | 											<tbody> | ||||||
|  | 											<?php | ||||||
|  | 											if ($plr_user_wallet_wallet != false) { | ||||||
|  | 												foreach ($plr_user_wallet_wallet->result() as $row) { | ||||||
|  | 													echo "<tr>
 | ||||||
|  | 																	<td>" . $row->min . "</td> | ||||||
|  | 																	<td>" . $row->max . "</td> | ||||||
|  | 																	  <td>" . $row->taux . "</td>" . '
 | ||||||
|  | 																	  <td> | ||||||
|  | 																		<a class="add add1" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>
 | ||||||
|  | 																		<a class="edit edit1" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>
 | ||||||
|  | 																		<a class="delete delete1" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>
 | ||||||
|  | 																	</td> | ||||||
|  | 																	 </tr>'; | ||||||
|  | 												} | ||||||
|  | 											} | ||||||
|  | 											?>
 | ||||||
|  | 											</tbody> | ||||||
|  | 										</table> | ||||||
|  | 									</div> | ||||||
|  | 								</div> | ||||||
|  | 								<div class="col-lg-6"> | ||||||
|  | 									<div class="form-group" style="overflow-x:auto;"> | ||||||
|  | 										<div class="table-title"> | ||||||
|  | 											<div class="row"> | ||||||
|  | 												<div class="col-sm-8"> | ||||||
|  | 													<label for="nom" | ||||||
|  | 														   class="col-form-label"><?php echo $this->lang->line('rate_com_user_wallet_wallet_national'); ?></label>
 | ||||||
|  | 												</div> | ||||||
|  | 												<div class="col-sm-4"> | ||||||
|  | 													<button type="button" class="btn btn-info add-new new7"><i | ||||||
|  | 																class="fa fa-plus"></i> <?php echo $this->lang->line('new_level'); ?>
 | ||||||
|  | 													</button> | ||||||
|  | 												</div> | ||||||
|  | 											</div> | ||||||
|  | 										</div> | ||||||
|  | 										<table id="user_wallet_wallet_national" class="table table-bordered"> | ||||||
|  | 											<thead> | ||||||
|  | 											<tr> | ||||||
|  | 												<th>Min</th> | ||||||
|  | 												<th>Max</th> | ||||||
|  | 												<th><?php echo $this->lang->line('rate'); ?> (%)</th>
 | ||||||
|  | 												<th>Actions</th> | ||||||
|  | 											</tr> | ||||||
|  | 											</thead> | ||||||
|  | 											<tbody> | ||||||
|  | 											<?php | ||||||
|  | 											if ($plr_user_wallet_wallet_national != false) { | ||||||
|  | 												foreach ($plr_user_wallet_wallet_national->result() as $row) { | ||||||
|  | 													echo "<tr>
 | ||||||
|  | 																	<td>" . $row->min . "</td> | ||||||
|  | 																	<td>" . $row->max . "</td> | ||||||
|  | 																	  <td>" . $row->taux . "</td>" . '
 | ||||||
|  | 																	  <td> | ||||||
|  | 																		<a class="add add7" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>
 | ||||||
|  | 																		<a class="edit edit7" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>
 | ||||||
|  | 																		<a class="delete delete7" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>
 | ||||||
|  | 																	</td> | ||||||
|  | 																	 </tr>'; | ||||||
|  | 												} | ||||||
|  | 											} | ||||||
|  | 											?>
 | ||||||
|  | 											</tbody> | ||||||
|  | 										</table> | ||||||
|  | 									</div> | ||||||
|  | 								</div> | ||||||
|  | 							</div> | ||||||
|  | 						</form> | ||||||
|  | 					</div> | ||||||
|  | 					<div class="modal-footer"> | ||||||
|  | 						<button type="button" class="btn btn-default pull-left" | ||||||
|  | 								data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
 | ||||||
|  | 						<button type="button" id="updateWallet" data-network-id="<?= $network_id ?>" | ||||||
|  | 								data-id-config="<?= $idConfig ?>" | ||||||
|  | 								class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
 | ||||||
|  | 					</div> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 	</section> | ||||||
|  | </div> | ||||||
|  | <!-- jQuery 3 --> | ||||||
|  | <script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script> | ||||||
|  | <!-- Bootstrap 3.3.7 --> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script> | ||||||
|  | <!-- DataTables --> | ||||||
|  | <script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script> | ||||||
|  | <!-- Slimscroll --> | ||||||
|  | <script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script> | ||||||
|  | <!-- FastClick --> | ||||||
|  | <script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script> | ||||||
|  | <!-- AdminLTE App --> | ||||||
|  | <script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script> | ||||||
|  | <!-- AdminLTE for demo purposes --> | ||||||
|  | <script src="<?php echo base_url('dist/js/demo.js') ?>"></script> | ||||||
|  | 
 | ||||||
|  | <script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script> | ||||||
|  | <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script> | ||||||
|  | <!-- ChartJS --> | ||||||
|  | <script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script> | ||||||
|  | <script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script> | ||||||
|  | 
 | ||||||
|  | <script> | ||||||
|  | 	toastr.options.closeButton = true; | ||||||
|  | 	toastr.options.closeMethod = 'fadeOut'; | ||||||
|  | 	toastr.options.closeDuration = 5000; | ||||||
|  | 	toastr.options.closeEasing = 'swing'; | ||||||
|  | 
 | ||||||
|  | 	$('#updateWallet').click(function () { | ||||||
|  | 		const network_id = $(this).data('network-id'); | ||||||
|  | 		const id_config = $(this).data('id-config'); | ||||||
|  | 		if ($('#walletForm')[0].checkValidity()) { | ||||||
|  | 
 | ||||||
|  | 			// Paliers
 | ||||||
|  | 			var plr_user_wallet_wallet = []; | ||||||
|  | 
 | ||||||
|  | 			var plr_user_wallet_wallet_national = []; | ||||||
|  | 
 | ||||||
|  | 			$('#user_wallet_wallet tr').has('td').each(function () { | ||||||
|  | 				var arrayItem = {}; | ||||||
|  | 				$('td', $(this)).each(function (index, item) { | ||||||
|  | 					if (index < 3) | ||||||
|  | 						arrayItem[index] = parseFloat($(item).html()); | ||||||
|  | 				}); | ||||||
|  | 				plr_user_wallet_wallet.push(arrayItem); | ||||||
|  | 			}); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 			$('#user_wallet_wallet_national tr').has('td').each(function () { | ||||||
|  | 				var arrayItem = {}; | ||||||
|  | 				$('td', $(this)).each(function (index, item) { | ||||||
|  | 					if (index < 3) | ||||||
|  | 						arrayItem[index] = parseFloat($(item).html()); | ||||||
|  | 				}); | ||||||
|  | 				plr_user_wallet_wallet_national.push(arrayItem); | ||||||
|  | 			}); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 			$.ajax({ | ||||||
|  | 				url: '<?php echo base_url('index.php/Gestion/config_wallet/update')?>', | ||||||
|  | 				type: 'POST', | ||||||
|  | 				dataType: 'json', | ||||||
|  | 				data: { | ||||||
|  | 					"type": "ilink", | ||||||
|  | 					"config":"user_wallet_wallet", | ||||||
|  | 					"network_id": network_id, "id_config": id_config, | ||||||
|  | 					"plr_user_wallet_wallet": plr_user_wallet_wallet, | ||||||
|  | 					"plr_user_wallet_wallet_national": plr_user_wallet_wallet_national, | ||||||
|  | 				}, | ||||||
|  | 				success: function (data) { | ||||||
|  | 					if (data == '200') { | ||||||
|  | 						Swal.fire({ | ||||||
|  | 							icon: 'success', | ||||||
|  | 							title: "<?php echo $this->lang->line('wallet_update')?>", | ||||||
|  | 							text: "<?php echo $this->lang->line('informations_updated')?>", | ||||||
|  | 							timer: 3000 | ||||||
|  | 						}).then(() => { | ||||||
|  | 							location.reload(); | ||||||
|  | 						}); | ||||||
|  | 						// alert("Les informations ont été mises à jour.") ? "" :
 | ||||||
|  | 					} else { | ||||||
|  | 						toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>"); | ||||||
|  | 					} | ||||||
|  | 				}, | ||||||
|  | 
 | ||||||
|  | 				error: function (resultat, statut, error) { | ||||||
|  | 					console.log(resultat + " " + error); | ||||||
|  | 					toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>"); | ||||||
|  | 				} | ||||||
|  | 			}); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 		} else { | ||||||
|  | 			$('#walletForm')[0].reportValidity(); | ||||||
|  | 		} | ||||||
|  | 	}); | ||||||
|  | </script> | ||||||
|  | <script type="text/javascript"> | ||||||
|  | 	// Paliers scripts
 | ||||||
|  | 	$(document).ready(function () { | ||||||
|  | 		$('[data-toggle="tooltip"]').tooltip(); | ||||||
|  | 		var actions1 = $("#user_wallet_wallet td:last-child").html(); | ||||||
|  | 		// Append table with add row form on add new button click
 | ||||||
|  | 		$(".new1").click(function () { | ||||||
|  | 			if (!actions1) { | ||||||
|  | 				actions1 = '<a class="add add1" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>\n' + | ||||||
|  | 						'                            <a class="edit edit1" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>\n' + | ||||||
|  | 						'                            <a class="delete delete1" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>'; | ||||||
|  | 			} | ||||||
|  | 			$(this).attr("disabled", "disabled"); | ||||||
|  | 			var index = $("#user_wallet_wallet tbody tr:last-child").index(); | ||||||
|  | 			var row = '<tr>' + | ||||||
|  | 					'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' + | ||||||
|  | 					'<td><input type="number"  required class="form-control" name="max" id="max"></td>' + | ||||||
|  | 					'<td><input type="number" required class="form-control" min="0" name="taux" id="taux"></td>' + | ||||||
|  | 					'<td> ' + actions1 + '</td>' + | ||||||
|  | 					'</tr>'; | ||||||
|  | 			$("#user_wallet_wallet").append(row); | ||||||
|  | 			$("#user_wallet_wallet tbody tr").eq(index + 1).find(".add, .edit").toggle(); | ||||||
|  | 			$('[data-toggle="tooltip"]').tooltip(); | ||||||
|  | 		}); | ||||||
|  | 		// Add row on add button click
 | ||||||
|  | 		$(document).on("click", ".add1", function () { | ||||||
|  | 			var empty = false; | ||||||
|  | 			var input = $(this).parents("tr").find('input[type="number"]'); | ||||||
|  | 			var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val()); | ||||||
|  | 			var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val()); | ||||||
|  | 
 | ||||||
|  | 			input.each(function () { | ||||||
|  | 				if ($(this).attr('id') == 'min') { | ||||||
|  | 					if (min >= max) { | ||||||
|  | 						$(this).addClass("error"); | ||||||
|  | 						$(this)[0].reportValidity(); | ||||||
|  | 						empty = true; | ||||||
|  | 					} else { | ||||||
|  | 						$(this).removeClass("error"); | ||||||
|  | 					} | ||||||
|  | 				} else if ($(this).attr('id') == 'max') { | ||||||
|  | 					if (max <= min) { | ||||||
|  | 						$(this).addClass("error"); | ||||||
|  | 						$(this)[0].reportValidity(); | ||||||
|  | 						empty = true; | ||||||
|  | 					} else { | ||||||
|  | 						$(this).removeClass("error"); | ||||||
|  | 					} | ||||||
|  | 				} else { | ||||||
|  | 					if (!$(this)[0].checkValidity()) { | ||||||
|  | 						$(this).addClass("error"); | ||||||
|  | 						$(this)[0].reportValidity(); | ||||||
|  | 						empty = true; | ||||||
|  | 					} else { | ||||||
|  | 						$(this).removeClass("error"); | ||||||
|  | 					} | ||||||
|  | 				} | ||||||
|  | 			}); | ||||||
|  | 			$(this).parents("tr").find(".error").first().focus(); | ||||||
|  | 			if (!empty) { | ||||||
|  | 				input.each(function () { | ||||||
|  | 					$(this).parent("td").html($(this).val()); | ||||||
|  | 				}); | ||||||
|  | 				$(this).parents("tr").find(".add, .edit").toggle(); | ||||||
|  | 				$(".new1").removeAttr("disabled"); | ||||||
|  | 			} | ||||||
|  | 		}); | ||||||
|  | 		// Edit row on edit button click
 | ||||||
|  | 		$(document).on("click", ".edit1", function () { | ||||||
|  | 			$(this).parents("tr").find("td:not(:last-child)").each(function (index) { | ||||||
|  | 				if (index == 0) | ||||||
|  | 					$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">'); | ||||||
|  | 				if (index == 1) | ||||||
|  | 					$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">'); | ||||||
|  | 				if (index == 2) | ||||||
|  | 					$(this).html('<input type="number" required class="form-control"  min="0" value="' + $(this).text() + '">'); | ||||||
|  | 			}); | ||||||
|  | 			$(this).parents("tr").find(".add, .edit").toggle(); | ||||||
|  | 			$(".new1").attr("disabled", "disabled"); | ||||||
|  | 		}); | ||||||
|  | 		// Delete row on delete button click
 | ||||||
|  | 		$(document).on("click", ".delete1", function () { | ||||||
|  | 			$(this).parents("tr").remove(); | ||||||
|  | 			$(".new1").removeAttr("disabled"); | ||||||
|  | 		}); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 		// Paliers nationaux
 | ||||||
|  | 
 | ||||||
|  | // Table 7
 | ||||||
|  | 		var actions7 = $("#user_wallet_wallet_national td:last-child").html(); | ||||||
|  | // Append table with add row form on add new button click
 | ||||||
|  | 		$(".new7").click(function () { | ||||||
|  | 			if (!actions7) { | ||||||
|  | 				actions7 = '<a class="add add7" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>\n' + | ||||||
|  | 						'                            <a class="edit edit7" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>\n' + | ||||||
|  | 						'                            <a class="delete delete7" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>'; | ||||||
|  | 			} | ||||||
|  | 			$(this).attr("disabled", "disabled"); | ||||||
|  | 			var index = $("#user_wallet_wallet_national tbody tr:last-child").index(); | ||||||
|  | 			var row = '<tr>' + | ||||||
|  | 					'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' + | ||||||
|  | 					'<td><input type="number" required class="form-control" name="max" id="max"></td>' + | ||||||
|  | 					'<td><input type="number" required class="form-control" name="taux" id="taux"></td>' + | ||||||
|  | 					'<td> ' + actions7 + '</td>' + | ||||||
|  | 					'</tr>'; | ||||||
|  | 			$("#user_wallet_wallet_national").append(row); | ||||||
|  | 			$("#user_wallet_wallet_national tbody tr").eq(index + 1).find(".add, .edit").toggle(); | ||||||
|  | 			$('[data-toggle="tooltip"]').tooltip(); | ||||||
|  | 		}); | ||||||
|  | // Add row on add button click
 | ||||||
|  | 		$(document).on("click", ".add7", function () { | ||||||
|  | 			var empty = false; | ||||||
|  | 			var input = $(this).parents("tr").find('input[type="number"]'); | ||||||
|  | 			var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val()); | ||||||
|  | 			var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val()); | ||||||
|  | 
 | ||||||
|  | 			input.each(function () { | ||||||
|  | 				if ($(this).attr('id') == 'min') { | ||||||
|  | 					if (min >= max) { | ||||||
|  | 						$(this).addClass("error"); | ||||||
|  | 						$(this)[0].reportValidity(); | ||||||
|  | 						empty = true; | ||||||
|  | 					} else { | ||||||
|  | 						$(this).removeClass("error"); | ||||||
|  | 					} | ||||||
|  | 				} else if ($(this).attr('id') == 'max') { | ||||||
|  | 					if (max <= min) { | ||||||
|  | 						$(this).addClass("error"); | ||||||
|  | 						$(this)[0].reportValidity(); | ||||||
|  | 						empty = true; | ||||||
|  | 					} else { | ||||||
|  | 						$(this).removeClass("error"); | ||||||
|  | 					} | ||||||
|  | 				} else { | ||||||
|  | 					if (!$(this)[0].checkValidity()) { | ||||||
|  | 						$(this).addClass("error"); | ||||||
|  | 						$(this)[0].reportValidity(); | ||||||
|  | 						empty = true; | ||||||
|  | 					} else { | ||||||
|  | 						$(this).removeClass("error"); | ||||||
|  | 					} | ||||||
|  | 				} | ||||||
|  | 			}); | ||||||
|  | 			$(this).parents("tr").find(".error").first().focus(); | ||||||
|  | 			if (!empty) { | ||||||
|  | 				input.each(function () { | ||||||
|  | 					$(this).parent("td").html($(this).val()); | ||||||
|  | 				}); | ||||||
|  | 				$(this).parents("tr").find(".add, .edit").toggle(); | ||||||
|  | 				$(".new7").removeAttr("disabled"); | ||||||
|  | 			} | ||||||
|  | 		}); | ||||||
|  | // Edit row on edit button click
 | ||||||
|  | 		$(document).on("click", ".edit7", function () { | ||||||
|  | 			$(this).parents("tr").find("td:not(:last-child)").each(function (index) { | ||||||
|  | 				if (index == 0) | ||||||
|  | 					$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">'); | ||||||
|  | 				if (index == 1) | ||||||
|  | 					$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">'); | ||||||
|  | 				if (index == 2) | ||||||
|  | 					$(this).html('<input type="number" required class="form-control"  min="0" value="' + $(this).text() + '">'); | ||||||
|  | 			}); | ||||||
|  | 			$(this).parents("tr").find(".add, .edit").toggle(); | ||||||
|  | 			$(".new7").attr("disabled", "disabled"); | ||||||
|  | 		}); | ||||||
|  | // Delete row on delete button click
 | ||||||
|  | 		$(document).on("click", ".delete7", function () { | ||||||
|  | 			$(this).parents("tr").remove(); | ||||||
|  | 			$(".new7").removeAttr("disabled"); | ||||||
|  | 		}); | ||||||
|  | 	}); | ||||||
|  | </script> | ||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Loading…
	
		Reference in New Issue