public function objectData($params) { $data = $this->objectedit->data($params); logCreate('driver:' . json_encode($data)); return $data; //$this->object->editData($params); }
public function objectData($params) { if (count($params) == 0) { return false; } $driver = $this->CI->stockdriver; $data = $driver->objectData($params); logCreate('libs:' . json_encode($data)); return $data; }
function _runApi($url, $parameter = array()) { global $maxTime; $CI =& get_instance(); if (count($parameter)) { $logTxt = "func:_runApi| url:{$url}| param:" . http_build_query($parameter, '', '&'); } else { $logTxt = "func:_runApi| url:{$url}"; } logCreate('API: ' . $logTxt); if (count($parameter)) { //logCreate( 'API: '.'param:'.print_r($parameter,1),'debug'); logCreate('API: ' . "url:{$url}| param:" . print_r($parameter, 1), 'debug'); } else { logCreate('API: param:' . print_r(parse_url($url), 1), 'debug'); } $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); if ($parameter != '' && count($parameter) != 0) { curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_TIMEOUT, $maxTime); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($parameter, '', '&')); if (isset($_SERVER['HTTP_USER_AGENT'])) { curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); } logCreate('API:POST', 'info'); } else { logCreate('API:GET', 'info'); } $response = curl_exec($curl); if (0 != curl_errno($curl)) { $response = new stdclass(); $response->code = '500'; $response->message = curl_error($curl); } else { $response0 = $response; $response = json_decode($response, 1); if (!is_array($response)) { $response = $response0; } } curl_close($curl); if (!isset($response0)) { $response0 = '?'; } logCreate('API |url:' . $url . "|raw:" . (is_array($response) ? 'total array/obj=' . count($response) : $response0)); return $response; }
function total() { $sql = "select count(id) total from " . $this->table; $data = dbFetchOne($sql); return isset($data['total']) ? $data['total'] : false; if (!$this->db->simple_query($sql)) { logCreate('sql:' . $sql . '|' . $this->db->error(), 'error'); return false; } else { $query = $this->db->query($sql); if ($query->num_rows() > 0) { $row = $query->row_array(); return $row['total']; } } return false; }
function checkView($target, $stat = 'view') { //return true; if (!is_file("views/" . $target . ".php") && ($stat == 'view' || $stat == 'body')) { $txt = "<?php \n/****\n\tviews\t: {$target}\n\tcreated\t: " . date("d-m-Y H:i:s") . "\n\tBy\t\t: CI3 Stock Controllers\n****/\ndefined('BASEPATH') OR exit('No direct script access allowed');"; if ($stat == 'view') { $txt .= "\n?>\n\n<div class='container'><div class='row'>\n\n<!-- content Start-->\n\n<!-- content End-->\n\n</div></div>"; } file_put_contents("views/" . $target . ".php", $txt, LOCK_EX); logCreate('create file:' . "views/" . $target . ".php"); } else { } if (!is_file("assets/js/" . $target) && $stat == 'js') { $txt = "/****\n\tJavascript\t: {$target}\n\tcreated\t: " . date("d-m-Y H:i:s") . "\n\tBy\t\t: CI3 Stock Controllers\n****/"; file_put_contents("assets/js/" . $target, $txt, LOCK_EX); logCreate('create file:' . "assets/js/" . $target); } else { } }
function logCreateDir($dir) { $a = explode('/', trim($dir)); $dir_str = ''; foreach ($a as $id => $path) { if ($path == '') { break; } $dir_str .= $id != 0 ? "/{$path}" : $path; // logCreate("path:{$dir_str}"); if (!is_dir($dir_str)) { @mkdir($dir_str); // logCreate("create:{$dir_str}"); } else { logCreate("dir avaiable:{$dir_str}"); } } // logCreate("dir avaiable:{$dir}"); }
private function showView() { $name = $this->uri->segment(2, ''); if ($name != '') { $jsScript = $this->param['folder'] . $this->uri->segment(2) . ".js"; $this->param['dataUrl'] = $this->uri->segment(1) . "_" . $name; $this->param['script'] = $this->param['type'] = $name; $this->param['openScript'] = $jsScript; logCreate('open script:' . $jsScript . '|data:' . $this->uri->segment(1) . "_" . $name); if (isset($this->param['content']) && !is_array($this->param['content'])) { $this->param['load_view'] = $this->param['folder'] . $this->param['content'] . '_view'; } else { } //$this->checkView( $this->param['load_view'] ); } else { $controller = $this->uri->segment(1); if ($controller == '') { $controller = 'forex'; } redirect(base_url() . $controller . "/index", "refresh"); } //logCreate($this->param); $this->load->view('base_view', $this->param); }
logCreate('not valid code url:' . $url, 'error'); logCreate('url:' . $url . '|respon:' . $result, 'error'); $res = lang('forex_activation_not_valid'); } if (!isset($res) && (int) $result == 99) { logCreate('Account had been actived url:' . $url, 'error'); logCreate('url:' . $url . '|respon:' . $result, 'error'); $res = lang('forex_activation_account_active'); } if (!isset($res) && (int) $result == 1) { $this->forex->accountCreate($data['userid']); $res = lang('forex_done'); } if (!isset($res) && (int) $result != 1) { $res = lang('forex_activation_not_valid'); logCreate('url:' . $url . '|respon:' . $result, 'error'); logCreate('not valid url:' . $url, 'error'); } } if (!isset($res)) { //print lang('forex_done') ; } else { print "<br/>" . $res; } } else { } } else { print lang('forex_wait'); } ?> </div>
function __CONSTRUCT() { parent::__construct(); date_default_timezone_set('Asia/Jakarta'); $this->param['today'] = date('Y-m-d'); $this->param['folder'] = 'forex/'; $this->load->helper('form'); $this->load->helper('formtable'); $this->load->helper('language'); $this->load->helper('api'); $this->load->helper('db'); $this->load->model('forex_model', 'forex'); $this->load->model('country_model', 'country'); $defaultLang = "english"; $this->lang->load('forex', $defaultLang); $this->param['fileCss'] = array('css/style.css', 'contact-form-7-css' => 'css/salmaforex/style.css', 'rs-plugin-settings-css' => 'css/salmaforex/settings.css', 'wpt-custom-login-css' => 'css/salmaforex/custom-login.css', 'theme-bootstrap-css' => 'css/envision/bootstrap.css', 'theme-frontend-style-css' => 'css/envision/style.css?ver=384753e655020ba892b1123f6ddf06b2', 'theme-frontend-extensions-css' => 'css/envision/extensions.css', 'theme-bootstrap-responsive-css' => 'css/envision/bootstrap-responsive.css', 'theme-bootstrap-responsive-1170-css' => 'css/envision/bootstrap-responsive-1170.css', 'theme-frontend-responsive-css' => 'css/envision/responsive.css', 'ttheme-fontawesome-css' => 'css/module.fontawesome/source/css/font-awesome.min.css', 'theme-icomoon-css' => 'css/module.fontawesome/source/css/font-awesome.min.css', 'theme-skin' => 'css/Dark-Blue-Skin_cf846b6937291eb00e63741d95d1ce40.css', 'css/cupertino/jquery-ui-1.10.3.custom.min.css'); $this->param['fileJs'] = array('js/jquery-1.11.3.js', 'js/jquery-migrate.min.js', 'js/rs-plugin/js/jquery.themepunch.tools.min.js', 'js/rs-plugin/js/jquery.themepunch.revolution.min.js'); $this->param['shortlink'] = site_url(); $this->param['footerJS'] = array('js/envision-2.0.9.4/lib/js/common.js', 'js/envision-2.0.9.4/lib/js/modernizr-2.6.2-respond-1.1.0.min.js', 'js/envision-2.0.9.4/lib/js/noconflict.js', 'js/envision-2.0.9.4/cloudfw/js/webfont.js', 'js/envision-2.0.9.4/lib/js/jquery.prettyPhoto.js', 'js/envision-2.0.9.4/lib/js/extensions.js', 'js/envision-2.0.9.4/lib/js/retina.js', 'js/envision-2.0.9.4/lib/js/queryloader2.js', 'js/envision-2.0.9.4/lib/js/waypoints.min.js', 'js/envision-2.0.9.4/lib/js/waypoints-sticky.js', 'js/envision-2.0.9.4/lib/js/jquery.viewport.mini.js', 'js/envision-2.0.9.4/lib/js/jquery.flexslider.js', 'js/jquery-ui-1.9.2.min.js', 'js/bootstrap.js', 'js/forex.js'); $this->param['description'] = "Trade now with the best and most transparent forex STP broker"; if ($this->input->post()) { logCreate($this->input->post(), 'post'); } }
function dbFetch($sql, $type = 0, $debug = 0) { $query = dbQuery($sql, $debug); if (!$query) { return false; } else { $data = array(); if ($type == 0) { foreach ($query->result_array() as $row) { $data[] = $row; } } else { foreach ($query->result() as $row) { $data[] = $row; } } if ($debug == 1) { logCreate('data total:' . $query->num_rows() . '| list:' . json_encode($data)); } else { } return $data; } }
public function test() { $this->param['baseFolder'] = 'demo/'; $this->param['folder'] = 'demo/'; $this->param['content'] = 'table'; //$this->config->load('logConfig', TRUE); //$logConfig = $this->config->item( 'logConfig'); //var_dump( $logConfig ); die('--'); logCreate('hello'); logConfig('hello core', 'logCore'); logConfig('hello error', 'logError'); $this->load->view('demo/baseAdmin_view', $this->param); }
$param['isfxflg'] = 1; $param['isdemoflg'] = $this->forex->demo; $param['isntdindexflg'] = 0; $param['isntdcfdflg'] = 0; $param['wlcode'] = 'NFX'; $param['displayLanguage'] = 'EN'; $param['ibcustid'] = (int) $dt['username']; $param['amsgroup'] = 'NFX_Salma'; $param['fxgroup'] = 'NFXSalma_USD'; $url .= "?" . http_build_query($param); $arr['url'] = $url; $result = _runApi($url); if ((int) $result == 1) { $id = $this->forex->accountActivation($row['id'], $result); $arr['accountActivation'] = $id; } else { $arr['accountCreate'] = false; logCreate('url:' . $this->forex->forexUrl() . '|respon:' . $result . '|url:' . $url, 'error'); } $arr['result'] = $result; $data[] = $arr; } $succes = true; $content = ob_get_contents(); ob_end_clean(); $result = array('body' => $content, 'data' => $data); //==========IF OK if ($succes === true) { $result['succes'] = true; } echo json_encode($result);