Example #1
0
 public function index()
 {
     $must = array('store_id' => 1);
     $res = get_api_data('store/add_verify_code', $must);
     op($res);
     echo json_encode($res);
 }
Example #2
0
 public function index()
 {
     $session = $_COOKIE['session'];
     $must = array('session' => $session);
     $res = get_api_data('user/user_street_time', $must);
     op($res);
     echo json_encode($res);
 }
Example #3
0
 /**
  * register
  *
  * @return void
  * @author Mathew
  **/
 public function register($username, $password, $email, $additional_data = array(), $group_ids = array())
 {
     $this->ion_auth_model->trigger_events('pre_account_creation');
     $email_activation = $this->config->item('email_activation', 'ion_auth');
     if (!$email_activation) {
         $id = $this->ion_auth_model->register($username, $password, $email, $additional_data, $group_ids);
         if ($id !== FALSE) {
             $this->set_message('account_creation_successful');
             $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_successful'));
             return $id;
         } else {
             $this->set_error('account_creation_unsuccessful');
             $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_unsuccessful'));
             return FALSE;
         }
     } else {
         $id = $this->ion_auth_model->register($username, $password, $email, $additional_data, $group_ids);
         if (!$id) {
             $this->set_error('account_creation_unsuccessful');
             return FALSE;
         }
         $deactivate = $this->ion_auth_model->deactivate($id);
         if (!$deactivate) {
             $this->set_error('deactivate_unsuccessful');
             $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_unsuccessful'));
             return FALSE;
         }
         $activation_code = $this->ion_auth_model->activation_code;
         $identity = $this->config->item('identity', 'ion_auth');
         $user = $this->ion_auth_model->user($id)->row();
         $data = array('identity' => $user->{$identity}, 'id' => $user->id, 'email' => $email, 'activation' => $activation_code);
         if (!$this->config->item('use_ci_email', 'ion_auth')) {
             $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_successful', 'activation_email_successful'));
             $this->set_message('activation_email_successful');
             return $data;
         } else {
             $message = $this->load->view($this->config->item('email_templates', 'ion_auth') . $this->config->item('email_activate', 'ion_auth'), $data, true);
             $this->email->clear();
             $this->email->from($this->config->item('admin_email', 'ion_auth'), op('sitename'));
             $this->email->to($email);
             $this->email->subject(op('sitename') . ' - ' . $this->lang->line('email_activation_subject'));
             $this->email->message($message);
             if ($this->email->send() == TRUE) {
                 $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_successful', 'activation_email_successful'));
                 $this->set_message('activation_email_successful');
                 return $id;
             }
         }
         $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_unsuccessful', 'activation_email_unsuccessful'));
         $this->set_error('activation_email_unsuccessful');
         return FALSE;
     }
 }
<?php

function op($v, &$min)
{
    $n = sizeof($v);
    $min = $v[0];
    for ($i = 0; $i < $n; $i++) {
        if ($v[$i] < $min) {
            $min = $v[$i];
        }
        if ($min < 0) {
            /*sacamos si es menor que 0 es falso
            	 y si es mayor verdadero*/
            return false;
        } else {
            return true;
        }
    }
}
$v = array(2, 5, 4, 6, 8, 1);
$min = 0;
$fun = op($v, $min);
var_dump($fun);
echo "{$min}";
Example #5
0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <title><?php 
echo op("sitename");
?>
</title>
    <link rel="shortcut icon" href="favicon.ico" />

    <link rel="stylesheet" href="<?php 
echo css();
?>
backend/style.css" media="all" type="text/css" />
    <link rel="stylesheet" href="<?php 
echo lib();
?>
jquery-ui/css/smoothness/jquery-ui-1.8.15.custom.css" type="text/css" />
    <link rel="stylesheet" href="<?php 
echo lib();
?>
harvesthq-chosen/chosen.css" type="text/css" />
    <link rel="stylesheet" href="<?php 
echo lib();
?>
elfinder/css/elfinder.min.css" type="text/css" />
    <link rel="stylesheet" href="<?php 
echo lib();
?>
fancybox/jquery.fancybox-1.3.4.css" type="text/css" />
    <link rel="stylesheet" href="<?php 
Example #6
0
function call()
{
    $args = func_get_args();
    $f = op(array_shift($args));
    return call_user_func_array($f, $args);
}
Example #7
0
<?php

