Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class HYIP_Manager_Pro_Database_Helper
- {
- private $_logfilepath = './HYIP_Manager_Pro_Database_Helper_php_log.txt';
- private $_servername = '';
- private $_username = '';
- private $_password = '';
- private $_dbname = '';
- private $PDOConn;
- public function __construct($ServerName, $UserName, $Password, $databaseName)
- {
- $this->_servername = $ServerName;
- $this->_username = $UserName;
- $this->_password = $Password;
- $this->_dbname = $databaseName;
- $this->PDOConn = new PDO('mysql:host=' . $ServerName . ';dbname=' . $databaseName, $UserName, $Password);
- $this->PDOConn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- }
- public function getHm2Processings()
- {
- $sql = 'select * from hm2_processings;';
- $stmt = $this->PDOConn->query($sql);
- $hm2_processings_data = $stmt->fetchAll(PDO::FETCH_ASSOC);
- return $hm2_processings_data;
- }
- public function checkHm2Processings($hm2_processings_data = null)
- {
- if ($hm2_processings_data == null) {
- $hm2_processings_data = $this->getHm2Processings();
- }
- $Bitcoin_Found = false;
- $Ethereum_Found = false;
- $Litecoin_Found = false;
- $Dash_Found = false;
- $BitcoinCash_Found = false;
- $Stellar_Found = false;
- $Zcash_Found = false;
- $TRON_Found = false;
- $Dai_Found = false;
- $USDCoin_Found = false;
- $PerfectMoney_Found = false;
- $Payeer_Found = false;
- foreach ($hm2_processings_data as $key => $value) {
- if ($value['name'] == 'Bitcoin') {
- $Bitcoin_Found = true;
- }
- if ($value['name'] == 'Ethereum') {
- $Ethereum_Found = true;
- }
- if ($value['name'] == 'Litecoin') {
- $Litecoin_Found = true;
- }
- }
- $Name = '';
- $DefaultInfoFields = '';
- $DefaultStatus = '0';
- $DefaultDescription = 'Payment Processor';
- $DefaultVerify = '0';
- $DefaultLang = '';
- $stmt = $this->PDOConn->prepare('INSERT INTO `hm2_processings` ( `name`, `infofields`, `status`, `description`, `verify`, `lang` ) VALUES ( :Name, :InfoFields, :Status, :Description, :Verify, :Lang);');
- $stmt->bindParam('Name', $Name, PDO::PARAM_STR, 255);
- $stmt->bindParam('InfoFields', $DefaultInfoFields, PDO::PARAM_INT, 1);
- $stmt->bindParam('Status', $DefaultStatus, PDO::PARAM_STR, 255);
- $stmt->bindParam('Description', $DefaultDescription, PDO::PARAM_STR, 255);
- $stmt->bindParam('Verify', $DefaultVerify, PDO::PARAM_INT, 1);
- $stmt->bindParam('Lang', $DefaultLang, PDO::PARAM_STR, 255);
- if ($Bitcoin_Found == false) {
- $Name = 'Bitcoin';
- $DefaultDescription = 'Send your funds to account: <b>Your Bitcoin address</b>';
- $stmt->execute();
- $BitcoinLastInsertId = $this->PDOConn->lastInsertId();
- }
- if ($Ethereum_Found == false) {
- $Name = 'Ethereum';
- $DefaultDescription = 'Send your funds to account: <b>Your Ethereum address</b>';
- $stmt->execute();
- ........................................................
- ..............................
- ...............
Advertisement
Add Comment
Please, Sign In to add comment