function makeLoginBox() { $CI =& get_instance(); $CI->make->sDiv(array('class' => 'center')); $CI->make->sDiv(array('class' => 'form-box login-shadow-box')); $CI->make->sDiv(array('class' => 'header')); $CI->make->span('PointOne'); $CI->make->eDiv(); $CI->make->sForm('site/go_login', array('id' => 'login-form')); $CI->make->sDiv(array('class' => 'body bg-white')); $CI->make->input(null, 'username', null, 'username', array('class' => 'rOkay'), null, fa('fa-user')); $CI->make->pwd(null, 'password', null, 'password', array('class' => 'rOkay'), null, fa('fa-lock')); $CI->make->sDivRow(); $CI->make->sDivCol(4, 'right', 8); $CI->make->button('Sign In', array('id' => 'login-btn', 'class' => 'btn-block btn-flat bg-olive', 'style' => 'padding:6px;'), 'success'); $CI->make->eDivCol(); $CI->make->eDivRow(); $CI->make->eDiv(); $CI->make->eForm(); $CI->make->sDiv(array('class' => 'footer')); $CI->make->eDiv(); $CI->make->eDiv(); $CI->make->eDiv(); return $CI->make->code(); }
function query_load($get_query) { $q = mysqli_query(Gbl::get('db'), $get_query) or die("Query failed, please consult the webmaster"); $arr = array(); while($r = fa($q)) { $arr[] = $r; } return($arr); }
function restartPage() { $CI =& get_instance(); $CI->make->sDivRow(); $CI->make->sDivCol(6, 'left', 3); $CI->make->sBox('solid'); $CI->make->sBoxBody(); $CI->make->sDiv(array('style' => 'margin:10px;')); $CI->make->H(4, 'Warning! this will remove all transactions and reset the POS!', array('class' => 'text-center', 'style' => 'color:red;')); $CI->make->button(fa('fa-refresh') . ' Restart POS', array('id' => 'restart-pos', 'class' => 'btn-block'), 'danger'); $CI->make->eDiv(); $CI->make->eBoxBody(); $CI->make->eBox(); $CI->make->eDivCol(); $CI->make->eDivRow(); return $CI->make->code(); }
public function load_repos() { $url = "https://api.github.com/user/repos"; $this->api_call($url); $this->repos = $this->json_response; $sq = query("SELECT * FROM repo WHERE user_id = '" . escape($_SESSION['user']['github_id']) . "'"); query("UPDATE wallet SET created = NOW() WHERE user_id='" . escape($_SESSION['user']['github_id']) . "'"); while ($r = fa($sq)) { $status[$r['name']] = $r; } foreach ($this->repos as $k => $v) { if (array_key_exists($v->full_name, $status)) { $this->repos[$k]->status = $status[$v->full_name]['status']; $this->repos[$k]->address = $status[$v->full_name]['address']; if ($status[$v->full_name]['status'] == 2) { $live_data = query_assoc("SELECT * FROM wallet WHERE bitcoin_address = '" . escape($status[$v->full_name]['address']) . "'"); $this->repos[$k]->confirmations = $live_data['confirmations']; $this->repos[$k]->transaction_hash = $live_data['last_transaction_hash']; } elseif ($status[$v->full_name]['status'] >= 3) { $hash = query_grab("SELECT transaction_hash FROM asset WHERE name = '" . escape($v->full_name) . "'"); if (substr($hash, 0, 1) == '"' && substr($hash, -1, 1) == '"') { $hash = substr($hash, 1, strlen($hash) - 2); } $this->repos[$k]->transaction_hash = $hash; } } else { $this->repos[$k]->status = 0; } } return; //$user_url = $this->json_response->url; //$this->api_call($user_url); $repos_url = $this->json_response->repos_url; $this->api_call($repos_url); $contributors_url = $this->json_response[0]->url . '/collaborators'; $this->api_call($contributors_url); }
function keyMap($combiner, $in, $keys = null) { if (!empty($in)) { if (!isset($keys)) { $keys = array_keys($in); $in = array_values($in); } return construct(fa($combiner, array(first($keys), first($in))), keyMap($combiner, rest($in), rest($keys))); } else { return array(); } //takes a combiner function }
public function testFa() { $this->assertEquals('<i class="fa fa-foo "></i>', fa('foo')); }
public function process_new_assets() { $q = query("SELECT * FROM address WHERE status >= 6 and asset_id <1"); while ($r = fa($q)) { $this->store_asset($r['repo']); die; } }
function onScrNumOnlyTarget($tblId, $target, $enterBtn = 'enter-btn', $returnBtnId = '', $returnBtnCaption = '', $useDot = true) { $CI =& get_instance(); $CI->make->sDiv(array('class' => 'screen-con')); $CI->make->sTable(array('class' => 'screen-pad', 'cellpadding' => '5', 'cellspacing' => '200', 'id' => $tblId, 'target' => $target)); // $CI->make->sRow(); // $textbox = $CI->make->textbox($inputName,null,null,array('class'=>'form-control pad-input','return'=>true)); // $CI->make->td($textbox,array('colspan'=>3,'class'=>'scr-pad-input')); // $CI->make->eRow(); $CI->make->sRow(); $CI->make->td(1, array('class' => 'scr-pad-key tsc_awb_large tsc_flat')); $CI->make->td(2, array('class' => 'scr-pad-key tsc_awb_large tsc_flat')); $CI->make->td(3, array('class' => 'scr-pad-key tsc_awb_large tsc_flat')); $CI->make->eRow(); $CI->make->sRow(); $CI->make->td(4, array('class' => 'scr-pad-key tsc_awb_large tsc_flat')); $CI->make->td(5, array('class' => 'scr-pad-key tsc_awb_large tsc_flat')); $CI->make->td(6, array('class' => 'scr-pad-key tsc_awb_large tsc_flat')); $CI->make->eRow(); $CI->make->sRow(); $CI->make->td(7, array('class' => 'scr-pad-key tsc_awb_large tsc_flat')); $CI->make->td(8, array('class' => 'scr-pad-key tsc_awb_large tsc_flat')); $CI->make->td(9, array('class' => 'scr-pad-key tsc_awb_large tsc_flat')); $CI->make->eRow(); $CI->make->sRow(); $CI->make->td($useDot ? '.' : '-', array('class' => 'scr-pad-key tsc_awb_large tsc_flat')); $CI->make->td(0, array('class' => 'scr-pad-key tsc_awb_large tsc_flat')); $CI->make->td(lng('btn_del'), array('class' => 'scr-pad-key tsc_awb_large btn-del tsc_awb_yellow tsc_flat')); $CI->make->eRow(); $CI->make->sRow(); $CI->make->td(lng('btn_enter'), array('colspan' => 3, 'id' => $enterBtn, 'class' => 'scr-pad-key btn-enter tsc_awb_large tsc_awb_green tsc_flat')); $CI->make->eRow(); if ($returnBtnCaption != '') { $CI->make->sRow(); $CI->make->td(fa('fa-reply fa-lg') . ' ' . $returnBtnCaption, array('colspan' => 3, 'id' => $returnBtnId, 'class' => 'scr-pad-key tsc_awb_large tsc_awb_red tsc_flat')); $CI->make->eRow(); } $CI->make->eTable(); $CI->make->eDiv(); return $CI->make->code(); }
<?php include 'a.php'; include 'b.php'; fa(); fb();
public function profile() { $this->load->helper('core/user_helper'); $data = $this->syter->spawn('profile'); $user = sess('user'); // echo var_dump($user); $args = array(); $join = array(); $select = "users.*,user_roles.role"; $args['users.id'] = $user['id']; $join['user_roles'] = array('content' => 'users.role=user_roles.id', 'mode' => 'left'); $result = $this->site_model->get_tbl('users', $args, array(), $join, true, $select); $res = $result[0]; $img = array(); $resultIMG = $this->site_model->get_image(null, $user['id'], 'users'); if (count($resultIMG) > 0) { $img = $resultIMG[0]; } $data['code'] = userProfilePage($res, $img); $data['page_title'] = fa('fa-user') . " User Profile"; $data['load_js'] = 'site/user'; $data['use_js'] = 'profileJs'; $this->load->view('page', $data); }
public function restart() { $this->load->helper('core/admin_helper'); $data = $this->syter->spawn('restart'); $data['page_title'] = fa('fa-refresh') . " Restart POS"; $data['code'] = restartPage(); $data['load_js'] = 'site/admin.php'; $data['use_js'] = 'restartJs'; $this->load->view('page', $data); }
function makeUserForm($user = array(), $img = null) { $CI =& get_instance(); $CI->make->sBox('solid'); $CI->make->sBoxBody(); $CI->make->sForm("core/user/users_db", array('id' => 'users_form')); /* GENERAL DETAILS */ $CI->make->sDivRow(); $CI->make->sDivCol(2); $url = base_url() . 'img/avatar.jpg'; if (iSetObj($img, 'img_path') != "") { $url = base_url() . $img->img_path; } $CI->make->img($url, array('style' => 'width:100%;', 'class' => 'media-object thumbnail', 'id' => 'target')); $CI->make->file('fileUpload', array('style' => 'display:none;')); $CI->make->eDivCol(); $CI->make->sDivCol(10); $CI->make->sDivRow(array("style" => "margin-top:20px;")); $CI->make->sDivCol(3); $CI->make->hidden('id', iSetObj($user, 'id')); $CI->make->inputv(null, 'fname', iSetObj($user, 'fname'), 'First Name', array('class' => 'rOkay')); $CI->make->eDivCol(); $CI->make->sDivCol(3); $CI->make->inputv(null, 'mname', iSetObj($user, 'mname'), 'Middle Name', array()); $CI->make->eDivCol(); $CI->make->sDivCol(3); $CI->make->inputv(null, 'lname', iSetObj($user, 'lname'), 'Last Name', array('class' => 'rOkay')); $CI->make->eDivCol(); $CI->make->sDivCol(2); $CI->make->inputv(null, 'suffix', iSetObj($user, 'suffix'), 'Suffix', array()); $CI->make->eDivCol(); $CI->make->eDivRow(); $CI->make->sDivRow(); $CI->make->sDivCol(3); $CI->make->roleDropv(null, 'role', iSetObj($user, 'role'), 'Role', array()); $CI->make->eDivCol(); $CI->make->eDivRow(); $CI->make->eDivCol(); $CI->make->eDivRow(); $CI->make->sDivRow(); $CI->make->sDivCol(5); $CI->make->inputv('Email:', 'email', iSetObj($user, 'email'), 'Email', array('class' => '')); $CI->make->genderDropv('Gender:', 'gender', iSetObj($user, 'gender'), array('class' => 'rOkay')); $CI->make->inactiveDropv('Inactive:', 'inactive', iSetObj($user, 'inactive')); $CI->make->eDivCol(); $CI->make->sDivCol(5, 'left', 2); $CI->make->inputv('Username:'******'uname', iSetObj($user, 'username'), 'Username', array('class' => 'rOkay', iSetObj($user, 'id') ? 'disabled' : '' => '')); if (!iSetObj($user, 'id')) { $CI->make->pwdv('Password:'******'password', iSetObj($user, 'password'), 'Password', array('type' => 'password', 'class' => 'rOkay', iSetObj($user, 'id') ? 'disabled' : '' => '')); } $CI->make->pwdv('Pin:', 'pin', iSetObj($user, 'pin'), 'PIN', array('class' => '')); $CI->make->eDivCol(); $CI->make->eDivRow(); /* GENERAL DETAILS END */ $CI->make->H(4, "", array('class' => 'page-header')); $CI->make->sDivRow(); $CI->make->sDivCol(6, 'left'); $CI->make->A(fa('fa-reply') . " Back", base_url() . 'user', array('class' => 'btn btn-primary ')); $CI->make->eDivCol(); $CI->make->sDivCol(6, 'right'); $CI->make->button(fa('fa-save') . " Save Details", array('id' => 'save-btn', 'class' => ''), 'success'); $CI->make->eDivCol(); $CI->make->eDivRow(); $CI->make->eForm(); $CI->make->eBoxBody(); $CI->make->eBox(); return $CI->make->code(); }
function site_list_form($load_url = null, $form = null, $title_header = null, $lists = array(), $desc = null, $ref = null) { $CI =& get_instance(); $CI->make->sDivRow(); $CI->make->sDivCol(3); $CI->make->sBox('primary'); $CI->make->sBoxHead(); $CI->make->boxTitle($title_header); $CI->make->eBoxHead(); $CI->make->sBoxBody(); $list = array(); // $icon = $CI->make->icon('fa-plus'); $list[fa('fa-plus') . ' Add New'] = array('id' => 'add-new', 'class' => 'grp-list'); foreach ($lists as $val) { $name = ""; if (!is_array($desc)) { $name = $val->{$desc}; } else { foreach ($desc as $dsc) { $name .= $val->{$dsc} . " "; } } $list[$name] = array('class' => 'grp-btn grp-list', 'id' => 'grp-list-' . $val->{$ref}, 'ref' => $val->{$ref}); } $CI->make->listGroup($list, array('id' => 'add-grp-list-div')); $CI->make->eBoxBody(); $CI->make->eBox(); $CI->make->eDivCol(); $CI->make->sDivCol(9); $CI->make->sBox('primary'); $CI->make->sBoxBody(array('id' => 'group-detail-con', 'load-url' => $load_url)); $CI->make->eBoxBody(); $CI->make->sBoxFoot(array("style" => "text-align:right")); $CI->make->button(fa('fa-save') . ' Save', array('id' => 'save-list-form', 'class' => 'btn-primary', 'save-form' => $form, 'load-url' => $load_url), 'primary'); $CI->make->eBoxFoot(); $CI->make->eBox(); $CI->make->eDivCol(); $CI->make->eDivRow(); return $CI->make->code(); }
public function sniff_wallets() { $q = query("SELECT * FROM wallet WHERE confirmations <6 AND TIMESTAMPDIFF(DAY, created, NOW()) < 5"); while ($r = fa($q)) { $addr[] = $r['bitcoin_address']; $data[$r['bitcoin_address']] = $r; echo $r['bitcoin_address'] . " "; } if (!count($addr)) { echo "No addresses"; return; } $url = "http://btc.blockr.io/api/v1/address/info/" . implode($addr, ",") . "?confirmations=0"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $ret = curl_exec($ch); $this->curlinfo = curl_getinfo($ch); $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); $this->header = substr($ret, 0, $header_size); $ret = substr($ret, $header_size); $arr = json_decode($ret); $this->json_response = $arr; $this->json_error = json_last_error(); $this->raw_response = $ret; if ($arr->status != 'success') { echo "Error"; print_r($arr); } foreach ($arr->data as $k => $v) { if ($v->nb_txs > 0 && $v->first_tx->confirmations > $data[$v->address]['confirmations'] || $data[$v->address]['confirmations'] == 0 && $v->first_tx->confirmations == 0 && $v->nb_txs == 1 && $v->balance > 0) { echo "New activity detected on " . $v->address . "\n<br/>\n"; query("UPDATE wallet SET deposit_amount = '" . escape($v->balance) . "', confirmations = '" . escape($v->first_tx->confirmations) . "', last_transaction_hash = '" . escape($v->first_tx->tx) . "', last_sniff_date=NOW() WHERE bitcoin_address = '" . escape($v->address) . "'"); $repo = query_assoc("SELECT * FROM repo WHERE address = '" . escape($v->address) . "'"); if (!is_array($repo)) { echo "Error fetching repo"; } elseif ($v->first_tx->confirmations >= 6 && $repo['status'] < 3) { query("UPDATE repo SET status = 3 WHERE repo_id = '" . $repo['repo_id'] . "'"); $A = new Asset(); $A->issue_asset($repo['name']); } else { if ($repo['status'] == 1) { query("UPDATE repo SET status = 2 WHERE repo_id = '" . $repo['repo_id'] . "'"); } } } else { query("UPDATE wallet SET last_sniff_date = NOW() WHERE bitcoin_address = '" . escape($v->address) . "'"); } } // print_r($addr);die(); }
<?php function fa($read1, &$written1) { } function fb($read2a, &$written2a) { } function fc($read3a, &$written3a) { } fa($r1->a, $w1->b); fb($r2->a, $w2->b); fc($r3->a, $w3->b);
function dashboardMain($lastGT = 0, $todaySales = 0, $todayTransNo = 0) { $CI =& get_instance(); // $CI->make->sDiv(array('style'=>'width:100%;background-color:#fff;padding-top:15px;padding-left:10px;padding-right:10px;')); // $opts = array('Today'=>'today','This Month'=>'monthly','This Year'=>'yearly'); // $CI->make->sDivRow(); // $CI->make->sDivCol(3,'right',9); // $CI->make->select(null,'show-drop',$opts); // $CI->make->eDivCol(); // $CI->make->eDivRow(); // $CI->make->eDiv(); $CI->make->sDiv(array('style' => 'width:100%;background-color:#f1f1f1')); $CI->make->sDiv(array('style' => 'padding:10px;')); ################################################ ########## BOXES ################################################ $CI->make->sDivRow(); $CI->make->sDivCol(3); $CI->make->sDiv(array('class' => 'info-box')); $CI->make->span(fa('fa-desktop'), array('class' => 'info-box-icon bg-blue')); $CI->make->sDiv(array('class' => 'info-box-content', 'id' => 'last-gt-box')); $CI->make->span('Last Grand Total', array('class' => 'info-box-text')); $CI->make->span('PHP ' . num($lastGT), array('class' => 'info-box-number', 'id' => "last-gt")); $CI->make->eDiv(); $CI->make->eDiv(); $CI->make->eDivCol(); $CI->make->sDivCol(3); $CI->make->sDiv(array('class' => 'info-box ')); $CI->make->span(fa('fa-money'), array('class' => 'info-box-icon bg-green')); $CI->make->sDiv(array('class' => 'info-box-content')); $CI->make->span('Today Sales', array('class' => 'info-box-text')); $CI->make->span('PHP ' . num($todaySales), array('class' => 'info-box-number')); $CI->make->eDiv(); $CI->make->eDiv(); $CI->make->eDivCol(); $CI->make->sDivCol(3); $CI->make->sDiv(array('class' => 'info-box ')); $CI->make->span(fa('fa-users'), array('class' => 'info-box-icon bg-yellow')); $CI->make->sDiv(array('class' => 'info-box-content')); $CI->make->span('Today Transactions', array('class' => 'info-box-text')); $CI->make->span(num($todayTransNo), array('class' => 'info-box-number')); $CI->make->eDiv(); $CI->make->eDiv(); $CI->make->eDivCol(); // $CI->make->sDivCol(3); // $CI->make->sDiv(array('class'=>'info-box')); // $CI->make->span(fa('fa-cutlery'),array('class'=>'info-box-icon bg-blue')); // $CI->make->sDiv(array('class'=>'info-box-content')); // $CI->make->span('Today\'s Top Menu',array('class'=>'info-box-text')); // $CI->make->span('Congee',array('class'=>'info-box-number')); // $CI->make->eDiv(); // $CI->make->eDiv(); // $CI->make->eDivCol(); $CI->make->sDivCol(3); $CI->make->sDiv(array('class' => 'info-box')); $CI->make->span(fa('fa-calendar'), array('class' => 'info-box-icon bg-aqua')); $CI->make->sDiv(array('class' => 'info-box-content')); $CI->make->span(null, array('class' => 'info-box-text', 'id' => 'box-day')); $CI->make->span('9:00 PM', array('class' => 'info-box-number', 'id' => 'box-time')); $CI->make->sDiv(array('class' => 'progress')); $CI->make->sDiv(array('class' => 'progress-bar', 'style' => 'width:100%')); $CI->make->eDiv(); $CI->make->eDiv(); $CI->make->span(null, array('class' => 'progress-description', 'id' => 'box-date')); $CI->make->eDiv(); $CI->make->eDiv(); $CI->make->eDivCol(); $CI->make->eDivRow(); ################################################ ########## GRAPHS ################################################ $CI->make->sDivRow(); $CI->make->sDivCol(9); $CI->make->sBox('solid'); // $CI->make->sBoxHead(); // $CI->make->boxTitle(fa('fa-money fa-fw').' Transactions Sales'); // $CI->make->eBoxHead(); $CI->make->sBoxHead(array('class' => 'bg-blue')); $CI->make->h(3, fa('fa-money') . ' Today\'s Sales', array('class' => 'box-title')); $CI->make->eBoxHead(); $CI->make->sBoxBody(); $CI->make->sDivRow(array('class' => 'chart-responsive')); // $CI->make->sDivCol(8); // $CI->make->sDiv(array('class'=>'chart','id'=>'bar-chart','style'=>'height:300px;')); // $CI->make->eDiv(); // $CI->make->eDivCol(); $CI->make->sDivCol(6); $CI->make->sDiv(array('id' => 'sales-chart', 'class' => 'chart', 'style' => 'height: 300px; position: relative;')); $CI->make->eDiv(); $CI->make->eDivCol(); $CI->make->sDivCol(6); $CI->make->sDiv(array('id' => 'bars-div')); $CI->make->eDiv(); $CI->make->eDivCol(); $CI->make->eDivRow(); $CI->make->eBoxBody(); $CI->make->eBox(); $CI->make->eDivCol(); $CI->make->sDivCol(3); $CI->make->sBox('default', array('class' => 'box-solid')); $CI->make->sBoxHead(array('class' => 'bg-teal')); $CI->make->h(3, fa('fa-cutlery') . ' Today\'s Top Menu', array('class' => 'box-title')); $CI->make->eBoxHead(); // $CI->make->append('<div class="overlay"> // <i class="fa fa-refresh fa-spin"></i> // </div>'); $CI->make->sBoxBody(array('class' => 'chart-responsive no-padding')); $CI->make->sDiv(array('id' => 'top-menu-box', 'style' => 'min-height:218px;')); $CI->make->eDiv(); $CI->make->eBoxBody(); $CI->make->eBox(); $CI->make->eDivCol(); $CI->make->eDivRow(); $CI->make->sDiv(); $CI->make->eDiv(); return $CI->make->code(); }