// Grouping syntax
function __()
{
    return array_merge(['grouped' => true], func_get_args());
}
call_user_func(function () {
    $interpret = null;
    $call = curry(function (array $env, $f, $arg) use(&$interpret) {
        return op($f, $interpret($env, $arg));
    });
    $chain = curry(function (array $env, array $calls) use($call) {
        return array_reduce(array_diff_key($calls, ['grouped' => '']), $call($env), function ($x) {
            return $x;
        });
    });
    $plumb = curry(function (array $env, array $expr, $arg) use($chain) {
        return $expr ? $chain(array_merge([$arg], $env), $expr) : $arg;
    });
    $interpret = curry(function (array $e, $x) use($chain, $plumb) {
        // Assume ints and arrays are Plumb; anything else is PHP
        if (is_int($x)) {
            return $e[$x];
        }
        if (is_array($x)) {
            return isset($x['grouped']) ? $chain($e, $x) : $plumb($e, $x);
        }
        return $x;
    });
    // Interpret $f in an empty environment
Example #8
0
File: exit.php Project: ehmedov/www
<?php

if ($db["glava"] != 1) {
    mysql_query("UPDATE users SET clan='',clan_short='',chin='',orden='',clan_take='0',glava=0 WHERE login='******'");
    history($login, 'Покинул ханства', $clan_t, $db['remote_ip'], "Ханства");
    op($login, "Покинул ханства", $clan_s);
    Header("Location: main.php?act=none&tmp={$random}");
    die;
} else {
    echo "Вы не можете так покинут ханства...";
}
                                <div class="wpb_content_element dynamic_page_header style_3">
                                    <?php 
if (op("rec_title")) {
    ?>
<h1 style="font-size:36px; color:#3d3d3d"><?php 
    echo op("rec_title");
    ?>
</h1><?php 
}
?>
                                   
                                     <?php 
if (op("rec_sub")) {
    ?>
<p class="description style_3"><?php 
    echo op("rec_sub");
    ?>
</p><?php 
}
?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        
            <div id="fws_5559b27a6ecce" class="wpb_row animate_onoffset  vc_row-fluid  animate_onoffset row-dynamic-el section-style    " style="padding-top: 0px !important; padding-bottom: 60px !important; ">
                <div class="container  dark">
                    <div class="section_clear">
                         <?php 
Example #10
0
function papply()
{
    $args = func_get_args();
    $f = op(array_shift($args));
    return function () use($args, $f) {
        static $curried = true;
        return call_user_func_array('call_user_func', array_merge($args, func_get_args()));
    };
}
Example #11
0
 public function employee_is_login()
 {
     $must = array('session' => '6645b0813f4b9c7135457090723dc31b');
     $res = get_api_data('employee/is_login', $must);
     op($res);
 }
Example #12
0
require_once __DIR__ . '/vendor/autoload.php';
function id($x)
{
    return $x;
}
deftests(['id' => function ($n) {
    $result = plumb([0], $n);
    return $result === $n ? 0 : get_defined_vars();
}, 'id2' => function ($n) {
    $result = plumb([], $n);
    return $result === $n ? 0 : get_defined_vars();
}, 'const' => function ($n, $m) {
    $result = plumb([[1]], $n, $m);
    return $result === $n ? 0 : get_defined_vars();
}, 'comp' => function ($l, $m, $n) {
    $lhs = plumb([[[2, __(1, 0)]]], op('+', $l), op('*', $m), $n);
    $rhs = $l + $m * $n;
    return $lhs === $rhs ? 0 : get_defined_vars();
}, 'nest' => function ($n) {
    $lhs = plumb([__('+', __('*', 0, 0)), __(__('id', 'id'), 0)], $n);
    $rhs = ($n + 1) * $n;
    return $lhs === $rhs ? 0 : get_defined_vars();
}, 'ops' => function ($m, $n) {
    $lhs = plumb([['+', 0, 1]], $m, $n);
    $rhs = $m + $n;
    return $lhs === $rhs ? 0 : get_defined_vars();
}]);
if ($results = runtests(null)) {
    var_dump($results);
} else {
    echo "All tests pass\n";
Example #13
0
    $result = call('instanceof', $o, 'stdClass');
    return $result ? 0 : get_defined_vars();
}, 'instanceof spots non-instances' => function () {
    $o = new Exception();
    $result = call('instanceof', $o, 'stdClass');
    return $result ? get_defined_vars() : 0;
}, 'array is callable' => function ($x, $y, $z) {
    $lhs = call('array', $x, $y, $z);
    return $lhs === array($x, $y, $z) ? 0 : get_defined_vars();
}, 'not is callable' => function ($x, $y) {
    $f = op('!');
    $lhs = $f($x > $y);
    $rhs = !($x > $y);
    return $lhs === $rhs ? 0 : get_defined_vars();
}, 'not is curried' => function ($x, $y) {
    $lhs = op('!', $x > $y);
    $rhs = !($x > $y);
    return $lhs === $rhs ? 0 : get_defined_vars();
}, 'can define functions' => function ($x, $y, $z) {
    $name = "func{$x}";
    $f = defun($name, function ($n) use($y) {
        return $y + $n;
    });
    $result = $name($z);
    return $result === $y + $z ? 0 : get_defined_vars();
}, 'uncurry uncurries' => function ($x, $y, $z) {
    $f = uncurry(function ($a, $b, $c) {
        return $a + $b + $c;
    });
    $result = $f(func_get_args());
    return $result === $x + $y + $z ? 0 : get_defined_vars();
if (op("email_url")) {
    ?>
<li class="email"><i class="moon-envelop"></i><span>Email:</span>
                                        <br /><span><?php 
    echo op("email_url");
    ?>
</span><?php 
}
?>
</span></li>
                                    <?php 
if (op("tel_num")) {
    ?>
<li class="phone"><i class="moon-phone"></i><span>Phone:</span>
                                        <br /><span><?php 
    echo op("tel_num");
}
?>
</span></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="arrow_down"><i class="icon-angle-up"></i></div>
            </div>
            <div id="copyright">
                <div class="container">
                    <div class="row-fluid">
                        <div class="span12 desc">
                            <div class="span4">
    <!-- Page Background used for background images -->
    <div id="page-bg"></div>
    <!-- Header BEGIN -->
    <div class="header_wrapper header_1 no-transparent  ">
        <header id="header" class="sticky_header ">
            <div class="container">
                <div class="row-fluid">
                    <div class="span12">
                        <!-- Logo -->
                        <div id="logo" class="">
                            <a href='index.html'><img src='<?php 
echo op("logo_url");
?>
' alt="" />
                            <img src='<?php 
echo op("logo_url");
?>
' alt="" class="light" /></a>
                        </div>
                        <!-- #logo END -->
                        <div class="after_logo">
                            <!-- Search -->
                            <div class="header_search">
                                <div class="right_search">
                                    <i class="moon-search-2"></i>
                                </div>
                                <div class="right_search_container">
                                    <form action="#" id="search-form">
                                        <div class="input-append">
                                            <input type="text" size="16" placeholder="Search&hellip;" name="s" id="s">
                                            <button type="submit" class="more">Search</button>
Example #16
0
                if ($SITED["kazna"] < $_POST['deneg_n']) {
                    $msgErr = "В казне нет такой суммы... (" . $_POST['deneg_n'] . " Зл.)";
                } else {
                    if (!$db["glava"]) {
                        $msgErr = "Только <b>ГЛАВА КЛАНА</b> должен переводить деньги с кланового счета...";
                    } else {
                        $number = (int) $_POST['bank_id'];
                        $bank = mysql_fetch_array(mysql_query("SELECT * FROM users,(SELECT number,login FROM bank WHERE number={$number} LIMIT 1) as b WHERE users.login=b.login and users.clan_short='{$clan_s}' LIMIT 1"));
                        if ($bank) {
                            $bank_sum = $_POST['deneg_n'];
                            $comment = htmlspecialchars(addslashes($_POST['comment']));
                            mysql_query("UPDATE `clan` SET kazna=kazna-{$bank_sum} WHERE name_short = '" . $clan_s . "'");
                            mysql_query("UPDATE `bank` SET money=money+{$bank_sum} WHERE number = {$number}");
                            $msgErr = "Вы удачно перевели <b>{$bank_sum} Зл.</b> из казны Клана на счет <b>{$number}</b> к <b>{$bank['login']}</b>...";
                            history($login, 'Передал из казны', $msgErr . "- Коментарий-{$comment}", $ip, 'Казна клана');
                            op($login, $msgErr, $clan_s);
                        } else {
                            $msgErr = "Неверные данные...";
                        }
                    }
                }
            }
        }
    }
}
echo "<font color=#ff0000>" . $msgErr . "</font>&nbsp;";
?>
<body onLoad='top.cf.action=1;' onUnload='top.cf.action=0;'>
<form name='action' method="POST" action="main.php?act=clan&do=4">
	<b>Введите сумму которую хотите положить в казну.</b><br>
	Сумма: <input type="text" name="summa_n" size="20" value="0" maxlength=3> <input type="submit" value=">>" name="action">