Viewing file: Provider_api.php (8.91 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Provider_Api {
public function get_number($provider, $country, $service, $operator = '') {
$number = array();
if($provider == 'fivesim') {
get_instance()->load->library('fivesim_api');
$number = get_instance()->fivesim_api->get_number($country, $service,$operator);
}
if($provider == 'smsacktiwator') {
get_instance()->load->library('smsacktiwator_api');
$number = get_instance()->smsacktiwator_api->get_number($country, $service);
}
if($provider == 'smsactivate') {
get_instance()->load->library('smsactivate_api');
$number = get_instance()->smsactivate_api->get_number($country, $service);
}
if($provider == 'smspva') {
get_instance()->load->library('smspva_api');
$number = get_instance()->smspva_api->get_number($country, $service);
}
if($provider == 'pvapins') {
get_instance()->load->library('pvapins_api');
$number = get_instance()->pvapins_api->get_number($country, $service);
}
if($provider == 'onlinesim') {
get_instance()->load->library('onlinesim_api');
$number = get_instance()->onlinesim_api->get_number($country, $service);
}
return $number;
}
public function get_message($provider, $number_id) {
$message = array();
if($provider == 'fivesim') {
get_instance()->load->library('fivesim_api');
$message = get_instance()->fivesim_api->get_message($number_id);
}
if($provider == 'smsacktiwator') {
get_instance()->load->library('smsacktiwator_api');
$message = get_instance()->smsacktiwator_api->get_message($number_id);
}
if($provider == 'smsactivate') {
get_instance()->load->library('smsactivate_api');
$message = get_instance()->smsactivate_api->get_message($number_id);
}
if($provider == 'smspva') {
get_instance()->load->library('smspva_api');
$message = get_instance()->smspva_api->get_message($number_id);
}
if($provider == 'pvapins') {
get_instance()->load->library('pvapins_api');
$message = get_instance()->pvapins_api->get_message($number_id);
}
if($provider == 'onlinesim') {
get_instance()->load->library('onlinesim_api');
$message = get_instance()->onlinesim_api->get_message($number_id);
}
return $message;
}
public function get_countries($provider) {
$services = array();
if($provider == 'fivesim') {
get_instance()->load->library('fivesim_api');
$services = get_instance()->fivesim_api->get_countries();
}
if($provider == 'smsacktiwator') {
get_instance()->load->library('smsacktiwator_api');
$services = get_instance()->smsacktiwator_api->get_countries();
}
if($provider == 'smsactivate') {
get_instance()->load->library('smsactivate_api');
$services = get_instance()->smsactivate_api->get_countries();
}
if($provider == 'smspva') {
get_instance()->load->library('smspva_api');
$services = get_instance()->smspva_api->get_countries();
}
if($provider == 'pvapins') {
get_instance()->load->library('pvapins_api');
$services = get_instance()->pvapins_api->get_countries();
}
if($provider == 'onlinesim') {
get_instance()->load->library('onlinesim_api');
$services = get_instance()->onlinesim_api->get_countries();
}
return $services;
}
public function get_service_price($provider, $country, $service) {
$price = "";
if($provider == 'fivesim') {
get_instance()->load->library('fivesim_api');
$price = get_instance()->fivesim_api->get_service_price($country, $service);
}
if($provider == 'smsacktiwator') {
get_instance()->load->library('smsacktiwator_api');
$price = get_instance()->smsacktiwator_api->get_service_price($country, $service);
}
if($provider == 'smsactivate') {
get_instance()->load->library('smsactivate_api');
$price = get_instance()->smsactivate_api->get_service_price($country, $service);
}
if($provider == 'smspva') {
get_instance()->load->library('smspva_api');
$price = get_instance()->smspva_api->get_service_price($country, $service);
}
if($provider == 'pvapins') {
get_instance()->load->library('pvapins_api');
$price = get_instance()->pvapins_api->get_service_price($country, $service);
}
if($provider == 'onlinesim') {
get_instance()->load->library('onlinesim_api');
$price = get_instance()->onlinesim_api->get_service_price($country, $service);
}
return $price;
}
public function get_services_by_country($provider, $country) {
$services = array();
if($provider == 'fivesim') {
get_instance()->load->library('fivesim_api');
$services = get_instance()->fivesim_api->get_services_by_country($country);
}
if($provider == 'smsacktiwator') {
get_instance()->load->library('smsacktiwator_api');
$services = get_instance()->smsacktiwator_api->get_services_by_country($country);
}
if($provider == 'smsactivate') {
get_instance()->load->library('smsactivate_api');
$services = get_instance()->smsactivate_api->get_services_by_country($country);
}
if($provider == 'smspva') {
get_instance()->load->library('smspva_api');
$services = get_instance()->smspva_api->get_services_by_country($country);
}
if($provider == 'pvapins') {
get_instance()->load->library('pvapins_api');
$services = get_instance()->pvapins_api->get_services_by_country($country);
}
if($provider == 'onlinesim') {
get_instance()->load->library('onlinesim_api');
$services = get_instance()->onlinesim_api->get_services_by_country($country);
}
return $services;
}
public function get_service_stock($provider, $country, $service) {
$stock = 0;
if($provider == 'fivesim') {
get_instance()->load->library('fivesim_api');
$stock = get_instance()->fivesim_api->get_service_stock($country, $service);
}
if($provider == 'smsacktiwator') {
get_instance()->load->library('smsacktiwator_api');
$stock = get_instance()->smsacktiwator_api->get_service_stock($country, $service);
}
if($provider == 'smsactivate') {
get_instance()->load->library('smsactivate_api');
$stock = get_instance()->smsactivate_api->get_service_stock($country, $service);
}
if($provider == 'smspva') {
get_instance()->load->library('smspva_api');
$stock = get_instance()->smspva_api->get_service_stock($country, $service);
}
if($provider == 'pvapins') {
get_instance()->load->library('pvapins_api');
$stock = get_instance()->pvapins_api->get_service_stock($country, $service);
}
if($provider == 'onlinesim') {
get_instance()->load->library('onlinesim_api');
$stock = get_instance()->onlinesim_api->get_service_stock($country, $service);
}
return $stock;
}
public function cancel_number($provider, $number_id) {
if($provider == 'fivesim') {
get_instance()->load->library('fivesim_api');
get_instance()->fivesim_api->cancel_number($number_id);
}
if($provider == 'smsacktiwator') {
get_instance()->load->library('smsacktiwator_api');
get_instance()->smsacktiwator_api->cancel_number($number_id);
}
if($provider == 'smsactivate') {
get_instance()->load->library('smsactivate_api');
get_instance()->smsactivate_api->cancel_number($number_id);
}
if($provider == 'smspva') {
get_instance()->load->library('smspva_api');
get_instance()->smspva_api->cancel_number($number_id);
}
if($provider == 'pvapins') {
get_instance()->load->library('pvapins_api');
get_instance()->pvapins_api->cancel_number($number_id);
}
if($provider == 'onlinesim') {
get_instance()->load->library('onlinesim_api');
get_instance()->onlinesim_api->cancel_number($number_id);
}
}
}
?>
|