text
stringlengths 2
1.03M
|
|---|
<?php
include_once "../src/SampleBilling.php";
use App\SampleBilling\SampleBilling;
$obj = new SampleBilling();
$obj->prepare($_POST);
$obj->transaction();
|
<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:64:"D:\wamp\www\tp5\public/../application/wap\view\forum\detail.html";i:1550476106;s:55:"D:\wamp\www\tp5\application\wap\view\public\header.html";i:1545358047;s:55:"D:\wamp\www\tp5\application\wap\view\public\huitie.html";i:1548208887;s:55:"D:\wamp\www\tp5\application\wap\view\public\footer.html";i:1545529423;}*/ ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>首页-征婚-163k地方门户网站系统</title>
<meta name="keywords" content="交友栏目关键字,关键字,关键字,关键字,关键字" />
<meta name="description" content="交友栏目描述" />
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"/>
<meta name="format-detection" content="telephone=no" />
<link rel="stylesheet" href="/static/layui/css/layui.css">
<link rel="stylesheet" type="text/css" href="/wap/main/css/mb-base.css" />
<link rel="stylesheet" type="text/css" href="/wap/main/css/mb-index.css" />
<link rel="stylesheet" type="text/css" href="/wap/main/css/mb-common.css" />
<link rel="stylesheet" type="text/css" href="/wap/main/css/tieba-mb.css" />
<link rel="stylesheet" type="text/css" href="/wap/main/css/comment-mb.css" />
<script src="/fds/js/jquery-1.11.3.min.js"></script>
<script src="/static/layui/layui.js"></script>
<script src="/wap/main/js/upload.js"></script>
<script src="/public/js/emotData.js"></script>
<style type="text/css">
.foot_link { display:none!important;}
#pageNavigation { display:none;}
.noMore { list-style:none; border-top:1px solid #eaebec; background-color:#eee!important; padding:20px 0; text-align:center; color:#666;}
#wrapper { position:static!important;}
#listEmpty { display:none!important;}
</style>
</head>
<body>
<div id="pageMain" class="page_srcoll page-current">
<div class="header">
<a href="javascript:history.back(-1)" id="header_back" class="back">返回</a>
<div class="search" id="search_ico" onclick="showNewPage('搜索',searchHtml,newPageSearch);" style="display:none;">搜索</div>
<?php if(\think\Session::get('nickname') != null): ?>
<a href="<?php echo url('user/index'); ?>" class="my ico_ok" id="login_ico">我的</a>
<?php else: ?>
<a href="<?php echo url('login/index'); ?>" class="my" id="login_ico">我的</a>
<?php endif; ?>
<div class="type" id="nav_ico">导航</div>
<span id="ipageTitle" style=""><?php echo $title; ?></span>
<div class="nav_APP" id="nav_APP" style="display: none;">
<ul class="clearfix" id="nav_APP_data2">
<li><a href="<?php echo url('wap/index/index'); ?>">首页<s class="s" style="background-image:url(/wap/main/images/nav_icon/headIcon.png);"></s></a></li>
<li><a href="">活动<s class="s" style="background-image:url(/wap/main/images/nav_icon/201705251752370917548.png);"></s></a></li>
<li><a href="<?php echo url('forum/index'); ?>">社区<s class="s" style="background-image:url(/wap/main/images/nav_icon/201705251752556953922.png);"></s></a></li>
</ul><span class="arrow-up"></span>
</div>
</div>
<div class="o_main" style="padding-bottom:50px;">
<div class="posts" id="resizeIMG">
<!--<div class="tabs">
<ul>
<li>加入收藏</li>
<li id="showLouzhu">只看楼主</li>
</ul>
</div>-->
<input id="pagenum" type="hidden" value="1">
<div id="wrapper">
<div class="player_h5" id="player_h5" style="display: none; width: 394px; height: 222px;"><video controls="" webkit-playsinline="" playsinline="" autoplay=""></video></div>
<div class="title">
<span class="d display0">顶</span><?php echo $ret['title']; ?>
<span class="jinghua display0">精</span>
<div class="info clearfix">
<div class="right"><?php echo $ret['view']; ?>阅读<s class="line"></s><?php echo $ret['reply']; ?>回帖</div>
<div class="left"><a href="javascript:;" class="cat display2276">嗦咆打啦</a></div>
</div>
</div>
<div class="Oposter" id="louzhuNode">
<div class="user_info">
<div class="user_head"><img src="<?php echo $ret['headimg']; ?>" onerror="this.src='/wap/main/images/user_small.gif';this.onerror='';"></div>
<ul>
<li>
<span class="uName"><?php echo $ret['author']; ?></span>
<!-- <span class="grade i_1" title="初级">1</span>
<span class="vipnum display0">无</span>
<span class="bazhu display0">版主</span>-->
</li>
<li><?php echo date("m-d H:i",$ret['time']); ?></li>
</ul>
<div class="op">楼主</div>
</div>
<div class="con" id="louzhuCon">
<?php echo htmlspecialchars_decode($ret['content']); if(isset($imgsarr)): if(is_array($imgsarr) || $imgsarr instanceof \think\Collection || $imgsarr instanceof \think\Paginator): $i = 0; $__LIST__ = $imgsarr;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
<p><img src="<?php echo $vo; ?>" style="width: 100%"></p>
<?php endforeach; endif; else: echo "" ;endif; endif; ?>
<p class="blod"></p>
<!-- <div class="p_btns">
<p class="manage"> <a href="javascript:void(0);" onclick="superManage('6');" class="blue">超级管理</a> <a href="javascript:;" class="blue">编辑</a> <a href="javascript:void(0);" onclick="$.managerTBisdel('6','2276');" class="blue">删除</a></p>
</div> -->
</div>
</div>
<?php if(isset($comarr)): ?>
<div class="post_list">
<div id="pagingList" class="isrevert1">
<?php if(is_array($comarr) || $comarr instanceof \think\Collection || $comarr instanceof \think\Paginator): $i = 0; $__LIST__ = $comarr;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
<div class="gentie post_item">
<div class="user_info">
<div class="user_head"><img src="<?php echo $vo['headimg']; ?>" onerror="this.src='/wap/main/images/user_small.gif';this.onerror='';"></div>
<ul>
<li>
<span class="uName"><?php echo $vo['uname']; ?></span>
<!-- <span class="grade i_1" title="初级">1</span>
<span class="vipnum display0">无</span>
<span class="bazhu display0">版主</span> -->
</li>
<li><?php echo $vo['louceng']; ?> <?php echo date("m-d H:i",$vo['time']); ?></li>
</ul>
<div class="reply_btn" onclick="return loadRevertReplay(this,<?php echo $vo['id']; ?>,'<?php echo $vo['uname']; ?>','0',<?php echo $vo['uid']; ?>);"></div>
</div>
<div class="con">
<div class="replaycontent1">
<?php echo htmlspecialchars_decode($vo['content']); ?>
</div>
<?php if($vo['pic']): ?>
<p class=""><img src="<?php echo $vo['pic']; ?>" style="width: 100%"></p>
<?php endif; if($vo['child']): if(is_array($vo['child']) || $vo['child'] instanceof \think\Collection || $vo['child'] instanceof \think\Paginator): $i = 0; $__LIST__ = $vo['child'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
<div class="comment_reply">
<div class="comment_user clearfix"><a href="#" onclick="return loadRevertReplay(this,<?php echo $vo['id']; ?>,'<?php echo $v['uname']; ?>','1',<?php echo $v['uid']; ?>);" class="replay_btn replay_life">回复</a><span class="comment_floor right"><?php echo $i; ?></span><span class="userName"><?php echo $v['uname']; ?></span><span class="dtappenddate"><?php echo date("m-d H:i",$v['time']); ?></span></div>
<p class="comment_content"><?php echo htmlspecialchars_decode($v['content']); ?></p>
<?php if($v['pic']): ?>
<p class=""><img src="<?php echo $v['pic']; ?>" style="width: 100%"></p>
<?php endif; ?>
</div>
<?php endforeach; endif; else: echo "" ;endif; endif; ?>
</div>
<p class="manage_replay display0" data-isrep="0">回复:<span class="replaycontent2"></span> <span class="time"></span></p>
<p class="manage"><a href="#" onclick="return edit_replay(this,<?php echo $vo['id']; ?>);" class="blue">编辑和回评</a><a href="#" onclick="return loadDelQuick(this,<?php echo $vo['id']; ?>);" class="blue" style="padding:0 13px;">更多操作</a></p>
</div>
<?php endforeach; endif; else: echo "" ;endif; ?>
<div class="noMore" id="noMore">没有更多了</div>
</div>
<div id="pullUp" style="display:none;"><span class="loader">loadding</span></div>
<div class="pageNavigation" id="pageNavigation"><div class="FirstPage"><span class="kill"><</span></div><div class="EndPage"><span class="kill">></span></div><span class="pageNo">1/1</span></div>
</div>
<?php endif; ?>
<span class="loader" id="pageLoader" style="display:none;">loadding</span>
</div>
</div>
<div class="reply_box page_srcoll" id="pageOther" style="display:none;z-index: 1019;">
<div class="inner">
<span class="title">回复<span id="replyName"></span></span>
<div class="return_close" id="closeReply">返回</div>
<div class="cmt_txt2" id="cmt_txt" placeholder="想跟他说点什么~" style=" margin-bottom:10px; height:160px; overflow:auto; -webkit-overflow-scrolling:touch; -webkit-user-select:auto;" contenteditable="true"></div>
<input id="isrep" name="isrep" type="hidden">
<input id="perid" name="perid" type="hidden">
<input id="repid" name="repid" type="hidden">
<input id="fid" name="fid" type="hidden" value="<?php echo $ret['id']; ?>">
<div class="reply_tabs" id="reply_tabs">
<ul class="clearfix tab-hd">
<li class="item" data-isvideo="0" data-isopen="0"><s class="s s_1"></s>表情</li>
<li class="item" data-isvideo="0" data-isopen="0"><s class="s s_2"></s>图片</li>
</ul>
<div class="tab-cont" style="display:none;">
<div class="face" id="emot_inner"></div>
</div>
<div class="tab-cont" style="display:none;">
<div class="imgcon">
<div id="xiangce" class="my_prop_imgitem_node clearfix">
<div class="upimgFileBtnNode"><div id="pageLoaderNode"><span id="pageLoader">loadding</span></div><img src="/wap/main/images/upimg.png" id="upimgFileBtn" class="upimgFileBtn imgview" alt="" style="height: 81.75px;"></div>
</div>
<input type="hidden" name="imgs" class="layui-input" value="">
<input type="hidden" name="isimgs" class="layui-input" value="">
</div>
</div>
<?php echo token(); ?>
</div>
<input type="submit" class="rsubmit" value="发表" id="fabiao"/>
<div style="margin:10px 10px 20px;">
<input class="comn-submit fabu_btn" type="submit" id="upimgs" value="确认所选图片" style="display: none;background: #5cc55c;">
</div>
</div>
</div>
<div class="footFixed">
<p class="display_isrevert_1">该帖已关闭回复</p>
<div class="reply_hd clearfix display1" id="reply_hd">
<ul>
<!-- <li id="share2015"><span class="share">分享</span></li> -->
<li id="openReply2"><span class="num" id="show_total_revert1"><?php echo $ret['reply']; ?></span></li>
<!-- <li id="reply_zan"><span class="zan"><?php echo $ret['view']; ?></span></li> -->
<li><a href="javascript:;" class="btn replay_louzhu" onclick="return loadRevertReplay(this,'0','楼主','0',<?php echo $ret['uid']; ?>);">回楼主</a></li>
</ul>
</div>
</div>
<div class="foot_link" id="foot_link">
<ul class="link">
<li><a href="<?php echo url('wap/index/index'); ?>">首页</a></li><!--<li><a href="https://www.mh163k.com/request.ashx?action=iswap&iswap=0">电脑版</a></li>--><li><a href="https://www.mh163k.com/help/article_13.html">联系我们</a></li><!--<li><a href="http://app.163k.com/download.aspx?id=12299" data-img="../UploadFile/index/2015/9-7/201509071154513472674.png">客户端</a></li>--><li><a href="https://www.mh163k.com/service/">反馈留言</a></li>
</ul>
<!--163k地方门户网站系统:<a href="https://www.mh163k.com/">mh163k.com</a> 皖ICP备11020229号-->Copyright @ 2003-2018 mh163k.com
<input type="hidden" name="nickname" value="<?php echo \think\Session::get('nickname'); ?>">
</div>
<script>
$(function(){
$('#nav_ico').click(function(e){
e.preventDefault();
$('#nav_APP').fadeToggle('fast');
});
});
</script>
</div>
</div>
<script type="text/javascript">
$(function(){
$("#closeReply").click(function(){
$("#pageOther").hide(500);
})
$("#fabiao").click(function(data){
var data={};
data.cont=$.trim($("#cmt_txt").html());
data.isrep=$("#isrep").val();
data.mid=$("#perid").val();
data.tid=$("#repid").val();
data.pic=$("input[name=imgs]").val();
data.__token__=$("input[name=__token__]").val();
data.fid=$("#fid").val();
var $this=$(this);
$.post("/forum/fatie",data,function(data){
if(data.code==1){
layer.msg(data.msg, {icon: 1, anim: 6, time: 1000},function(){
location.reload();
});
}else{
layer.msg(data.msg,function(){
location.href=data.url;
});
}
});
})
})
function loadRevertReplay(o,perid,uname,isrep,repid){
$("#replyName").text(uname);
$("#perid").val(perid);
$("#isrep").val(isrep);
$("#repid").val(repid);
$("#pageOther").show(500);
if(isrep==1){
$("#cmt_txt").text("@"+uname+" : ");
}
}
</script>
</body>
</html>
|
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateServiceListsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('service_lists', function (Blueprint $table) {
$table->id();
$table->integer('service_id')->index();
$table->integer('test_id')->index();
$table->double('cost')->default(0);
$table->text('description')->nullable();
$table->integer('created_by')->nullable();
$table->integer('updated_by')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('service_lists');
}
}
|
<?php
namespace App\Events;
use App\Models\User;
use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
class UserWasRegistered
{
use Dispatchable, SerializesModels;
public $user, $token, $feedback;
/**
* Create a new event instance.
* @param User $user
* @param $token
*/
public function __construct(User $user, $token)
{
$this->user = $user;
$this->token = $token;
$this->feedback = 'Email has been sent, check your mail.';
}
}
|
<?php
class wpdevart_bc_ControllerExtras {
private $model;
private $view;
public function __construct() {
require_once(WPDEVART_PLUGIN_DIR . "/admin/models/Extras.php");
$this->model = new wpdevart_bc_ModelExtras();
require_once(WPDEVART_PLUGIN_DIR . "/admin/views/Extras.php");
$this->view = new wpdevart_bc_ViewExtras($this->model);
}
public function perform() {
$task = wpdevart_bc_Library::get_value('task');
$id = wpdevart_bc_Library::get_value('id', 0);
if (method_exists($this, $task)) {
$this->$task($id);
}
else {
$this->display_extras();
}
}
private function display_extras($error_msg="",$delete=true){
$this->view->display_extras($error_msg,$delete);
}
private function add(){
$this->view->edit_extra();
}
private function edit( $id ){
$this->view->edit_extra( $id );
}
private function save( $id ){
global $wpdb; //var_dump(array_slice($_POST, 2, -2)); exit;
$saved_parametrs = wpdevart_bc_Library::sanitizeAllPost(array_slice($_POST, 2, -2));
$data_json = json_encode($saved_parametrs);
$title = wpdevart_bc_Library::getData($_POST, 'title', 'text', '');
if ($id != 0) {
$save = $wpdb->update($wpdb->prefix . 'wpdevart_extras', array(
'title' => $title,
'data' => $data_json,
), array('id' => $id));
}
else {
$save = $wpdb->insert($wpdb->prefix . 'wpdevart_extras', array(
'title' => $title,
'data' => $data_json,
'user_id' => $user,
), array(
'%s',
'%s',
'%d',
));
$id = $wpdb->get_var('SELECT MAX(id) FROM ' . $wpdb->prefix . 'wpdevart_extras');
}
if(isset($_POST["save"])) {
$this->display_extras();
}
else {
$this->edit($id);
}
}
private function delete( $id ){
global $wpdb;
$error_msg = "";
$delete = true;
$exists = $this->model->check_exists( $id );
if($exists === false) {
$del_query = $wpdb->query($wpdb->prepare( 'DELETE FROM ' . $wpdb->prefix . 'wpdevart_extras WHERE id="%d"',$id ));
if($del_query) {
$error_msg = "Item succesfully deleted.";
}
} else {
$error_msg = "You can't delete form which in use";
$delete = false;
}
$this->display_extras($error_msg,$delete);
}
private function delete_selected(){
global $wpdb;
$error_msg = "";
$delete = true;
$check_for_action = (isset($_POST['check_for_action']) ? ( $_POST['check_for_action']) : '');
foreach($check_for_action as $check){
$exists = $this->model->check_exists( $check );
if($exists === false) {
$del_query = $wpdb->query($wpdb->prepare( 'DELETE FROM ' . $wpdb->prefix . 'wpdevart_extras WHERE id="%d"',$check ));
if($del_query) {
$error_msg = "Items succesfully deleted.";
}
} else {
$error_msg = "You can't delete form which in use";
$delete = false;
}
}
$this->display_extras($error_msg,$delete);
}
}
?>
|
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yii\db\cubrid;
use yii\db\Expression;
use yii\db\TableSchema;
use yii\db\ColumnSchema;
use yii\db\Transaction;
/**
* Schema is the class for retrieving metadata from a CUBRID database (version 9.3.x and higher).
*
* @author Carsten Brandt <mail@cebe.cc>
* @since 2.0
*/
class Schema extends \yii\db\Schema
{
/**
* @var array mapping from physical column types (keys) to abstract column types (values)
* Please refer to [CUBRID manual](http://www.cubrid.org/manual/91/en/sql/datatype.html) for
* details on data types.
*/
public $typeMap = [
// Numeric data types
'short' => self::TYPE_SMALLINT,
'smallint' => self::TYPE_SMALLINT,
'int' => self::TYPE_INTEGER,
'integer' => self::TYPE_INTEGER,
'bigint' => self::TYPE_BIGINT,
'numeric' => self::TYPE_DECIMAL,
'decimal' => self::TYPE_DECIMAL,
'float' => self::TYPE_FLOAT,
'real' => self::TYPE_FLOAT,
'double' => self::TYPE_DOUBLE,
'double precision' => self::TYPE_DOUBLE,
'monetary' => self::TYPE_MONEY,
// Date/Time data types
'date' => self::TYPE_DATE,
'time' => self::TYPE_TIME,
'timestamp' => self::TYPE_TIMESTAMP,
'datetime' => self::TYPE_DATETIME,
// String data types
'char' => self::TYPE_CHAR,
'varchar' => self::TYPE_STRING,
'char varying' => self::TYPE_STRING,
'nchar' => self::TYPE_CHAR,
'nchar varying' => self::TYPE_STRING,
'string' => self::TYPE_STRING,
// BLOB/CLOB data types
'blob' => self::TYPE_BINARY,
'clob' => self::TYPE_BINARY,
// Bit string data types
'bit' => self::TYPE_INTEGER,
'bit varying' => self::TYPE_INTEGER,
// Collection data types (considered strings for now)
'set' => self::TYPE_STRING,
'multiset' => self::TYPE_STRING,
'list' => self::TYPE_STRING,
'sequence' => self::TYPE_STRING,
'enum' => self::TYPE_STRING,
];
/**
* @var array map of DB errors and corresponding exceptions
* If left part is found in DB error message exception class from the right part is used.
*/
public $exceptionMap = [
'Operation would have caused one or more unique constraint violations' => 'yii\db\IntegrityException',
];
/**
* @inheritdoc
*/
public function releaseSavepoint($name)
{
// does nothing as cubrid does not support this
}
/**
* Quotes a table name for use in a query.
* A simple table name has no schema prefix.
* @param string $name table name
* @return string the properly quoted table name
*/
public function quoteSimpleTableName($name)
{
return strpos($name, '"') !== false ? $name : '"' . $name . '"';
}
/**
* Quotes a column name for use in a query.
* A simple column name has no prefix.
* @param string $name column name
* @return string the properly quoted column name
*/
public function quoteSimpleColumnName($name)
{
return strpos($name, '"') !== false || $name === '*' ? $name : '"' . $name . '"';
}
/**
* Creates a query builder for the CUBRID database.
* @return QueryBuilder query builder instance
*/
public function createQueryBuilder()
{
return new QueryBuilder($this->db);
}
/**
* Loads the metadata for the specified table.
* @param string $name table name
* @return TableSchema driver dependent table metadata. Null if the table does not exist.
*/
protected function loadTableSchema($name)
{
$pdo = $this->db->getSlavePdo();
$tableInfo = $pdo->cubrid_schema(\PDO::CUBRID_SCH_TABLE, $name);
if (!isset($tableInfo[0]['NAME'])) {
return null;
}
$table = new TableSchema();
$table->fullName = $table->name = $tableInfo[0]['NAME'];
$sql = 'SHOW FULL COLUMNS FROM ' . $this->quoteSimpleTableName($table->name);
$columns = $this->db->createCommand($sql)->queryAll();
foreach ($columns as $info) {
$column = $this->loadColumnSchema($info);
$table->columns[$column->name] = $column;
}
$primaryKeys = $pdo->cubrid_schema(\PDO::CUBRID_SCH_PRIMARY_KEY, $table->name);
foreach ($primaryKeys as $key) {
$column = $table->columns[$key['ATTR_NAME']];
$column->isPrimaryKey = true;
$table->primaryKey[] = $column->name;
if ($column->autoIncrement) {
$table->sequenceName = '';
}
}
$foreignKeys = $pdo->cubrid_schema(\PDO::CUBRID_SCH_IMPORTED_KEYS, $table->name);
foreach ($foreignKeys as $key) {
if (isset($table->foreignKeys[$key['FK_NAME']])) {
$table->foreignKeys[$key['FK_NAME']][$key['FKCOLUMN_NAME']] = $key['PKCOLUMN_NAME'];
} else {
$table->foreignKeys[$key['FK_NAME']] = [
$key['PKTABLE_NAME'],
$key['FKCOLUMN_NAME'] => $key['PKCOLUMN_NAME'],
];
}
}
$table->foreignKeys = array_values($table->foreignKeys);
return $table;
}
/**
* Loads the column information into a [[ColumnSchema]] object.
* @param array $info column information
* @return ColumnSchema the column schema object
*/
protected function loadColumnSchema($info)
{
$column = $this->createColumnSchema();
$column->name = $info['Field'];
$column->allowNull = $info['Null'] === 'YES';
$column->isPrimaryKey = false; // primary key will be set by loadTableSchema() later
$column->autoIncrement = stripos($info['Extra'], 'auto_increment') !== false;
$column->dbType = $info['Type'];
$column->unsigned = strpos($column->dbType, 'unsigned') !== false;
$column->type = self::TYPE_STRING;
if (preg_match('/^([\w ]+)(?:\(([^\)]+)\))?$/', $column->dbType, $matches)) {
$type = strtolower($matches[1]);
$column->dbType = $type . (isset($matches[2]) ? "({$matches[2]})" : '');
if (isset($this->typeMap[$type])) {
$column->type = $this->typeMap[$type];
}
if (!empty($matches[2])) {
if ($type === 'enum') {
$values = preg_split('/\s*,\s*/', $matches[2]);
foreach ($values as $i => $value) {
$values[$i] = trim($value, "'");
}
$column->enumValues = $values;
} else {
$values = explode(',', $matches[2]);
$column->size = $column->precision = (int) $values[0];
if (isset($values[1])) {
$column->scale = (int) $values[1];
}
if ($column->size === 1 && $type === 'bit') {
$column->type = 'boolean';
} elseif ($type === 'bit') {
if ($column->size > 32) {
$column->type = 'bigint';
} elseif ($column->size === 32) {
$column->type = 'integer';
}
}
}
}
}
$column->phpType = $this->getColumnPhpType($column);
if ($column->isPrimaryKey) {
return $column;
}
if ($column->type === 'timestamp' && $info['Default'] === 'SYS_TIMESTAMP' ||
$column->type === 'datetime' && $info['Default'] === 'SYS_DATETIME' ||
$column->type === 'date' && $info['Default'] === 'SYS_DATE' ||
$column->type === 'time' && $info['Default'] === 'SYS_TIME'
) {
$column->defaultValue = new Expression($info['Default']);
} elseif (isset($type) && $type === 'bit') {
$column->defaultValue = hexdec(trim($info['Default'], 'X\''));
} else {
$column->defaultValue = $column->phpTypecast($info['Default']);
}
return $column;
}
/**
* Returns all table names in the database.
* @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema.
* @return array all table names in the database. The names have NO schema name prefix.
*/
protected function findTableNames($schema = '')
{
$pdo = $this->db->getSlavePdo();
$tables = $pdo->cubrid_schema(\PDO::CUBRID_SCH_TABLE);
$tableNames = [];
foreach ($tables as $table) {
// do not list system tables
if ($table['TYPE'] != 0) {
$tableNames[] = $table['NAME'];
}
}
return $tableNames;
}
/**
* Determines the PDO type for the given PHP data value.
* @param mixed $data the data whose PDO type is to be determined
* @return integer the PDO type
* @see http://www.php.net/manual/en/pdo.constants.php
*/
public function getPdoType($data)
{
static $typeMap = [
// php type => PDO type
'boolean' => \PDO::PARAM_INT, // PARAM_BOOL is not supported by CUBRID PDO
'integer' => \PDO::PARAM_INT,
'string' => \PDO::PARAM_STR,
'resource' => \PDO::PARAM_LOB,
'NULL' => \PDO::PARAM_NULL,
];
$type = gettype($data);
return isset($typeMap[$type]) ? $typeMap[$type] : \PDO::PARAM_STR;
}
/**
* @inheritdoc
* @see http://www.cubrid.org/manual/91/en/sql/transaction.html#database-concurrency
*/
public function setTransactionIsolationLevel($level)
{
// translate SQL92 levels to CUBRID levels:
switch ($level) {
case Transaction::SERIALIZABLE:
$level = '6'; // SERIALIZABLE
break;
case Transaction::REPEATABLE_READ:
$level = '5'; // REPEATABLE READ CLASS with REPEATABLE READ INSTANCES
break;
case Transaction::READ_COMMITTED:
$level = '4'; // REPEATABLE READ CLASS with READ COMMITTED INSTANCES
break;
case Transaction::READ_UNCOMMITTED:
$level = '3'; // REPEATABLE READ CLASS with READ UNCOMMITTED INSTANCES
break;
}
parent::setTransactionIsolationLevel($level);
}
/**
* @inheritdoc
*/
public function createColumnSchemaBuilder($type, $length = null)
{
return new ColumnSchemaBuilder($type, $length, $this->db);
}
}
|
<?php
namespace App\Test;
use Silex\WebTestCase;
class HomeTest extends WebTestCase
{
public function createApplication()
{
$app = require __DIR__.'/../src/app.php';
$app['session.test'] = true;
return $app;
}
public function testGetHomePage()
{
$client = $this->createClient();
$client->request('GET', '/todo/1/json');
$response = $client->getResponse()->getContent();
}
}
|
<?php
declare(strict_types=1);
namespace PunktDe\Neos\Mjml;
/*
* This file is part of the PunktDe.Eel.Mjml package.
*
* This package is open source software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/
use Neos\Eel\ProtectedContextAwareInterface;
use Neos\Flow\Configuration\Exception\InvalidConfigurationException;
use Neos\Flow\Core\Bootstrap;
use Neos\Flow\Exception;
use Neos\Flow\Package\PackageManager;
use Neos\Utility\Files;
use Neos\Flow\Annotations as Flow;
class MjmlHelper implements ProtectedContextAwareInterface
{
/**
* @var string
* @Flow\InjectConfiguration(path="mjmlBinPath")
*/
protected $mjmlBinPath;
/**
* @Flow\Inject
* @var PackageManager
*/
protected $packageManager;
/**
* @Flow\Inject
* @var Bootstrap
*/
protected $bootstrap;
/**
* @param string $mjmlSource
* @return string
* @throws Exception
* @throws InvalidConfigurationException
* @throws \Neos\Utility\Exception\FilesException
*/
public function compile(string $mjmlSource): string
{
$htmlFile = $this->createTemporaryFile('html');
$mjmlFile = $this->createTemporaryFile('mjml');
file_put_contents($mjmlFile, $mjmlSource);
shell_exec(escapeshellarg($this->getMjmlBinaryPath()) . ' -r ' . escapeshellarg($mjmlFile) . ' -o ' . escapeshellarg($htmlFile));
$compiledHtml = file_get_contents($htmlFile);
Files::unlink($htmlFile);
Files::unlink($mjmlFile);
return $compiledHtml;
}
/**
* @throws InvalidConfigurationException
* @throws Exception
* @return string
*/
protected function getMjmlBinaryPath(): string
{
$packageResourcePath = $this->packageManager->getPackage('PunktDe.Neos.Mjml')->getResourcesPath();
$mjmlBinPath = str_replace('{PACKAGERESOURCEROOT}', $packageResourcePath, $this->mjmlBinPath);
if (!is_file($mjmlBinPath)) {
throw new InvalidConfigurationException(sprintf('The mjml binary in the configured path "%s" was not found', $mjmlBinPath), 1519111452);
}
if (!is_executable($mjmlBinPath)) {
throw new Exception(sprintf('The mjml binary in the configured path "%s" is not executable', $mjmlBinPath), 1519111547);
}
return $mjmlBinPath;
}
/**
* @param $prefix
* @return bool|string
* @throws \Neos\Utility\Exception\FilesException
*/
protected function createTemporaryFile($prefix)
{
$items = [FLOW_PATH_TEMPORARY_BASE, $this->bootstrap->getContext(), 'Mjml'];
$path = Files::concatenatePaths($items);
Files::createDirectoryRecursively($path);
$temporaryFileName = tempnam($path, $prefix);
return $temporaryFileName;
}
/**
* @param string $methodName
* @return bool
*/
public function allowsCallOfMethod($methodName)
{
return true;
}
}
|
<?php
namespace Laravel\Passport\Console;
use Illuminate\Console\Command;
use Illuminate\Support\Carbon;
use Laravel\Passport\AuthCode;
use Laravel\Passport\RefreshToken;
use Laravel\Passport\Token;
class PurgeCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'passport:purge
{--revoked : Only purge revoked tokens and authentication codes}
{--expired : Only purge expired tokens and authentication codes}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Purge revoked and / or expired tokens and authentication codes';
/**
* Execute the console command.
*/
public function handle()
{
$expired = Carbon::now()->subDays(7);
if (($this->option('revoked') && $this->option('expired')) ||
(! $this->option('revoked') && ! $this->option('expired'))) {
Token::where('revoked', 1)->orWhereDate('expires_at', '<', $expired)->delete();
AuthCode::where('revoked', 1)->orWhereDate('expires_at', '<', $expired)->delete();
RefreshToken::where('revoked', 1)->orWhereDate('expires_at', '<', $expired)->delete();
$this->info('Purged revoked items and items expired for more than seven days.');
} elseif ($this->option('revoked')) {
Token::where('revoked', 1)->delete();
AuthCode::where('revoked', 1)->delete();
RefreshToken::where('revoked', 1)->delete();
$this->info('Purged revoked items.');
} elseif ($this->option('expired')) {
Token::whereDate('expires_at', '<', $expired)->delete();
AuthCode::whereDate('expires_at', '<', $expired)->delete();
RefreshToken::whereDate('expires_at', '<', $expired)->delete();
$this->info('Purged items expired for more than seven days.');
}
}
}
|
<?php $this->load->view('back/meta') ?>
<div class="wrapper">
<?php $this->load->view('back/head') ?>
<?php $this->load->view('back/sidebar') ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<h1>Tambah user baru</h1>
</div>
<!-- /.content-header -->
<!-- Main content -->
<section class="content">
<!-- Small boxes (Stat box) -->
<div class="row">
<div class="col-md-6">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Tambah User Baru</h3>
</div>
<div id="infoMessage"><?php echo $message; ?></div>
<?php echo form_open("admin/auth/create_user"); ?>
<div class="box-body">
<div class="form-group">
<?php echo lang('create_user_fname_label', 'first_name'); ?> <br />
<?php echo form_input($first_name); ?>
</div>
<div class="form-group">
<?php echo lang('create_user_lname_label', 'last_name'); ?> <br />
<?php echo form_input($last_name); ?>
</div>
<?php
if ($identity_column !== 'email') {
echo '<div class="form-group">';
echo lang('create_user_identity_label', 'identity');
echo '<br />';
echo form_error('identity');
echo form_input($identity);
echo '</div>';
}
?>
<div class="form-group">
<?php echo lang('create_user_company_label', 'company'); ?> <br />
<?php echo form_input($company); ?>
</div>
<div class="form-group">
<?php echo lang('create_user_email_label', 'email'); ?> <br />
<?php echo form_input($email); ?>
</div>
<div class="form-group">
<?php echo lang('create_user_phone_label', 'phone'); ?> <br />
<?php echo form_input($phone); ?>
</div>
<div class="form-group">
<?php echo lang('create_user_password_label', 'password'); ?> <br />
<?php echo form_input($password); ?>
</div>
<div class="form-group">
<?php echo lang('create_user_password_confirm_label', 'password_confirm'); ?> <br />
<?php echo form_input($password_confirm); ?>
</div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-success">Kirim</button>
</div>
<?php echo form_close(); ?>
</div>
</div>
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php $this->load->view('back/footer') ?>
</div>
<!-- ./wrapper -->
<?php $this->load->view('back/js') ?>
</body>
</html>
|
<?php
declare(strict_types=1);
/**
* This file is part of the Phalcon Framework.
*
* (c) Phalcon Team <team@phalcon.io>
*
* For the full copyright and license information, please view the LICENSE.txt
* file that was distributed with this source code.
*/
namespace Phalcon\Test\Integration\Validation\Validator\PresenceOf;
use IntegrationTester;
use Phalcon\Test\Fixtures\Traits\ValidationTrait;
use Phalcon\Validation\Validator\PresenceOf;
class HasOptionCest
{
use ValidationTrait;
/**
* Tests Phalcon\Validation\Validator\PresenceOf :: hasOption()
*
* @author Phalcon Team <team@phalcon.io>
* @since 2018-11-13
*/
public function validationValidatorPresenceOfHasOption(IntegrationTester $I)
{
$I->wantToTest('Validation\Validator\PresenceOf - hasOption()');
$validator = new PresenceOf(
[
'message' => 'This is a message',
]
);
$this->checkHasOption($I, $validator);
}
}
|
@extends('layouts.app')
@section('section')
<div class="col-md-6 col-md-offset-3">
<div class="box box-primary ">
<div class="box-body mx-auto text-center">
<a href="{{url('home')}}" id="welcomeHeader" style="text-decoration: none;" >
<img src="{{url('images/project tracker.png')}}" class="img img-responsive img-thumbnail margin" style="display:inline; background:transparent; border:none;" alt="Project Tracker" width="250" height="250">
</a>
<h3 ><b>List of Projects</b></h3>
<div class="col-md-6 col-md-offset-3">
<ol >
@foreach(App\project_detail::all() as $project)
<li ><b>{{$project->name}}</b></li>
@endforeach
</ol>
</div>
</div>
</div>
@endsection
|
<script type="text/javascript">
var base_path = "<?php echo Yii::app()->params->base_path;?>";
$j(document).ready(function(){
$j('.delete_this').click(function(){
var id= $j(this).attr('lang');
if(confirm("Do you want to delete this record"))
{
window.location=base_path+"admin/deleteApiFunction/id/"+id;
}
})
})
function approveFunction(obj)
{
var statusValue='0';
if($j(obj).attr('checked'))
{
statusValue='1';
}
$j.ajax({
type: "POST",
url: base_path+"admin/approvalApiFunction",
data: "statusName="+$j(obj).attr('name')+"&statusValue="+statusValue+"&id="+$j(obj).attr('lang')+"&"+csrfToken,
cache: false,
success: function(data)
{
if(statusValue=='1')
{
alert("Approved successfully");
}
else
{
alert("Disapproved successfully");
}
}
});
}
function validateAll()
{
var flag=0;
return true;
}
</script>
<div align="center">
<?php if(Yii::app()->user->hasFlash('success')): ?>
<div id="msgbox" class="clearmsg"> <?php echo Yii::app()->user->getFlash('success'); ?></div>
<div class="clear"></div>
<?php endif; ?>
<?php if(Yii::app()->user->hasFlash('error')): ?>
<div id="msgbox" class="clearmsg errormsg"> <?php echo Yii::app()->user->getFlash('error'); ?></div>
<div class="clear"></div>
<?php endif; ?>
</div>
<div class="clear"></div>
<div id="content">
<h1>
<a href="<?php echo Yii::app()->params->base_path;?>admin/apiModules">Module</a>
<img src="<?php echo Yii::app()->params->base_url;?>images/path-arrow.png" alt="" border="0" />
Function Listing
</h1>
<div>
<?php echo CHtml::beginForm(Yii::app()->params->base_path.'admin/apiFunctions/','post',array('id' => 'events','name' => 'events','enctype' => 'multipart/form-data','onsubmit' => 'return validateAll();')) ?>
<table width="100%" border="0" class="search-table" cellpadding="0" cellspacing="0">
<tr>
<td width="8%" align="left">Search :</td>
<td width="28%" align="left">
<input name="findname" id="findname" class="textbox2" type="text" value="<?php echo Yii::app()->session['findname']; ?>"/>
</td>
<td width="9%" align="left">
<input type="submit" name="Search" value="Search" class="btn" />
</td>
<td width="55%" align="left">
<input type="button" name="" value="Show All" onclick="window.location.href='<?php echo Yii::app()->params->base_path;?>admin/apiFunctions/'" class="btn" />
</td>
<td align="right">
<input type="button" name="" value="Add Function" onclick="window.location.href='<?php echo Yii::app()->params->base_path;?>admin/addApiFunction'" class="btn" />
</td>
</tr>
</table>
<?php echo CHtml::endForm();?>
</div>
<div id="employee">
<div class="content-box">
<table cellpadding="0" cellspacing="0" border="0" class="listing api" width="100%">
<tr>
<th>No</th>
<th>Function</th>
<th align="left">Module</th>
<th align="left">Approved By</th>
<th class="alignCenter">Parameters</th>
<th align="left">Resources</th>
<th class="alignCenter">Edit</th>
<th class="alignCenter">Delete</th>
</tr>
<?php
if(count($functionList) > 0)
{
$i=1;
foreach($functionList as $functionList){ ?>
<tr>
<td align="center">
<?php
echo $i+($pagination->getCurrentPage()*$pagination->getLimit());
?>
</td>
<td><?php echo $functionList['function_name'];?></td>
<td align="center"><?php echo $functionList['moduleLabel'];?></td>
<td align="left">
<input type="checkbox" <?php if(isset($functionList['uiTeamApproval']) && $functionList['uiTeamApproval']==1){ ?> checked="checked" <?php } ?> name="uiTeamApproval" lang="<?php echo $functionList['id'];?>" onchange="approveFunction(this)" />
UI Team<br />
<input type="checkbox" <?php if(isset($functionList['backendTeamApproval']) && $functionList['backendTeamApproval']==1){ ?> checked="checked" <?php } ?> name="backendTeamApproval" lang="<?php echo $functionList['id'];?>" onchange="approveFunction(this)" />
Backend Team<br />
<input type="checkbox" <?php if(isset($functionList['overallApproval']) && $functionList['overallApproval']==1){ ?> checked="checked" <?php } ?> name="overallApproval" lang="<?php echo $functionList['id'];?>" onchange="approveFunction(this)" />
overall<br />
</td>
<td align="center">
<a href="<?php echo Yii::app()->params->base_path;?>admin/functionParametes/fn_id/<?php echo $functionList['id'];?>" title="View Parametes">
<img src="<?php echo Yii::app()->params->base_url;?>images/login_key.png"/>
</a>
</td>
<td align="left">
<div class="resources">
<table cellpadding="0" cellspacing="0" border="0" class="inner-listing">
<tr>
<td>
<div class="resources-url"><b>URL</b>:<?php if(isset($functionList['resource_url'])){ echo $functionList['resource_url']; }?>
</div>
</td>
</tr>
<tr>
<td>
<b>Res. Formats</b>:<?php if(isset($functionList['response_formats'])){ echo $functionList['response_formats']; }?>
</td>
</tr>
<tr>
<td>
<b>Http Methods</b>:<?php if(isset($functionList['http_methods'])){ echo $functionList['http_methods']; }?>
</td>
</tr>
<tr>
<td>
<a href="<?php echo Yii::app()->params->base_path;?>admin/apiResource/fn_id/<?php echo $functionList['id'];?>" title="Edit Resources">
<img src="<?php echo Yii::app()->params->base_url;?>images/login_key.png"/>
</a>
</td>
</tr>
</table>
</div>
</td>
<td align="center">
<a href="<?php echo Yii::app()->params->base_path;?>admin/addApiFunction/id/<?php echo $functionList['id'];?>" title="Edit Function" >
<img src="<?php echo Yii::app()->params->base_url;?>images/edit-icon.png"/>
</a>
</td>
<td align="center">
<center>
<a href="javascript:;" lang="<?php echo $functionList['id'];?>" class="delete_this" title="Delete Seeker">
<img src="<?php echo Yii::app()->params->base_url;?>images/false.png" alt="Delete"/>
</a>
</center>
</td>
</tr>
<?php
$i++;
}
}else{?>
<tr>
<td colspan="100%">No Record Found</td>
</tr>
<?php
}?>
</table>
</div>
<?php
if($pagination->getItemCount() > $pagination->getLimit()){?>
<div class="pagination" style="margin:0 auto;">
<?php
$this->widget('application.extensions.WebPager',
array('cssFile'=>Yii::app()->params->base_url.'css/style.css',
'pages' => $pagination,
'id'=>'link_pager',
));
?>
</div>
<?php
}?>
</div>
</div>
|
<?php
declare(strict_types=1);
namespace Jellyfish\RoadRunner;
use Pimple\Container;
use Pimple\ServiceProviderInterface;
class RoadRunnerServiceProvider implements ServiceProviderInterface
{
/**
* @param \Pimple\Container $container
*
* @return void
*/
public function register(Container $container): void
{
$this->registerRoadRunnerFacade($container);
}
/**
* @param \Pimple\Container $container
*
* @return \Jellyfish\RoadRunner\RoadRunnerServiceProvider
*/
protected function registerRoadRunnerFacade(Container $container): RoadRunnerServiceProvider
{
$container->offsetSet(
RoadRunnerConstants::FACADE,
static fn () => new RoadRunnerFacade(new RoadRunnerFactory())
);
return $this;
}
}
|
@extends('layouts.frontoffice')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">{{ __('Register') }}</div>
<div class="card-body">
<form method="POST" action="{{ route('register') }}">
@csrf
<div class="form-group row">
<label for="name" class="col-md-4 col-form-label text-md-right">{{ __('Name') }}</label>
<div class="col-md-6">
<input id="name" type="text" class="form-control @error('name') is-invalid @enderror" name="name" value="{{ old('name') }}" required autocomplete="name" autofocus>
@error('name')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row">
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email">
@error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row">
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password">
@error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row">
<label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label>
<div class="col-md-6">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password">
</div>
</div>
<div class="form-group row mb-0">
<div class="col-md-6 offset-md-4">
<button type="submit" class="btn btn-primary">
{{ __('Register') }}
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<table>
<tr>
<td>Codigo</td>
<td>Serie</td>
<td>Numero_Correo</td>
<td>Fecha</td>
<td>IGB_TOTAL</td>
<td>sub_TOTAL</td>
<td>TOTAL</td>
</tr>
@foreach($dato as $value)
<tr><td>{{$value->idcompra}}</td>
<td>{{$value->serie}}</td>
<td>{{$value->nun_correo}}</td>
<td>{{$value->fec_rec}}</td>
<td>{{$value->igb_total}}</td>
<td>{{$value->sub_total}}</td>
<td>{{$value->total}}</td>
</tr>
@endforeach
</table>
</body>
</html>
|
<?php
namespace Home\Controller;
use Think\Controller;
class CateController extends CommonController {
public function index(){
$article=M('article');
$count= $article->where(array('cateid'=>I('id')))->count();
$Page= new \Think\Page($count,2);
$show= $Page->show();
$list = $article->where(array('cateid'=>I('id')))->order('time desc')->limit($Page->firstRow.','.$Page->listRows)->select();
$this->assign('list',$list);
$this->assign('page',$show);
$this->current();
$this->display();
}
public function current(){
$current=I('id');
$this->assign('current',$current);
}
}
|
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateReservationItemsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('reservation_items', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('reservation_id')->unsigned();
$table->bigInteger('product_id')->unsigned();
$table->string('notes', 255);
$table->timestamps();
$table->foreign('reservation_id')->references('id')->on('reservations')->onDelete('cascade');
$table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('reservation_items');
}
}
|
<?php
/*
* This file is part of Payload.
*
* (c) DraperStudio <hello@draperstudio.tech>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace DraperStudio\Payload\Serialisers;
use DraperStudio\Payload\Contracts\Serialiser;
use Symfony\Component\Serializer\Encoder\XmlEncoder;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\Serializer as SymfonySerialiser;
/**
* Class XmlSerialiser.
*/
class XmlSerialiser implements Serialiser
{
/**
* @param $input
*
* @return mixed
*/
public function serialise($input)
{
return (new SymfonySerialiser(
[new ObjectNormalizer()], [new XmlEncoder()]
))->serialize($input, 'xml');
}
}
|
<?php
include "pages/includes/header.php";
?>
<div class="row">
<div class="col-md-12">
<?php
if (isset($_GET['success'])) {
$msg="<strong>Fragility Index field successfully added!</strong>";
echo '<div class="alert alert-info" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>';
echo $msg;
echo '</div>';
}
?>
<?php
if (isset($_GET['update'])) {
$msg = $_GET['update'];
$msg="<strong>Fragility Index field successfully updated!</strong>";
echo '<div class="alert alert-info" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>';
echo $msg;
echo '</div>';
}
?>
<div class="box box-warning" style="width: 100%">
<div class="box-header">
<!-- <h3 class="box-title">List of beneficiaries</h3> -->
</div><!-- /.box-header -->
<div class="box-body">
<section class="content-header">
<h1>
View Fragility Index Table<br>
<!-- <small><a href="addfunding"><button type="button" class="btn btn-primary btn-block btn-flat">Add Funding</button></small> -->
</h1>
<ol class="breadcrumb">
<li><a href="index"><i class="fa fa-dashboard"></i> Home</a></li>
<li><a href="addfragilityindex">Add Fragility Index</a></li>
<li class="active">View Fragility Index</li>
</ol>
</section>
<hr>
<section class="content-button">
<div class="pull-left">
<a href="addfragilityindex" type="button" class="btn btn-warning btn-block btn-flat"><i class="fa fa-plus"></i> Add Fragility Index</a>
</div>
</section>
<br>
<hr>
<table id="example" class="table table-bordered table-hover nowrap" style="width:100%">
<thead>
<tr>
<th>Fragility Index ID</th>
<th>Region</th>
<th>Country</th>
<th>Security Contact</th>
<th>Fragility Index</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$query = "SELECT * FROM fragility_index ORDER BY fragility_index_id DESC";
$fragility_query = mysqli_query($connection,$query);
$counter = 0;
if (!$fragility_query) {
die('query failed'.mysqli_error($connection));
}
while ($row = mysqli_fetch_assoc($fragility_query)) {
$id = $row["fragility_index_id"];
$region = $row["region"];
$country = $row["country"];
$contact = $row["security_contact"];
$fragilityindex = $row["fragility_index"];
$globalpeaceindex = $row["global_peace_index"];
$failedstatesindex = $row["failed_states_index"];
$headeclaration = $row["hea_declaration"];
$hazards = $row["hazards"];
$population = $row["population"];
$displacedpeople = $row["displaced_people"];
$fieldspend = $row["field_spend"];
$wvfragilityindexrank = $row["wv_fragility_index_rank_global"];
echo "<tr>";
echo "<td>{$id}</td>";
echo "<td>{$region}</td>";
echo "<td>{$country}</td>";
echo "<td>{$contact}</td>";
echo "<td>{$fragilityindex}</td>";
echo "<td><a type='button' class='btn btn-sm btn-primary' data-toggle='modal' data-placement='bottom' rel='tooltip' title='View row' data-target='#exampleModal_".$counter."'>
<span><i class='fa fa-eye'></i></span>
</a>
<a class='btn btn-sm btn-warning' href='update_fragilityIndex.php?editfragility={$id}' data-toggle='tooltip' data-placement='bottom' title='Edit row'><i class='fa fa-pencil-square-o' aria-hidden='true'></i></a>
<a class='btn btn-sm btn-danger delete_fragility' data-fragility-id=".$row['fragility_index_id']." href='javascript:void(0)' data-toggle='tooltip' data-placement='bottom' title='Delete row'><i class='fa fa-trash-o' aria-hidden='true'></i></td>";
echo "</tr>";
echo '<div class="modal fade" id="exampleModal_'.$counter.'" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">';
echo "Beneficiary Id Number"." ".$id;
echo '</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">';
echo '<ul class="list-group">';
echo '<li class="list-group-item list-group-item-primary">';
echo 'Region'.' - '.$region;
echo '</li>';
echo '<li class="list-group-item list-group-item-light">';
echo 'Country'.' - '.$country;
echo '</li>';
echo '<li class="list-group-item list-group-item-primary">';
echo 'Security Contact'.' - '.$contact;
echo '</li>';
echo '<li class="list-group-item list-group-item-primary">';
echo 'Fragility Index'.' - '.$fragilityindex;
echo '</li>';
echo '<li class="list-group-item list-group-item-primary">';
echo 'Global Peace Index'.' - '.$globalpeaceindex;
echo '</li>';
echo '<li class="list-group-item list-group-item-primary">';
echo 'Failed States Index'.' - '.$failedstatesindex;
echo '</li>';
echo '<li class="list-group-item list-group-item-primary">';
echo 'HEA Declaration'.' - '.$headeclaration;
echo '</li>';
echo '<li class="list-group-item list-group-item-primary">';
echo 'Hazards'.' - '.$hazards;
echo '</li>';
echo '<li class="list-group-item list-group-item-primary">';
echo 'Population (million people)'.' - '.$population;
echo '</li>';
echo '<li class="list-group-item list-group-item-primary">';
echo 'Displaced People'.' - '.$displacedpeople;
echo '</li>';
echo '<li class="list-group-item list-group-item-primary">';
echo 'Field spend (in million US$)'.' - '.$fieldspend;
echo '</li>';
echo '<li class="list-group-item list-group-item-primary">';
echo 'WV Fragility index rank(Global)'.' - '.$wvfragilityindexrank;
echo '</li>';
echo '</ul>';
echo '</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>';
$counter++;
}
?>
</tbody>
<tfoot>
<tr>
<th>Beneficiary Id</th>
<th>Region</th>
<th>Country</th>
<th>Period</th>
<th>Last Update</th>
<th>Action</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<?php
// if (isset($_GET['delete'])) {
// $deleteew = $_GET['delete'];
// $query = "DELETE FROM fragility_index WHERE fragility_index_id = {$deleteew}";
// $deletedwarning = mysqli_query($connection,$query);
// header("Location:viewfragilityindex.php");
// }
?>
<?php
include "pages/includes/footer.php";
?>
|
<?php
namespace app\models;
use Yii;
use omgdef\multilingual\MultilingualBehavior;
use omgdef\multilingual\MultilingualQuery;
use yii\behaviors\TimestampBehavior;
/**
* This is the model class for table "cms_pages".
*
* @property integer $id
* @property string $created_at
* @property string $updated_at
* @property integer $status
*
* @property CmsPagesLang[] $cmsPagesLangs
*/
class CmsPages extends \yii\db\ActiveRecord {
/**
* @inheritdoc
*/
public static function tableName() {
return 'cms_pages';
}
public function behaviors() {
return [
'ml' => [
'class' => MultilingualBehavior::className(),
'languages' => [
'de' => 'German',
'es' => 'Spanish',
'en-US' => 'English',
],
//'languageField' => 'language',
//'localizedPrefix' => '',
//'requireTranslations' => false',
//'dynamicLangClass' => true',
//'langClassName' => PostLang::className(), // or namespace/for/a/class/PostLang
'defaultLanguage' => 'en-US',
'langForeignKey' => 'page_id',
'tableName' => "{{%cms_pagesLang}}",
'attributes' => [
'title', 'content',
]
],
TimestampBehavior::className(),
];
}
public static function find() {
return new MultilingualQuery(get_called_class());
}
/**
* @inheritdoc
*/
public function rules() {
return [
[['title', 'content'], 'required'],
[['created_at', 'updated_at'], 'safe'],
[['status'], 'integer']
];
}
/**
* @inheritdoc
*/
public function attributeLabels() {
return [
'id' => Yii::t('app', 'ID'),
'created_at' => Yii::t('app', 'Created At'),
'updated_at' => Yii::t('app', 'Updated At'),
'status' => Yii::t('app', 'Status'),
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getCmsPagesLangs() {
return $this->hasMany(CmsPagesLang::className(), ['page_id' => 'id']);
}
}
|
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddStatusToNewsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('news', function (Blueprint $table) {
$table->tinyInteger('status');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('news', function (Blueprint $table) {
//
});
}
}
|
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
class VerifyCsrfToken extends BaseVerifier
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'news/*'
];
}
|
<?php namespace ProcessWire; ?>
<div class='uk-container uk-container-small uk-margin-medium-top'>
<?php
// Find comments that don't have a parent ( parent_id=0 )
$comments = page()->comments->find("parent_id=0");
// Show Comments ( https://processwire.com/talk/topic/21926-paginating-comments-using-pw-built-in-pagination-in-uikit-3-siteblog-profile/ )
echo ukComments($comments, ['paginate' => true, 'limit' => 12]);
// Comment form
echo ukHeading3(setting('post-comment'), "icon=comment");
echo ukCommentForm(page()->comments);
?>
</div>
|
<?php
/**
* File: RawClientException.php
* Copyright 2016 Anton Lempinen <bafoed@bafoed.ru>
* This file is part of TorControl project.
*/
class RawClientException extends \Exception {}
|
<?php
/*
Plugin Name: All In One SEO Pack
Plugin URI: http://semperfiwebdesign.com
Description: Out-of-the-box SEO for your WordPress blog. <a href="admin.php?page=all-in-one-seo-pack/aioseop_class.php">Options configuration panel</a> | <a href="http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=plugins" target="_blank">Upgrade to Pro Version</a> | <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0¤cy_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8">Donate</a> | <a href="http://semperplugins.com/support/" >Support</a> | <a href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank" title="Amazon Wish List">Amazon Wishlist</a>
Version: 2.2.6.2
Author: Michael Torbert
Author URI: http://michaeltorbert.com
*/
/*
Copyright (C) 2008-2014 Michael Torbert, semperfiwebdesign.com (michael AT semperfiwebdesign DOT com)
Original code by uberdose of uberdose.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//register_activation_hook(__FILE__,'aioseop_activate_pl');
/**
* @package All-in-One-SEO-Pack
* @version 2.2.6.2
*/
if ( ! defined( 'ABSPATH' ) ) return;
global $aioseop_plugin_name;
$aioseop_plugin_name = 'All in One SEO Pack';
if ( ! defined( 'AIOSEOP_PLUGIN_NAME' ) )
define( 'AIOSEOP_PLUGIN_NAME', $aioseop_plugin_name );
if ( ! defined( 'AIOSEOP_VERSION' ) )
define( 'AIOSEOP_VERSION', '2.2.6.2' );
if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
} elseif ( AIOSEOP_PLUGIN_DIR != plugin_dir_path( __FILE__ ) ) {
add_action( 'admin_notices', create_function( '', 'echo "' . "<div class='error'>" . sprintf(
__( "%s detected a conflict; please deactivate the plugin located in %s.", 'all_in_one_seo_pack' ),
$aioseop_plugin_name, AIOSEOP_PLUGIN_DIR ) . "</div>" . '";' ) );
return;
}
if ( ! defined( 'AIOSEOP_PLUGIN_BASENAME' ) )
define( 'AIOSEOP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
if ( ! defined( 'AIOSEOP_PLUGIN_DIRNAME' ) )
define( 'AIOSEOP_PLUGIN_DIRNAME', dirname( AIOSEOP_PLUGIN_BASENAME ) );
if ( ! defined( 'AIOSEOP_PLUGIN_URL' ) )
define( 'AIOSEOP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
if ( ! defined( 'AIOSEOP_PLUGIN_IMAGES_URL' ) )
define( 'AIOSEOP_PLUGIN_IMAGES_URL', AIOSEOP_PLUGIN_URL . 'images/' );
if ( ! defined( 'AIOSEOP_BASELINE_MEM_LIMIT' ) )
define( 'AIOSEOP_BASELINE_MEM_LIMIT', 268435456 ); // 256MB
if ( ! defined( 'WP_CONTENT_URL' ) )
define( 'WP_CONTENT_URL', site_url() . '/wp-content' );
if ( ! defined( 'WP_ADMIN_URL' ) )
define( 'WP_ADMIN_URL', site_url() . '/wp-admin' );
if ( ! defined( 'WP_CONTENT_DIR' ) )
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
if ( ! defined( 'WP_PLUGIN_URL' ) )
define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' );
if ( ! defined( 'WP_PLUGIN_DIR' ) )
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
global $aiosp, $aioseop_options, $aioseop_modules, $aioseop_module_list, $aiosp_activation, $aioseop_mem_limit, $aioseop_get_pages_start, $aioseop_admin_menu;
$aioseop_get_pages_start = $aioseop_admin_menu = 0;
$aioseop_options = get_option( 'aioseop_options' );
$aioseop_mem_limit = @ini_get( 'memory_limit' );
if ( !function_exists( 'aioseop_convert_bytestring' ) ) {
function aioseop_convert_bytestring( $byteString ) {
$num = 0;
preg_match( '/^\s*([0-9.]+)\s*([KMGTPE])B?\s*$/i', $byteString, $matches );
if ( !empty( $matches ) ) {
$num = ( float )$matches[1];
switch ( strtoupper( $matches[2] ) ) {
case 'E': $num = $num * 1024;
case 'P': $num = $num * 1024;
case 'T': $num = $num * 1024;
case 'G': $num = $num * 1024;
case 'M': $num = $num * 1024;
case 'K': $num = $num * 1024;
}
}
return intval( $num );
}
}
if ( is_array( $aioseop_options ) && isset( $aioseop_options['modules'] ) && isset( $aioseop_options['modules']['aiosp_performance_options'] ) ) {
$perf_opts = $aioseop_options['modules']['aiosp_performance_options'];
if ( isset( $perf_opts['aiosp_performance_memory_limit'] ) )
$aioseop_mem_limit = $perf_opts['aiosp_performance_memory_limit'];
if ( isset( $perf_opts['aiosp_performance_execution_time'] ) && ( $perf_opts['aiosp_performance_execution_time'] !== '' ) ) {
@ini_set( 'max_execution_time', (int)$perf_opts['aiosp_performance_execution_time'] );
@set_time_limit( (int)$perf_opts['aiosp_performance_execution_time'] );
}
} else {
$aioseop_mem_limit = aioseop_convert_bytestring( $aioseop_mem_limit );
if ( ( $aioseop_mem_limit > 0 ) && ( $aioseop_mem_limit < AIOSEOP_BASELINE_MEM_LIMIT ) )
$aioseop_mem_limit = AIOSEOP_BASELINE_MEM_LIMIT;
}
if ( !empty( $aioseop_mem_limit ) ) {
if ( !is_int( $aioseop_mem_limit ) )
$aioseop_mem_limit = aioseop_convert_bytestring( $aioseop_mem_limit );
if ( ( $aioseop_mem_limit > 0 ) && ( $aioseop_mem_limit <= AIOSEOP_BASELINE_MEM_LIMIT ) )
@ini_set( 'memory_limit', $aioseop_mem_limit );
}
$aiosp_activation = false;
$aioseop_module_list = Array( 'sitemap', 'opengraph', 'robots', 'file_editor', 'importer_exporter', 'performance' ); // list all available modules here
if ( class_exists( 'All_in_One_SEO_Pack' ) ) {
add_action( 'admin_notices', create_function( '', 'echo "<div class=\'error\'>The All In One SEO Pack class is already defined";'
. "if ( class_exists( 'ReflectionClass' ) ) { \$r = new ReflectionClass( 'All_in_One_SEO_Pack' ); echo ' in ' . \$r->getFileName(); } "
. ' echo ", preventing All In One SEO Pack from loading.</div>";' ) );
return;
}
/**
* Check if we just got activated.
*/
if ( !function_exists( 'aioseop_activate' ) ) {
function aioseop_activate() {
global $aiosp_activation;
$aiosp_activation = true;
delete_transient( "aioseop_oauth_current" );
}
}
register_activation_hook( __FILE__, 'aioseop_activate' );
add_action( 'plugins_loaded', 'aioseop_init_class' );
if ( !function_exists( 'aioseop_init_class' ) ) {
function aioseop_init_class() {
global $aiosp;
require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_functions.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_class.php' );
$aiosp = new All_in_One_SEO_Pack();
if ( aioseop_option_isset( 'aiosp_unprotect_meta' ) )
add_filter( 'is_protected_meta', 'aioseop_unprotect_meta', 10, 3 );
add_action( 'init', array( $aiosp, 'add_hooks' ) );
if ( defined( 'DOING_AJAX' ) && !empty( $_POST ) && !empty( $_POST['action'] ) && ( $_POST['action'] === 'aioseop_ajax_scan_header' ) ) {
remove_action( 'init', array( $aiosp, 'add_hooks' ) );
add_action('admin_init', 'aioseop_scan_post_header' );
add_action('shutdown', 'aioseop_ajax_scan_header' ); // if the action doesn't run -- pdb
include_once(ABSPATH . 'wp-admin/includes/screen.php');
global $current_screen;
if ( class_exists( 'WP_Screen' ) )
$current_screen = WP_Screen::get( 'front' );
}
}
}
add_action( 'init', 'aioseop_load_modules', 1 );
//add_action( 'after_setup_theme', 'aioseop_load_modules' );
if ( is_admin() ) {
add_action( 'wp_ajax_aioseop_ajax_save_meta', 'aioseop_ajax_save_meta' );
add_action( 'wp_ajax_aioseop_ajax_save_url', 'aioseop_ajax_save_url' );
add_action( 'wp_ajax_aioseop_ajax_delete_url', 'aioseop_ajax_delete_url' );
add_action( 'wp_ajax_aioseop_ajax_scan_header', 'aioseop_ajax_scan_header' );
add_action( 'wp_ajax_aioseop_ajax_save_settings', 'aioseop_ajax_save_settings');
add_action( 'wp_ajax_aioseop_ajax_get_menu_links', 'aioseop_ajax_get_menu_links');
}
if ( !function_exists( 'aioseop_scan_post_header' ) ) {
function aioseop_scan_post_header() {
require_once( ABSPATH . WPINC . '/default-filters.php' );
global $wp_query;
$wp_query->query_vars['paged'] = 0;
query_posts('post_type=post&posts_per_page=1');
if (have_posts()) the_post();
}
}
|
@extends('layouts.authLayout')
@section('content')
<div class="container-login100" style="background-image: url('{{asset('images/home-banner.jpg')}}');background-size: cover">
<div class="wrap-login100 p-l-55 pr-55 p-t-80 p-b-30">
<form class="login100-form validate-form" action="" method="POST">
@csrf
<span class="login100-form-title p-b-37 mb-5">
Forgot Password
</span>
@if (session('success'))
<div class="alert alert-success" role="alert">
{{ session('success') }}
</div>
@endif
@if (session('error'))
<div class="alert alert-danger" role="alert">
{{ session('error') }}
</div>
@endif
<div class="wrap-input100 validate-input m-b-20" data-validate="Enter username or email">
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
<span class="focus-input100"></span>
</div>
@error('name')
<p class='error'>{{ $message }}</p>
@enderror
<div class="container-login100-form-btn mb-4">
<button class="login100-form-btn" type="submit">
{{ __('Send Password Reset Link') }}
</button>
</div>
</form>
</div>
</div>
@endsection
|
@php
$i = 1
@endphp
@foreach($equipamentos as $equipamento)
<tr>
<td align="center">{{$i}}</td>
<td>{{$equipamento->tipo}}</td>
<td>{{$equipamento->marca}}</td>
<td>{{$equipamento->modelo}}</td>
<td>{{$equipamento->serial}}</td>
</tr>
@if($i == 30)
@break
@endif
@php
$i++
@endphp
@endforeach
{{-- @include('layouts.layout-two-pages-two') --}}
|
<?php
namespace ImmobiliareLabs\BrazeSDK\Test\Response\EmailTemplates;
use ImmobiliareLabs\BrazeSDK\Response\EmailTemplates\InfoResponse;
use PHPUnit\Framework\TestCase;
class InfoResponseTest extends TestCase
{
public function testFillFromArray(): void
{
$response = new InfoResponse();
$createdAt = '2022-01-26 17:43:00';
$updatedAt = '2022-01-26 17:48:00';
$tags = ['tag'];
$response->fillFromArray([
'created_at' => $createdAt,
'updated_at' => $updatedAt,
'tags' => $tags,
]);
$this->assertEquals(new \DateTimeImmutable($createdAt), $response->created_at);
$this->assertEquals(new \DateTimeImmutable($updatedAt), $response->updated_at);
$this->assertSame($tags, $response->tags);
}
}
|
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
class hair_color extends Model
{
//
protected $table="hair_color";
public $timestamps = false;
public function users_properties()
{
return $this->hasMany('App\user_properties','Hair_color','id');
}
}
|
<?php
use yii\db\Migration;
/**
* Handles the creation of table `{{%reception}}`.
*/
class m190603_141216_create_reception_table extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->createTable('{{%reception}}', [
'id' => $this->primaryKey(),
'text' => $this->text(),
]);
$this->insert('reception', ['id' => 1]);
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropTable('{{%reception}}');
}
}
|
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class Student extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('student', function (Blueprint $table) {
$table->increments('idStudent');
$table->string('nameStudent', 150);
$table->string('username', 50)->unique();
$table->string('passWord', 50);
$table->date('DoB');
$table->string('email', 150)->unique();
$table->char('phone', 10)->unique();
$table->unsignedInteger('idGrade');
$table->foreign('idGrade')->references('idGrade')->on('grade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('student');
}
}
|
<?php
/**
* SurveyeditorupdateSettingsConfigCredentials
*
* PHP version 5
*
* @category Class
* @package AnketologClient
* @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Документация к Анкетолог API (beta-версия)
*
* ### Библиотеки для работы с API * **PHP** https://github.com/anketolog/AnketologClient-php ### Библиотеки на других языках Вы можете самостоятельно сгенерировать библиотеку, [на любом доступном языке](https://github.com/swagger-api/swagger-codegen#api-clients), воспользовавшись [генератором](http://swagger.io/swagger-codegen). Конфигурационный файл можно скачать по [этой ссылке](https://anketolog.ru/api/external/v2/anketolog.yaml). ### Работа с API Работа с API осуществляется при помощи отправки POST-запросов на адрес: ``` https://apiv2.anketolog.ru/{resource} ``` Необходимые параметры передаются в теле запроса в виде JSON-строки: ``` { \"survey_id\": \"ID опроса\" } ``` Для авторизации необходимо передать заголовок **X-Anketolog-ApiKey** в запросе: ``` X-Anketolog-ApiKey: API_KEY ``` Ключ доступа к API можно получить в [разделе настроек](https://anketolog.ru/user/account/apikey). ### Пример запроса ``` curl -X POST \\ --header 'X-Anketolog-ApiKey: API_KEY' \\ -d '{\"survey_id\": \"ID опроса\"}' \\ 'https://apiv2.anketolog.ru/survey/manage/info' ``` ### Webhook Webhook – это уведомление сторонних приложений о событиях, произошедших на сайте anketolog.ru, путем отправки уведомлений. Во время возникновения события сервер посылает POST-запрос по адресу, который указан в URL. Настроить Webhook можно в [разделе настроек](https://anketolog.loc/user/account/apikey). ### Webhook : Ответ на анкету ``` action=new-answer data={ \"answer\": { \"id\": 0, \"survey_id\": 0, \"revision_id\": 0, \"start_date\": 0, \"finish_date\": 0, \"status\": \"v\", \"collector\": { \"type\": \"string\", \"name\": \"string\", \"swagger_type\": \"string\" } } } date=Fri, 26 Oct 2018 05:46:30 +0300 ```
*
* OpenAPI spec version: 2.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace AnketologClient\Model;
use \ArrayAccess;
/**
* SurveyeditorupdateSettingsConfigCredentials Class Doc Comment
*
* @category Class */
/**
* @package AnketologClient
* @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
* @link https://github.com/swagger-api/swagger-codegen
*/
class SurveyeditorupdateSettingsConfigCredentials implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
protected static $swaggerModelName = 'surveyeditorupdateSettings_config_credentials';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
*/
protected static $swaggerTypes = array(
'username' => 'string',
'password' => 'string'
);
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of attributes where the key is the local name, and the value is the original name
* @var string[]
*/
protected static $attributeMap = array(
'username' => 'username',
'password' => 'password'
);
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
* @var string[]
*/
protected static $setters = array(
'username' => 'setUsername',
'password' => 'setPassword'
);
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
* @var string[]
*/
protected static $getters = array(
'username' => 'getUsername',
'password' => 'getPassword'
);
public static function getters()
{
return self::$getters;
}
/**
* Associative array for storing property values
* @var mixed[]
*/
protected $container = array();
/**
* Constructor
* @param mixed[] $data Associated array of property value initalizing the model
*/
public function __construct(array $data = null)
{
$this->container['username'] = isset($data['username']) ? $data['username'] : null;
$this->container['password'] = isset($data['password']) ? $data['password'] : null;
}
/**
* show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalid_properties = array();
if ($this->container['username'] === null) {
$invalid_properties[] = "'username' can't be null";
}
if ($this->container['password'] === null) {
$invalid_properties[] = "'password' can't be null";
}
return $invalid_properties;
}
/**
* validate all the properties in the model
* return true if all passed
*
* @return bool True if all properteis are valid
*/
public function valid()
{
if ($this->container['username'] === null) {
return false;
}
if ($this->container['password'] === null) {
return false;
}
return true;
}
/**
* Gets username
* @return string
*/
public function getUsername()
{
return $this->container['username'];
}
/**
* Sets username
* @param string $username
* @return $this
*/
public function setUsername($username)
{
$this->container['username'] = $username;
return $this;
}
/**
* Gets password
* @return string
*/
public function getPassword()
{
return $this->container['password'];
}
/**
* Sets password
* @param string $password
* @return $this
*/
public function setPassword($password)
{
$this->container['password'] = $password;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
* @param integer $offset Offset
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
* @param integer $offset Offset
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
* @param integer $offset Offset
* @param mixed $value Value to be set
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
* @param integer $offset Offset
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(\AnketologClient\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
}
return json_encode(\AnketologClient\ObjectSerializer::sanitizeForSerialization($this));
}
}
|
<?php
$version = $_GET['v'];
$import = simplexml_load_file('translations/' . $version . '.xml');
if (!is_dir($version)):
mkdir($version);
endif;
$bn = 1;
foreach($import->book as $book):
$n = 1;
if(!is_dir($version . '/' . $bn)):
mkdir($version . '/' . $bn);
endif;
foreach($book->chapter as $chap):
$chap->addAttribute('translation', $book['translation']);
$chap->addAttribute('testament', $book['testament']);
$chap->addAttribute('book', $book['name']);
$chap->addAttribute('book_id', $bn);
$chap->addAttribute('n', $n);
$xml = $chap->asXML();
$filename = $version . '/' . $bn . '/' . $n . '.xml';
$file = fopen( $filename, 'w' );
fwrite( $file, $xml );
fclose( $file );
$n++;
endforeach;
$bn++;
endforeach;
?>
|
<?php
namespace App\Http\Controllers;
use Carbon\Carbon;
use Illuminate\Http\Request;
use App\Todo;
use Auth;
class TodoController extends Controller
{
public function add(Request $request){
if ($request->isMethod('post')){
$input = $request->all();
$date = Carbon::parse($input['when']);
Todo::create([
'title' => $input['title'],
'description' => $input['description']!=''?$input['description']:null,
'owner_id' => Auth::user()->id,
'status' => false,
'date_year' => $date->year,
'date_month' => $date->month,
'date_day' => $date->day,
]);
return back();
}
}
public function setList($where = null){
$where = $where==null?'today':$where;
$date = Carbon::parse($where);
if(!Todo::todayList($date)->exists()) {
$data = [
'messeage' => 'U 2Do list EMPTY, create first task!<span class="emoji"></span>'
];
}
$data['todos'] = Todo::todayList($date)->get();
$data['where'] = $where;
echo view('site.todo.list', $data);
}
public function setFromId($id = null){
if($id != null){
if(Todo::where('id', $id)->exists()) {
$todo = Todo::find($id);
if($todo->owner_id == Auth::user()->id)
echo view('site.todo.set', ['todo' => $todo]);
else
echo '<h2>You dont have promise!</h2>';
} else {
echo '<h2>Data does not exist</h2>';
}
}
}
public function status($id){
if($id != null){
$todo = Todo::where('id', $id)->first();
if($todo->owner_id == Auth::user()->id)
Todo::where('id', $id)->update([
'status'=> $todo->status==0?1:0
]);
}
}
public function delete($id){
if($id != null){
$todo = Todo::where('id', $id)->first();
if($todo->owner_id == Auth::user()->id)
Todo::where('id', $id)->delete();
}
}
public function editFromId(Request $request, $id = null){
if($request->isMethod('post')){
$input = $request->all();
$update = [
'title' => $input['title'],
'description' => $input['description']
];
if (isset($input['ttomorrow'])) {
$date = Carbon::parse('tomorrow');
$update['date_year'] = $date->year;
$update['date_month'] = $date->month;
$update['date_day'] = $date->day;
}
Todo::where('id', $input['id'])
->update($update);
return back();
}
if($id != null){
if(Todo::where('id', $id)->exists()) {
$todo = Todo::find($id);
if($todo->owner_id == Auth::user()->id)
echo view('site.todo.edit', ['todo' => $todo]);
else
echo '<h2>You dont have promise!</h2>';
} else {
echo '<h2>Data does not exist</h2>';
}
}
}
}
|
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
use HasFactory;
protected $guarded = ['id'];
protected $with = ['category'];
public function category()
{
return $this->belongsTo(Category::class);
}
}
|
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\BusinessCategory */
$this->title = 'Update Business Type: ' . $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Business Categories', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="content business-category-create">
<div class="container-fluid">
<div class="card ">
<div class="card-header card-header-primary card-header-icon">
<div class="card-icon">
<i class="material-icons">account_box</i>
</div>
<h4 class="card-title">
<?= $model->isNewRecord ? 'Update Business Type' : 'Update Business Type'; ?>
<div class="pull-right">
<a class="btn btn-xs btn-success btn-round btn-fab" href="index" rel="tooltip" data-placement="bottom" data-original-title="Back"><b class="material-icons">keyboard_arrow_left</b><div class="ripple-container"></div></a>
</div>
</h4>
</div>
<?=
$this->render('_form', [
'model' => $model,
])
?>
</div>
</div>
</div>
|
<?php
defined('C5_EXECUTE') or die("Access Denied.");
class FileUploaderPermissionAccessEntity extends Concrete5_Model_FileUploaderPermissionAccessEntity {}
|
<?php
namespace jdRoll\service\campagne;
/**
* Manage Campagne Information
*
* @package campagneService
* @copyright (C) 2013 jdRoll
* @license MIT
*/
class CampagneConfigService {
private $db;
public function __construct($db)
{
$this->db = $db;
}
public function getFormCampagneConfig($request) {
$campagne = array();
$campagne['campagne_id'] = $request->get('campagne_id');
$campagne['banniere'] = $request->get('banniere');
$campagne['hr'] = $request->get('hr');
$campagne['odd_line_color'] = $request->get('odd_line_color');
$campagne['even_line_color'] = $request->get('even_line_color');
$campagne['sidebar_color'] = $request->get('sidebar_color');
$campagne['link_color'] = $request->get('link_color');
$campagne['text_color'] = $request->get('text_color');
$campagne['default_perso_id'] = $request->get('default_perso_id');
$campagne['link_sidebar_color'] = $request->get('link_sidebar_color');
$campagne['template'] = $request->get('template');
$campagne['template_html'] = $request->get('hiddenInput');
$campagne['template_fields'] = $request->get('hiddenInputFields');
$campagne['template_img'] = $request->get('imgBG');
$campagne['sidebar_text'] = $request->get('sidebar_text');
return $campagne;
}
public function createCampagneConfig($campagne) {
$sql = "INSERT INTO campagne_config
(campagne_id, banniere, hr, odd_line_color, even_line_color, sidebar_color, link_sidebar_color, link_color, text_color, default_perso_id, template, sidebar_text, widgets)
VALUES
(:campagne, '', '', '', '', '', '', '', '', '', '', '', '[]')";
$stmt = $this->db->prepare($sql);
$stmt->bindValue("campagne", $campagne);
$stmt->execute();
}
public function updateCampagneConfigSheet($request) {
$sql = "UPDATE campagne_config
SET
template = :template,
template_html = :template_html,
template_fields = :template_fields,
template_img = :template_img
WHERE
campagne_id = :campagne";
$stmt = $this->db->prepare($sql);
$stmt->bindValue("campagne", $request->get('id'));
$stmt->bindValue("template", $request->get('template'));
$stmt->bindValue("template_html",$request->get('hiddenInput'));
if($request->get('typeFiche') == 0)
$stmt->bindValue("template_img",NULL);
else
$stmt->bindValue("template_img",$request->get('imgBG'));
$stmt->bindValue("template_fields",$request->get('hiddenInputFields'));
$stmt->execute();
}
public function updateWidgetsConfig($campagne, $widgets) {
$sql = "UPDATE campagne_config
SET
widgets = :widgets
WHERE
campagne_id = :campagne";
$stmt = $this->db->prepare($sql);
$stmt->bindValue("campagne", $campagne);
$stmt->bindValue("widgets", $widgets);
$stmt->execute();
}
public function updateCampagneConfigTheme($request) {
$sql = "UPDATE campagne_config
SET
banniere = :banniere,
hr = :hr,
odd_line_color = :odd_line_color,
even_line_color = :even_line_color,
sidebar_color = :sidebar_color,
link_color = :link_color,
text_color = :text_color,
link_sidebar_color = :link_sidebar_color,
dialogue_color = :dialogue_color,
pensee_color = :pensee_color,
rp1_color = :rp1_color,
rp2_color = :rp2_color,
quote_color = :quote_color
WHERE
campagne_id = :campagne";
$stmt = $this->db->prepare($sql);
$stmt->bindValue("campagne", $request->get('campagne_id'));
$stmt->bindValue("banniere", $request->get('banniere'));
$stmt->bindValue("hr", $request->get('hr'));
$stmt->bindValue("odd_line_color", $request->get('odd_line_color'));
$stmt->bindValue("even_line_color", $request->get('even_line_color'));
$stmt->bindValue("sidebar_color", $request->get('sidebar_color'));
$stmt->bindValue("link_color", $request->get('link_color'));
$stmt->bindValue("text_color", $request->get('text_color'));
$stmt->bindValue("dialogue_color", $request->get('dialogue_color'));
$stmt->bindValue("pensee_color", $request->get('pensee_color'));
$stmt->bindValue("rp1_color", $request->get('rp1_color'));
$stmt->bindValue("rp2_color", $request->get('rp2_color'));
$stmt->bindValue("quote_color", $request->get('quote_color'));
$stmt->bindValue("link_sidebar_color", $request->get('link_sidebar_color'));
$stmt->execute();
}
public function updateCampagneConfigDivers($request) {
$sql = "UPDATE campagne_config
SET
sidebar_text = :sidebar_text,
default_perso_id = :default_perso_id,
default_dice = :default_dice
WHERE
campagne_id = :campagne";
$stmt = $this->db->prepare($sql);
$stmt->bindValue("campagne", $request->get('campagne_id'));
$stmt->bindValue("default_perso_id", $request->get('default_perso_id'));
$stmt->bindValue("sidebar_text", $request->get('sidebar_text'));
$stmt->bindValue("default_dice", $request->get('default_dice'));
$stmt->execute();
}
public function getCampagneConfig($id) {
$sql = "SELECT * FROM campagne_config WHERE campagne_id = ?";
$campagne = $this->db->fetchAssoc($sql, array($id));
return $campagne;
}
}
|
<?php
/*
* This file is part of the Black package.
*
* (c) Boris Tacyniak <boris.tacyniak@free.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Black\Bundle\CommonBundle\Application\Form\Type;
use DTL\Symfony\Form\DataTransformer\ArrayToDelimitedStringTransformer;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
/**
* Class TagType
*
* TagType create a new type based on FormToArrayDelimitedTransformer
*
* @author Alexandre 'pocky' Balmes <alexandre@lablackroom.com>
* @license http://opensource.org/licenses/mit-license.php MIT
*/
class TagType extends AbstractType
{
/**
* @var
*/
protected $name;
/**
* Construct the type with his name
*
* @param string $name
*/
public function __construct($name)
{
$this->name = $name;
}
/**
* {@inheritDoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$transformer = new ArrayToDelimitedStringTransformer();
$builder->addModelTransformer($transformer);
}
/**
* {@inheritDoc}
*/
public function getName()
{
return $this->name;
}
/**
* {@inheritDoc}
*/
public function getParent()
{
return 'text';
}
}
|
<div class="panel-body col-lg-12">
<?php if(isExistsInTable("privilage", array("id_user" => $this->session->id_user,"id_menu" => "insert_supplier")) == 0):?>
<div class="row">
<div class="col-md-6">
<div class="mb-15">
<button data-target="#AddSupplier" data-toggle="modal" type="button" class="btn btn-sm btn-outline btn-primary" type="button">
<i class="icon wb-plus" aria-hidden="true"></i> Add Supplier
</button>
</div>
</div>
</div>
<?php endif;?>
<table class="table table-bordered table-hover table-striped w-full" cellspacing="0" data-plugin = "dataTable">
<thead>
<tr>
<th>Company ID</th>
<th>Company Name</th>
<th>Company Address</th>
<th>Company Phone</th>
<th>Main Contact Person</th>
<th>CP Email / Phone</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php for($a = 0; $a<count($perusahaan); $a++): ?>
<tr class="gradeA">
<td><?php echo $perusahaan[$a]["no_urut"];?></td>
<td><?php echo $perusahaan[$a]["nama_perusahaan"];?></td>
<td><?php echo nl2br($perusahaan[$a]["alamat_perusahaan"]);?></td>
<td><?php echo $perusahaan[$a]["notelp_perusahaan"];?></td>
<td><?php echo $perusahaan[$a]["nama_cp"];?></td>
<td><?php echo $perusahaan[$a]["email_cp"]."<br/>".$perusahaan[$a]["nohp_cp"];?></td>
<td class="actions">
<?php if(isExistsInTable("privilage", array("id_user" => $this->session->id_user,"id_menu" => "edit_supplier")) == 0):?>
<a href = "<?php echo base_url();?>master/vendor/product/contact/<?php echo $perusahaan[$a]["id_perusahaan"];?>" class="btn btn-sm col-lg-12 btn-outline btn-success"
data-toggle="tooltip">PIC</a>
<a href = "<?php echo base_url();?>master/vendor/product/edit/<?php echo $perusahaan[$a]["id_perusahaan"];?>" class="btn btn-sm col-lg-12 btn-outline btn-primary" >EDIT</a>
<?php endif;?>
<?php if(isExistsInTable("privilage", array("id_user" => $this->session->id_user,"id_menu" => "delete_supplier")) == 0):?>
<a href = "<?php echo base_url();?>master/vendor/product/delete/<?php echo $perusahaan[$a]["id_perusahaan"];?>" class="btn btn-sm col-lg-12 btn-outline btn-danger"
data-toggle="tooltip">REMOVE</a>
<?php endif;?>
</td>
</tr>
<?php endfor; ?>
</tbody>
</table>
</div>
<?php if(isExistsInTable("privilage", array("id_user" => $this->session->id_user,"id_menu" => "insert_supplier")) == 0):?>
<div class="modal fade" id="AddSupplier" aria-hidden="true" aria-labelledby="DaftarUser" role="dialog" tabindex="-1">
<div class="modal-dialog modal-simple">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="exampleModalTabs">Supplier Data</h4>
</div>
<ul class="nav nav-tabs nav-tabs-line" role="tablist">
<li class="nav-item" role="presentation"><a class="nav-link active" data-toggle="tab" href="#primaryData"
aria-controls="primaryData" role="tab">Primary Data</a></li>
<li class="nav-item" role="presentation"><a class="nav-link" data-toggle="tab" href="#privilage"
aria-controls="privilage" role="tab">Contact Person</a></li>
</ul>
<form action = "<?php echo base_url();?>master/vendor/product/register" method = "post">
<div class="modal-body">
<div class="tab-content">
<div class="tab-pane active" id="primaryData" role="tabpanel">
<input type = "hidden" name = "no_urut" value = "<?php echo $maxId;?>">
<div class = "form-group">
<h5 style = "opacity:0.5">Nama Supplier</h5>
<input type = "text" class = "form-control" name = "nama_perusahaan">
</div>
<div class = "form-group">
<h5 style = "opacity:0.5">No Fax Supplier</h5>
<input type = "text" class = "form-control" name = "nofax_perusahaan">
</div>
<div class = "form-group">
<h5 style = "opacity:0.5">No Telp Supplier</h5>
<input type = "text" class = "form-control" name = "notelp_perusahaan">
</div>
<div class = "form-group">
<h5 style = "opacity:0.5">Alamat Perusahaan</h5>
<textarea class = "form-control" name = "alamat_perusahaan" rows = "5"></textarea>
</div>
</div>
<div class="tab-pane" id="privilage" role="tabpanel">
<div class = "form-group">
<h5 style = "opacity:0.5">Nama PIC</h5>
<input type = "text" class = "form-control" name = "nama_cp">
</div>
<div class = "form-group">
<h5 style = "opacity:0.5">Gender PIC</h5>
<select class = "form-control" name = "jk_cp" data-plugin = "select2">
<option value = "Mr">Mr</option>
<option value = "Ms">Ms</option>
<option value = "Mrs">Mrs</option>
</select>
</div>
<div class = "form-group">
<h5 style = "opacity:0.5">Email PIC</h5>
<input type = "text" class = "form-control" name = "email_cp">
</div>
<div class = "form-group">
<h5 style = "opacity:0.5">No HP PIC</h5>
<input type = "text" class = "form-control" name = "nohp_cp">
</div>
<div class = "form-group">
<h5 style = "opacity:0.5">Jabatan PIC</h5>
<input type = "text" class = "form-control" name = "jabatan_cp">
</div>
<button class = "btn btn-primary btn-outline btn-sm">SUBMIT</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<?php endif;?>
|
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* @category RatePAY
* @package RatePAY_Ratepaypayment
* @copyright Copyright (c) 2015 RatePAY GmbH (https://www.ratepay.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class RatePAY_Ratepaypayment_Block_Adminhtml_Logs extends Mage_Adminhtml_Block_Widget_Grid_Container
{
/**
* Construct
*/
public function __construct()
{
$this->_blockGroup = 'ratepaypayment';
$this->_controller = 'adminhtml_logs';
$this->_headerText = Mage::helper('ratepaypayment')->__('Ratepay Logs');
parent::__construct();
}
/**
* @see Mage_Adminhtml_Block_Widget_Grid_Container::_prepareLayout()
*/
protected function _prepareLayout()
{
$this->_removeButton('add');
return parent::_prepareLayout();
}
}
|
<?php defined('BX_DOL') or die('hack attempt');
/**
* Copyright (c) UNA, Inc - https://una.io
* MIT License - https://opensource.org/licenses/MIT
*
* @defgroup UnaBaseView UNA Base Representation Classes
* @{
*/
/**
* Menu representation.
* @see BxDolMenu
*/
class BxBaseMenuInteractive extends BxTemplMenu
{
protected $_oTemplate;
protected $_bShowDivider;
public function __construct ($aObject, $oTemplate)
{
parent::__construct ($aObject);
if(empty($this->_aObject['menu_id']))
$this->_aObject['menu_id'] = $this->_sObject;
if ($oTemplate)
$this->_oTemplate = $oTemplate;
else
$this->_oTemplate = BxDolTemplate::getInstance();
$this->_bShowDivider = true;
}
/**
* Get menu code.
* @return string
*/
public function getCode ()
{
$sCode = parent::getCode();
if($sCode !== false)
$sCode = $this->_oTemplate->parseHtmlByContent($sCode, array(
'id' => $this->_aObject['menu_id']
));
return $sCode;
}
/**
* Get menu items array, which are ready to pass to template.
* @return array
*/
public function getMenuItems ()
{
$aRet = array();
if (!isset($this->_aObject['menu_items']))
$this->_aObject['menu_items'] = $this->getMenuItemsRaw();
foreach ($this->_aObject['menu_items'] as $a) {
if (isset($a['active']) && !$a['active'])
continue;
if (isset($a['visible_for_levels']) && !$this->_isVisible($a))
continue;
$a = $this->_replaceMarkers($a);
list ($sIcon, $sIconUrl) = $this->_getMenuIcon($a);
$a['class'] = 'bx-menu-item-inter';
$a['class_wrp_act'] = 'bx-menu-inter-hidden';
$a['class_wrp_pas'] = '';
if($this->_isSelected($a)) {
$a['class_wrp_act'] = '';
$a['class_wrp_pas'] = 'bx-menu-inter-hidden';
}
$a['link'] = isset($a['link']) ? $this->_oPermalinks->permalink($a['link']) : 'javascript:void(0);';
$a['title'] = _t($a['title']);
$a['title_attr'] = isset($a['title_attr']) ? bx_html_attribute($a['title_attr']) : '';
$a['bx_if:show_divider'] = array (
'condition' => $this->_bShowDivider,
'content' => array(),
);
$a['bx_if:image'] = array (
'condition' => (bool)$sIconUrl,
'content' => array('icon_url' => $sIconUrl),
);
$a['bx_if:icon'] = array (
'condition' => (bool)$sIcon,
'content' => array('icon' => $sIcon),
);
$aRet[] = $a;
}
return $aRet;
}
/**
* Add css/js files which are needed for menu display and functionality.
*/
protected function _addJsCss()
{
$this->_oTemplate->addCss('menu.css');
}
}
/** @} */
|
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
|
*/
'name' => env('APP_NAME', 'Laravel'),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => (bool) env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL', null),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'en',
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Faker Locale
|--------------------------------------------------------------------------
|
| This locale will be used by the Faker PHP library when generating fake
| data for your database seeds. For example, this will be used to get
| localized telephone numbers, street address information and more.
|
*/
'faker_locale' => 'en_US',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Cohensive\Embed\EmbedServiceProvider::class,
],
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'Date' => Illuminate\Support\Facades\Date::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Http' => Illuminate\Support\Facades\Http::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
// 'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Str' => Illuminate\Support\Str::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'Cart' => Darryldecode\Cart\Facades\CartFacade::class,
'Embed' => Cohensive\Embed\Facades\Embed::class,
],
];
|
<?php
namespace App\Providers;
use App\User;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array
*/
protected $policies = [
'App\Model' => 'App\Policies\ModelPolicy',
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
{
$this->registerPolicies();
$this->registerUserPolicies();
//
}
public function registerUserPolicies(){
Gate::define('create-users', function($user){
return $user->hasAccess(['create-users']);
});
Gate::define('update-users', function($variable){
return $variable->hasAccess(['update-users']);
});
Gate::define('read-users', function($variable){
return $variable->hasAccess(['read-users']);
});
Gate::define('delete-users', function($variable){
return $variable->hasAccess(['delete-users']);
});
}
}
|
<?php
/**
* Corresponding Class to test Timeline class
*
* @author Arturo Ramos
*/
class TimelineTest extends PHPUnit_Framework_TestCase
{
/**
* Just check if the YourClass has no syntax error
*
* This is just a simple check to make sure your library has no syntax error. This helps you troubleshoot
* any typo before you even use this library in a real project.
*
*/
public function testIsThereAnySyntaxError() {
$var = new ircsasw\timeline\Timeline;
$this->assertTrue(is_object($var));
unset($var);
}
}
|
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Serializer\Normalizer;
/**
* Defines the interface of normalizers.
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*/
interface NormalizerInterface
{
/**
* Normalizes an object into a set of arrays/scalars.
*
* @param object $object object to normalize
* @param string $format format the normalization result will be encoded as
* @param array $context Context options for the normalizer
*
* @return array|scalar
*/
public function normalize($object, $format = null, array $context = array());
/**
* Checks whether the given class is supported for normalization by this normalizer.
*
* @param mixed $data Data to normalize
* @param string $format The format being (de-)serialized from or into
*
* @return bool
*/
public function supportsNormalization($data, $format = null);
}
|
<?php
$fecha1 = new DateTime("1990-04-03");
$fecha2 = new DateTime($fecha_consultar);
$fecha_actual = strtotime(date("d-m-Y H:i:00", $fecha1->getTimestamp()));
$fecha_entrada = strtotime($fecha_consultar);
$diff = $fecha1->diff($fecha2);
$dias = $diff->days;
$reversa = false;
if ($fecha_actual > $fecha_entrada) {
$reversa = true;
}
if ($reversa) {
$dias = $dias % 365;
if ($dias < 360) {
$mes = 18-ceil($dias / 20);
$dia = 20-$dias % 20;
} else {
$mes = 0;
$dia = 365-$dias;
}
} else {
if ($dias >= 365) {
$dias = $dias % 365;
}
if ($dias > 5) {
$dias = $dias - 5;
$diasmes = $dias+1;
$mes = ceil($diasmes / 20);
$dia = $dias % 20;
} else {
$mes = 0;
$dia = $dias % 20;
}
}
$Query = $conn->query("SELECT nombre FROM uinal WHERE idweb=".$mes." ;");
$row = mysqli_fetch_assoc($Query);
$uinal = $row['nombre']." ";
return array($uinal.strval($dia),$row['nombre']);
?>
|
@extends('Fronted.layouts.master')
@section('title')
{{about()->site_name}}
@endsection
@section('content')
@include('Fronted.GeneralPages.banner')
@include('Fronted.GeneralPages.homeVids')
@endsection
@section('script')
<script>
const video = document.getElementById("video3");
const play = document.getElementById("play");
const stop = document.getElementById("stop");
const progress = document.getElementById("progress");
const timestamp = document.getElementById("timestamp");
video.addEventListener("click", toggleVideoStatus);
video.addEventListener("pause", updatePlayIcon);
video.addEventListener("play", updatePlayIcon);
video.addEventListener("timeupdate", updateProgress);
play.addEventListener("click", toggleVideoStatus);
stop.addEventListener("click", stopVideo);
progress.addEventListener("change", setVideoProgress);
</script>
<script>
function closeVideo(id) {
var video = $('#video' + id);
video.pause();
video.style.display = 'none'
}
</script>
@endsection
|
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Licensing;
class LicenseAssignmentInsert extends \Google\Model
{
/**
* @var string
*/
public $userId;
/**
* @param string
*/
public function setUserId($userId)
{
$this->userId = $userId;
}
/**
* @return string
*/
public function getUserId()
{
return $this->userId;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(LicenseAssignmentInsert::class, 'Google_Service_Licensing_LicenseAssignmentInsert');
|
<?php
namespace Budget\BudgetBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="Budget\BudgetBundle\Repository\FeeRepository")
*/
class Fee
{
/**
* @var integer
*/
private $id;
/**
* @var string
*/
private $title;
/**
* @var \DateTime
*/
private $feeDate;
/**
* @var float
*/
private $amount = '0';
/**
* @var \Budget\BudgetBundle\Entity\FeesCategory
*/
private $feesCategory;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set title
*
* @param string $title
*
* @return Fee
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Get title
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Set feeDate
*
* @param \DateTime $feeDate
*
* @return Fee
*/
public function setFeeDate($feeDate)
{
$this->feeDate = $feeDate;
return $this;
}
/**
* Get feeDate
*
* @return \DateTime
*/
public function getFeeDate()
{
return $this->feeDate;
}
/**
* Set amount
*
* @param float $amount
*
* @return Fee
*/
public function setAmount($amount)
{
$this->amount = $amount;
return $this;
}
/**
* Get amount
*
* @return float
*/
public function getAmount()
{
return $this->amount;
}
/**
* Set feesCategory
*
* @param \Budget\BudgetBundle\Entity\FeesCategory $feesCategory
*
* @return Fee
*/
public function setFeesCategory(\Budget\BudgetBundle\Entity\FeesCategory $feesCategory = null)
{
$this->feesCategory = $feesCategory;
return $this;
}
/**
* Get feesCategory
*
* @return \Budget\BudgetBundle\Entity\FeesCategory
*/
public function getFeesCategory()
{
return $this->feesCategory;
}
}
|
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('first_name', 25);
$table->string('last_name', 25);
$table->string('email', 50)->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password')->nullable();
$table->boolean('owner')->default(false);
$table->string('photo_path', 100)->nullable();
$table->rememberToken();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}
|
<?php
/*
* This file is part of JSON RPC Client.
*
* (c) Igor Lazarev <strider2038@yandex.ru>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Strider2038\JsonRpcClient\Request;
/**
* @author Igor Lazarev <strider2038@yandex.ru>
*/
interface IdGeneratorInterface
{
public function generateId();
}
|
<?php
namespace App\Http\Controllers\Front;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
// models
use Illuminate\Support\Str;
use Illuminate\Validation\Validator;
use Illuminate\Support\Facades\DB;
use App\Models\Article;
use App\Models\Category;
use App\Models\Page;
use App\Models\Contact;
use App\Models\Image;
class HomepageController extends Controller
{
public function __construct(){
view()->share('pages', Page::orderBy('order', 'ASC')->get());
view()->share('categories', Category::inRandomOrder()->get());
}
public function index(){
$data['articles']=Article::orderBy('created_at', 'DESC')->paginate(10);
$data['hits']=Article::orderBy('hit', 'DESC')->limit(5)->get();
$data['articles']->withPath(url('page'));
return view('front.homepage', $data);
}
public function single($category, $slug){;
$category = Category::whereSlug($category)->first() ?? abort(403, 'Bu isimde bir kategori bulunamadı.');
$article=Article::whereSlug($slug)->first() ?? abort(403, 'Böyle bir yazı bulunamadı');
$article->increment('hit');
$data['article']=$article;
$data['categories']=Category::inRandomOrder()->get();
$data['images']=Image::inRandomOrder()->get();
$data['relatedPosts'] = Article::where('id', "!=", $category->id)->take(2)->get();
$data['next'] = Article::where('id', '>', $article->id)->orderBy('id')->first();
$data['previous'] = Article::where('id', '<', $article->id)->orderBy('id', 'DESC')->first();
return view('front.single',$data);
}
public function category($slug){
$category = Category::whereSlug($slug)->first() ?? abort(403, 'Bu isimde bir kategori bulunamadı.');
$data['category']=$category;
$data['articles']=Article::where('category_id', $category->id)->orderBy('created_at', 'DESC')->paginate(1);
$data['categories'] = Category::inRandomOrder()->get();
return view('front.category', $data);
}
public function page($slug){
$page=Page::whereSlug($slug)->first() ?? abort(403, 'Böyle bir sayfa bulunamadı.');
$data['page']=$page;
$data['pages']=Page::orderBy('order','ASC')->get();
return view('front.info-page', $data);
}
public function contact(){
return view('front.contact');
}
public function postcontact(Request $request){
$this->validate($request, [
'name'=>'required',
'email'=>'required',
'message'=>'required'
]);
$contact = new Contact;
$contact->name=$request->name;
$contact->email=$request->email;
$contact->message=$request->message;
$contact->save();
return redirect()->route('contact')->with('success','cong');
}
}
|
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Tag extends Model
{
protected $fillable = [
'name', 'unit'
];
public function locations()
{
return $this->belongsToMany('App\Location');
}
public function loctag()
{
return $this->hasOne('App\LocTag');
}
}
|
<?php
$MESS["LANDING_DEMO_STORE_INSTAGRAM--HEADER_MAIN--NAME"] = "Шапка на главной";
|
<div class="sidebar">
<nav class="sidebar-nav">
<ul class="nav">
<li @click="menu=0" class="nav-item">
<a class="nav-link active" href="#"><i class="icon-speedometer"></i> Escritorio</a>
</li>
<li class="nav-title">
Mantenimiento
</li>
<li class="nav-item nav-dropdown">
<a class="nav-link nav-dropdown-toggle" href="#"><i class="icon-basket"></i> Ventas</a>
<ul class="nav-dropdown-items">
<li @click="menu=5" class="nav-item">
<a class="nav-link" href="#"><i class="icon-basket-loaded"></i> Ventas</a>
</li>
<li @click="menu=6" class="nav-item">
<a class="nav-link" href="#"><i class="icon-notebook"></i> Clientes</a>
</li>
</ul>
</li>
<li class="nav-item nav-dropdown">
<a class="nav-link nav-dropdown-toggle" href="#"><i class="icon-pie-chart"></i> Reportes</a>
<ul class="nav-dropdown-items">
<li @click="menu=10" class="nav-item">
<a class="nav-link" href="#"><i class="icon-chart"></i> Reporte Ventas</a>
</li>
</ul>
</li>
<li @click="menu=11" class="nav-item">
<a class="nav-link" href="#"><i class="icon-book-open"></i> Ayuda <span class="badge badge-danger">PDF</span></a>
</li>
<li @click="menu=12" class="nav-item">
<a class="nav-link" href="#"><i class="icon-info"></i> Acerca de...<span class="badge badge-info">IT</span></a>
</li>
</ul>
</nav>
<button class="sidebar-minimizer brand-minimizer" type="button"></button>
</div>
|
<?php
namespace Dazzle\MySQL;
use Dazzle\Event\BaseEventEmitter;
use Dazzle\Loop\LoopAwareTrait;
use Dazzle\Loop\LoopInterface;
use Dazzle\MySQL\Protocol\Command\AuthCommand;
use Dazzle\MySQL\Protocol\Command\PingCommand;
use Dazzle\MySQL\Protocol\Command\QueryCommand;
use Dazzle\MySQL\Protocol\Command\QuitCommand;
use Dazzle\MySQL\Protocol\Command;
use Dazzle\MySQL\Protocol\CommandInterface;
use Dazzle\MySQL\Protocol\ProtocolParser;
use Dazzle\MySQL\Protocol\Query;
use Dazzle\MySQL\Protocol\QueryInterface;
use Dazzle\MySQL\Support\Queue\Queue;
use Dazzle\MySQL\Support\Queue\QueueInterface;
use Dazzle\MySQL\Support\Transaction\TransactionBox;
use Dazzle\MySQL\Support\Transaction\TransactionBoxInterface;
use Dazzle\Promise\Promise;
use Dazzle\Promise\PromiseInterface;
use Dazzle\Socket\Socket;
use Dazzle\Socket\SocketInterface;
use Dazzle\Throwable\Exception\Runtime\ExecutionException;
use RuntimeException;
use SplQueue;
class Database extends BaseEventEmitter implements DatabaseInterface
{
use LoopAwareTrait;
/**
* @var int
*/
const STATE_INIT = 0;
/**
* @var int
*/
const STATE_CONNECT_PENDING = 4;
/**
* @var int
*/
const STATE_CONNECT_FAILED = 2;
/**
* @var int
*/
const STATE_CONNECT_SUCCEEDED = 6;
/**
* @var int
*/
const STATE_AUTH_PENDING = 5;
/**
* @var int
*/
const STATE_AUTH_FAILED = 3;
/**
* @var int
*/
const STATE_AUTH_SUCCEEDED = 7;
/**
* @var int
*/
const STATE_DISCONNECT_PENDING = 8;
/**
* @var int
*/
const STATE_DISCONNECT_SUCCEEDED = 1;
/**
* @var mixed[]
*/
protected $config;
/**
* @var mixed[]
*/
protected $serverInfo;
/**
* @var int
*/
protected $state;
/**
* @var Queue|QueueInterface
*/
protected $queue;
/**
* @var ProtocolParser|null
*/
protected $parser;
/**
* @var SocketInterface|null
*/
protected $stream;
/**
* @var TransactionBoxInterface
*/
protected $transBox;
/**
* @param LoopInterface $loop
* @param mixed[] $config
*/
public function __construct(LoopInterface $loop, $config = [])
{
$this->loop = $loop;
$this->config = $this->createConfig($config);
$this->serverInfo = [];
$this->state = self::STATE_INIT;
$this->queue = $this->createQueue();
$this->parser = null;
$this->stream = null;
$this->transBox = $this->createTransactionBox();
}
/**
* @override
* @inheritDoc
*/
public function isPaused()
{
// TODO
return false;
}
/**
* @override
* @inheritDoc
*/
public function pause()
{
// TODO
}
/**
* @override
* @inheritDoc
*/
public function resume()
{
// TODO
}
/**
* @override
* @inheritDoc
*/
public function isStarted()
{
return $this->state >= self::STATE_CONNECT_PENDING;
}
/**
* @override
* @inheritDoc
*/
public function start()
{
if ($this->isStarted())
{
return Promise::doResolve($this);
}
$promise = new Promise();
$this->state = self::STATE_CONNECT_PENDING;
$config = $this->config;
$errorHandler = function ($command, $reason) use ($promise) {
$this->state = self::STATE_AUTH_FAILED;
return $promise->reject($reason);
};
$connectedHandler = function ($command, $info) use ($promise) {
$this->state = self::STATE_AUTH_SUCCEEDED;
$this->serverInfo = $info;
return $promise->resolve($info);
};
$this
->connect()
->then(function($stream) use ($config, $errorHandler, $connectedHandler) {
$this->stream = $stream;
$stream->on('error', [ $this, 'handleSocketError' ]);
$stream->on('close', [ $this, 'handleSocketClose' ]);
$this->state = self::STATE_AUTH_PENDING;
$this->parser = new ProtocolParser($stream, $this->queue, $config);
$command = $this->doAuth(new AuthCommand($this));
$command->on('success', $connectedHandler);
$command->on('error', $errorHandler);
$this->parser->start();
})
->done(null, [ $this, 'handleError' ]);
return $promise;
}
/**
* @override
* @inheritDoc
*/
public function stop()
{
if (!$this->isStarted())
{
return Promise::doResolve($this);
}
return new Promise(function($resolve, $reject) {
$this
->doCommand(new QuitCommand($this))
->on('success', function() use($resolve) {
$this->state = self::STATE_DISCONNECT_SUCCEEDED;
$this->emit('stop', [ $this ]);
$resolve($this);
});
$this->state = self::STATE_DISCONNECT_PENDING;
});
}
/**
* @override
* @inheritDoc
*/
public function getState()
{
return $this->state;
}
/**
* @override
* @inheritDoc
*/
public function getInfo()
{
return $this->serverInfo;
}
/**
* @override
* @inheritDoc
*/
public function setDatabase($dbname)
{
return $this->query(sprintf('USE `%s`', $dbname));
}
/**
* @override
* @inheritDoc
*/
public function getDatabase()
{
// TODO
}
/**
* @override
* @inheritDoc
*/
public function query($sql, $sqlParams = [])
{
$promise = new Promise();
$query = new Query($sql, $sqlParams);
$command = new QueryCommand($this, $query);
$this->doCommand($command);
$command->on('error', function ($command, $err) use ($promise) {
return $promise->reject($err);
});
$command->on('success', function ($command) use ($promise) {
return $promise->resolve($command);
});
return $promise;
}
/**
* @override
* @inheritDoc
*/
public function execute($sql, $sqlParams = [])
{
return $this->query($sql, $sqlParams)->then(function($command) {
return $command->affectedRows;
});
}
/**
* @override
* @inheritDoc
*/
public function ping()
{
$promise = new Promise();
$command = $this->doCommand(new PingCommand($this));
$command->on('error', function ($command, $reason) use ($promise) {
return $promise->reject($reason);
});
$command->on('success', function () use ($promise) {
return $promise->resolve();
});
return $promise;
}
/**
* @override
* @inheritDoc
*/
public function beginTransaction()
{
$trans = new Transaction($this);
$trans->on('commit', function(TransactionInterface $trans, array $queue) {
$this->commitTransaction($queue)->then(
function() use($trans) {
return $trans->emit('success', [ $trans ]);
},
function($ex) use($trans) {
return $trans->emit('error', [ $trans, $ex ]);
}
);
$this->transBox->remove($trans);
});
$trans->on('rollback', function(TransactionInterface $trans) {
$this->transBox->remove($trans);
});
return $this->transBox->add($trans);
}
/**
* @override
* @inheritDoc
*/
public function endTransaction(TransactionInterface $trans)
{
return $trans->rollback();
}
/**
* Try to commit a transaction.
*
* @param CommandInterface[] $queue
* @return PromiseInterface
*/
protected function commitTransaction($queue)
{
$promise = new Promise();
$ex = null;
array_unshift($queue, new QueryCommand($this, new Query('BEGIN')));
array_unshift($queue, new QueryCommand($this, new Query('START TRANSACTION')));
$size = 0;
$sizeCap = count($queue);
for ($i=0; $i<$sizeCap; $i++)
{
$command = $this->doCommand($queue[$i]);
$command->on('error', function($command, $err) use(&$ex, $promise) {
if ($ex === null)
{
$ex = $err;
$this->doCommand(new QueryCommand($this, new Query('ROLLBACK')));
$promise->reject($ex);
}
});
$command->on('success', function() use (&$size, &$sizeCap, $promise) {
if (++$size >= $sizeCap)
{
$commit = $this->doCommand(new QueryCommand($this, new Query('COMMIT')));
$commit->on('success', function() use($promise) {
return $promise->resolve();
});
$commit->on('error', function($command, $err) use($promise) {
return $promise->reject($err);
});
}
});
}
return $promise;
}
/**
* @override
* @inheritDoc
*/
public function inTransaction()
{
return !$this->transBox->isEmpty();
}
/**
* @internal
*/
public function handleError($err)
{
$this->emit('error', [ $this, $err ]);
}
/**
* @internal
*/
public function handleSocketError($socket, $err)
{
$this->emit('error', [ $this, $err ]);
}
/**
* @internal
*/
public function handleSocketClose()
{
if ($this->state < self::STATE_DISCONNECT_PENDING)
{
$this->state = self::STATE_DISCONNECT_SUCCEEDED;
$this->emit('error', [ $this, new RuntimeException('MySQL server has gone away!') ]);
}
}
/**
* Do auth command.
*
* @param CommandInterface $command
* @return CommandInterface
* @throws ExecutionException
*/
protected function doAuth(CommandInterface $command)
{
if ($command->equals(Command::INIT_AUTHENTICATE))
{
return $this->queue->unshift($command);
}
throw new ExecutionException("Cann't send command");
}
/**
* Do command.
*
* @param CommandInterface $command
* @return CommandInterface
* @throws ExecutionException
*/
protected function doCommand($command)
{
if ($this->state >= self::STATE_CONNECT_PENDING && $this->state <= self::STATE_AUTH_SUCCEEDED)
{
return $this->queue->enqueue($command);
}
throw new ExecutionException("Cann't send command");
}
/**
* Connect to the database endpoint.
*
* @return PromiseInterface
*/
protected function connect()
{
return Promise::doResolve(
new Socket($this->config['endpoint'], $this->getLoop())
);
}
/**
* Create Queue.
*
* @return Queue|QueueInterface
*/
protected function createQueue()
{
return new Queue();
}
/**
* Create transaction box.
*
* @return TransactionBoxInterface
*/
protected function createTransactionBox()
{
return new TransactionBox();
}
/**
* Create configuration file.
*
* @param mixed[] $config
* @return mixed[]
*/
protected function createConfig($config = [])
{
$default = [
'endpoint' => 'tcp://127.0.0.1:3306',
'user' => 'root',
'pass' => '',
'dbname' => '',
];
return array_merge($default, $config);
}
}
|
<?php return array(
'root' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => 'e319dd1b112153f82ac772428c6927c9a9a571e0',
'name' => 'laravel/laravel',
'dev' => true,
),
'versions' => array(
'brick/math' => array(
'pretty_version' => '0.9.3',
'version' => '0.9.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../brick/math',
'aliases' => array(),
'reference' => 'ca57d18f028f84f777b2168cd1911b0dee2343ae',
'dev_requirement' => false,
),
'cordoval/hamcrest-php' => array(
'dev_requirement' => true,
'replaced' => array(
0 => '*',
),
),
'davedevelopment/hamcrest-php' => array(
'dev_requirement' => true,
'replaced' => array(
0 => '*',
),
),
'dflydev/dot-access-data' => array(
'pretty_version' => 'v3.0.1',
'version' => '3.0.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../dflydev/dot-access-data',
'aliases' => array(),
'reference' => '0992cc19268b259a39e86f296da5f0677841f42c',
'dev_requirement' => false,
),
'doctrine/inflector' => array(
'pretty_version' => '2.0.4',
'version' => '2.0.4.0',
'type' => 'library',
'install_path' => __DIR__ . '/../doctrine/inflector',
'aliases' => array(),
'reference' => '8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89',
'dev_requirement' => false,
),
'doctrine/instantiator' => array(
'pretty_version' => '1.4.1',
'version' => '1.4.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../doctrine/instantiator',
'aliases' => array(),
'reference' => '10dcfce151b967d20fde1b34ae6640712c3891bc',
'dev_requirement' => true,
),
'doctrine/lexer' => array(
'pretty_version' => '1.2.3',
'version' => '1.2.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../doctrine/lexer',
'aliases' => array(),
'reference' => 'c268e882d4dbdd85e36e4ad69e02dc284f89d229',
'dev_requirement' => false,
),
'dragonmantank/cron-expression' => array(
'pretty_version' => 'v3.3.1',
'version' => '3.3.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../dragonmantank/cron-expression',
'aliases' => array(),
'reference' => 'be85b3f05b46c39bbc0d95f6c071ddff669510fa',
'dev_requirement' => false,
),
'egulias/email-validator' => array(
'pretty_version' => '3.1.2',
'version' => '3.1.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../egulias/email-validator',
'aliases' => array(),
'reference' => 'ee0db30118f661fb166bcffbf5d82032df484697',
'dev_requirement' => false,
),
'facade/ignition-contracts' => array(
'pretty_version' => '1.0.2',
'version' => '1.0.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../facade/ignition-contracts',
'aliases' => array(),
'reference' => '3c921a1cdba35b68a7f0ccffc6dffc1995b18267',
'dev_requirement' => true,
),
'fakerphp/faker' => array(
'pretty_version' => 'v1.19.0',
'version' => '1.19.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../fakerphp/faker',
'aliases' => array(),
'reference' => 'd7f08a622b3346766325488aa32ddc93ccdecc75',
'dev_requirement' => true,
),
'filp/whoops' => array(
'pretty_version' => '2.14.5',
'version' => '2.14.5.0',
'type' => 'library',
'install_path' => __DIR__ . '/../filp/whoops',
'aliases' => array(),
'reference' => 'a63e5e8f26ebbebf8ed3c5c691637325512eb0dc',
'dev_requirement' => true,
),
'fruitcake/php-cors' => array(
'pretty_version' => 'v1.2.0',
'version' => '1.2.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../fruitcake/php-cors',
'aliases' => array(),
'reference' => '58571acbaa5f9f462c9c77e911700ac66f446d4e',
'dev_requirement' => false,
),
'graham-campbell/result-type' => array(
'pretty_version' => 'v1.0.4',
'version' => '1.0.4.0',
'type' => 'library',
'install_path' => __DIR__ . '/../graham-campbell/result-type',
'aliases' => array(),
'reference' => '0690bde05318336c7221785f2a932467f98b64ca',
'dev_requirement' => false,
),
'guzzlehttp/guzzle' => array(
'pretty_version' => '7.4.2',
'version' => '7.4.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
'aliases' => array(),
'reference' => 'ac1ec1cd9b5624694c3a40be801d94137afb12b4',
'dev_requirement' => false,
),
'guzzlehttp/promises' => array(
'pretty_version' => '1.5.1',
'version' => '1.5.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/promises',
'aliases' => array(),
'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da',
'dev_requirement' => false,
),
'guzzlehttp/psr7' => array(
'pretty_version' => '2.2.1',
'version' => '2.2.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/psr7',
'aliases' => array(),
'reference' => 'c94a94f120803a18554c1805ef2e539f8285f9a2',
'dev_requirement' => false,
),
'hamcrest/hamcrest-php' => array(
'pretty_version' => 'v2.0.1',
'version' => '2.0.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../hamcrest/hamcrest-php',
'aliases' => array(),
'reference' => '8c3d0a3f6af734494ad8f6fbbee0ba92422859f3',
'dev_requirement' => true,
),
'illuminate/auth' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/broadcasting' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/bus' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/cache' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/collections' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/conditionable' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/config' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/console' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/container' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/contracts' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/cookie' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/database' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/encryption' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/events' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/filesystem' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/hashing' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/http' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/log' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/macroable' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/mail' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/notifications' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/pagination' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/pipeline' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/queue' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/redis' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/routing' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/session' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/support' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/testing' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/translation' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/validation' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'illuminate/view' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v9.11.0',
),
),
'josiasmontag/laravel-recaptchav3' => array(
'pretty_version' => '1.0.0',
'version' => '1.0.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../josiasmontag/laravel-recaptchav3',
'aliases' => array(),
'reference' => 'a18b78e3921ea8c265a136bb0823a08e601bef0b',
'dev_requirement' => false,
),
'kodova/hamcrest-php' => array(
'dev_requirement' => true,
'replaced' => array(
0 => '*',
),
),
'laravel-frontend-presets/argon' => array(
'pretty_version' => 'v1.1.2',
'version' => '1.1.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../laravel-frontend-presets/argon',
'aliases' => array(),
'reference' => '3e2ef776d17ea1787c16c6af7594dbc95ce8f77b',
'dev_requirement' => false,
),
'laravel/framework' => array(
'pretty_version' => 'v9.11.0',
'version' => '9.11.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../laravel/framework',
'aliases' => array(),
'reference' => '598a8c84d452a66b90a3213b1d67189cc726c728',
'dev_requirement' => false,
),
'laravel/laravel' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => 'e319dd1b112153f82ac772428c6927c9a9a571e0',
'dev_requirement' => false,
),
'laravel/legacy-factories' => array(
'pretty_version' => 'v1.3.0',
'version' => '1.3.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../laravel/legacy-factories',
'aliases' => array(),
'reference' => '5edc7e7eb76e7b4b29221f32139bcbf806c8870f',
'dev_requirement' => false,
),
'laravel/sail' => array(
'pretty_version' => 'v1.14.1',
'version' => '1.14.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../laravel/sail',
'aliases' => array(),
'reference' => '9a7348dedfccc894718a21f71c09d669747e3f33',
'dev_requirement' => true,
),
'laravel/sanctum' => array(
'pretty_version' => 'v2.15.1',
'version' => '2.15.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../laravel/sanctum',
'aliases' => array(),
'reference' => '31fbe6f85aee080c4dc2f9b03dc6dd5d0ee72473',
'dev_requirement' => false,
),
'laravel/serializable-closure' => array(
'pretty_version' => 'v1.1.1',
'version' => '1.1.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../laravel/serializable-closure',
'aliases' => array(),
'reference' => '9e4b005daa20b0c161f3845040046dc9ddc1d74e',
'dev_requirement' => false,
),
'laravel/tinker' => array(
'pretty_version' => 'v2.7.2',
'version' => '2.7.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../laravel/tinker',
'aliases' => array(),
'reference' => 'dff39b661e827dae6e092412f976658df82dbac5',
'dev_requirement' => false,
),
'laravel/ui' => array(
'pretty_version' => 'v3.4.5',
'version' => '3.4.5.0',
'type' => 'library',
'install_path' => __DIR__ . '/../laravel/ui',
'aliases' => array(),
'reference' => 'f11d295de1508c5bb56206a620b00b6616de414c',
'dev_requirement' => false,
),
'league/commonmark' => array(
'pretty_version' => '2.3.0',
'version' => '2.3.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../league/commonmark',
'aliases' => array(),
'reference' => '32a49eb2b38fe5e5c417ab748a45d0beaab97955',
'dev_requirement' => false,
),
'league/config' => array(
'pretty_version' => 'v1.1.1',
'version' => '1.1.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../league/config',
'aliases' => array(),
'reference' => 'a9d39eeeb6cc49d10a6e6c36f22c4c1f4a767f3e',
'dev_requirement' => false,
),
'league/flysystem' => array(
'pretty_version' => '3.0.19',
'version' => '3.0.19.0',
'type' => 'library',
'install_path' => __DIR__ . '/../league/flysystem',
'aliases' => array(),
'reference' => '670df21225d68d165a8df38587ac3f41caf608f8',
'dev_requirement' => false,
),
'league/mime-type-detection' => array(
'pretty_version' => '1.11.0',
'version' => '1.11.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../league/mime-type-detection',
'aliases' => array(),
'reference' => 'ff6248ea87a9f116e78edd6002e39e5128a0d4dd',
'dev_requirement' => false,
),
'mockery/mockery' => array(
'pretty_version' => '1.5.0',
'version' => '1.5.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../mockery/mockery',
'aliases' => array(),
'reference' => 'c10a5f6e06fc2470ab1822fa13fa2a7380f8fbac',
'dev_requirement' => true,
),
'monolog/monolog' => array(
'pretty_version' => '2.5.0',
'version' => '2.5.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../monolog/monolog',
'aliases' => array(),
'reference' => '4192345e260f1d51b365536199744b987e160edc',
'dev_requirement' => false,
),
'mtdowling/cron-expression' => array(
'dev_requirement' => false,
'replaced' => array(
0 => '^1.0',
),
),
'myclabs/deep-copy' => array(
'pretty_version' => '1.11.0',
'version' => '1.11.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../myclabs/deep-copy',
'aliases' => array(),
'reference' => '14daed4296fae74d9e3201d2c4925d1acb7aa614',
'dev_requirement' => true,
),
'nesbot/carbon' => array(
'pretty_version' => '2.58.0',
'version' => '2.58.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../nesbot/carbon',
'aliases' => array(),
'reference' => '97a34af22bde8d0ac20ab34b29d7bfe360902055',
'dev_requirement' => false,
),
'nette/schema' => array(
'pretty_version' => 'v1.2.2',
'version' => '1.2.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../nette/schema',
'aliases' => array(),
'reference' => '9a39cef03a5b34c7de64f551538cbba05c2be5df',
'dev_requirement' => false,
),
'nette/utils' => array(
'pretty_version' => 'v3.2.7',
'version' => '3.2.7.0',
'type' => 'library',
'install_path' => __DIR__ . '/../nette/utils',
'aliases' => array(),
'reference' => '0af4e3de4df9f1543534beab255ccf459e7a2c99',
'dev_requirement' => false,
),
'nikic/php-parser' => array(
'pretty_version' => 'v4.13.2',
'version' => '4.13.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../nikic/php-parser',
'aliases' => array(),
'reference' => '210577fe3cf7badcc5814d99455df46564f3c077',
'dev_requirement' => false,
),
'nunomaduro/collision' => array(
'pretty_version' => 'v6.2.0',
'version' => '6.2.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../nunomaduro/collision',
'aliases' => array(),
'reference' => 'c379636dc50e829edb3a8bcb944a01aa1aed8f25',
'dev_requirement' => true,
),
'phar-io/manifest' => array(
'pretty_version' => '2.0.3',
'version' => '2.0.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phar-io/manifest',
'aliases' => array(),
'reference' => '97803eca37d319dfa7826cc2437fc020857acb53',
'dev_requirement' => true,
),
'phar-io/version' => array(
'pretty_version' => '3.2.1',
'version' => '3.2.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phar-io/version',
'aliases' => array(),
'reference' => '4f7fd7836c6f332bb2933569e566a0d6c4cbed74',
'dev_requirement' => true,
),
'phpdocumentor/reflection-common' => array(
'pretty_version' => '2.2.0',
'version' => '2.2.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpdocumentor/reflection-common',
'aliases' => array(),
'reference' => '1d01c49d4ed62f25aa84a747ad35d5a16924662b',
'dev_requirement' => true,
),
'phpdocumentor/reflection-docblock' => array(
'pretty_version' => '5.3.0',
'version' => '5.3.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpdocumentor/reflection-docblock',
'aliases' => array(),
'reference' => '622548b623e81ca6d78b721c5e029f4ce664f170',
'dev_requirement' => true,
),
'phpdocumentor/type-resolver' => array(
'pretty_version' => '1.6.1',
'version' => '1.6.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpdocumentor/type-resolver',
'aliases' => array(),
'reference' => '77a32518733312af16a44300404e945338981de3',
'dev_requirement' => true,
),
'phpoption/phpoption' => array(
'pretty_version' => '1.8.1',
'version' => '1.8.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpoption/phpoption',
'aliases' => array(),
'reference' => 'eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15',
'dev_requirement' => false,
),
'phpspec/prophecy' => array(
'pretty_version' => 'v1.15.0',
'version' => '1.15.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpspec/prophecy',
'aliases' => array(),
'reference' => 'bbcd7380b0ebf3961ee21409db7b38bc31d69a13',
'dev_requirement' => true,
),
'phpunit/php-code-coverage' => array(
'pretty_version' => '9.2.15',
'version' => '9.2.15.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpunit/php-code-coverage',
'aliases' => array(),
'reference' => '2e9da11878c4202f97915c1cb4bb1ca318a63f5f',
'dev_requirement' => true,
),
'phpunit/php-file-iterator' => array(
'pretty_version' => '3.0.6',
'version' => '3.0.6.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpunit/php-file-iterator',
'aliases' => array(),
'reference' => 'cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf',
'dev_requirement' => true,
),
'phpunit/php-invoker' => array(
'pretty_version' => '3.1.1',
'version' => '3.1.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpunit/php-invoker',
'aliases' => array(),
'reference' => '5a10147d0aaf65b58940a0b72f71c9ac0423cc67',
'dev_requirement' => true,
),
'phpunit/php-text-template' => array(
'pretty_version' => '2.0.4',
'version' => '2.0.4.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpunit/php-text-template',
'aliases' => array(),
'reference' => '5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28',
'dev_requirement' => true,
),
'phpunit/php-timer' => array(
'pretty_version' => '5.0.3',
'version' => '5.0.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpunit/php-timer',
'aliases' => array(),
'reference' => '5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2',
'dev_requirement' => true,
),
'phpunit/phpunit' => array(
'pretty_version' => '9.5.20',
'version' => '9.5.20.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpunit/phpunit',
'aliases' => array(),
'reference' => '12bc8879fb65aef2138b26fc633cb1e3620cffba',
'dev_requirement' => true,
),
'psr/container' => array(
'pretty_version' => '2.0.2',
'version' => '2.0.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/container',
'aliases' => array(),
'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963',
'dev_requirement' => false,
),
'psr/container-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.1|2.0',
),
),
'psr/event-dispatcher' => array(
'pretty_version' => '1.0.0',
'version' => '1.0.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/event-dispatcher',
'aliases' => array(),
'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0',
'dev_requirement' => false,
),
'psr/event-dispatcher-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0',
),
),
'psr/http-client' => array(
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-client',
'aliases' => array(),
'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621',
'dev_requirement' => false,
),
'psr/http-client-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0',
),
),
'psr/http-factory' => array(
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-factory',
'aliases' => array(),
'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be',
'dev_requirement' => false,
),
'psr/http-factory-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0',
),
),
'psr/http-message' => array(
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-message',
'aliases' => array(),
'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363',
'dev_requirement' => false,
),
'psr/http-message-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0',
),
),
'psr/log' => array(
'pretty_version' => '3.0.0',
'version' => '3.0.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/log',
'aliases' => array(),
'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001',
'dev_requirement' => false,
),
'psr/log-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0.0 || 2.0.0 || 3.0.0',
1 => '1.0|2.0|3.0',
),
),
'psr/simple-cache' => array(
'pretty_version' => '3.0.0',
'version' => '3.0.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/simple-cache',
'aliases' => array(),
'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865',
'dev_requirement' => false,
),
'psr/simple-cache-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0|2.0|3.0',
),
),
'psy/psysh' => array(
'pretty_version' => 'v0.11.4',
'version' => '0.11.4.0',
'type' => 'library',
'install_path' => __DIR__ . '/../psy/psysh',
'aliases' => array(),
'reference' => '05c544b339b112226ad14803e1e5b09a61957454',
'dev_requirement' => false,
),
'ralouphie/getallheaders' => array(
'pretty_version' => '3.0.3',
'version' => '3.0.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../ralouphie/getallheaders',
'aliases' => array(),
'reference' => '120b605dfeb996808c31b6477290a714d356e822',
'dev_requirement' => false,
),
'ramsey/collection' => array(
'pretty_version' => '1.2.2',
'version' => '1.2.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../ramsey/collection',
'aliases' => array(),
'reference' => 'cccc74ee5e328031b15640b51056ee8d3bb66c0a',
'dev_requirement' => false,
),
'ramsey/uuid' => array(
'pretty_version' => '4.3.1',
'version' => '4.3.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../ramsey/uuid',
'aliases' => array(),
'reference' => '8505afd4fea63b81a85d3b7b53ac3cb8dc347c28',
'dev_requirement' => false,
),
'rhumsaa/uuid' => array(
'dev_requirement' => false,
'replaced' => array(
0 => '4.3.1',
),
),
'sebastian/cli-parser' => array(
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/cli-parser',
'aliases' => array(),
'reference' => '442e7c7e687e42adc03470c7b668bc4b2402c0b2',
'dev_requirement' => true,
),
'sebastian/code-unit' => array(
'pretty_version' => '1.0.8',
'version' => '1.0.8.0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/code-unit',
'aliases' => array(),
'reference' => '1fc9f64c0927627ef78ba436c9b17d967e68e120',
'dev_requirement' => true,
),
'sebastian/code-unit-reverse-lookup' => array(
'pretty_version' => '2.0.3',
'version' => '2.0.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/code-unit-reverse-lookup',
'aliases' => array(),
'reference' => 'ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5',
'dev_requirement' => true,
),
'sebastian/comparator' => array(
'pretty_version' => '4.0.6',
'version' => '4.0.6.0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/comparator',
'aliases' => array(),
'reference' => '55f4261989e546dc112258c7a75935a81a7ce382',
'dev_requirement' => true,
),
'sebastian/complexity' => array(
'pretty_version' => '2.0.2',
'version' => '2.0.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/complexity',
'aliases' => array(),
'reference' => '739b35e53379900cc9ac327b2147867b8b6efd88',
'dev_requirement' => true,
),
'sebastian/diff' => array(
'pretty_version' => '4.0.4',
'version' => '4.0.4.0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/diff',
'aliases' => array(),
'reference' => '3461e3fccc7cfdfc2720be910d3bd73c69be590d',
'dev_requirement' => true,
),
'sebastian/environment' => array(
'pretty_version' => '5.1.4',
'version' => '5.1.4.0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/environment',
'aliases' => array(),
'reference' => '1b5dff7bb151a4db11d49d90e5408e4e938270f7',
'dev_requirement' => true,
),
'sebastian/exporter' => array(
'pretty_version' => '4.0.4',
'version' => '4.0.4.0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/exporter',
'aliases' => array(),
'reference' => '65e8b7db476c5dd267e65eea9cab77584d3cfff9',
'dev_requirement' => true,
),
'sebastian/global-state' => array(
'pretty_version' => '5.0.5',
'version' => '5.0.5.0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/global-state',
'aliases' => array(),
'reference' => '0ca8db5a5fc9c8646244e629625ac486fa286bf2',
'dev_requirement' => true,
),
'sebastian/lines-of-code' => array(
'pretty_version' => '1.0.3',
'version' => '1.0.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/lines-of-code',
'aliases' => array(),
'reference' => 'c1c2e997aa3146983ed888ad08b15470a2e22ecc',
'dev_requirement' => true,
),
'sebastian/object-enumerator' => array(
'pretty_version' => '4.0.4',
'version' => '4.0.4.0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/object-enumerator',
'aliases' => array(),
'reference' => '5c9eeac41b290a3712d88851518825ad78f45c71',
'dev_requirement' => true,
),
'sebastian/object-reflector' => array(
'pretty_version' => '2.0.4',
'version' => '2.0.4.0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/object-reflector',
'aliases' => array(),
'reference' => 'b4f479ebdbf63ac605d183ece17d8d7fe49c15c7',
'dev_requirement' => true,
),
'sebastian/recursion-context' => array(
'pretty_version' => '4.0.4',
'version' => '4.0.4.0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/recursion-context',
'aliases' => array(),
'reference' => 'cd9d8cf3c5804de4341c283ed787f099f5506172',
'dev_requirement' => true,
),
'sebastian/resource-operations' => array(
'pretty_version' => '3.0.3',
'version' => '3.0.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/resource-operations',
'aliases' => array(),
'reference' => '0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8',
'dev_requirement' => true,
),
'sebastian/type' => array(
'pretty_version' => '3.0.0',
'version' => '3.0.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/type',
'aliases' => array(),
'reference' => 'b233b84bc4465aff7b57cf1c4bc75c86d00d6dad',
'dev_requirement' => true,
),
'sebastian/version' => array(
'pretty_version' => '3.0.2',
'version' => '3.0.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/version',
'aliases' => array(),
'reference' => 'c6c1022351a901512170118436c764e473f6de8c',
'dev_requirement' => true,
),
'spatie/backtrace' => array(
'pretty_version' => '1.2.1',
'version' => '1.2.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../spatie/backtrace',
'aliases' => array(),
'reference' => '4ee7d41aa5268107906ea8a4d9ceccde136dbd5b',
'dev_requirement' => true,
),
'spatie/flare-client-php' => array(
'pretty_version' => '1.1.0',
'version' => '1.1.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../spatie/flare-client-php',
'aliases' => array(),
'reference' => 'ceab058852a1278d9f57a7b95f1c348e4956d866',
'dev_requirement' => true,
),
'spatie/ignition' => array(
'pretty_version' => '1.2.9',
'version' => '1.2.9.0',
'type' => 'library',
'install_path' => __DIR__ . '/../spatie/ignition',
'aliases' => array(),
'reference' => 'db25202fab2d5c14613b8914a1bb374998bbf870',
'dev_requirement' => true,
),
'spatie/laravel-ignition' => array(
'pretty_version' => '1.2.3',
'version' => '1.2.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../spatie/laravel-ignition',
'aliases' => array(),
'reference' => '51e5daaa7e43c154fe57f1ddfbba862f9fe57646',
'dev_requirement' => true,
),
'symfony/console' => array(
'pretty_version' => 'v6.0.8',
'version' => '6.0.8.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/console',
'aliases' => array(),
'reference' => '0d00aa289215353aa8746a31d101f8e60826285c',
'dev_requirement' => false,
),
'symfony/css-selector' => array(
'pretty_version' => 'v6.0.3',
'version' => '6.0.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/css-selector',
'aliases' => array(),
'reference' => '1955d595c12c111629cc814d3f2a2ff13580508a',
'dev_requirement' => false,
),
'symfony/deprecation-contracts' => array(
'pretty_version' => 'v3.0.1',
'version' => '3.0.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
'aliases' => array(),
'reference' => '26954b3d62a6c5fd0ea8a2a00c0353a14978d05c',
'dev_requirement' => false,
),
'symfony/error-handler' => array(
'pretty_version' => 'v6.0.8',
'version' => '6.0.8.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/error-handler',
'aliases' => array(),
'reference' => '5e2795163acbd13b3cd46835c9f8f6c5d0a3a280',
'dev_requirement' => false,
),
'symfony/event-dispatcher' => array(
'pretty_version' => 'v6.0.3',
'version' => '6.0.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/event-dispatcher',
'aliases' => array(),
'reference' => '6472ea2dd415e925b90ca82be64b8bc6157f3934',
'dev_requirement' => false,
),
'symfony/event-dispatcher-contracts' => array(
'pretty_version' => 'v3.0.1',
'version' => '3.0.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/event-dispatcher-contracts',
'aliases' => array(),
'reference' => '7bc61cc2db649b4637d331240c5346dcc7708051',
'dev_requirement' => false,
),
'symfony/event-dispatcher-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '2.0|3.0',
),
),
'symfony/finder' => array(
'pretty_version' => 'v6.0.8',
'version' => '6.0.8.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/finder',
'aliases' => array(),
'reference' => 'af7edab28d17caecd1f40a9219fc646ae751c21f',
'dev_requirement' => false,
),
'symfony/http-foundation' => array(
'pretty_version' => 'v6.0.8',
'version' => '6.0.8.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/http-foundation',
'aliases' => array(),
'reference' => 'c9c86b02d7ef6f44f3154acc7de42831518afe7c',
'dev_requirement' => false,
),
'symfony/http-kernel' => array(
'pretty_version' => 'v6.0.8',
'version' => '6.0.8.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/http-kernel',
'aliases' => array(),
'reference' => '7aaf1cdc9cc2ad47e926f624efcb679883a39ca7',
'dev_requirement' => false,
),
'symfony/mailer' => array(
'pretty_version' => 'v6.0.8',
'version' => '6.0.8.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/mailer',
'aliases' => array(),
'reference' => '706af6b3e99ebcbc639c9c664f5579aaa869409b',
'dev_requirement' => false,
),
'symfony/mime' => array(
'pretty_version' => 'v6.0.8',
'version' => '6.0.8.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/mime',
'aliases' => array(),
'reference' => 'c1701e88ad0ca49fc6ad6cdf360bc0e1209fb5e1',
'dev_requirement' => false,
),
'symfony/polyfill-ctype' => array(
'pretty_version' => 'v1.25.0',
'version' => '1.25.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
'aliases' => array(),
'reference' => '30885182c981ab175d4d034db0f6f469898070ab',
'dev_requirement' => false,
),
'symfony/polyfill-intl-grapheme' => array(
'pretty_version' => 'v1.25.0',
'version' => '1.25.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme',
'aliases' => array(),
'reference' => '81b86b50cf841a64252b439e738e97f4a34e2783',
'dev_requirement' => false,
),
'symfony/polyfill-intl-idn' => array(
'pretty_version' => 'v1.25.0',
'version' => '1.25.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn',
'aliases' => array(),
'reference' => '749045c69efb97c70d25d7463abba812e91f3a44',
'dev_requirement' => false,
),
'symfony/polyfill-intl-normalizer' => array(
'pretty_version' => 'v1.25.0',
'version' => '1.25.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer',
'aliases' => array(),
'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8',
'dev_requirement' => false,
),
'symfony/polyfill-mbstring' => array(
'pretty_version' => 'v1.25.0',
'version' => '1.25.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
'aliases' => array(),
'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825',
'dev_requirement' => false,
),
'symfony/polyfill-php72' => array(
'pretty_version' => 'v1.25.0',
'version' => '1.25.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php72',
'aliases' => array(),
'reference' => '9a142215a36a3888e30d0a9eeea9766764e96976',
'dev_requirement' => false,
),
'symfony/polyfill-php80' => array(
'pretty_version' => 'v1.25.0',
'version' => '1.25.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php80',
'aliases' => array(),
'reference' => '4407588e0d3f1f52efb65fbe92babe41f37fe50c',
'dev_requirement' => false,
),
'symfony/polyfill-php81' => array(
'pretty_version' => 'v1.25.0',
'version' => '1.25.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php81',
'aliases' => array(),
'reference' => '5de4ba2d41b15f9bd0e19b2ab9674135813ec98f',
'dev_requirement' => false,
),
'symfony/process' => array(
'pretty_version' => 'v6.0.8',
'version' => '6.0.8.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/process',
'aliases' => array(),
'reference' => 'd074154ea8b1443a96391f6e39f9e547b2dd01b9',
'dev_requirement' => false,
),
'symfony/routing' => array(
'pretty_version' => 'v6.0.8',
'version' => '6.0.8.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/routing',
'aliases' => array(),
'reference' => '74c40c9fc334acc601a32fcf4274e74fb3bac11e',
'dev_requirement' => false,
),
'symfony/service-contracts' => array(
'pretty_version' => 'v3.0.1',
'version' => '3.0.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/service-contracts',
'aliases' => array(),
'reference' => 'e517458f278c2131ca9f262f8fbaf01410f2c65c',
'dev_requirement' => false,
),
'symfony/string' => array(
'pretty_version' => 'v6.0.8',
'version' => '6.0.8.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/string',
'aliases' => array(),
'reference' => 'ac0aa5c2282e0de624c175b68d13f2c8f2e2649d',
'dev_requirement' => false,
),
'symfony/translation' => array(
'pretty_version' => 'v6.0.8',
'version' => '6.0.8.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/translation',
'aliases' => array(),
'reference' => '3d38cf8f8834148c4457681d539bc204de701501',
'dev_requirement' => false,
),
'symfony/translation-contracts' => array(
'pretty_version' => 'v3.0.1',
'version' => '3.0.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/translation-contracts',
'aliases' => array(),
'reference' => 'c4183fc3ef0f0510893cbeedc7718fb5cafc9ac9',
'dev_requirement' => false,
),
'symfony/translation-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '2.3|3.0',
),
),
'symfony/var-dumper' => array(
'pretty_version' => 'v6.0.8',
'version' => '6.0.8.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/var-dumper',
'aliases' => array(),
'reference' => 'fa61dfb4bd3068df2492013dc65f3190e9f550c0',
'dev_requirement' => false,
),
'theseer/tokenizer' => array(
'pretty_version' => '1.2.1',
'version' => '1.2.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../theseer/tokenizer',
'aliases' => array(),
'reference' => '34a41e998c2183e22995f158c581e7b5e755ab9e',
'dev_requirement' => true,
),
'tijsverkoyen/css-to-inline-styles' => array(
'pretty_version' => '2.2.4',
'version' => '2.2.4.0',
'type' => 'library',
'install_path' => __DIR__ . '/../tijsverkoyen/css-to-inline-styles',
'aliases' => array(),
'reference' => 'da444caae6aca7a19c0c140f68c6182e337d5b1c',
'dev_requirement' => false,
),
'vlucas/phpdotenv' => array(
'pretty_version' => 'v5.4.1',
'version' => '5.4.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../vlucas/phpdotenv',
'aliases' => array(),
'reference' => '264dce589e7ce37a7ba99cb901eed8249fbec92f',
'dev_requirement' => false,
),
'voku/portable-ascii' => array(
'pretty_version' => '2.0.1',
'version' => '2.0.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../voku/portable-ascii',
'aliases' => array(),
'reference' => 'b56450eed252f6801410d810c8e1727224ae0743',
'dev_requirement' => false,
),
'webmozart/assert' => array(
'pretty_version' => '1.10.0',
'version' => '1.10.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../webmozart/assert',
'aliases' => array(),
'reference' => '6964c76c7804814a842473e0c8fd15bab0f18e25',
'dev_requirement' => false,
),
'yoeunes/toastr' => array(
'pretty_version' => 'v1.2.7',
'version' => '1.2.7.0',
'type' => 'library',
'install_path' => __DIR__ . '/../yoeunes/toastr',
'aliases' => array(),
'reference' => 'ff1af05918e2cd9e725a0a811c9a14546c8f1219',
'dev_requirement' => false,
),
),
);
|
<?php
namespace qeephp;
/**
* 用与保存和读取应用程序设置的工具类
*/
abstract class Config
{
/**
* 应用程序设置
*
* @var array
*/
public static $_config = array();
/**
* 导入设置
*
* @param array $config
*/
static function import(array $config)
{
self::$_config = array_merge(self::$_config, $config);
}
/**
* 读取指定的设置,如果不存在则返回$default参数指定的默认值
*
* @param string $item
* @param mixed $default
* @param bool $found
*
* @return mixed
*/
static function get($item, $default = null, & $found = false)
{
if (is_array($item))
{
$found = false;
foreach ($item as $key)
{
$return = self::get($key, $default, $found);
if ($found) return $return;
}
return $default;
}
if (strpos($item, '/') === false)
{
$found = array_key_exists($item, self::$_config);
return $found ? self::$_config[$item] : $default;
}
list($keys, $last) = self::_get_nested_keys($item);
$config =& self::$_config;
foreach ($keys as $key)
{
if (array_key_exists($key, $config))
{
$config =& $config[$key];
}
else
{
return $default;
}
}
$found = array_key_exists($last, $config);
return $found ? $config[$last] : $default;
}
/**
* 修改指定的设置
*
* @param string $item
* @param mixed $value
*/
static function set($item, $value)
{
if (strpos($item, '/') === false)
{
self::$_config[$item] = $value;
}
list($keys, $last) = self::_get_nested_keys($item);
$config =& self::$_config;
foreach ($keys as $key)
{
if (!array_key_exists($key, $config))
{
$config[$key] = array();
}
$config =& $config[$key];
}
$config[$last] = $value;
}
static private function _get_nested_keys($key)
{
$keys = arr($key, '/');
$last = array_pop($keys);
return array($keys, $last);
}
}
// 载入 QeePHP 框架默认值
Config::$_config = require(__DIR__ . '/__defaults.php');
|
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace Doctrine\DBAL\Platforms\Keywords;
/**
* DB2 Keywords
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.com
* @since 2.0
* @author Benjamin Eberlei <kontakt@beberlei.de>
*/
class DB2Keywords extends KeywordList
{
public function getName()
{
return 'DB2';
}
protected function getKeywords()
{
return array(
'ACTIVATE',
'ADD',
'AFTER',
'ALIAS',
'ALL',
'ALLOCATE',
'DOCUMENT',
'DOUBLE',
'DROP',
'DSSIZE',
'DYNAMIC',
'EACH',
'LOCK',
'LOCKMAX',
'LOCKSIZE',
'LONG',
'LOOP',
'MAINTAINED',
'ROUND_CEILING',
'ROUND_DOWN',
'ROUND_FLOOR',
'ROUND_HALF_DOWN',
'ROUND_HALF_EVEN',
'ROUND_HALF_UP',
'ALLOW',
'ALTER',
'AND',
'ANY',
'AS',
'ASENSITIVE',
'ASSOCIATE',
'ASUTIME',
'AT',
'ATTRIBUTES',
'AUDIT',
'AUTHORIZATION',
'AUX',
'AUXILIARY',
'BEFORE',
'BEGIN',
'BETWEEN',
'BINARY',
'BUFFERPOOL',
'BY',
'CACHE',
'CALL',
'CALLED',
'CAPTURE',
'CARDINALITY',
'CASCADED',
'CASE',
'CAST',
'CCSID',
'CHAR',
'CHARACTER',
'CHECK',
'CLONE',
'CLOSE',
'CLUSTER',
'COLLECTION',
'COLLID',
'COLUMN',
'COMMENT',
'COMMIT',
'CONCAT',
'CONDITION',
'CONNECT',
'CONNECTION',
'CONSTRAINT',
'CONTAINS',
'CONTINUE',
'COUNT',
'COUNT_BIG',
'CREATE',
'CROSS',
'CURRENT',
'CURRENT_DATE',
'CURRENT_LC_CTYPE',
'CURRENT_PATH',
'CURRENT_SCHEMA',
'CURRENT_SERVER',
'CURRENT_TIME',
'CURRENT_TIMESTAMP',
'CURRENT_TIMEZONE',
'CURRENT_USER',
'CURSOR',
'CYCLE',
'DATA',
'DATABASE',
'DATAPARTITIONNAME',
'DATAPARTITIONNUM',
'EDITPROC',
'ELSE',
'ELSEIF',
'ENABLE',
'ENCODING',
'ENCRYPTION',
'END',
'END-EXEC',
'ENDING',
'ERASE',
'ESCAPE',
'EVERY',
'EXCEPT',
'EXCEPTION',
'EXCLUDING',
'EXCLUSIVE',
'EXECUTE',
'EXISTS',
'EXIT',
'EXPLAIN',
'EXTERNAL',
'EXTRACT',
'FENCED',
'FETCH',
'FIELDPROC',
'FILE',
'FINAL',
'FOR',
'FOREIGN',
'FREE',
'FROM',
'FULL',
'FUNCTION',
'GENERAL',
'GENERATED',
'GET',
'GLOBAL',
'GO',
'GOTO',
'GRANT',
'GRAPHIC',
'GROUP',
'HANDLER',
'HASH',
'HASHED_VALUE',
'HAVING',
'HINT',
'HOLD',
'HOUR',
'HOURS',
'IDENTITY',
'IF',
'IMMEDIATE',
'IN',
'INCLUDING',
'INCLUSIVE',
'INCREMENT',
'INDEX',
'INDICATOR',
'INF',
'INFINITY',
'INHERIT',
'INNER',
'INOUT',
'INSENSITIVE',
'INSERT',
'INTEGRITY',
'MATERIALIZED',
'MAXVALUE',
'MICROSECOND',
'MICROSECONDS',
'MINUTE',
'MINUTES',
'MINVALUE',
'MODE',
'MODIFIES',
'MONTH',
'MONTHS',
'NAN',
'NEW',
'NEW_TABLE',
'NEXTVAL',
'NO',
'NOCACHE',
'NOCYCLE',
'NODENAME',
'NODENUMBER',
'NOMAXVALUE',
'NOMINVALUE',
'NONE',
'NOORDER',
'NORMALIZED',
'NOT',
'NULL',
'NULLS',
'NUMPARTS',
'OBID',
'OF',
'OLD',
'OLD_TABLE',
'ON',
'OPEN',
'OPTIMIZATION',
'OPTIMIZE',
'OPTION',
'OR',
'ORDER',
'OUT',
'OUTER',
'OVER',
'OVERRIDING',
'PACKAGE',
'PADDED',
'PAGESIZE',
'PARAMETER',
'PART',
'PARTITION',
'PARTITIONED',
'PARTITIONING',
'PARTITIONS',
'PASSWORD',
'PATH',
'PIECESIZE',
'PLAN',
'POSITION',
'PRECISION',
'PREPARE',
'PREVVAL',
'PRIMARY',
'PRIQTY',
'PRIVILEGES',
'PROCEDURE',
'PROGRAM',
'PSID',
'ROUND_UP',
'ROUTINE',
'ROW',
'ROW_NUMBER',
'ROWNUMBER',
'ROWS',
'ROWSET',
'RRN',
'RUN',
'SAVEPOINT',
'SCHEMA',
'SCRATCHPAD',
'SCROLL',
'SEARCH',
'SECOND',
'SECONDS',
'SECQTY',
'SECURITY',
'SELECT',
'SENSITIVE',
'SEQUENCE',
'SESSION',
'SESSION_USER',
'SET',
'SIGNAL',
'SIMPLE',
'SNAN',
'SOME',
'SOURCE',
'SPECIFIC',
'SQL',
'SQLID',
'STACKED',
'STANDARD',
'START',
'STARTING',
'STATEMENT',
'STATIC',
'STATMENT',
'STAY',
'STOGROUP',
'STORES',
'STYLE',
'SUBSTRING',
'SUMMARY',
'SYNONYM',
'SYSFUN',
'SYSIBM',
'SYSPROC',
'SYSTEM',
'SYSTEM_USER',
'TABLE',
'TABLESPACE',
'THEN',
'TIME',
'TIMESTAMP',
'TO',
'TRANSACTION',
'TRIGGER',
'TRIM',
'TRUNCATE',
'TYPE',
'UNDO',
'UNION',
'UNIQUE',
'UNTIL',
'UPDATE',
'DATE',
'DAY',
'DAYS',
'DB2GENERAL',
'DB2GENRL',
'DB2SQL',
'DBINFO',
'DBPARTITIONNAME',
'DBPARTITIONNUM',
'DEALLOCATE',
'DECLARE',
'DEFAULT',
'DEFAULTS',
'DEFINITION',
'DELETE',
'DENSE_RANK',
'DENSERANK',
'DESCRIBE',
'DESCRIPTOR',
'DETERMINISTIC',
'DIAGNOSTICS',
'DISABLE',
'DISALLOW',
'DISCONNECT',
'DISTINCT',
'DO',
'INTERSECT',
'PUBLIC',
'USAGE',
'INTO',
'QUERY',
'USER',
'IS',
'QUERYNO',
'USING',
'ISOBID',
'RANGE',
'VALIDPROC',
'ISOLATION',
'RANK',
'VALUE',
'ITERATE',
'READ',
'VALUES',
'JAR',
'READS',
'VARIABLE',
'JAVA',
'RECOVERY',
'VARIANT',
'JOIN',
'REFERENCES',
'VCAT',
'KEEP',
'REFERENCING',
'VERSION',
'KEY',
'REFRESH',
'VIEW',
'LABEL',
'RELEASE',
'VOLATILE',
'LANGUAGE',
'RENAME',
'VOLUMES',
'LATERAL',
'REPEAT',
'WHEN',
'LC_CTYPE',
'RESET',
'WHENEVER',
'LEAVE',
'RESIGNAL',
'WHERE',
'LEFT',
'RESTART',
'WHILE',
'LIKE',
'RESTRICT',
'WITH',
'LINKTYPE',
'RESULT',
'WITHOUT',
'LOCAL',
'RESULT_SET_LOCATOR WLM',
'LOCALDATE',
'RETURN',
'WRITE',
'LOCALE',
'RETURNS',
'XMLELEMENT',
'LOCALTIME',
'REVOKE',
'XMLEXISTS',
'LOCALTIMESTAMP RIGHT',
'XMLNAMESPACES',
'LOCATOR',
'ROLE',
'YEAR',
'LOCATORS',
'ROLLBACK',
'YEARS',
);
}
}
|
@extends('layouts.app')
@section('content')
<section class="content-header">
<h1 class="pull-left">Area Influencia Has Topologias</h1>
<h1 class="pull-right">
<a class="btn btn-primary pull-right" style="margin-top: -10px;margin-bottom: 5px" href="{!! route('areaInfluenciaHasTopologias.create') !!}">Agregar Nuevo</a>
</h1>
</section>
<div class="content">
<div class="clearfix"></div>
@include('flash::message')
<div class="clearfix"></div>
<div class="box box-primary">
<div class="box-body">
@include('area_influencia_has_topologias.table')
</div>
</div>
<div class="text-center">
</div>
</div>
@endsection
|
<?php
namespace App\Http\Controllers\Admin\Modules\Gallery;
use App\Models\Gallery;
class DeleteController extends BaseController
{
public function __invoke(int $id)
{
Gallery::findOrFail($id)->delete();
return redirect()->route('admin.gallery.index');
}
}
|
<?php
/**
* Created by Maksym Ignatchenko, Appus Studio LP on 03.12.2018
*
*/
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class CategoriesSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('categories')->insert([
['name' => 'test', 'description' => 'test category description',],
['name' => 'test2', 'description' => 'test2 category description',],
['name' => 'test3', 'description' => 'test3 category description',]
]);
DB::table('specialities')->insert([
['name' => 'test', 'description' => 'test speciality description',],
['name' => 'test2', 'description' => 'test2 speciality description',],
['name' => 'test3', 'description' => 'test3 speciality description',]
]);
DB::table('types')->insert([
['name' => 'test', 'description' => 'test type description',],
['name' => 'test2', 'description' => 'test2 type description',],
['name' => 'test3', 'description' => 'test3 type description',]
]);
}
}
|
<?php
/**
* Created by 有情人好聚好散.
* Author: ASang
* Date: 18-8-8
* Time: 下午12:22
*/
namespace Api\Validate;
class AddressNew extends BaseValidate
{
protected $rule = [
'name' => 'require|isNotEmpty',
'mobile' => 'require|isMobile|isMobile',
'city' => 'require|isNotEmpty',
'detail' => 'require|isNotEmpty',
'is_default' => 'require'
];
protected $message = [
'name.isNotEmpty' => "姓名不能为空",
'name.require' => "姓名必须存在",
'mobile.isNotEmpty' => "手机号不能为空",
'mobile.require' => "手机号必须存在",
'mobile.isMobile' => "手机号非法",
'city.require' => "地址必须存在",
'city.isNotEmpty' => "地址不能为空",
'detail.require' => "详细地址必须存在",
'detail.isNotEmpty' => "详细地址不能为空",
];
}
|
<?php
namespace MongoDB;
use MongoDB\BSON\Serializable;
use MongoDB\Driver\ReadConcern;
use MongoDB\Driver\Server;
use MongoDB\Exception\InvalidArgumentException;
use stdClass;
/**
* Extracts an ID from an inserted document.
*
* This function is used when BulkWrite::insert() does not return a generated
* ID, which means that the ID should be fetched from an array offset, public
* property, or in the data returned by bsonSerialize().
*
* @internal
* @see https://jira.mongodb.org/browse/PHPC-382
* @param array|object $document Inserted document
* @return mixed
*/
function extract_id_from_inserted_document($document)
{
if ($document instanceof Serializable) {
return extract_id_from_inserted_document($document->bsonSerialize());
}
return is_array($document) ? $document['_id'] : $document->_id;
}
/**
* Generate an index name from a key specification.
*
* @internal
* @param array|object $document Document containing fields mapped to values,
* which denote order or an index type
* @return string
* @throws InvalidArgumentException
*/
function generate_index_name($document)
{
if (is_object($document)) {
$document = get_object_vars($document);
}
if ( ! is_array($document)) {
throw InvalidArgumentException::invalidType('$document', $document, 'array or object');
}
$name = '';
foreach ($document as $field => $type) {
$name .= ($name != '' ? '_' : '') . $field . '_' . $type;
}
return $name;
}
/**
* Return whether the first key in the document starts with a "$" character.
*
* This is used for differentiating update and replacement documents.
*
* @internal
* @param array|object $document Update or replacement document
* @return boolean
* @throws InvalidArgumentException
*/
function is_first_key_operator($document)
{
if (is_object($document)) {
$document = get_object_vars($document);
}
if ( ! is_array($document)) {
throw InvalidArgumentException::invalidType('$document', $document, 'array or object');
}
$firstKey = (string) key($document);
return (isset($firstKey[0]) && $firstKey[0] == '$');
}
/**
* Return whether the aggregation pipeline ends with an $out operator.
*
* This is used for determining whether the aggregation pipeline msut be
* executed against a primary server.
*
* @internal
* @param array $pipeline List of pipeline operations
* @return boolean
*/
function is_last_pipeline_operator_out(array $pipeline)
{
$lastOp = end($pipeline);
if ($lastOp === false) {
return false;
}
$lastOp = (array) $lastOp;
return key($lastOp) === '$out';
}
/**
* Converts a ReadConcern instance to a stdClass for use in a BSON document.
*
* @internal
* @see https://jira.mongodb.org/browse/PHPC-498
* @param ReadConcern $readConcern Read concern
* @return stdClass
*/
function read_concern_as_document(ReadConcern $readConcern)
{
$document = [];
if ($readConcern->getLevel() !== null) {
$document['level'] = $readConcern->getLevel();
}
return (object) $document;
}
/**
* Return whether the server supports a particular feature.
*
* @internal
* @param Server $server Server to check
* @param integer $feature Feature constant (i.e. wire protocol version)
* @return boolean
*/
function server_supports_feature(Server $server, $feature)
{
$info = $server->getInfo();
$maxWireVersion = isset($info['maxWireVersion']) ? (integer) $info['maxWireVersion'] : 0;
$minWireVersion = isset($info['minWireVersion']) ? (integer) $info['minWireVersion'] : 0;
return ($minWireVersion <= $feature && $maxWireVersion >= $feature);
}
function is_string_array($input) {
if (!is_array($input)){
return false;
}
foreach($input as $item) {
if (!is_string($item)) {
return false;
}
}
return true;
}
|
<?php
/*
* This file is part of the TranslationFormBundle package.
*
* (c) David ALLIX <http://a2lix.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace A2lix\TranslationFormBundle\Util\Gedmo\EventListener;
use Gedmo\Translatable\TranslatableListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
/**
* @author David ALLIX
*/
class LocaleListener implements EventSubscriberInterface
{
private $translatableListener;
/**
* @param \Gedmo\Translatable\TranslatableListener $translatableListener
*/
public function __construct(TranslatableListener $translatableListener)
{
$this->translatableListener = $translatableListener;
}
/**
* @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
*/
public function onKernelRequest(GetResponseEvent $event)
{
$this->translatableListener->setTranslatableLocale($event->getRequest()->getLocale());
}
public static function getSubscribedEvents()
{
return array(
KernelEvents::REQUEST => array('onKernelRequest', -10),
);
}
}
|
<?php declare(strict_types=1);
namespace Shopware\Core\Framework\Plugin\Requirement;
use Composer\Composer;
use Composer\Package\Link;
use Composer\Repository\PlatformRepository;
use Composer\Semver\Constraint\Constraint;
use Composer\Semver\VersionParser;
use Shopware\Core\Framework\Context;
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\NotFilter;
use Shopware\Core\Framework\Plugin\Composer\Factory;
use Shopware\Core\Framework\Plugin\PluginCollection;
use Shopware\Core\Framework\Plugin\PluginEntity;
use Shopware\Core\Framework\Plugin\Requirement\Exception\MissingRequirementException;
use Shopware\Core\Framework\Plugin\Requirement\Exception\RequirementStackException;
use Shopware\Core\Framework\Plugin\Requirement\Exception\VersionMismatchException;
class RequirementsValidator
{
/**
* @var EntityRepositoryInterface
*/
private $pluginRepo;
/**
* @var string
*/
private $projectDir;
/**
* @var Composer
*/
private $pluginComposer;
public function __construct(EntityRepositoryInterface $pluginRepo, string $projectDir)
{
$this->pluginRepo = $pluginRepo;
$this->projectDir = $projectDir;
}
/**
* @throws RequirementStackException
*/
public function validateRequirements(PluginEntity $plugin, Context $context, string $method): void
{
$exceptionStack = new RequirementExceptionStack();
$pluginRequirements = $this->getPluginRequirements($plugin);
$pluginRequirements = $this->validateComposerPackages($pluginRequirements, $exceptionStack);
$pluginRequirements = $this->validateInstalledPlugins($context, $pluginRequirements, $exceptionStack);
$pluginRequirements = $this->validateShippedDependencies($plugin, $pluginRequirements, $exceptionStack);
$this->addRemainingRequirementsAsException($pluginRequirements, $exceptionStack);
$exceptionStack->tryToThrow($method);
}
/**
* resolveActiveDependants returns all active dependants of the given plugin.
*
* @param PluginEntity[] $dependants the plugins to check for a dependency on the given plugin
*
* @return PluginEntity[]
*/
public function resolveActiveDependants(PluginEntity $dependency, array $dependants): array
{
return array_filter($dependants, function ($dependant) use ($dependency) {
if (!$dependant->getActive()) {
return false;
}
return $this->dependsOn($dependant, $dependency);
});
}
/**
* dependsOn determines, wether a given plugin depends on another one.
*
* @param PluginEntity $plugin the plugin to be checked
* @param PluginEntity $dependency the potential dependency
*/
private function dependsOn(PluginEntity $plugin, PluginEntity $dependency): bool
{
foreach (array_keys($this->getPluginRequirements($plugin)) as $requirement) {
if ($requirement === $dependency->getComposerName()) {
return true;
}
}
return false;
}
/**
* @return Link[]
*/
private function getPluginRequirements(PluginEntity $plugin): array
{
$this->pluginComposer = $this->getComposer($this->projectDir . '/' . $plugin->getPath());
return $this->pluginComposer->getPackage()->getRequires();
}
/**
* @param Link[] $pluginRequirements
*
* @return Link[]
*/
private function validateComposerPackages(
array $pluginRequirements,
RequirementExceptionStack $exceptionStack
): array {
$shopwareProjectComposer = $this->getComposer($this->projectDir);
$pluginRequirements = $this->checkComposerDependencies(
$pluginRequirements,
$exceptionStack,
$shopwareProjectComposer
);
return $pluginRequirements;
}
private function getComposer(string $composerPath): Composer
{
return Factory::createComposer($composerPath);
}
/**
* @param Link[] $pluginRequirements
*
* @return Link[]
*/
private function checkComposerDependencies(
array $pluginRequirements,
RequirementExceptionStack $exceptionStack,
Composer $pluginComposer
): array {
$packages = $pluginComposer->getRepositoryManager()->getLocalRepository()->getPackages();
// Get PHP extension "packages"
$packages = array_merge($packages, (new PlatformRepository())->getPackages());
foreach ($packages as $package) {
$pluginRequirements = $this->checkRequirement(
$pluginRequirements,
$package->getName(),
$package->getVersion(),
$exceptionStack
);
foreach ($package->getReplaces() as $replace) {
$replaceVersion = $replace->getPrettyConstraint();
if ($replaceVersion === 'self.version') {
$replaceVersion = $package->getVersion();
}
$pluginRequirements = $this->checkRequirement(
$pluginRequirements,
$replace->getTarget(),
$replaceVersion,
$exceptionStack
);
}
}
return $pluginRequirements;
}
/**
* @param Link[] $pluginRequirements
*
* @return Link[]
*/
private function validateInstalledPlugins(
Context $context,
array $pluginRequirements,
RequirementExceptionStack $exceptionStack
): array {
$parser = new VersionParser();
foreach ($this->getInstalledPlugins($context) as $pluginEntity) {
$pluginRequirements = $this->checkRequirement(
$pluginRequirements,
$pluginEntity->getComposerName(),
$parser->normalize($pluginEntity->getVersion()),
$exceptionStack
);
}
return $pluginRequirements;
}
private function getInstalledPlugins(Context $context): PluginCollection
{
$criteria = new Criteria();
$criteria->addFilter(new NotFilter(NotFilter::CONNECTION_AND, [new EqualsFilter('installedAt', null)]));
$criteria->addFilter(new EqualsFilter('active', true));
/** @var PluginCollection $plugins */
$plugins = $this->pluginRepo->search($criteria, $context)->getEntities();
return $plugins;
}
/**
* @param Link[] $pluginRequirements
*
* @return Link[]
*/
private function checkRequirement(
array $pluginRequirements,
string $installedName,
string $installedVersion,
RequirementExceptionStack $exceptionStack
): array {
if (isset($pluginRequirements[$installedName])) {
$constraint = $pluginRequirements[$installedName]->getConstraint();
if ($constraint === null) {
return $pluginRequirements;
}
if ($constraint->matches(new Constraint('==', $installedVersion)) === false) {
$exceptionStack->add(
new VersionMismatchException($installedName, $constraint->getPrettyString(), $installedVersion)
);
}
unset($pluginRequirements[$installedName]);
}
return $pluginRequirements;
}
/**
* @param Link[] $pluginRequirements
*/
private function addRemainingRequirementsAsException(
array $pluginRequirements,
RequirementExceptionStack $exceptionStack
): void {
foreach ($pluginRequirements as $installedPackage => $requirement) {
$exceptionStack->add(
new MissingRequirementException($installedPackage, $requirement->getPrettyConstraint())
);
}
}
/**
* @param Link[] $pluginRequirements
*
* @return Link[]
*/
private function validateShippedDependencies(
PluginEntity $plugin,
array $pluginRequirements,
RequirementExceptionStack $exceptionStack
): array {
if ($plugin->getManagedByComposer()) {
return $pluginRequirements;
}
$vendorDir = $this->pluginComposer->getConfig()->get('vendor-dir');
if (!is_dir($vendorDir)) {
return $pluginRequirements;
}
$pluginRequirements = $this->checkComposerDependencies(
$pluginRequirements,
$exceptionStack,
$this->pluginComposer
);
return $pluginRequirements;
}
}
|
<?php
/**
*
* NOTICE OF LICENSE
*
* This source file is subject to the GNU General Public License (GPL 3)
* that is bundled with this package in the file LICENSE.txt
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Payone to newer
* versions in the future. If you wish to customize Payone for your
* needs please refer to http://www.payone.de for more information.
*
* @category Payone
* @package Payone_TransactionStatus
* @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
* @author Matthias Walter <info@noovias.com>
* @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
* @link http://www.noovias.com
*/
/**
*
* @category Payone
* @package Payone_TransactionStatus
* @subpackage Request
* @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
* @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
* @link http://www.noovias.com
*/
class Payone_TransactionStatus_Request extends Payone_TransactionStatus_Request_Abstract
{
/**
* @var string Payment portal key as MD5 value
*/
protected $key = NULL;
/**
* @var string
*/
protected $txaction = NULL;
/**
* @var string
*/
protected $mode = NULL;
/**
* @var int Payment portal ID
*/
protected $portalid = NULL;
/**
* @var int Account ID (subaccount ID)
*/
protected $aid = NULL;
/** *
* @var string
*/
protected $clearingtype = NULL;
/**
* unix timestamp
*
* @var int
*/
protected $txtime = NULL;
/**
* @var string ISO-4217
*/
protected $currency = NULL;
/**
* @var int
*/
protected $userid = NULL;
/**
* @var int
*/
protected $customerid = NULL;
/**
* @var string
*/
protected $param = NULL;
// Parameter bei einer Statusmeldung eines Zahlungsvorgangs
/**
* @var int
*/
protected $txid = NULL;
/**
* @var string
*/
protected $reference = NULL;
/**
* @var string
*/
protected $sequencenumber = NULL;
/**
* @var string
*/
protected $receivable = NULL;
/**
* @var string
*/
protected $balance = NULL;
/**
* @var string
*/
protected $failedcause = NULL;
// Zusätzliche Parameter Contract bei Statusmeldung eines Zahlungsvorgangs
/**
* @var int
*/
protected $productid = NULL;
/**
* @var int
*/
protected $accessid = NULL;
// Zusätzliche Parameter Collect (txaction=reminder) bei Statusmeldung eines Zahlungsvorgangs
/**
* @var string
*/
protected $reminderlevel = NULL;
// Parameter Invoicing (txaction=invoice)
/**
* @var string
*/
protected $invoiceid = NULL;
/**
* @var string
*/
protected $invoice_grossamount = NULL;
/**
* @var string
*/
protected $invoice_date = NULL;
/**
* @var string
*/
protected $invoice_deliverydate = NULL;
/**
* @var string
*/
protected $invoice_deliveryenddate = NULL;
/**
* @var string
*/
protected $clearing_bankaccountholder = NULL;
/**
* @var string
*/
protected $clearing_bankcountry = NULL;
/**
* @var string
*/
protected $clearing_bankaccount = NULL;
/**
* @var string
*/
protected $clearing_bankcode = NULL;
/**
* @var string
*/
protected $clearing_bankiban = NULL;
/**
* @var string
*/
protected $clearing_bankbic = NULL;
/**
* @var string
*/
protected $clearing_bankcity = NULL;
/**
* @var string
*/
protected $clearing_bankname = NULL;
/** @var string */
protected $clearing_legalnote = NULL;
/**
* (YYYYMMDD)
* @var string
*/
protected $clearing_duedate = NULL;
/** @var string */
protected $clearing_reference = NULL;
/** @var string */
protected $clearing_instructionnote = NULL;
/**
* @var string
*/
protected $iban = NULL;
/**
* @var string
*/
protected $bic = NULL;
/**
* @var string
*/
protected $mandate_identification = NULL;
/**
* @var string
*/
protected $creditor_identifier = NULL;
/**
* Format YYYYMMDD
* @var int
*/
protected $clearing_date = NULL;
/**
* @var float
*/
protected $clearing_amount = NULL;
/**
* @param int $accessid
*/
public function setAccessid($accessid)
{
$this->accessid = $accessid;
}
/**
* @return int
*/
public function getAccessid()
{
return $this->accessid;
}
/**
* @param int $aid
*/
public function setAid($aid)
{
$this->aid = $aid;
}
/**
* @return int
*/
public function getAid()
{
return $this->aid;
}
/**
* @param string $balance
*/
public function setBalance($balance)
{
$this->balance = $balance;
}
/**
* @return string
*/
public function getBalance()
{
return $this->balance;
}
/**
* @param string $clearingtype
*/
public function setClearingtype($clearingtype)
{
$this->clearingtype = $clearingtype;
}
/**
* @return string
*/
public function getClearingtype()
{
return $this->clearingtype;
}
/**
* @param string $currency
*/
public function setCurrency($currency)
{
$this->currency = $currency;
}
/**
* @return string
*/
public function getCurrency()
{
return $this->currency;
}
/**
* @param int $customerid
*/
public function setCustomerid($customerid)
{
$this->customerid = $customerid;
}
/**
* @return int
*/
public function getCustomerid()
{
return $this->customerid;
}
/**
* @param string $failedcause
*/
public function setFailedcause($failedcause)
{
$this->failedcause = $failedcause;
}
/**
* @return string
*/
public function getFailedcause()
{
return $this->failedcause;
}
/**
* @param string $invoice_date
*/
public function setInvoiceDate($invoice_date)
{
$this->invoice_date = $invoice_date;
}
/**
* @return string
*/
public function getInvoiceDate()
{
return $this->invoice_date;
}
/**
* @param string $invoice_deliverydate
*/
public function setInvoiceDeliverydate($invoice_deliverydate)
{
$this->invoice_deliverydate = $invoice_deliverydate;
}
/**
* @return string
*/
public function getInvoiceDeliverydate()
{
return $this->invoice_deliverydate;
}
/**
* @param string $invoice_deliveryenddate
*/
public function setInvoiceDeliveryenddate($invoice_deliveryenddate)
{
$this->invoice_deliveryenddate = $invoice_deliveryenddate;
}
/**
* @return string
*/
public function getInvoiceDeliveryenddate()
{
return $this->invoice_deliveryenddate;
}
/**
* @param string $invoice_grossamount
*/
public function setInvoiceGrossamount($invoice_grossamount)
{
$this->invoice_grossamount = $invoice_grossamount;
}
/**
* @return string
*/
public function getInvoiceGrossamount()
{
return $this->invoice_grossamount;
}
/**
* @param string $invoiceid
*/
public function setInvoiceid($invoiceid)
{
$this->invoiceid = $invoiceid;
}
/**
* @return string
*/
public function getInvoiceid()
{
return $this->invoiceid;
}
/**
* @param string $key
*/
public function setKey($key)
{
$this->key = $key;
}
/**
* @return string
*/
public function getKey()
{
return $this->key;
}
/**
* @param string $mode
*/
public function setMode($mode)
{
$this->mode = $mode;
}
/**
* @return string
*/
public function getMode()
{
return $this->mode;
}
/**
* @param string $param
*/
public function setParam($param)
{
$this->param = $param;
}
/**
* @return string
*/
public function getParam()
{
return $this->param;
}
/**
* @param int $portalid
*/
public function setPortalid($portalid)
{
$this->portalid = $portalid;
}
/**
* @return int
*/
public function getPortalid()
{
return $this->portalid;
}
/**
* @param int $productid
*/
public function setProductid($productid)
{
$this->productid = $productid;
}
/**
* @return int
*/
public function getProductid()
{
return $this->productid;
}
/**
* @param string $receivable
*/
public function setReceivable($receivable)
{
$this->receivable = $receivable;
}
/**
* @return string
*/
public function getReceivable()
{
return $this->receivable;
}
/**
* @param string $reference
*/
public function setReference($reference)
{
$this->reference = $reference;
}
/**
* @return string
*/
public function getReference()
{
return $this->reference;
}
/**
* @param string $reminderlevel
*/
public function setReminderlevel($reminderlevel)
{
$this->reminderlevel = $reminderlevel;
}
/**
* @return string
*/
public function getReminderlevel()
{
return $this->reminderlevel;
}
/**
* @param string $sequencenumber
*/
public function setSequencenumber($sequencenumber)
{
$this->sequencenumber = $sequencenumber;
}
/**
* @return string
*/
public function getSequencenumber()
{
return $this->sequencenumber;
}
/**
* @param string $txaction
*/
public function setTxaction($txaction)
{
$this->txaction = $txaction;
}
/**
* @return string
*/
public function getTxaction()
{
return $this->txaction;
}
/**
* @param int $txid
*/
public function setTxid($txid)
{
$this->txid = $txid;
}
/**
* @return int
*/
public function getTxid()
{
return $this->txid;
}
/**
* @param int $txtime
*/
public function setTxtime($txtime)
{
$this->txtime = $txtime;
}
/**
* @return int
*/
public function getTxtime()
{
return $this->txtime;
}
/**
* @param int $userid
*/
public function setUserid($userid)
{
$this->userid = $userid;
}
/**
* @return int
*/
public function getUserid()
{
return $this->userid;
}
/**
* @param string $clearing_bankaccount
*/
public function setClearingBankaccount( $clearing_bankaccount)
{
$this->clearing_bankaccount = $clearing_bankaccount;
}
/**
* @return string
*/
public function getClearingBankaccount()
{
return $this->clearing_bankaccount;
}
/**
* @param string $clearing_bankaccountholder
*/
public function setClearingBankaccountholder( $clearing_bankaccountholder)
{
$this->clearing_bankaccountholder = $clearing_bankaccountholder;
}
/**
* @return string
*/
public function getClearingBankaccountholder()
{
return $this->clearing_bankaccountholder;
}
/**
* @param string $clearing_bankbic
*/
public function setClearingBankbic( $clearing_bankbic)
{
$this->clearing_bankbic = $clearing_bankbic;
}
/**
* @return string
*/
public function getClearingBankbic()
{
return $this->clearing_bankbic;
}
/**
* @param string $clearing_bankcity
*/
public function setClearingBankcity( $clearing_bankcity)
{
$this->clearing_bankcity = $clearing_bankcity;
}
/**
* @return string
*/
public function getClearingBankcity()
{
return $this->clearing_bankcity;
}
/**
* @param string $clearing_bankcode
*/
public function setClearingBankcode( $clearing_bankcode)
{
$this->clearing_bankcode = $clearing_bankcode;
}
/**
* @return string
*/
public function getClearingBankcode()
{
return $this->clearing_bankcode;
}
/**
* @param string $clearing_bankcountry
*/
public function setClearingBankcountry( $clearing_bankcountry)
{
$this->clearing_bankcountry = $clearing_bankcountry;
}
/**
* @return string
*/
public function getClearingBankcountry()
{
return $this->clearing_bankcountry;
}
/**
* @param string $clearing_bankiban
*/
public function setClearingBankiban( $clearing_bankiban)
{
$this->clearing_bankiban = $clearing_bankiban;
}
/**
* @return string
*/
public function getClearingBankiban()
{
return $this->clearing_bankiban;
}
/**
* @param string $clearing_bankname
*/
public function setClearingBankname( $clearing_bankname)
{
$this->clearing_bankname = $clearing_bankname;
}
/**
* @return string
*/
public function getClearingBankname()
{
return $this->clearing_bankname;
}
/**
* @param string $clearing_duedate
*/
public function setClearingDuedate( $clearing_duedate)
{
$this->clearing_duedate = $clearing_duedate;
}
/**
* @return string
*/
public function getClearingDuedate()
{
return $this->clearing_duedate;
}
/**
* @param string $clearing_instructionnote
*/
public function setClearingInstructionnote( $clearing_instructionnote)
{
$this->clearing_instructionnote = $clearing_instructionnote;
}
/**
* @return string
*/
public function getClearingInstructionnote()
{
return $this->clearing_instructionnote;
}
/**
* @param string $clearing_legalnote
*/
public function setClearingLegalnote( $clearing_legalnote)
{
$this->clearing_legalnote = $clearing_legalnote;
}
/**
* @return string
*/
public function getClearingLegalnote()
{
return $this->clearing_legalnote;
}
/**
* @param string $clearing_reference
*/
public function setClearingReference( $clearing_reference)
{
$this->clearing_reference = $clearing_reference;
}
/**
* @return string
*/
public function getClearingReference()
{
return $this->clearing_reference;
}
/**
* @param string $iban
*/
public function setIban($iban)
{
$this->iban = $iban;
}
/**
* @return string
*/
public function getIban()
{
return $this->iban;
}
/**
* @param string $bic
*/
public function setBic($bic)
{
$this->bic = $bic;
}
/**
* @return string
*/
public function getBic()
{
return $this->bic;
}
/**
* @param string $mandateIdentification
*/
public function setMandateIdentification($mandateIdentification)
{
$this->mandate_identification = $mandateIdentification;
}
/**
* @return string
*/
public function getMandateIdentification()
{
return $this->mandate_identification;
}
/**
* @param string $creditorIdentifier
*/
public function setCreditorIdentifier($creditorIdentifier)
{
$this->creditor_identifier = $creditorIdentifier;
}
/**
* @return string
*/
public function getCreditorIdentifier()
{
return $this->creditor_identifier;
}
/**
* @param int $clearingDate
*/
public function setClearingDate($clearingDate)
{
$this->clearing_date = $clearingDate;
}
/**
* @return int
*/
public function getClearingDate()
{
return $this->clearing_date;
}
/**
* @param float $clearingAmount
*/
public function setClearingAmount($clearingAmount)
{
$this->clearing_amount = $clearingAmount;
}
/**
* @return float
*/
public function getClearingAmount()
{
return $this->clearing_amount;
}
}
|
<?php
// $Id: x25.php,v 1.3 2009/06/09 19:07:06 smk Exp $
$base = array(
0x00 => '-', '-', '|', '|', '-', '-', '|', '|', '-', '-', '|', '|', '+', '+', '+', '+',
0x10 => '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+',
0x20 => '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+',
0x30 => '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+',
0x40 => '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '-', '-', '|', '|',
0x50 => '-', '|', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+',
0x60 => '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+', '+',
0x70 => '+', '/', '\\', 'X', '-', '|', '-', '|', '-', '|', '-', '|', '-', '|', '-', '|',
0x80 => '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#',
0x90 => '#', '#', '#', '#', '-', '|', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
0xA0 => '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#',
0xB0 => '#', '#', '^', '^', '^', '^', '>', '>', '>', '>', '>', '>', 'V', 'V', 'V', 'V',
0xC0 => '<', '<', '<', '<', '<', '<', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*',
0xD0 => '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*',
0xE0 => '*', '*', '*', '*', '*', '*', '*', '#', '#', '#', '#', '#', '^', '^', '^', 'O',
0xF0 => '#', '#', '#', '#', '#', '#', '#', '#', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
);
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<form action="{{route('diagnosa.store')}}" method="POST">
@csrf
{{-- <input type="hidden" name="user_id" value="{{auth()->user()->id}}"> --}}
<button onclick="return confirm(`Siap untuk diagnosa ?`)" type="submit">Diagnosa Sekarang</button>
</form>
</div>
<div>
<ul>
@foreach ($diag as $item)
<li>
<a href="{{route('diagnosa.show', $item->id)}}">{{$item->id}}</a>
</li>
@endforeach
</ul>
</div>
</div>
</div>
</div>
</body>
</html>
|
<h2><?= $title?></h2>
<table class="table table-hover ">
<thead>
<tr>
<th>Username</th>
<th>Email</th>
<th>Registered Date</th>
<th>Change Status</th>
<th>Other</th>
</tr>
</thead>
<tbody>
<?php foreach($users as $user):?>
<tr>
<td><?php echo $user['username']?></td>
<td><?php echo $user['email']?></td>
<td><?php echo $user['register_date']?></td>
<?php if($user['status']=='ban'){?>
<td><a class="btn btn-primary d-inline-block" href="<?php echo base_url()."users/unbanuser/".$user['id'] ;?>">UNBAN</a></td>
<?php }?>
<?php if($user['status']=='unban'){?>
<td><a class="btn btn-primary d-inline-block" href="<?php echo base_url()."users/banuser/".$user['id'];?>">BAN</a></td>
<?php }?>
<?php if($this->session->userdata('user_id')==1){?>
<td><a class="btn btn-danger d-inline-block" href="<?php echo base_url()."users/deleteuser/".$user['id'];?>">DELETE</a></td>
<?php }?>
</tr>
<?php endforeach?>
</tbody>
</table>
|
<?php
class input_model extends CI_Model {
public function insert_menu() {
$data = array(
'id_menu' => $this->input->post('id_menu'),
'nama_menu' => $this->input->post('nama_menu'),
'kategori' => $this->input->post('kategori'),
'satuan' => $this->input->post('satuan'),
'harga' => $this->input->post('harga')
);
$insert = $this->db->insert('tb_menu', $data);
if ($insert) {
$this->session->set_flashdata('input_menu', 'Input Berhasil ('.$this->input->post('id_menu').')');
redirect('kasir/menu');
}
}
public function update_menu() {
$data = array(
'nama_menu' => $this->input->post('nama_menu'),
'kategori' => $this->input->post('kategori'),
'satuan' => $this->input->post('satuan'),
'harga' => $this->input->post('harga')
);
$this->db->where('id_menu', $this->input->post('id_menu'));
$update = $this->db->update('tb_menu', $data);
if ($update) {
$this->session->set_flashdata('edit_menu', 'Edit Berhasil ('.$this->input->post('id_menu').')');
redirect('kasir/menu');
}
}
public function delete_menu($id_menu) {
$this->db->where('id_menu', $id_menu);
$query = $this->db->delete('tb_menu');
if ($query) {
$this->session->set_flashdata('delete_menu', 'Delete Berhasil ('.$id_menu.')');
redirect('kasir/menu');
}
}
public function insert_pelanggan() {
$data = array(
'id_pelanggan' => $this->input->post('id_pelanggan'),
'nama_pelanggan' => $this->input->post('nama_pelanggan'),
'jk' => $this->input->post('jenis_kelamin'),
'no_telepon' => $this->input->post('no_telepon'),
'alamat' => $this->input->post('alamat')
);
$insert = $this->db->insert('tb_pelanggan', $data);
if ($insert) {
$this->session->set_flashdata('input_pelanggan', 'Input Berhasil ('.$this->input->post('id_pelanggan').')');
redirect('kasir/pelanggan');
}
}
public function update_pelanggan() {
$data = array(
'nama_pelanggan' => $this->input->post('nama_pelanggan'),
'jk' => $this->input->post('jenis_kelamin'),
'no_telepon' => $this->input->post('no_telepon'),
'alamat' => $this->input->post('alamat')
);
$this->db->where('id_pelanggan', $this->input->post('id_pelanggan'));
$update = $this->db->update('tb_pelanggan', $data);
if ($update) {
$this->session->set_flashdata('edit_pelanggan', 'Edit Berhasil ('.$this->input->post('id_pelanggan').')');
redirect('kasir/pelanggan');
}
}
public function insert_bahan() {
$data = array(
'id_bahan' => $this->input->post('id_bahan'),
'nama_bahan' => $this->input->post('nama_bahan'),
'jenis' => $this->input->post('jenis'),
'stok' => 0,
'satuan' => $this->input->post('satuan'),
'harga' => $this->input->post('harga'),
'id_supplier' => $this->input->post('id_supplier')
);
$insert = $this->db->insert('tb_bahan', $data);
if ($insert) {
$this->session->set_flashdata('input_bahan', 'Input Berhasil ('.$this->input->post('id_bahan').')');
redirect('admin/bahan');
}
}
public function update_bahan() {
$data = array(
'nama_bahan' => $this->input->post('nama_bahan'),
'jenis' => $this->input->post('jenis'),
'satuan' => $this->input->post('satuan'),
'harga' => $this->input->post('harga'),
'id_supplier' => $this->input->post('id_supplier')
);
$this->db->where('id_bahan', $this->input->post('id_bahan'));
$update = $this->db->update('tb_bahan', $data);
if ($update) {
$this->session->set_flashdata('edit_bahan', 'Edit Berhasil ('.$this->input->post('id_bahan').')');
redirect('admin/bahan');
}
}
public function delete_bahan($id_bahan) {
$this->db->where('id_bahan', $id_bahan);
$query = $this->db->delete('tb_bahan');
if ($query) {
$this->session->set_flashdata('delete_bahan', 'Delete Berhasil ('.$id_bahan.')');
redirect('admin/bahan');
}
}
public function insert_supplier() {
$data = array(
'id_supplier' => $this->input->post('id_supplier'),
'nama_supplier' => $this->input->post('nama_supplier'),
'no_telepon' => $this->input->post('no_telepon'),
'alamat' => $this->input->post('alamat')
);
$insert = $this->db->insert('tb_supplier', $data);
if ($insert) {
$this->session->set_flashdata('input_supplier', 'Input Berhasil ('.$this->input->post('id_supplier').')');
redirect('admin/supplier');
}
}
public function update_supplier() {
$data = array(
'nama_supplier' => $this->input->post('nama_supplier'),
'no_telepon' => $this->input->post('no_telepon'),
'alamat' => $this->input->post('alamat')
);
$this->db->where('id_supplier', $this->input->post('id_supplier'));
$update = $this->db->update('tb_supplier', $data);
if ($update) {
$this->session->set_flashdata('edit_supplier', 'Edit Berhasil ('.$this->input->post('id_supplier').')');
redirect('admin/supplier');
}
}
public function delete_supplier($id_supplier) {
$this->db->where('id_supplier', $id_supplier);
$query = $this->db->delete('tb_supplier');
if ($query) {
$this->session->set_flashdata('delete_supplier', 'Delete Berhasil ('.$id_supplier.')');
redirect('admin/supplier');
}
}
public function insert_penjualan() {
date_default_timezone_set("Asia/Jakarta");
$data = array(
'no_nota_penjualan' => $this->input->post('no_nota_penjualan'),
'tgl_nota_penjualan' => date('Y-m-d'),
'waktu_nota_penjualan' => date('H:i:s'),
'id_pelanggan' => $this->input->post('id_pelanggan'),
'total_menu' => 0,
'total_harga' => 0,
'id_user' => $this->session->userdata('id_user'),
'status' => "nomenu"
);
$insert = $this->db->insert('tb_penjualan', $data);
if ($insert) {
$this->session->set_flashdata('input_penjualan', 'Input Berhasil ('.$this->input->post('no_nota_penjualan').')');
redirect('kasir/penjualan');
}
}
public function insert_detail_penjualan() {
$data3 = array(
'id_pelanggan' => $this->input->post('id_pelanggan'),
'nama_pelanggan' => $this->input->post('nama_pelanggan'),
'no_telepon' => $this->input->post('no_telepon')
);
$insert3 = $this->db->insert('tb_pelanggan', $data3);
if ($insert3) {
date_default_timezone_set("Asia/Jakarta");
$data = array(
'no_nota_penjualan' => $this->input->post('no_nota_penjualan'),
'tgl_nota_penjualan' => date('Y-m-d'),
'waktu_nota_penjualan' => date('H:i:s'),
'id_pelanggan' => $this->input->post('id_pelanggan'),
'total_menu' => 0,
'total_harga' => 0,
'id_user' => $this->session->userdata('id_user')
);
$insert = $this->db->insert('tb_penjualan', $data);
if ($insert) {
$data = array();
for ($i = 1; $i <= $this->input->post('counter'); $i++) {
if ($this->input->post('jumlah'.$i) != 0 && $this->input->post('nama_menu'.$i) != '') {
$data[] = array(
'no_nota_penjualan' => $this->input->post('no_nota_penjualan'),
'id_bahan' => $this->input->post('nama_menu'.$i),
'jumlah' => $this->input->post('jumlah'.$i)
);
$this->db->select('stok_cangkir,stok,id_bahan');
$this->db->from('tb_bahan');
$this->db->where('id_bahan', $this->input->post('nama_menu'.$i));
$duta = $this->db->get()->row();
$duta2 = array(
// 'stok_cangkir' => $duta->stok_cangkir - $this->input->post('jumlah'.$i),
'stok_cangkir' => $this->input->post('cangkirShow'.$i),
'stok' => $duta->stok - ($this->input->post('jumlah'.$i) / 12),
);
$this->db->where('id_bahan', $this->input->post('nama_menu'.$i));
$update = $this->db->update('tb_bahan', $duta2);
}
}
$insert2 = $this->db->insert_batch('tb_detail_penjualan_new', $data);
if ($insert2) {
$this->db->select('sum(jumlah) as sum_jumlah, harga, sum(jumlah * harga) as sum_total');
$this->db->from('tb_detail_penjualan');
$this->db->join('tb_menu', 'tb_menu.id_menu = tb_detail_penjualan.id_menu');
$this->db->where('no_nota_penjualan', $this->input->post('no_nota_penjualan'));
$this->db->group_by('no_nota_penjualan');
$diskon = $this->db->insert_batch('tb_detail_penjualan_new', $data);
if ('sum_total'>=150000) {
$this->db->select('sum(sum_total * 0.1) as diskon, sum(sum_total-diskon) as total_fix');
$this->db->from('tb_detail_penjualan');
$this->db->join('tb_menu', 'tb_menu.id_menu = tb_detail_penjualan.id_menu');
$this->db->where('no_nota_penjualan', $this->input->post('no_nota_penjualan'));
$this->db->group_by('no_nota_penjualan');
$data = $this->db->get()->row();
$data2 = array(
'total_menu' => $data->sum_jumlah,
'total_harga' => $data->total_fix,
);
}
$this->db->where('no_nota_penjualan', $this->input->post('no_nota_penjualan'));
$update = $this->db->update('tb_penjualan', $data2);
if ($update) {
$this->session->set_flashdata('input_detail_penjualan', 'Input Berhasil ('.$this->input->post('no_nota_penjualan').')');
$no_nota_penjualan = $this->input->post('no_nota_penjualan');
$bayar = $this->input->post('bayar');
$kembalian = $this->input->post('kembalian');
redirect('kasir/nota_penjualan/'.$no_nota_penjualan.'/'.$bayar.'/'.$kembalian);
} else {}
} else {}
}
}
}
public function coba() {
$this->db->select('sum(jumlah) as sum_jumlah, harga, sum(jumlah * harga) as sum_total');
$this->db->from('tb_detail_penjualan');
$this->db->join('tb_menu', 'tb_menu.id_menu = tb_detail_penjualan.id_menu');
$this->db->where('no_nota_penjualan', 'PJ2019060001');
$this->db->group_by('no_nota_penjualan');
$data = $this->db->get()->row();
echo $data->sum_jumlah."<br>";
echo $data->harga."<br>";
echo $data->sum_total;
}
public function insert_pembelian() {
date_default_timezone_set("Asia/Jakarta");
// $counter = $this->input->post('counter');
$data = array(
'no_nota_pembelian' => $this->input->post('no_nota_pembelian'),
'tgl_nota_pembelian' => date('Y-m-d'),
'waktu_nota_pembelian' => date('H:i:s'),
'id_supplier' => $this->input->post('id_supplier'),
'total_bahan' => $this->input->post('totalJumlahAll'),
'total_harga' => $this->input->post('totalHargaAll'),
'id_user' => $this->session->userdata('id_user'),
// 'status' => "nobahan"
);
$insert = $this->db->insert('tb_pembelian', $data);
$data2 = array();
for ($i = 1; $i <= 5; $i++) {
if ($this->input->post('jumlah'.$i) != 0 && $this->input->post('id_bahan'.$i) != '') {
$data2[] = array(
'no_nota_pembelian' => $this->input->post('no_nota_pembelian'),
'id_bahan' => $this->input->post('id_bahan'.$i),
'jumlah' => $this->input->post('jumlah'.$i)
);
}
}
$insert2 = $this->db->insert_batch('tb_detail_pembelian', $data2);
if ($insert2) {
$this->db->select('sum(jumlah) as sum_jumlah, harga, sum(jumlah * harga) as sum_total');
$this->db->from('tb_detail_pembelian');
$this->db->join('tb_bahan', 'tb_bahan.id_bahan = tb_detail_pembelian.id_bahan');
$this->db->where('no_nota_pembelian', $this->input->post('no_nota_pembelian'));
$this->db->group_by('no_nota_pembelian');
$data2 = $this->db->get()->row();
$data2 = array(
'total_bahan' => $data2->sum_jumlah,
'total_harga' => $data2->sum_total,
// 'status' => 'done'
);
$this->db->where('no_nota_pembelian', $this->input->post('no_nota_pembelian'));
$update = $this->db->update('tb_pembelian', $data2);
if ($update) {
$this->db->select('*');
$this->db->from('tb_detail_pembelian');
$this->db->where('no_nota_pembelian', $this->input->post('no_nota_pembelian'));
$query = $this->db->get()->result();
foreach ($query as $row) {
$convertCangkir = $row->jumlah * 12;
$this->db->query("UPDATE tb_bahan SET stok = stok + ".$row->jumlah.", stok_cangkir = ".$convertCangkir." WHERE id_bahan = '".$row->id_bahan."'");
}
}
if ($update) {
$this->session->set_flashdata('input_detail_pembelian', 'Input Berhasil ('.$this->input->post('no_nota_pembelian').')');
redirect('admin/pembelian');
} else {}
} else {}
if ($insert) {
$this->session->set_flashdata('input_pembelian', 'Input Berhasil ('.$this->input->post('no_nota_pembelian').')');
redirect('admin/pembelian');
}
}
public function insert_detail_pembelian() {
$data = array();
for ($i = 1; $i <= 5; $i++) {
if ($this->input->post('jumlah'.$i) != 0 && $this->input->post('id_bahan'.$i) != '') {
$data[] = array(
'no_nota_pembelian' => $this->input->post('no_nota_pembelian'),
'id_bahan' => $this->input->post('id_bahan'.$i),
'jumlah' => $this->input->post('jumlah'.$i)
);
}
}
$insert = $this->db->insert_batch('tb_detail_pembelian', $data);
if ($insert) {
$this->db->select('sum(jumlah) as sum_jumlah, harga, sum(jumlah * harga) as sum_total');
$this->db->from('tb_detail_pembelian');
$this->db->join('tb_bahan', 'tb_bahan.id_bahan = tb_detail_pembelian.id_bahan');
$this->db->where('no_nota_pembelian', $this->input->post('no_nota_pembelian'));
$this->db->group_by('no_nota_pembelian');
$data = $this->db->get()->row();
$data2 = array(
'total_bahan' => $data->sum_jumlah,
'total_harga' => $data->sum_total,
'status' => 'done'
);
$this->db->where('no_nota_pembelian', $this->input->post('no_nota_pembelian'));
$update = $this->db->update('tb_pembelian', $data2);
if ($update) {
$this->db->select('*');
$this->db->from('tb_detail_pembelian');
$this->db->where('no_nota_pembelian', $this->input->post('no_nota_pembelian'));
$query = $this->db->get()->result();
foreach ($query as $row) {
$convertCangkir = $row->jumlah * 12;
$this->db->query("UPDATE tb_bahan SET stok = stok + ".$row->jumlah.", stok_cangkir = stok + ".$convertCangkir." WHERE id_bahan = '".$row->id_bahan."'");
}
}
if ($update) {
$this->session->set_flashdata('input_detail_pembelian', 'Input Berhasil ('.$this->input->post('no_nota_pembelian').')');
redirect('admin/pembelian');
} else {}
} else {}
}
public function insert_penggunaan() {
date_default_timezone_set("Asia/Jakarta");
$data = array(
'id_penggunaan' => $this->input->post('id_penggunaan'),
'tanggal_penggunaan' => date('Y-m-d'),
'waktu_penggunaan' => date('H:i:s'),
'id_bahan' => $this->input->post('id_bahan'),
'jumlah' => $this->input->post('jumlah'),
'id_user' => $this->session->userdata('id_user'),
);
$insert = $this->db->insert('tb_penggunaan', $data);
if ($insert) {
$this->db->where('id_bahan', $this->input->post('id_bahan'));
$update = $this->db->query("UPDATE tb_bahan SET stok = stok - ".$this->input->post('jumlah')." WHERE id_bahan = '".$this->input->post('id_bahan')."' ");
if ($insert) {
$this->session->set_flashdata('input_penggunaan', 'Input Berhasil ('.$this->input->post('id_penggunaan').')');
redirect('admin/penggunaan');
}
}
}
public function update_penggunaan() {
$data = array(
'id_bahan' => $this->input->post('id_bahan'),
'jumlah' => $this->input->post('jumlah')
);
$this->db->where('id_penggunaan', $this->input->post('id_penggunaan'));
$update = $this->db->update('tb_penggunaan', $data);
if ($update) {
$this->session->set_flashdata('edit_penggunaan', 'Edit Berhasil ('.$this->input->post('id_penggunaan').')');
redirect('admin/penggunaan');
}
}
}
|
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">{{ __('Register') }}</div>
<div class="card-body">
<form method="POST" action="{{ route('register') }}">
@csrf
<div class="form-group row">
<label for="username" class="col-md-4 col-form-label text-md-right">{{ __('User Name') }}</label>
<div class="col-md-6">
<input id="username" type="text" class="form-control @error('name') is-invalid @enderror" name="username" value="{{ old('username') }}" required autocomplete="username" autofocus>
@error('username')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row">
<label for="first_name" class="col-md-4 col-form-label text-md-right">{{ __('First Name') }}</label>
<div class="col-md-6">
<input id="first_name" type="text" class="form-control @error('name') is-invalid @enderror" name="first_name" value="{{ old('first_name') }}" required autocomplete="first_name" autofocus>
@error('first_name')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row">
<label for="last_name" class="col-md-4 col-form-label text-md-right">{{ __('Last Name') }}</label>
<div class="col-md-6">
<input id="last_name" type="text" class="form-control @error('name') is-invalid @enderror" name="last_name" value="{{ old('last_name') }}" required autocomplete="last_name" autofocus>
@error('last_name')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row">
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email">
@error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row">
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password">
@error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row">
<label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label>
<div class="col-md-6">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password">
</div>
</div>
<div class="form-group row mb-0">
<div class="col-md-6 offset-md-4">
<button type="submit" class="btn btn-primary">
{{ __('Register') }}
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection
|
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTelegramUpdateTable extends Migration
{
public function up()
{
Schema::create('telegram_update', static function (Blueprint $table) {
$table->bigInteger('id')->unsigned()->primary()->comment('Update\'s unique identifier');
$table->bigInteger('chat_id')->nullable()->comment('Unique chat identifier');
$table->bigInteger('message_id')->unsigned()->nullable()->comment('Unique message identifier');
$table->bigInteger('inline_query_id')->unsigned()->nullable()->index('inline_query_id')->comment('Unique inline query identifier');
$table->bigInteger('chosen_inline_result_id')->unsigned()->nullable()->index('chosen_inline_result_id')->comment('Local chosen inline result identifier');
$table->bigInteger('callback_query_id')->unsigned()->nullable()->index('callback_query_id')->comment('Unique callback query identifier');
$table->bigInteger('edited_message_id')->unsigned()->nullable()->index('edited_message_id')->comment('Local edited message identifier');
$table->bigInteger('channel_post_id')->unsigned()->nullable()->index('channel_post_id');
$table->bigInteger('edited_channel_post_id')->unsigned()->nullable()->index('edited_channel_post_id');
$table->bigInteger('shipping_query_id')->unsigned()->nullable()->index('shipping_query_id');
$table->bigInteger('pre_checkout_query_id')->unsigned()->nullable()->index('pre_checkout_query_id');
$table->bigInteger('poll_id')->unsigned()->nullable()->index('poll_id');
$table->index(['chat_id', 'message_id'], 'message_id');
});
}
public function down()
{
Schema::drop('telegram_update');
}
}
|
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Debug\Exception;
use Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
/**
* FlattenException wraps a PHP Error or Exception to be able to serialize it.
*
* Basically, this class removes all objects from the trace.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class FlattenException
{
private $message;
private $code;
private $previous;
private $trace;
private $class;
private $statusCode;
private $headers;
private $file;
private $line;
public static function create(\Exception $exception, $statusCode = null, array $headers = array())
{
return static::createFromThrowable($exception, $statusCode, $headers);
}
public static function createFromThrowable(\Throwable $exception, ?int $statusCode = null, array $headers = array()): self
{
$e = new static();
$e->setMessage($exception->getMessage());
$e->setCode($exception->getCode());
if ($exception instanceof HttpExceptionInterface) {
$statusCode = $exception->getStatusCode();
$headers = array_merge($headers, $exception->getHeaders());
} elseif ($exception instanceof RequestExceptionInterface) {
$statusCode = 400;
}
if (null === $statusCode) {
$statusCode = 500;
}
$e->setStatusCode($statusCode);
$e->setHeaders($headers);
$e->setTraceFromThrowable($exception);
$e->setClass($exception instanceof FatalThrowableError ? $exception->getOriginalClassName() : \get_class($exception));
$e->setFile($exception->getFile());
$e->setLine($exception->getLine());
$previous = $exception->getPrevious();
if ($previous instanceof \Throwable) {
$e->setPrevious(static::createFromThrowable($previous));
}
return $e;
}
public function toArray()
{
$exceptions = array();
foreach (array_merge(array($this), $this->getAllPrevious()) as $exception) {
$exceptions[] = array(
'message' => $exception->getMessage(),
'class' => $exception->getClass(),
'trace' => $exception->getTrace(),
);
}
return $exceptions;
}
public function getStatusCode()
{
return $this->statusCode;
}
public function setStatusCode($code)
{
$this->statusCode = $code;
}
public function getHeaders()
{
return $this->headers;
}
public function setHeaders(array $headers)
{
$this->headers = $headers;
}
public function getClass()
{
return $this->class;
}
public function setClass($class)
{
$this->class = $class;
}
public function getFile()
{
return $this->file;
}
public function setFile($file)
{
$this->file = $file;
}
public function getLine()
{
return $this->line;
}
public function setLine($line)
{
$this->line = $line;
}
public function getMessage()
{
return $this->message;
}
public function setMessage($message)
{
$this->message = $message;
}
public function getCode()
{
return $this->code;
}
public function setCode($code)
{
$this->code = $code;
}
public function getPrevious()
{
return $this->previous;
}
public function setPrevious(self $previous)
{
$this->previous = $previous;
}
public function getAllPrevious()
{
$exceptions = array();
$e = $this;
while ($e = $e->getPrevious()) {
$exceptions[] = $e;
}
return $exceptions;
}
public function getTrace()
{
return $this->trace;
}
/**
* @deprecated since 4.1, use {@see setTraceFromThrowable()} instead.
*/
public function setTraceFromException(\Exception $exception)
{
@trigger_error(sprintf('"%s" is deprecated since Symfony 4.1, use "setTraceFromThrowable()" instead.', __METHOD__), E_USER_DEPRECATED);
$this->setTraceFromThrowable($exception);
}
public function setTraceFromThrowable(\Throwable $throwable): void
{
$this->setTrace($throwable->getTrace(), $throwable->getFile(), $throwable->getLine());
}
public function setTrace($trace, $file, $line)
{
$this->trace = array();
$this->trace[] = array(
'namespace' => '',
'short_class' => '',
'class' => '',
'type' => '',
'function' => '',
'file' => $file,
'line' => $line,
'args' => array(),
);
foreach ($trace as $entry) {
$class = '';
$namespace = '';
if (isset($entry['class'])) {
$parts = explode('\\', $entry['class']);
$class = array_pop($parts);
$namespace = implode('\\', $parts);
}
$this->trace[] = array(
'namespace' => $namespace,
'short_class' => $class,
'class' => isset($entry['class']) ? $entry['class'] : '',
'type' => isset($entry['type']) ? $entry['type'] : '',
'function' => isset($entry['function']) ? $entry['function'] : null,
'file' => isset($entry['file']) ? $entry['file'] : null,
'line' => isset($entry['line']) ? $entry['line'] : null,
'args' => isset($entry['args']) ? $this->flattenArgs($entry['args']) : array(),
);
}
}
private function flattenArgs($args, $level = 0, &$count = 0)
{
$result = array();
foreach ($args as $key => $value) {
if (++$count > 1e4) {
return array('array', '*SKIPPED over 10000 entries*');
}
if ($value instanceof \__PHP_Incomplete_Class) {
// is_object() returns false on PHP<=7.1
$result[$key] = array('incomplete-object', $this->getClassNameFromIncomplete($value));
} elseif (is_object($value)) {
$result[$key] = array('object', get_class($value));
} elseif (is_array($value)) {
if ($level > 10) {
$result[$key] = array('array', '*DEEP NESTED ARRAY*');
} else {
$result[$key] = array('array', $this->flattenArgs($value, $level + 1, $count));
}
} elseif (null === $value) {
$result[$key] = array('null', null);
} elseif (is_bool($value)) {
$result[$key] = array('boolean', $value);
} elseif (is_int($value)) {
$result[$key] = array('integer', $value);
} elseif (is_float($value)) {
$result[$key] = array('float', $value);
} elseif (is_resource($value)) {
$result[$key] = array('resource', get_resource_type($value));
} else {
$result[$key] = array('string', (string) $value);
}
}
return $result;
}
private function getClassNameFromIncomplete(\__PHP_Incomplete_Class $value)
{
$array = new \ArrayObject($value);
return $array['__PHP_Incomplete_Class_Name'];
}
}
|
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array<int, class-string|string>
*/
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Fruitcake\Cors\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
];
/**
* The application's route middleware groups.
*
* @var array<string, array<int, class-string|string>>
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' => [
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
'throttle:api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array<string, class-string|string>
*/
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
'jwt.user' => \App\Http\Middleware\UserMiddleware::class,
'jwt.admin' => \App\Http\Middleware\AdminMiddleware::class,
'recaptcha.verify' => \App\Http\Middleware\RecaptchaMiddleware::class,
];
}
|
<!doctype html>
<html class="no-js" lang="">
<head>
<title>Zabuun - Learn Egyptian Arabic for English speakers</title>
<meta name="description" content="">
<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/head.php';?>
</head>
<body>
<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/ie8.php';?>
<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/header.php';?>
<div class="content">
<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/side.php';?>
<div class="main">
<div class="location">
<p class="breadcrumbs">Essays > Get Me a Caffe Latte or Go to Jail</p>
<p class="expandcollapse">
<a href="">Expand All</a> | <a href="">Collapse All</a>
</p>
</div>
<!-- begin essay -->
<h1>Get Me a Caffe Latte or Go to Jail</h1>
<p> Mantle was in jail because he had displeased Judge Brown. Brown had asked Mantle to bring her a caffe latte from Moonbucks on Mantle's way back from lunch. Mantle had had previous run-ins with Brown. He didn't like Brown, and refused to be her errand boy. When Mantle returned from lunch, she asked him where her coffee was. Mantle said, "They ran out. They said to come back tomorrow." </p>
<!-- end essay -->
</div>
</div>
<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/footer.php';?>
<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/scripts.php';?>
</body>
</html>
|
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
use Magento\Newsletter\Model\SubscriberFactory;
require __DIR__ . '/../../../Magento/Customer/_files/new_customer.php';
$subscriberFactory = $objectManager->get(SubscriberFactory::class);
$subscriberFactory->create()->subscribe('new_customer@example.com');
|
<?php
namespace App\Service\V1\patient_system\obstetrics;
use App\Models\MilkprogramFollowup;
use App\Models\MilkprogramFollowupDetail;
class MilkProgramService
{
public function store_followup($request){
$fup= new MilkprogramFollowup();
$fup->fill($this->_fillFollowup($request));
$fup->save();
foreach($request->milk_given as $milk){
$fup_det= new MilkprogramFollowupDetail();
$fup_det->create($this->_fillFollowupDetail($milk,$fup->id));
}
return response()->json(
['success'=>true]
);
}
private function _fillFollowup($data){
return [
'milkprogram_admission_id'=>$data->milkprogram_admission_id,
'weight'=>$data->weight,
'remark'=>$data->remark
];
}
private function _fillFollowupDetail($data,$fup_id){
return [
'milkprogram_followup_id'=>$fup_id,
'item_id'=>$data['milk']['id'],
'qty'=>$data['qty']
];
}
}
|
<?php
namespace ccxt;
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
use Exception; // a common import
use \ccxt\ExchangeError;
use \ccxt\ArgumentsRequired;
use \ccxt\InvalidOrder;
use \ccxt\NotSupported;
class bitget extends Exchange {
public function describe() {
return $this->deep_extend(parent::describe (), array(
'id' => 'bitget',
'name' => 'Bitget',
'countries' => array( 'SG' ),
'version' => 'v3',
'rateLimit' => 1000, // up to 3000 requests per 5 minutes ≈ 600 requests per minute ≈ 10 requests per second ≈ 100 ms
'has' => array(
'cancelOrder' => true,
'cancelOrders' => true,
'CORS' => false,
'createOrder' => true,
'fetchAccounts' => true,
'fetchBalance' => true,
'fetchCurrencies' => true,
'fetchDeposits' => true,
'fetchMarkets' => true,
'fetchMyTrades' => true,
'fetchOHLCV' => true,
'fetchOrder' => true,
'fetchOrderBook' => true,
'fetchOpenOrders' => true,
'fetchClosedOrders' => true,
'fetchOrderTrades' => true,
'fetchTicker' => true,
'fetchTickers' => true,
'fetchTime' => true,
'fetchTrades' => true,
'fetchWithdrawals' => true,
),
'timeframes' => array(
'1m' => '1m',
'5m' => '5m',
'15m' => '15m',
'30m' => '30m',
'1h' => '1h',
'2h' => '2h',
'4h' => '4h',
'6h' => '6h',
'12h' => '12h',
'1d' => '1d',
'1w' => '1w',
),
'hostname' => 'bitget.com',
'urls' => array(
'logo' => 'https://user-images.githubusercontent.com/51840849/88317935-a8a21c80-cd22-11ea-8e2b-4b9fac5975eb.jpg',
'api' => array(
'data' => 'https://api.{hostname}',
'api' => 'https://api.{hostname}',
'capi' => 'https://capi.{hostname}',
'swap' => 'https://capi.{hostname}',
),
'www' => 'https://www.bitget.com',
'doc' => array(
'https://bitgetlimited.github.io/apidoc/en/swap',
'https://bitgetlimited.github.io/apidoc/en/spot',
),
'fees' => 'https://www.bitget.cc/zh-CN/rate?tab=1',
'test' => array(
'rest' => 'https://testnet.bitget.com',
),
'referral' => 'https://www.bitget.com/expressly?languageType=0&channelCode=ccxt&vipCode=tg9j',
),
'api' => array(
'data' => array(
'get' => array(
'market/history/kline', // Kline data
'market/detail/merged', // Get aggregated ticker
'market/tickers', // Get all trading tickers
'market/allticker', // Get all trading market method 2
'market/depth', // Get Market Depth Data
'market/trade', // Get Trade Detail Data
'market/history/trade', // Get record of trading
'market/detail', // Get Market Detail 24h Volume
'common/symbols', // Query all trading pairs and accuracy supported in the station
'common/currencys', // Query all currencies supported in the station
'common/timestamp', // Query system current time
),
),
'api' => array(
'get' => array(
'account/accounts', // Get all accounts of current user(即account_id)。
'accounts/{account_id}/balance', // Get the balance of the specified account
'order/orders', // Query order, deprecated
'order/orders/openOrders',
'order/orders/history',
'order/deposit_withdraw', // Query assets history
),
'post' => array(
'order/orders/place', // Place order
'order/orders/{order_id}/submitcancel', // Request to cancel an order request
'order/orders/batchcancel', // Bulk order cancellation
'order/orders/{order_id}', // Query an order details
'order/orders/{order_id}/matchresults', // Query the transaction details of an order
'order/matchresults', // Query current order, order history
),
),
'capi' => array(
'get' => array(
'market/time',
'market/contracts',
'market/depth',
'market/tickers',
'market/ticker',
'market/trades',
'market/candles',
'market/index',
'market/open_count',
'market/open_interest',
'market/price_limit',
'market/funding_time',
'market/mark_price',
'market/open_count',
'market/historyFundRate',
),
),
'swap' => array(
'get' => array(
'account/accounts',
'account/account',
'account/settings',
'position/allPosition',
'position/singlePosition',
'position/holds',
'order/detail',
'order/orders',
'order/fills',
'order/current',
'order/currentPlan', // conditional
'order/history',
'order/historyPlan', // conditional
'trace/closeTrack',
'trace/currentTrack',
'trace/historyTrack',
'trace/summary',
'trace/profitSettleTokenIdGroup',
'trace/profitDateGroupList',
'trace/profitDateList',
'trace/waitProfitDateList',
),
'post' => array(
'account/leverage',
'account/adjustMargin',
'account/modifyAutoAppendMargin',
'order/placeOrder',
'order/batchOrders',
'order/cancel_order',
'order/cancel_batch_orders',
'order/plan_order',
'order/cancel_plan',
'position/changeHoldModel',
'trace/closeTrackOrder',
),
),
),
'fees' => array(
'spot' => array(
'taker' => $this->parse_number('0.002'),
'maker' => $this->parse_number('0.002'),
),
'swap' => array(
'taker' => $this->parse_number('0.0006'),
'maker' => $this->parse_number('0.0004'),
),
),
'requiredCredentials' => array(
'apiKey' => true,
'secret' => true,
'password' => true,
),
'exceptions' => array(
// http error codes
// 400 Bad Request — Invalid request format
// 401 Unauthorized — Invalid API Key
// 403 Forbidden — You do not have access to the requested resource
// 404 Not Found
// 500 Internal Server Error — We had a problem with our server
'exact' => array(
'1' => '\\ccxt\\ExchangeError', // array( "code" => 1, "message" => "System error" )
// undocumented
'failure to get a peer from the ring-balancer' => '\\ccxt\\ExchangeNotAvailable', // array( "message" => "failure to get a peer from the ring-balancer" )
'4010' => '\\ccxt\\PermissionDenied', // array( "code" => 4010, "message" => "For the security of your funds, withdrawals are not permitted within 24 hours after changing fund password / mobile number / Google Authenticator settings " )
// common
// '0' => '\\ccxt\\ExchangeError', // 200 successful,when the order placement / cancellation / operation is successful
'4001' => '\\ccxt\\ExchangeError', // no data received in 30s
'4002' => '\\ccxt\\ExchangeError', // Buffer full. cannot write data
// --------------------------------------------------------
'30001' => '\\ccxt\\AuthenticationError', // array( "code" => 30001, "message" => 'request header "OK_ACCESS_KEY" cannot be blank')
'30002' => '\\ccxt\\AuthenticationError', // array( "code" => 30002, "message" => 'request header "OK_ACCESS_SIGN" cannot be blank')
'30003' => '\\ccxt\\AuthenticationError', // array( "code" => 30003, "message" => 'request header "OK_ACCESS_TIMESTAMP" cannot be blank')
'30004' => '\\ccxt\\AuthenticationError', // array( "code" => 30004, "message" => 'request header "OK_ACCESS_PASSPHRASE" cannot be blank')
'30005' => '\\ccxt\\InvalidNonce', // array( "code" => 30005, "message" => "invalid OK_ACCESS_TIMESTAMP" )
'30006' => '\\ccxt\\AuthenticationError', // array( "code" => 30006, "message" => "invalid OK_ACCESS_KEY" )
'30007' => '\\ccxt\\BadRequest', // array( "code" => 30007, "message" => 'invalid Content_Type, please use "application/json" format')
'30008' => '\\ccxt\\RequestTimeout', // array( "code" => 30008, "message" => "timestamp request expired" )
'30009' => '\\ccxt\\ExchangeError', // array( "code" => 30009, "message" => "system error" )
'30010' => '\\ccxt\\AuthenticationError', // array( "code" => 30010, "message" => "API validation failed" )
'30011' => '\\ccxt\\PermissionDenied', // array( "code" => 30011, "message" => "invalid IP" )
'30012' => '\\ccxt\\AuthenticationError', // array( "code" => 30012, "message" => "invalid authorization" )
'30013' => '\\ccxt\\AuthenticationError', // array( "code" => 30013, "message" => "invalid sign" )
'30014' => '\\ccxt\\DDoSProtection', // array( "code" => 30014, "message" => "request too frequent" )
'30015' => '\\ccxt\\AuthenticationError', // array( "code" => 30015, "message" => 'request header "OK_ACCESS_PASSPHRASE" incorrect')
'30016' => '\\ccxt\\ExchangeError', // array( "code" => 30015, "message" => "you are using v1 apiKey, please use v1 endpoint. If you would like to use v3 endpoint, please subscribe to v3 apiKey" )
'30017' => '\\ccxt\\ExchangeError', // array( "code" => 30017, "message" => "apikey's broker id does not match" )
'30018' => '\\ccxt\\ExchangeError', // array( "code" => 30018, "message" => "apikey's domain does not match" )
'30019' => '\\ccxt\\ExchangeNotAvailable', // array( "code" => 30019, "message" => "Api is offline or unavailable" )
'30020' => '\\ccxt\\BadRequest', // array( "code" => 30020, "message" => "body cannot be blank" )
'30021' => '\\ccxt\\BadRequest', // array( "code" => 30021, "message" => "Json data format error" ), array( "code" => 30021, "message" => "json data format error" )
'30022' => '\\ccxt\\PermissionDenied', // array( "code" => 30022, "message" => "Api has been frozen" )
'30023' => '\\ccxt\\BadRequest', // array( "code" => 30023, "message" => "{0} parameter cannot be blank" )
'30024' => '\\ccxt\\BadSymbol', // array("code":30024,"message":"\"instrument_id\" is an invalid parameter")
'30025' => '\\ccxt\\BadRequest', // array( "code" => 30025, "message" => "{0} parameter category error" )
'30026' => '\\ccxt\\DDoSProtection', // array( "code" => 30026, "message" => "requested too frequent" )
'30027' => '\\ccxt\\AuthenticationError', // array( "code" => 30027, "message" => "login failure" )
'30028' => '\\ccxt\\PermissionDenied', // array( "code" => 30028, "message" => "unauthorized execution" )
'30029' => '\\ccxt\\AccountSuspended', // array( "code" => 30029, "message" => "account suspended" )
'30030' => '\\ccxt\\ExchangeError', // array( "code" => 30030, "message" => "endpoint request failed. Please try again" )
'30031' => '\\ccxt\\BadRequest', // array( "code" => 30031, "message" => "token does not exist" )
'30032' => '\\ccxt\\BadSymbol', // array( "code" => 30032, "message" => "pair does not exist" )
'30033' => '\\ccxt\\BadRequest', // array( "code" => 30033, "message" => "exchange domain does not exist" )
'30034' => '\\ccxt\\ExchangeError', // array( "code" => 30034, "message" => "exchange ID does not exist" )
'30035' => '\\ccxt\\ExchangeError', // array( "code" => 30035, "message" => "trading is not supported in this website" )
'30036' => '\\ccxt\\ExchangeError', // array( "code" => 30036, "message" => "no relevant data" )
'30037' => '\\ccxt\\ExchangeNotAvailable', // array( "code" => 30037, "message" => "endpoint is offline or unavailable" )
// '30038' => '\\ccxt\\AuthenticationError', // array( "code" => 30038, "message" => "user does not exist" )
'30038' => '\\ccxt\\OnMaintenance', // array("client_oid":"","code":"30038","error_code":"30038","error_message":"Matching engine is being upgraded. Please try in about 1 minute.","message":"Matching engine is being upgraded. Please try in about 1 minute.","order_id":"-1","result":false)
// futures
'32001' => '\\ccxt\\AccountSuspended', // array( "code" => 32001, "message" => "futures account suspended" )
'32002' => '\\ccxt\\PermissionDenied', // array( "code" => 32002, "message" => "futures account does not exist" )
'32003' => '\\ccxt\\CancelPending', // array( "code" => 32003, "message" => "canceling, please wait" )
'32004' => '\\ccxt\\ExchangeError', // array( "code" => 32004, "message" => "you have no unfilled orders" )
'32005' => '\\ccxt\\InvalidOrder', // array( "code" => 32005, "message" => "max order quantity" )
'32006' => '\\ccxt\\InvalidOrder', // array( "code" => 32006, "message" => "the order price or trigger price exceeds USD 1 million" )
'32007' => '\\ccxt\\InvalidOrder', // array( "code" => 32007, "message" => "leverage level must be the same for orders on the same side of the contract" )
'32008' => '\\ccxt\\InvalidOrder', // array( "code" => 32008, "message" => "Max. positions to open (cross margin)" )
'32009' => '\\ccxt\\InvalidOrder', // array( "code" => 32009, "message" => "Max. positions to open (fixed margin)" )
'32010' => '\\ccxt\\ExchangeError', // array( "code" => 32010, "message" => "leverage cannot be changed with open positions" )
'32011' => '\\ccxt\\ExchangeError', // array( "code" => 32011, "message" => "futures status error" )
'32012' => '\\ccxt\\ExchangeError', // array( "code" => 32012, "message" => "futures order update error" )
'32013' => '\\ccxt\\ExchangeError', // array( "code" => 32013, "message" => "token type is blank" )
'32014' => '\\ccxt\\ExchangeError', // array( "code" => 32014, "message" => "your number of contracts closing is larger than the number of contracts available" )
'32015' => '\\ccxt\\ExchangeError', // array( "code" => 32015, "message" => "margin ratio is lower than 100% before opening positions" )
'32016' => '\\ccxt\\ExchangeError', // array( "code" => 32016, "message" => "margin ratio is lower than 100% after opening position" )
'32017' => '\\ccxt\\ExchangeError', // array( "code" => 32017, "message" => "no BBO" )
'32018' => '\\ccxt\\ExchangeError', // array( "code" => 32018, "message" => "the order quantity is less than 1, please try again" )
'32019' => '\\ccxt\\ExchangeError', // array( "code" => 32019, "message" => "the order price deviates from the price of the previous minute by more than 3%" )
'32020' => '\\ccxt\\ExchangeError', // array( "code" => 32020, "message" => "the price is not in the range of the price limit" )
'32021' => '\\ccxt\\ExchangeError', // array( "code" => 32021, "message" => "leverage error" )
'32022' => '\\ccxt\\ExchangeError', // array( "code" => 32022, "message" => "this function is not supported in your country or region according to the regulations" )
'32023' => '\\ccxt\\ExchangeError', // array( "code" => 32023, "message" => "this account has outstanding loan" )
'32024' => '\\ccxt\\ExchangeError', // array( "code" => 32024, "message" => "order cannot be placed during delivery" )
'32025' => '\\ccxt\\ExchangeError', // array( "code" => 32025, "message" => "order cannot be placed during settlement" )
'32026' => '\\ccxt\\ExchangeError', // array( "code" => 32026, "message" => "your account is restricted from opening positions" )
'32027' => '\\ccxt\\ExchangeError', // array( "code" => 32027, "message" => "cancelled over 20 orders" )
'32028' => '\\ccxt\\AccountSuspended', // array( "code" => 32028, "message" => "account is suspended and liquidated" )
'32029' => '\\ccxt\\ExchangeError', // array( "code" => 32029, "message" => "order info does not exist" )
'32030' => '\\ccxt\\InvalidOrder', // The order cannot be cancelled
'32031' => '\\ccxt\\ArgumentsRequired', // client_oid or order_id is required.
'32038' => '\\ccxt\\AuthenticationError', // User does not exist
'32040' => '\\ccxt\\ExchangeError', // User have open contract orders or position
'32044' => '\\ccxt\\ExchangeError', // array( "code" => 32044, "message" => "The margin ratio after submitting this order is lower than the minimum requirement ({0}) for your tier." )
'32045' => '\\ccxt\\ExchangeError', // String of commission over 1 million
'32046' => '\\ccxt\\ExchangeError', // Each user can hold up to 10 trade plans at the same time
'32047' => '\\ccxt\\ExchangeError', // system error
'32048' => '\\ccxt\\InvalidOrder', // Order strategy track range error
'32049' => '\\ccxt\\ExchangeError', // Each user can hold up to 10 track plans at the same time
'32050' => '\\ccxt\\InvalidOrder', // Order strategy rang error
'32051' => '\\ccxt\\InvalidOrder', // Order strategy ice depth error
'32052' => '\\ccxt\\ExchangeError', // String of commission over 100 thousand
'32053' => '\\ccxt\\ExchangeError', // Each user can hold up to 6 ice plans at the same time
'32057' => '\\ccxt\\ExchangeError', // The order price is zero. Market-close-all function cannot be executed
'32054' => '\\ccxt\\ExchangeError', // Trade not allow
'32055' => '\\ccxt\\InvalidOrder', // cancel order error
'32056' => '\\ccxt\\ExchangeError', // iceberg per order average should between {0}-{1} contracts
'32058' => '\\ccxt\\ExchangeError', // Each user can hold up to 6 initiative plans at the same time
'32059' => '\\ccxt\\InvalidOrder', // Total amount should exceed per order amount
'32060' => '\\ccxt\\InvalidOrder', // Order strategy type error
'32061' => '\\ccxt\\InvalidOrder', // Order strategy initiative limit error
'32062' => '\\ccxt\\InvalidOrder', // Order strategy initiative range error
'32063' => '\\ccxt\\InvalidOrder', // Order strategy initiative rate error
'32064' => '\\ccxt\\ExchangeError', // Time Stringerval of orders should set between 5-120s
'32065' => '\\ccxt\\ExchangeError', // Close amount exceeds the limit of Market-close-all (999 for BTC, and 9999 for the rest tokens)
'32066' => '\\ccxt\\ExchangeError', // You have open orders. Please cancel all open orders before changing your leverage level.
'32067' => '\\ccxt\\ExchangeError', // Account equity < required margin in this setting. Please adjust your leverage level again.
'32068' => '\\ccxt\\ExchangeError', // The margin for this position will fall short of the required margin in this setting. Please adjust your leverage level or increase your margin to proceed.
'32069' => '\\ccxt\\ExchangeError', // Target leverage level too low. Your account balance is insufficient to cover the margin required. Please adjust the leverage level again.
'32070' => '\\ccxt\\ExchangeError', // Please check open position or unfilled order
'32071' => '\\ccxt\\ExchangeError', // Your current liquidation mode does not support this action.
'32072' => '\\ccxt\\ExchangeError', // The highest available margin for your order’s tier is {0}. Please edit your margin and place a new order.
'32073' => '\\ccxt\\ExchangeError', // The action does not apply to the token
'32074' => '\\ccxt\\ExchangeError', // The number of contracts of your position, open orders, and the current order has exceeded the maximum order limit of this asset.
'32075' => '\\ccxt\\ExchangeError', // Account risk rate breach
'32076' => '\\ccxt\\ExchangeError', // Liquidation of the holding position(s) at market price will require cancellation of all pending close orders of the contracts.
'32077' => '\\ccxt\\ExchangeError', // Your margin for this asset in futures account is insufficient and the position has been taken over for liquidation. (You will not be able to place orders, close positions, transfer funds, or add margin during this period of time. Your account will be restored after the liquidation is complete.)
'32078' => '\\ccxt\\ExchangeError', // Please cancel all open orders before switching the liquidation mode(Please cancel all open orders before switching the liquidation mode)
'32079' => '\\ccxt\\ExchangeError', // Your open positions are at high risk.(Please add margin or reduce positions before switching the mode)
'32080' => '\\ccxt\\ExchangeError', // Funds cannot be transferred out within 30 minutes after futures settlement
'32083' => '\\ccxt\\ExchangeError', // The number of contracts should be a positive multiple of %%. Please place your order again
// token and margin trading
'33001' => '\\ccxt\\PermissionDenied', // array( "code" => 33001, "message" => "margin account for this pair is not enabled yet" )
'33002' => '\\ccxt\\AccountSuspended', // array( "code" => 33002, "message" => "margin account for this pair is suspended" )
'33003' => '\\ccxt\\InsufficientFunds', // array( "code" => 33003, "message" => "no loan balance" )
'33004' => '\\ccxt\\ExchangeError', // array( "code" => 33004, "message" => "loan amount cannot be smaller than the minimum limit" )
'33005' => '\\ccxt\\ExchangeError', // array( "code" => 33005, "message" => "repayment amount must exceed 0" )
'33006' => '\\ccxt\\ExchangeError', // array( "code" => 33006, "message" => "loan order not found" )
'33007' => '\\ccxt\\ExchangeError', // array( "code" => 33007, "message" => "status not found" )
'33008' => '\\ccxt\\InsufficientFunds', // array( "code" => 33008, "message" => "loan amount cannot exceed the maximum limit" )
'33009' => '\\ccxt\\ExchangeError', // array( "code" => 33009, "message" => "user ID is blank" )
'33010' => '\\ccxt\\ExchangeError', // array( "code" => 33010, "message" => "you cannot cancel an order during session 2 of call auction" )
'33011' => '\\ccxt\\ExchangeError', // array( "code" => 33011, "message" => "no new market data" )
'33012' => '\\ccxt\\ExchangeError', // array( "code" => 33012, "message" => "order cancellation failed" )
'33013' => '\\ccxt\\InvalidOrder', // array( "code" => 33013, "message" => "order placement failed" )
'33014' => '\\ccxt\\OrderNotFound', // array( "code" => 33014, "message" => "order does not exist" )
'33015' => '\\ccxt\\InvalidOrder', // array( "code" => 33015, "message" => "exceeded maximum limit" )
'33016' => '\\ccxt\\ExchangeError', // array( "code" => 33016, "message" => "margin trading is not open for this token" )
'33017' => '\\ccxt\\InsufficientFunds', // array( "code" => 33017, "message" => "insufficient balance" )
'33018' => '\\ccxt\\ExchangeError', // array( "code" => 33018, "message" => "this parameter must be smaller than 1" )
'33020' => '\\ccxt\\ExchangeError', // array( "code" => 33020, "message" => "request not supported" )
'33021' => '\\ccxt\\BadRequest', // array( "code" => 33021, "message" => "token and the pair do not match" )
'33022' => '\\ccxt\\InvalidOrder', // array( "code" => 33022, "message" => "pair and the order do not match" )
'33023' => '\\ccxt\\ExchangeError', // array( "code" => 33023, "message" => "you can only place market orders during call auction" )
'33024' => '\\ccxt\\InvalidOrder', // array( "code" => 33024, "message" => "trading amount too small" )
'33025' => '\\ccxt\\InvalidOrder', // array( "code" => 33025, "message" => "base token amount is blank" )
'33026' => '\\ccxt\\ExchangeError', // array( "code" => 33026, "message" => "transaction completed" )
'33027' => '\\ccxt\\InvalidOrder', // array( "code" => 33027, "message" => "cancelled order or order cancelling" )
'33028' => '\\ccxt\\InvalidOrder', // array( "code" => 33028, "message" => "the decimal places of the trading price exceeded the limit" )
'33029' => '\\ccxt\\InvalidOrder', // array( "code" => 33029, "message" => "the decimal places of the trading size exceeded the limit" )
'33034' => '\\ccxt\\ExchangeError', // array( "code" => 33034, "message" => "You can only place limit order after Call Auction has started" )
'33035' => '\\ccxt\\ExchangeError', // This type of order cannot be canceled(This type of order cannot be canceled)
'33036' => '\\ccxt\\ExchangeError', // Exceeding the limit of entrust order
'33037' => '\\ccxt\\ExchangeError', // The buy order price should be lower than 130% of the trigger price
'33038' => '\\ccxt\\ExchangeError', // The sell order price should be higher than 70% of the trigger price
'33039' => '\\ccxt\\ExchangeError', // The limit of callback rate is 0 < x <= 5%
'33040' => '\\ccxt\\ExchangeError', // The trigger price of a buy order should be lower than the latest transaction price
'33041' => '\\ccxt\\ExchangeError', // The trigger price of a sell order should be higher than the latest transaction price
'33042' => '\\ccxt\\ExchangeError', // The limit of price variance is 0 < x <= 1%
'33043' => '\\ccxt\\ExchangeError', // The total amount must be larger than 0
'33044' => '\\ccxt\\ExchangeError', // The average amount should be 1/1000 * total amount <= x <= total amount
'33045' => '\\ccxt\\ExchangeError', // The price should not be 0, including trigger price, order price, and price limit
'33046' => '\\ccxt\\ExchangeError', // Price variance should be 0 < x <= 1%
'33047' => '\\ccxt\\ExchangeError', // Sweep ratio should be 0 < x <= 100%
'33048' => '\\ccxt\\ExchangeError', // Per order limit => Total amount/1000 < x <= Total amount
'33049' => '\\ccxt\\ExchangeError', // Total amount should be X > 0
'33050' => '\\ccxt\\ExchangeError', // Time interval should be 5 <= x <= 120s
'33051' => '\\ccxt\\ExchangeError', // cancel order number not higher limit => plan and track entrust no more than 10, ice and time entrust no more than 6
'33059' => '\\ccxt\\BadRequest', // array( "code" => 33059, "message" => "client_oid or order_id is required" )
'33060' => '\\ccxt\\BadRequest', // array( "code" => 33060, "message" => "Only fill in either parameter client_oid or order_id" )
'33061' => '\\ccxt\\ExchangeError', // Value of a single market price order cannot exceed 100,000 USD
'33062' => '\\ccxt\\ExchangeError', // The leverage ratio is too high. The borrowed position has exceeded the maximum position of this leverage ratio. Please readjust the leverage ratio
'33063' => '\\ccxt\\ExchangeError', // Leverage multiple is too low, there is insufficient margin in the account, please readjust the leverage ratio
'33064' => '\\ccxt\\ExchangeError', // The setting of the leverage ratio cannot be less than 2, please readjust the leverage ratio
'33065' => '\\ccxt\\ExchangeError', // Leverage ratio exceeds maximum leverage ratio, please readjust leverage ratio
// account
'21009' => '\\ccxt\\ExchangeError', // Funds cannot be transferred out within 30 minutes after swap settlement(Funds cannot be transferred out within 30 minutes after swap settlement)
'34001' => '\\ccxt\\PermissionDenied', // array( "code" => 34001, "message" => "withdrawal suspended" )
'34002' => '\\ccxt\\InvalidAddress', // array( "code" => 34002, "message" => "please add a withdrawal address" )
'34003' => '\\ccxt\\ExchangeError', // array( "code" => 34003, "message" => "sorry, this token cannot be withdrawn to xx at the moment" )
'34004' => '\\ccxt\\ExchangeError', // array( "code" => 34004, "message" => "withdrawal fee is smaller than minimum limit" )
'34005' => '\\ccxt\\ExchangeError', // array( "code" => 34005, "message" => "withdrawal fee exceeds the maximum limit" )
'34006' => '\\ccxt\\ExchangeError', // array( "code" => 34006, "message" => "withdrawal amount is lower than the minimum limit" )
'34007' => '\\ccxt\\ExchangeError', // array( "code" => 34007, "message" => "withdrawal amount exceeds the maximum limit" )
'34008' => '\\ccxt\\InsufficientFunds', // array( "code" => 34008, "message" => "insufficient balance" )
'34009' => '\\ccxt\\ExchangeError', // array( "code" => 34009, "message" => "your withdrawal amount exceeds the daily limit" )
'34010' => '\\ccxt\\ExchangeError', // array( "code" => 34010, "message" => "transfer amount must be larger than 0" )
'34011' => '\\ccxt\\ExchangeError', // array( "code" => 34011, "message" => "conditions not met" )
'34012' => '\\ccxt\\ExchangeError', // array( "code" => 34012, "message" => "the minimum withdrawal amount for NEO is 1, and the amount must be an integer" )
'34013' => '\\ccxt\\ExchangeError', // array( "code" => 34013, "message" => "please transfer" )
'34014' => '\\ccxt\\ExchangeError', // array( "code" => 34014, "message" => "transfer limited" )
'34015' => '\\ccxt\\ExchangeError', // array( "code" => 34015, "message" => "subaccount does not exist" )
'34016' => '\\ccxt\\PermissionDenied', // array( "code" => 34016, "message" => "transfer suspended" )
'34017' => '\\ccxt\\AccountSuspended', // array( "code" => 34017, "message" => "account suspended" )
'34018' => '\\ccxt\\AuthenticationError', // array( "code" => 34018, "message" => "incorrect trades password" )
'34019' => '\\ccxt\\PermissionDenied', // array( "code" => 34019, "message" => "please bind your email before withdrawal" )
'34020' => '\\ccxt\\PermissionDenied', // array( "code" => 34020, "message" => "please bind your funds password before withdrawal" )
'34021' => '\\ccxt\\InvalidAddress', // array( "code" => 34021, "message" => "Not verified address" )
'34022' => '\\ccxt\\ExchangeError', // array( "code" => 34022, "message" => "Withdrawals are not available for sub accounts" )
'34023' => '\\ccxt\\PermissionDenied', // array( "code" => 34023, "message" => "Please enable futures trading before transferring your funds" )
'34026' => '\\ccxt\\ExchangeError', // transfer too frequently(transfer too frequently)
'34036' => '\\ccxt\\ExchangeError', // Parameter is incorrect, please refer to API documentation
'34037' => '\\ccxt\\ExchangeError', // Get the sub-account balance interface, account type is not supported
'34038' => '\\ccxt\\ExchangeError', // Since your C2C transaction is unusual, you are restricted from fund transfer. Please contact our customer support to cancel the restriction
'34039' => '\\ccxt\\ExchangeError', // You are now restricted from transferring out your funds due to abnormal trades on C2C Market. Please transfer your fund on our website or app instead to verify your identity
// swap
'35001' => '\\ccxt\\ExchangeError', // array( "code" => 35001, "message" => "Contract does not exist" )
'35002' => '\\ccxt\\ExchangeError', // array( "code" => 35002, "message" => "Contract settling" )
'35003' => '\\ccxt\\ExchangeError', // array( "code" => 35003, "message" => "Contract paused" )
'35004' => '\\ccxt\\ExchangeError', // array( "code" => 35004, "message" => "Contract pending settlement" )
'35005' => '\\ccxt\\AuthenticationError', // array( "code" => 35005, "message" => "User does not exist" )
'35008' => '\\ccxt\\InvalidOrder', // array( "code" => 35008, "message" => "Risk ratio too high" )
'35010' => '\\ccxt\\InvalidOrder', // array( "code" => 35010, "message" => "Position closing too large" )
'35012' => '\\ccxt\\InvalidOrder', // array( "code" => 35012, "message" => "Incorrect order size" )
'35014' => '\\ccxt\\InvalidOrder', // array( "code" => 35014, "message" => "Order price is not within limit" )
'35015' => '\\ccxt\\InvalidOrder', // array( "code" => 35015, "message" => "Invalid leverage level" )
'35017' => '\\ccxt\\ExchangeError', // array( "code" => 35017, "message" => "Open orders exist" )
'35019' => '\\ccxt\\InvalidOrder', // array( "code" => 35019, "message" => "Order size too large" )
'35020' => '\\ccxt\\InvalidOrder', // array( "code" => 35020, "message" => "Order price too high" )
'35021' => '\\ccxt\\InvalidOrder', // array( "code" => 35021, "message" => "Order size exceeded current tier limit" )
'35022' => '\\ccxt\\ExchangeError', // array( "code" => 35022, "message" => "Contract status error" )
'35024' => '\\ccxt\\ExchangeError', // array( "code" => 35024, "message" => "Contract not initialized" )
'35025' => '\\ccxt\\InsufficientFunds', // array( "code" => 35025, "message" => "No account balance" )
'35026' => '\\ccxt\\ExchangeError', // array( "code" => 35026, "message" => "Contract settings not initialized" )
'35029' => '\\ccxt\\OrderNotFound', // array( "code" => 35029, "message" => "Order does not exist" )
'35030' => '\\ccxt\\InvalidOrder', // array( "code" => 35030, "message" => "Order size too large" )
'35031' => '\\ccxt\\InvalidOrder', // array( "code" => 35031, "message" => "Cancel order size too large" )
'35032' => '\\ccxt\\ExchangeError', // array( "code" => 35032, "message" => "Invalid user status" )
'35037' => '\\ccxt\\ExchangeError', // No last traded price in cache
'35039' => '\\ccxt\\ExchangeError', // array( "code" => 35039, "message" => "Open order quantity exceeds limit" )
'35040' => '\\ccxt\\InvalidOrder', // array("error_message":"Invalid order type","result":"true","error_code":"35040","order_id":"-1")
'35044' => '\\ccxt\\ExchangeError', // array( "code" => 35044, "message" => "Invalid order status" )
'35046' => '\\ccxt\\InsufficientFunds', // array( "code" => 35046, "message" => "Negative account balance" )
'35047' => '\\ccxt\\InsufficientFunds', // array( "code" => 35047, "message" => "Insufficient account balance" )
'35048' => '\\ccxt\\ExchangeError', // array( "code" => 35048, "message" => "User contract is frozen and liquidating" )
'35049' => '\\ccxt\\InvalidOrder', // array( "code" => 35049, "message" => "Invalid order type" )
'35050' => '\\ccxt\\InvalidOrder', // array( "code" => 35050, "message" => "Position settings are blank" )
'35052' => '\\ccxt\\InsufficientFunds', // array( "code" => 35052, "message" => "Insufficient cross margin" )
'35053' => '\\ccxt\\ExchangeError', // array( "code" => 35053, "message" => "Account risk too high" )
'35055' => '\\ccxt\\InsufficientFunds', // array( "code" => 35055, "message" => "Insufficient account balance" )
'35057' => '\\ccxt\\ExchangeError', // array( "code" => 35057, "message" => "No last traded price" )
'35058' => '\\ccxt\\ExchangeError', // array( "code" => 35058, "message" => "No limit" )
'35059' => '\\ccxt\\BadRequest', // array( "code" => 35059, "message" => "client_oid or order_id is required" )
'35060' => '\\ccxt\\BadRequest', // array( "code" => 35060, "message" => "Only fill in either parameter client_oid or order_id" )
'35061' => '\\ccxt\\BadRequest', // array( "code" => 35061, "message" => "Invalid instrument_id" )
'35062' => '\\ccxt\\InvalidOrder', // array( "code" => 35062, "message" => "Invalid match_price" )
'35063' => '\\ccxt\\InvalidOrder', // array( "code" => 35063, "message" => "Invalid order_size" )
'35064' => '\\ccxt\\InvalidOrder', // array( "code" => 35064, "message" => "Invalid client_oid" )
'35066' => '\\ccxt\\InvalidOrder', // Order interval error
'35067' => '\\ccxt\\InvalidOrder', // Time-weighted order ratio error
'35068' => '\\ccxt\\InvalidOrder', // Time-weighted order range error
'35069' => '\\ccxt\\InvalidOrder', // Time-weighted single transaction limit error
'35070' => '\\ccxt\\InvalidOrder', // Algo order type error
'35071' => '\\ccxt\\InvalidOrder', // Order total must be larger than single order limit
'35072' => '\\ccxt\\InvalidOrder', // Maximum 6 unfulfilled time-weighted orders can be held at the same time
'35073' => '\\ccxt\\InvalidOrder', // Order price is 0. Market-close-all not available
'35074' => '\\ccxt\\InvalidOrder', // Iceberg order single transaction average error
'35075' => '\\ccxt\\InvalidOrder', // Failed to cancel order
'35076' => '\\ccxt\\InvalidOrder', // LTC 20x leverage. Not allowed to open position
'35077' => '\\ccxt\\InvalidOrder', // Maximum 6 unfulfilled iceberg orders can be held at the same time
'35078' => '\\ccxt\\InvalidOrder', // Order amount exceeded 100,000
'35079' => '\\ccxt\\InvalidOrder', // Iceberg order price variance error
'35080' => '\\ccxt\\InvalidOrder', // Callback rate error
'35081' => '\\ccxt\\InvalidOrder', // Maximum 10 unfulfilled trail orders can be held at the same time
'35082' => '\\ccxt\\InvalidOrder', // Trail order callback rate error
'35083' => '\\ccxt\\InvalidOrder', // Each user can only hold a maximum of 10 unfulfilled stop-limit orders at the same time
'35084' => '\\ccxt\\InvalidOrder', // Order amount exceeded 1 million
'35085' => '\\ccxt\\InvalidOrder', // Order amount is not in the correct range
'35086' => '\\ccxt\\InvalidOrder', // Price exceeds 100 thousand
'35087' => '\\ccxt\\InvalidOrder', // Price exceeds 100 thousand
'35088' => '\\ccxt\\InvalidOrder', // Average amount error
'35089' => '\\ccxt\\InvalidOrder', // Price exceeds 100 thousand
'35090' => '\\ccxt\\ExchangeError', // No stop-limit orders available for cancelation
'35091' => '\\ccxt\\ExchangeError', // No trail orders available for cancellation
'35092' => '\\ccxt\\ExchangeError', // No iceberg orders available for cancellation
'35093' => '\\ccxt\\ExchangeError', // No trail orders available for cancellation
'35094' => '\\ccxt\\ExchangeError', // Stop-limit order last traded price error
'35095' => '\\ccxt\\BadRequest', // Instrument_id error
'35096' => '\\ccxt\\ExchangeError', // Algo order status error
'35097' => '\\ccxt\\ExchangeError', // Order status and order ID cannot exist at the same time
'35098' => '\\ccxt\\ExchangeError', // An order status or order ID must exist
'35099' => '\\ccxt\\ExchangeError', // Algo order ID error
// option
'36001' => '\\ccxt\\BadRequest', // Invalid underlying index.
'36002' => '\\ccxt\\BadRequest', // Instrument does not exist.
'36005' => '\\ccxt\\ExchangeError', // Instrument status is invalid.
'36101' => '\\ccxt\\AuthenticationError', // Account does not exist.
'36102' => '\\ccxt\\PermissionDenied', // Account status is invalid.
'36103' => '\\ccxt\\AccountSuspended', // Account is suspended due to ongoing liquidation.
'36104' => '\\ccxt\\PermissionDenied', // Account is not enabled for options trading.
'36105' => '\\ccxt\\PermissionDenied', // Please enable the account for option contract.
'36106' => '\\ccxt\\AccountSuspended', // Funds cannot be transferred in or out, as account is suspended.
'36107' => '\\ccxt\\PermissionDenied', // Funds cannot be transferred out within 30 minutes after option exercising or settlement.
'36108' => '\\ccxt\\InsufficientFunds', // Funds cannot be transferred in or out, as equity of the account is less than zero.
'36109' => '\\ccxt\\PermissionDenied', // Funds cannot be transferred in or out during option exercising or settlement.
'36201' => '\\ccxt\\PermissionDenied', // New order function is blocked.
'36202' => '\\ccxt\\PermissionDenied', // Account does not have permission to short option.
'36203' => '\\ccxt\\InvalidOrder', // Invalid format for client_oid.
'36204' => '\\ccxt\\ExchangeError', // Invalid format for request_id.
'36205' => '\\ccxt\\BadRequest', // Instrument id does not match underlying index.
'36206' => '\\ccxt\\BadRequest', // Order_id and client_oid can not be used at the same time.
'36207' => '\\ccxt\\InvalidOrder', // Either order price or fartouch price must be present.
'36208' => '\\ccxt\\InvalidOrder', // Either order price or size must be present.
'36209' => '\\ccxt\\InvalidOrder', // Either order_id or client_oid must be present.
'36210' => '\\ccxt\\InvalidOrder', // Either order_ids or client_oids must be present.
'36211' => '\\ccxt\\InvalidOrder', // Exceeding max batch size for order submission.
'36212' => '\\ccxt\\InvalidOrder', // Exceeding max batch size for oder cancellation.
'36213' => '\\ccxt\\InvalidOrder', // Exceeding max batch size for order amendment.
'36214' => '\\ccxt\\ExchangeError', // Instrument does not have valid bid/ask quote.
'36216' => '\\ccxt\\OrderNotFound', // Order does not exist.
'36217' => '\\ccxt\\InvalidOrder', // Order submission failed.
'36218' => '\\ccxt\\InvalidOrder', // Order cancellation failed.
'36219' => '\\ccxt\\InvalidOrder', // Order amendment failed.
'36220' => '\\ccxt\\InvalidOrder', // Order is pending cancel.
'36221' => '\\ccxt\\InvalidOrder', // Order qty is not valid multiple of lot size.
'36222' => '\\ccxt\\InvalidOrder', // Order price is breaching highest buy limit.
'36223' => '\\ccxt\\InvalidOrder', // Order price is breaching lowest sell limit.
'36224' => '\\ccxt\\InvalidOrder', // Exceeding max order size.
'36225' => '\\ccxt\\InvalidOrder', // Exceeding max open order count for instrument.
'36226' => '\\ccxt\\InvalidOrder', // Exceeding max open order count for underlying.
'36227' => '\\ccxt\\InvalidOrder', // Exceeding max open size across all orders for underlying
'36228' => '\\ccxt\\InvalidOrder', // Exceeding max available qty for instrument.
'36229' => '\\ccxt\\InvalidOrder', // Exceeding max available qty for underlying.
'36230' => '\\ccxt\\InvalidOrder', // Exceeding max position limit for underlying.
// --------------------------------------------------------
// swap
'400' => '\\ccxt\\BadRequest', // Bad Request
'401' => '\\ccxt\\AuthenticationError', // Unauthorized access
'403' => '\\ccxt\\PermissionDenied', // Access prohibited
'404' => '\\ccxt\\BadRequest', // Request address does not exist
'405' => '\\ccxt\\BadRequest', // The HTTP Method is not supported
'415' => '\\ccxt\\BadRequest', // The current media type is not supported
'429' => '\\ccxt\\DDoSProtection', // Too many requests
'500' => '\\ccxt\\ExchangeNotAvailable', // System busy
'1001' => '\\ccxt\\RateLimitExceeded', // The request is too frequent and has been throttled
'1002' => '\\ccxt\\ExchangeError', // {0} verifications within 24 hours
'1003' => '\\ccxt\\ExchangeError', // You failed more than {0} times today, the current operation is locked, please try again in 24 hours
// '00000' => '\\ccxt\\ExchangeError', // success
'40001' => '\\ccxt\\AuthenticationError', // ACCESS_KEY cannot be empty
'40002' => '\\ccxt\\AuthenticationError', // SECRET_KEY cannot be empty
'40003' => '\\ccxt\\AuthenticationError', // Signature cannot be empty
'40004' => '\\ccxt\\InvalidNonce', // Request timestamp expired
'40005' => '\\ccxt\\InvalidNonce', // Invalid ACCESS_TIMESTAMP
'40006' => '\\ccxt\\AuthenticationError', // Invalid ACCESS_KEY
'40007' => '\\ccxt\\BadRequest', // Invalid Content_Type
'40008' => '\\ccxt\\InvalidNonce', // Request timestamp expired
'40009' => '\\ccxt\\AuthenticationError', // sign signature error
'40010' => '\\ccxt\\AuthenticationError', // sign signature error
'40011' => '\\ccxt\\AuthenticationError', // ACCESS_PASSPHRASE cannot be empty
'40012' => '\\ccxt\\AuthenticationError', // apikey/password is incorrect
'40013' => '\\ccxt\\ExchangeError', // User status is abnormal
'40014' => '\\ccxt\\PermissionDenied', // Incorrect permissions
'40015' => '\\ccxt\\ExchangeError', // System is abnormal, please try again later
'40016' => '\\ccxt\\PermissionDenied', // The user must bind the phone or Google
'40017' => '\\ccxt\\ExchangeError', // Parameter verification failed
'40018' => '\\ccxt\\PermissionDenied', // Invalid IP
'40102' => '\\ccxt\\BadRequest', // Contract configuration does not exist, please check the parameters
'40103' => '\\ccxt\\BadRequest', // Request method cannot be empty
'40104' => '\\ccxt\\ExchangeError', // Lever adjustment failure
'40105' => '\\ccxt\\ExchangeError', // Abnormal access to current price limit data
'40106' => '\\ccxt\\ExchangeError', // Abnormal get next settlement time
'40107' => '\\ccxt\\ExchangeError', // Abnormal access to index price data
'40108' => '\\ccxt\\InvalidOrder', // Wrong order quantity
'40109' => '\\ccxt\\OrderNotFound', // The data of the order cannot be found, please confirm the order number
'40200' => '\\ccxt\\OnMaintenance', // Server upgrade, please try again later
'40201' => '\\ccxt\\InvalidOrder', // Order number cannot be empty
'40202' => '\\ccxt\\ExchangeError', // User information cannot be empty
'40203' => '\\ccxt\\BadRequest', // The amount of adjustment margin cannot be empty or negative
'40204' => '\\ccxt\\BadRequest', // Adjustment margin type cannot be empty
'40205' => '\\ccxt\\BadRequest', // Adjusted margin type data is wrong
'40206' => '\\ccxt\\BadRequest', // The direction of the adjustment margin cannot be empty
'40207' => '\\ccxt\\BadRequest', // The adjustment margin data is wrong
'40208' => '\\ccxt\\BadRequest', // The accuracy of the adjustment margin amount is incorrect
'40209' => '\\ccxt\\BadRequest', // The current page number is wrong, please confirm
'40300' => '\\ccxt\\ExchangeError', // User does not exist
'40301' => '\\ccxt\\PermissionDenied', // Permission has not been obtained yet. If you need to use it, please contact customer service
'40302' => '\\ccxt\\BadRequest', // Parameter abnormality
'40303' => '\\ccxt\\BadRequest', // Can only query up to 20,000 data
'40304' => '\\ccxt\\BadRequest', // Parameter type is abnormal
'40305' => '\\ccxt\\BadRequest', // Client_oid length is not greater than 50, and cannot be Martian characters
'40306' => '\\ccxt\\ExchangeError', // Batch processing orders can only process up to 20
'40308' => '\\ccxt\\OnMaintenance', // The contract is being temporarily maintained
'40309' => '\\ccxt\\BadSymbol', // The contract has been removed
'40400' => '\\ccxt\\ExchangeError', // Status check abnormal
'40401' => '\\ccxt\\ExchangeError', // The operation cannot be performed
'40402' => '\\ccxt\\BadRequest', // The opening direction cannot be empty
'40403' => '\\ccxt\\BadRequest', // Wrong opening direction format
'40404' => '\\ccxt\\BadRequest', // Whether to enable automatic margin call parameters cannot be empty
'40405' => '\\ccxt\\BadRequest', // Whether to enable the automatic margin call parameter type is wrong
'40406' => '\\ccxt\\BadRequest', // Whether to enable automatic margin call parameters is of unknown type
'40407' => '\\ccxt\\ExchangeError', // The query direction is not the direction entrusted by the plan
'40408' => '\\ccxt\\ExchangeError', // Wrong time range
'40409' => '\\ccxt\\ExchangeError', // Time format error
'40500' => '\\ccxt\\InvalidOrder', // Client_oid check error
'40501' => '\\ccxt\\ExchangeError', // Channel name error
'40502' => '\\ccxt\\ExchangeError', // If it is a copy user, you must pass the copy to whom
'40503' => '\\ccxt\\ExchangeError', // With the single type
'40504' => '\\ccxt\\ExchangeError', // Platform code must pass
'40505' => '\\ccxt\\ExchangeError', // Not the same as single type
'40506' => '\\ccxt\\AuthenticationError', // Platform signature error
'40507' => '\\ccxt\\AuthenticationError', // Api signature error
'40508' => '\\ccxt\\ExchangeError', // KOL is not authorized
'40509' => '\\ccxt\\ExchangeError', // Abnormal copy end
'40600' => '\\ccxt\\ExchangeError', // Copy function suspended
'40601' => '\\ccxt\\ExchangeError', // Followers cannot be KOL
'40602' => '\\ccxt\\ExchangeError', // The number of copies has reached the limit and cannot process the request
'40603' => '\\ccxt\\ExchangeError', // Abnormal copy end
'40604' => '\\ccxt\\ExchangeNotAvailable', // Server is busy, please try again later
'40605' => '\\ccxt\\ExchangeError', // Copy type, the copy number must be passed
'40606' => '\\ccxt\\ExchangeError', // The type of document number is wrong
'40607' => '\\ccxt\\ExchangeError', // Document number must be passed
'40608' => '\\ccxt\\ExchangeError', // No documented products currently supported
'40609' => '\\ccxt\\ExchangeError', // The contract product does not support copying
'40700' => '\\ccxt\\BadRequest', // Cursor parameters are incorrect
'40701' => '\\ccxt\\ExchangeError', // KOL is not authorized
'40702' => '\\ccxt\\ExchangeError', // Unauthorized copying user
'40703' => '\\ccxt\\ExchangeError', // Bill inquiry start and end time cannot be empty
'40704' => '\\ccxt\\ExchangeError', // Can only check the data of the last three months
'40705' => '\\ccxt\\BadRequest', // The start and end time cannot exceed 90 days
'40706' => '\\ccxt\\InvalidOrder', // Wrong order price
'40707' => '\\ccxt\\BadRequest', // Start time is greater than end time
'40708' => '\\ccxt\\BadRequest', // Parameter verification is abnormal
'40709' => '\\ccxt\\ExchangeError', // There is no position in this position, and no automatic margin call can be set
'40710' => '\\ccxt\\ExchangeError', // Abnormal account status
'40711' => '\\ccxt\\InsufficientFunds', // Insufficient contract account balance
'40712' => '\\ccxt\\InsufficientFunds', // Insufficient margin
'40713' => '\\ccxt\\ExchangeError', // Cannot exceed the maximum transferable margin amount
'40714' => '\\ccxt\\ExchangeError', // No direct margin call is allowed
// spot
'invalid sign' => '\\ccxt\\AuthenticationError',
'invalid currency' => '\\ccxt\\BadSymbol', // invalid trading pair
'invalid symbol' => '\\ccxt\\BadSymbol',
'invalid period' => '\\ccxt\\BadRequest', // invalid Kline type
'invalid user' => '\\ccxt\\ExchangeError',
'invalid amount' => '\\ccxt\\InvalidOrder',
'invalid type' => '\\ccxt\\InvalidOrder', // array("status":"error","ts":1595700344504,"err_code":"invalid-parameter","err_msg":"invalid type")
'invalid orderId' => '\\ccxt\\InvalidOrder',
'invalid record' => '\\ccxt\\ExchangeError',
'invalid accountId' => '\\ccxt\\BadRequest',
'invalid address' => '\\ccxt\\BadRequest',
'accesskey not null' => '\\ccxt\\AuthenticationError', // array("status":"error","ts":1595704360508,"err_code":"invalid-parameter","err_msg":"accesskey not null")
'illegal accesskey' => '\\ccxt\\AuthenticationError',
'sign not null' => '\\ccxt\\AuthenticationError',
'req_time is too much difference from server time' => '\\ccxt\\InvalidNonce',
'permissions not right' => '\\ccxt\\PermissionDenied', // array("status":"error","ts":1595704490084,"err_code":"invalid-parameter","err_msg":"permissions not right")
'illegal sign invalid' => '\\ccxt\\AuthenticationError', // array("status":"error","ts":1595684716042,"err_code":"invalid-parameter","err_msg":"illegal sign invalid")
'user locked' => '\\ccxt\\AccountSuspended',
'Request Frequency Is Too High' => '\\ccxt\\RateLimitExceeded',
'more than a daily rate of cash' => '\\ccxt\\BadRequest',
'more than the maximum daily withdrawal amount' => '\\ccxt\\BadRequest',
'need to bind email or mobile' => '\\ccxt\\ExchangeError',
'user forbid' => '\\ccxt\\PermissionDenied',
'User Prohibited Cash Withdrawal' => '\\ccxt\\PermissionDenied',
'Cash Withdrawal Is Less Than The Minimum Value' => '\\ccxt\\BadRequest',
'Cash Withdrawal Is More Than The Maximum Value' => '\\ccxt\\BadRequest',
'the account with in 24 hours ban coin' => '\\ccxt\\PermissionDenied',
'order cancel fail' => '\\ccxt\\BadRequest', // array("status":"error","ts":1595703343035,"err_code":"bad-request","err_msg":"order cancel fail")
'base symbol error' => '\\ccxt\\BadSymbol',
'base date error' => '\\ccxt\\ExchangeError',
'api signature not valid' => '\\ccxt\\AuthenticationError',
'gateway internal error' => '\\ccxt\\ExchangeError',
'audit failed' => '\\ccxt\\ExchangeError',
'order queryorder invalid' => '\\ccxt\\BadRequest',
'market no need price' => '\\ccxt\\InvalidOrder',
'limit need price' => '\\ccxt\\InvalidOrder',
'userid not equal to account_id' => '\\ccxt\\ExchangeError',
'your balance is low' => '\\ccxt\\InsufficientFunds', // array("status":"error","ts":1595594160149,"err_code":"invalid-parameter","err_msg":"invalid size, valid range => [1,2000]")
'address invalid cointype' => '\\ccxt\\ExchangeError',
'system exception' => '\\ccxt\\ExchangeError', // array("status":"error","ts":1595711862763,"err_code":"system exception","err_msg":"system exception")
'50003' => '\\ccxt\\ExchangeError', // No record
'50004' => '\\ccxt\\BadSymbol', // The transaction pair is currently not supported or has been suspended
'50006' => '\\ccxt\\PermissionDenied', // The account is forbidden to withdraw. If you have any questions, please contact customer service.
'50007' => '\\ccxt\\PermissionDenied', // The account is forbidden to withdraw within 24 hours. If you have any questions, please contact customer service.
'50008' => '\\ccxt\\RequestTimeout', // network timeout
'50009' => '\\ccxt\\RateLimitExceeded', // The operation is too frequent, please try again later
'50010' => '\\ccxt\\ExchangeError', // The account is abnormally frozen. If you have any questions, please contact customer service.
'50014' => '\\ccxt\\InvalidOrder', // The transaction amount under minimum limits
'50015' => '\\ccxt\\InvalidOrder', // The transaction amount exceed maximum limits
'50016' => '\\ccxt\\InvalidOrder', // The price can't be higher than the current price
'50017' => '\\ccxt\\InvalidOrder', // Price under minimum limits
'50018' => '\\ccxt\\InvalidOrder', // The price exceed maximum limits
'50019' => '\\ccxt\\InvalidOrder', // The amount under minimum limits
'50020' => '\\ccxt\\InsufficientFunds', // Insufficient balance
'50021' => '\\ccxt\\InvalidOrder', // Price is under minimum limits
'50026' => '\\ccxt\\InvalidOrder', // Market price parameter error
'invalid order query time' => '\\ccxt\\ExchangeError', // start time is greater than end time; or the time interval between start time and end time is greater than 48 hours
'invalid start time' => '\\ccxt\\BadRequest', // start time is a date 30 days ago; or start time is a date in the future
'invalid end time' => '\\ccxt\\BadRequest', // end time is a date 30 days ago; or end time is a date in the future
'20003' => '\\ccxt\\ExchangeError', // operation failed, array("status":"error","ts":1595730308979,"err_code":"bad-request","err_msg":"20003")
'01001' => '\\ccxt\\ExchangeError', // order failed, array("status":"fail","err_code":"01001","err_msg":"系统异常,请稍后重试")
),
'broad' => array(
'invalid size, valid range' => '\\ccxt\\ExchangeError',
),
),
'precisionMode' => TICK_SIZE,
'options' => array(
'createMarketBuyOrderRequiresPrice' => true,
'fetchMarkets' => array(
'spot',
'swap',
),
'parseOHLCV' => array(
'volume' => array(
'spot' => 'amount',
'swap' => 5,
),
),
'defaultType' => 'spot', // 'spot', 'swap'
'accountId' => null, // '1012838157',
'timeframes' => array(
'spot' => array(
'1m' => '1min',
'5m' => '5min',
'15m' => '15min',
'30m' => '30min',
'1h' => '60min',
'2h' => '120min',
'4h' => '240min',
'6h' => '360min',
'12h' => '720min',
'1d' => '1day',
'1w' => '1week',
),
'swap' => array(
'1m' => '60',
'5m' => '300',
'15m' => '900',
'30m' => '1800',
'1h' => '3600',
'2h' => '7200',
'4h' => '14400',
'6h' => '21600',
'12h' => '43200',
'1d' => '86400',
'1w' => '604800',
),
),
),
));
}
public function fetch_time($params = array ()) {
$response = $this->dataGetCommonTimestamp ($params);
//
// {
// "status":"ok",
// "data":"1595525139400"
// }
//
return $this->safe_integer($response, 'data');
}
public function fetch_markets($params = array ()) {
$types = $this->safe_value($this->options, 'fetchMarkets');
if (strlen(!$types)) {
$types = [
$this->options['defaultType'],
];
}
$result = array();
for ($i = 0; $i < count($types); $i++) {
$markets = $this->fetch_markets_by_type($types[$i], $params);
$result = $this->array_concat($result, $markets);
}
return $result;
}
public function parse_markets($markets) {
$result = array();
for ($i = 0; $i < count($markets); $i++) {
$result[] = $this->parse_market($markets[$i]);
}
return $result;
}
public function parse_market($market) {
//
// $spot
//
// {
// "base_currency":"btc",
// "quote_currency":"usdt",
// "$symbol":"btc_usdt",
// "tick_size":"2",
// "size_increment":"4",
// "$status":"1",
// "base_asset_precision":"8"
// }
//
//
// $swap
//
// {
// "$symbol":"btcusd",
// "underlying_index":"BTC",
// "quote_currency":"USD",
// "coin":"BTC",
// "contract_val":"1",
// "listing":null,
// "delivery":["07:00:00","15:00:00","23:00:00"],
// "size_increment":"0",
// "tick_size":"1",
// "forwardContractFlag":false,
// "priceEndStep":5
// }
//
$id = $this->safe_string($market, 'symbol');
$marketType = 'spot';
$spot = true;
$swap = false;
$baseId = $this->safe_string_2($market, 'base_currency', 'coin');
$quoteId = $this->safe_string($market, 'quote_currency');
$contractVal = $this->safe_number($market, 'contract_val');
if ($contractVal !== null) {
$marketType = 'swap';
$spot = false;
$swap = true;
}
$base = $this->safe_currency_code($baseId);
$quote = $this->safe_currency_code($quoteId);
$symbol = strtoupper($id);
if ($spot) {
$symbol = $base . '/' . $quote;
}
$tickSize = $this->safe_string($market, 'tick_size');
$sizeIncrement = $this->safe_string($market, 'size_increment');
$precision = array(
'amount' => $this->parse_number($this->parse_precision($sizeIncrement)),
'price' => $this->parse_number($this->parse_precision($tickSize)),
);
$minAmount = $this->safe_number_2($market, 'min_size', 'base_min_size');
$status = $this->safe_string($market, 'status');
$active = null;
if ($status !== null) {
$active = ($status === '1');
}
$fees = $this->safe_value_2($this->fees, $marketType, 'trading', array());
return array_merge($fees, array(
'id' => $id,
'symbol' => $symbol,
'base' => $base,
'quote' => $quote,
'baseId' => $baseId,
'quoteId' => $quoteId,
'info' => $market,
'type' => $marketType,
'spot' => $spot,
'swap' => $swap,
'active' => $active,
'precision' => $precision,
'limits' => array(
'amount' => array(
'min' => $minAmount,
'max' => null,
),
'price' => array(
'min' => $precision['price'],
'max' => null,
),
'cost' => array(
'min' => $precision['price'],
'max' => null,
),
),
));
}
public function fetch_markets_by_type($type, $params = array ()) {
if ($type === 'spot') {
$response = $this->dataGetCommonSymbols ($params);
//
// {
// "status":"ok",
// "ts":1595526622408,
// "$data":array(
// array(
// "base_currency":"btc",
// "quote_currency":"usdt",
// "symbol":"btc_usdt",
// "tick_size":"2",
// "size_increment":"4",
// "status":"1",
// "base_asset_precision":"8"
// ),
// )
// }
//
$data = $this->safe_value($response, 'data', array());
return $this->parse_markets($data);
} else if ($type === 'swap') {
$response = $this->capiGetMarketContracts ($params);
//
// {
// "$data":array(
// "contractApis":[
// array(
// "instrument_id":"btcusd",
// "underlying_index":"BTC",
// "quote_currency":"USD",
// "coin":"BTC",
// "contract_val":"1",
// "delivery":["07:00:00","15:00:00","23:00:00"],
// "size_increment":"0",
// "tick_size":"1",
// "forwardContractFlag":false,
// "priceEndStep":"5"
// ),
// ]
// ),
// "status":"ok",
// "err_code":"00000"
// }
//
return $this->parse_markets($response);
} else {
throw new NotSupported($this->id . ' fetchMarketsByType does not support market $type ' . $type);
}
}
public function fetch_currencies($params = array ()) {
$response = $this->dataGetCommonCurrencys ($params);
//
// {
// "status":"ok",
// "ts":1595537740466,
// "$data":array(
// "btc",
// "bft",
// "usdt",
// "usdt-omni",
// "usdt-erc20"
// )
// }
//
$result = array();
$data = $this->safe_value($response, 'data', array());
for ($i = 0; $i < count($data); $i++) {
$id = $data[$i];
$code = $this->safe_currency_code($id);
$result[$code] = array(
'id' => $id,
'code' => $code,
'info' => $id,
'type' => null,
'name' => null,
'active' => null,
'fee' => null,
'precision' => null,
'limits' => array(
'amount' => array( 'min' => null, 'max' => null ),
'withdraw' => array( 'min' => null, 'max' => null ),
),
);
}
return $result;
}
public function fetch_order_book($symbol, $limit = null, $params = array ()) {
$this->load_markets();
$market = $this->market($symbol);
$request = array(
'symbol' => $market['id'],
);
$method = null;
if ($market['spot']) {
$method = 'dataGetMarketDepth';
$request['type'] = 'step0'; // step0, step1, step2, step3, step4, step5, do not merge depth if step0
} else if ($market['swap']) {
$method = 'capiGetMarketDepth';
$request['limit'] = ($limit === null) ? 100 : $limit; // max 100
}
$response = $this->$method (array_merge($request, $params));
//
// spot
//
// {
// "status":"ok",
// "ch":"$market->btc_usdt.depth.step0",
// "ts":1595607628197,
// "$data":{
// "id":"1595607628197",
// "ts":"1595607628197",
// "bids":[
// ["9534.99","15.36160000000000000000"],
// ["9534.85","0.14580000000000000000"],
// ["9534.73","0.02100000000000000000"],
// ],
// "asks":[
// ["9535.02","7.37160000000000000000"],
// ["9535.03","0.09040000000000000000"],
// ["9535.05","0.02180000000000000000"],
// ]
// }
// }
//
// swap
//
// {
// "asks":[
// ["9579.0","119865",1],
// ["9579.5","90069",1],
// ["9580.0","256673",1],
// ],
// "bids":[
// ["9578.5","2417",1],
// ["9577.5","3024",1],
// ["9577.0","21548",1],
// ],
// "$timestamp":"1595664767349"
// }
//
$data = $this->safe_value($response, 'data', $response);
$timestamp = $this->safe_integer_2($data, 'timestamp', 'ts');
$nonce = $this->safe_integer($data, 'id');
$orderbook = $this->parse_order_book($data, $symbol, $timestamp);
$orderbook['nonce'] = $nonce;
return $orderbook;
}
public function parse_ticker($ticker, $market = null) {
//
// spot
//
// fetchTicker
//
// {
// "id":"1595538241113",
// "$bid":["0.028474000000","1.139400000000"],
// "$ask":["0.028482000000","0.353100000000"],
// "amount":"2850.6649",
// "count":"818",
// "$open":"0.02821",
// "close":"0.028474",
// "low":"0.02821",
// "high":"0.029091",
// "vol":"79.4548693404"
// }
//
// fetchTickers
//
// {
// "amount":"30086.8095",
// "count":"22450",
// "$open":"9525.11",
// "close":"9591.81",
// "low":"9510.68",
// "high":"9659.7",
// "vol":"286239092.250461",
// "$symbol":"btc_usdt"
// }
//
// swap
//
// {
// "instrument_id":"btcusd",
// "$last":"9574.5",
// "best_ask":"9575.0",
// "best_bid":"9574.0",
// "high_24h":"9672",
// "low_24h":"9512",
// "volume_24h":"567697050",
// "$timestamp":"1595538450096"
// }
//
$timestamp = $this->safe_integer_2($ticker, 'timestamp', 'id');
$symbol = null;
$marketId = $this->safe_string_2($ticker, 'instrument_id', 'symbol');
if (is_array($this->markets_by_id) && array_key_exists($marketId, $this->markets_by_id)) {
$market = $this->markets_by_id[$marketId];
$symbol = $market['symbol'];
} else if ($marketId !== null) {
$parts = explode('_', $marketId);
$numParts = is_array($parts) ? count($parts) : 0;
if ($numParts === 2) {
list($baseId, $quoteId) = $parts;
$base = $this->safe_currency_code($baseId);
$quote = $this->safe_currency_code($quoteId);
$symbol = $base . '/' . $quote;
} else {
$symbol = $marketId;
}
}
if (($symbol === null) && ($market !== null)) {
$symbol = $market['symbol'];
}
$last = $this->safe_number_2($ticker, 'last', 'close');
$open = $this->safe_number($ticker, 'open');
$bidVolume = null;
$askVolume = null;
$bid = $this->safe_value($ticker, 'bid');
if ($bid === null) {
$bid = $this->safe_number($ticker, 'best_bid');
} else {
$bidVolume = $this->safe_number($bid, 1);
$bid = $this->safe_number($bid, 0);
}
$ask = $this->safe_value($ticker, 'ask');
if ($ask === null) {
$ask = $this->safe_number($ticker, 'best_ask');
} else {
$askVolume = $this->safe_number($ask, 1);
$ask = $this->safe_number($ask, 0);
}
$baseVolume = $this->safe_number_2($ticker, 'amount', 'volume_24h');
$quoteVolume = $this->safe_number($ticker, 'vol');
$vwap = $this->vwap($baseVolume, $quoteVolume);
$change = null;
$percentage = null;
$average = null;
if (($last !== null) && ($open !== null)) {
$change = $last - $open;
$percentage = $change / $open * 100;
$average = $this->sum($open, $last) / 2;
}
return array(
'symbol' => $symbol,
'timestamp' => $timestamp,
'datetime' => $this->iso8601($timestamp),
'high' => $this->safe_number_2($ticker, 'high', 'high_24h'),
'low' => $this->safe_number_2($ticker, 'low', 'low_24h'),
'bid' => $bid,
'bidVolume' => $bidVolume,
'ask' => $ask,
'askVolume' => $askVolume,
'vwap' => $vwap,
'open' => $open,
'close' => $last,
'last' => $last,
'previousClose' => null,
'change' => $change,
'percentage' => $percentage,
'average' => $average,
'baseVolume' => $baseVolume,
'quoteVolume' => $quoteVolume,
'info' => $ticker,
);
}
public function fetch_ticker($symbol, $params = array ()) {
$this->load_markets();
$market = $this->market($symbol);
$method = null;
if ($market['spot']) {
$method = 'dataGetMarketDetailMerged';
} else if ($market['swap']) {
$method = 'capiGetMarketTicker';
}
$request = array(
'symbol' => $market['id'],
);
$response = $this->$method (array_merge($request, $params));
//
// spot
//
// {
// "status":"ok",
// "ch":"$market->eth_btc.detail.merged",
// "ts":1595538241474,
// "$data":{
// "id":"1595538241113",
// "bid":["0.028474000000","1.139400000000"],
// "ask":["0.028482000000","0.353100000000"],
// "amount":"2850.6649",
// "count":"818",
// "open":"0.02821",
// "close":"0.028474",
// "low":"0.02821",
// "high":"0.029091",
// "vol":"79.4548693404"
// }
// }
//
// swap
//
// {
// "$symbol":"btcusd",
// "last":"9575.5",
// "best_ask":"9576.0",
// "best_bid":"9575.0",
// "high_24h":"9646",
// "low_24h":"9516",
// "volume_24h":"516656839",
// "timestamp":"1595664217405"
// }
//
$data = $this->safe_value($response, 'data', $response);
return $this->parse_ticker($data, $market);
}
public function fetch_tickers_by_type($type, $symbols = null, $params = array ()) {
$this->load_markets();
$method = null;
if ($type === 'spot') {
$method = 'dataGetMarketTickers';
} else if ($type === 'swap') {
$method = 'capiGetMarketTickers';
}
$response = $this->$method ($params);
//
// spot
//
// {
// "status":"ok",
// "ts":1595542893250,
// "$data":array(
// {
// "amount":"30086.8095",
// "count":"22450",
// "open":"9525.11",
// "close":"9591.81",
// "low":"9510.68",
// "high":"9659.7",
// "vol":"286239092.250461",
// "$symbol":"btc_usdt"
// }
// )
// }
//
// swap
//
// array(
// {
// "$symbol":"btcusd",
// "last":"9572",
// "best_ask":"9571.5",
// "best_bid":"9570.5",
// "high_24h":"9646",
// "low_24h":"9516",
// "volume_24h":"515401635",
// "$timestamp":"1595664479952"
// }
// )
//
$data = $this->safe_value($response, 'data', $response);
$timestamp = null;
if (gettype($response) === 'array' && count(array_filter(array_keys($response), 'is_string')) != 0) {
$timestamp = $this->safe_integer($response, 'ts');
}
$result = array();
for ($i = 0; $i < count($data); $i++) {
$ticker = $this->parse_ticker(array_merge(array(
'timestamp' => $timestamp,
), $data[$i]));
$symbol = $ticker['symbol'];
$result[$symbol] = $ticker;
}
return $this->filter_by_array($result, 'symbol', $symbols);
}
public function fetch_tickers($symbols = null, $params = array ()) {
$defaultType = $this->safe_string_2($this->options, 'fetchTickers', 'defaultType');
$type = $this->safe_string($params, 'type', $defaultType);
return $this->fetch_tickers_by_type($type, $symbols, $this->omit($params, 'type'));
}
public function parse_trade($trade, $market = null) {
//
// fetchTrades (public)
//
// spot
//
// {
// "$id":"1",
// "$price":"9533.81",
// "$amount":"0.7326",
// "direction":"sell",
// "ts":"1595604964000"
// }
//
// swap
//
// {
// "trade_id":"670581881367954915",
// "$price":"9553.00",
// "size":"20",
// "$side":"sell",
// "$timestamp":"1595605100004",
// "$symbol":"btcusd"
// }
//
// spot fetchMyTrades (private)
//
// {
// "$id" => 29555,
// "order_id" => 59378,
// "match_id" => 59335,
// "$symbol" => "eth_usdt",
// "$type" => "buy-limit",
// "source" => "api",
// "$price" => "100.1000000000",
// "filled_amount" => "0.9845000000",
// "filled_fees" => "0.0019690000",
// "created_at" => 1494901400487
// }
//
// fetchOrderTrades (private)
//
// spot
//
// {
// "$id":"614164775",
// "created_at":"1596298860602",
// "filled_amount":"0.0417000000000000",
// "filled_fees":"0.0000834000000000",
// "match_id":"673491702661292033",
// "order_id":"673491720340279296",
// "$price":"359.240000000000",
// "source":"接口",
// "$symbol":"eth_usdt",
// "$type":"buy-$market"
// }
//
// swap
//
// {
// "trade_id":"6667390",
// "$symbol":"cmt_btcusdt",
// "order_id":"525946425993854915",
// "$price":"9839.00",
// "order_qty":"3466",
// "$fee":"-0.0000528407360000",
// "$timestamp":"1561121514442",
// "exec_type":"M",
// "$side":"3"
// }
//
$symbol = null;
$marketId = $this->safe_string($trade, 'symbol');
$base = null;
$quote = null;
if (is_array($this->markets_by_id) && array_key_exists($marketId, $this->markets_by_id)) {
$market = $this->markets_by_id[$marketId];
$symbol = $market['symbol'];
$base = $market['base'];
$quote = $market['quote'];
} else if ($marketId !== null) {
$parts = explode('_', $marketId);
$numParts = is_array($parts) ? count($parts) : 0;
if ($numParts === 2) {
list($baseId, $quoteId) = $parts;
$base = $this->safe_currency_code($baseId);
$quote = $this->safe_currency_code($quoteId);
$symbol = $base . '/' . $quote;
} else {
$symbol = strtoupper($marketId);
}
}
if (($symbol === null) && ($market !== null)) {
$symbol = $market['symbol'];
$base = $market['base'];
$quote = $market['quote'];
}
$timestamp = $this->safe_integer($trade, 'created_at');
$timestamp = $this->safe_integer_2($trade, 'timestamp', 'ts', $timestamp);
$priceString = $this->safe_string($trade, 'price');
$amountString = $this->safe_string_2($trade, 'filled_amount', 'order_qty');
$amountString = $this->safe_string_2($trade, 'size', 'amount', $amountString);
$price = $this->parse_number($priceString);
$amount = $this->parse_number($amountString);
$cost = $this->parse_number(Precise::string_mul($priceString, $amountString));
$takerOrMaker = $this->safe_string_2($trade, 'exec_type', 'liquidity');
if ($takerOrMaker === 'M') {
$takerOrMaker = 'maker';
} else if ($takerOrMaker === 'T') {
$takerOrMaker = 'taker';
}
$orderType = $this->safe_string($trade, 'type');
$side = null;
$type = null;
if ($orderType !== null) {
$side = $this->safe_string($trade, 'type');
$type = $this->parse_order_type($side);
$side = $this->parse_order_side($side);
} else {
$side = $this->safe_string_2($trade, 'side', 'direction');
$type = $this->parse_order_type($side);
$side = $this->parse_order_side($side);
}
$feeCostString = $this->safe_string($trade, 'fee');
if ($feeCostString === null) {
$feeCostString = $this->safe_string($trade, 'filled_fees');
} else {
$feeCostString = Precise::string_neg($feeCostString);
}
$feeCost = $this->parse_number($feeCostString);
$fee = null;
if ($feeCost !== null) {
$feeCurrency = ($side === 'buy') ? $base : $quote;
$fee = array(
// $fee is either a positive number (invitation rebate)
// or a negative number (transaction $fee deduction)
// therefore we need to invert the $fee
// more about it https://github.com/ccxt/ccxt/issues/5909
'cost' => $feeCost,
'currency' => $feeCurrency,
);
}
$orderId = $this->safe_string($trade, 'order_id');
$id = $this->safe_string_2($trade, 'trade_id', 'id');
return array(
'info' => $trade,
'timestamp' => $timestamp,
'datetime' => $this->iso8601($timestamp),
'symbol' => $symbol,
'id' => $id,
'order' => $orderId,
'type' => $type,
'takerOrMaker' => $takerOrMaker,
'side' => $side,
'price' => $price,
'amount' => $amount,
'cost' => $cost,
'fee' => $fee,
);
}
public function fetch_trades($symbol, $limit = null, $since = null, $params = array ()) {
$this->load_markets();
$market = $this->market($symbol);
$request = array(
'symbol' => $market['id'],
);
$method = null;
if ($market['spot']) {
$method = 'dataGetMarketHistoryTrade';
} else if ($market['swap']) {
$method = 'capiGetMarketTrades';
}
if ($market['spot']) {
if ($limit !== null) {
$request['size'] = $limit; // default 1, max 2000
}
} else if ($market['swap']) {
if ($limit === null) {
$limit = 100; // default 20, max 100
}
$request['limit'] = $limit;
}
$response = $this->$method (array_merge($request, $params));
//
// spot
//
// {
// "status":"ok",
// "ch":"$market->btc_usdt.trade.detail",
// "ts":1595604968430,
// "$data":{
// "ts":"1595604964000",
// "$data":array(
// array("id":"1","price":"9533.81","amount":"0.7326","direction":"sell","ts":"1595604964000"),
// array("id":"2","price":"9533.67","amount":"1.1591","direction":"buy","ts":"1595604961000"),
// array("id":"3","price":"9533.67","amount":"1.5022","direction":"sell","ts":"1595604959000"),
// )
// }
// }
//
// swap
//
// array(
// array("trade_id":"670833198971748613","price":"9578.50","size":"5412","side":"sell","timestamp":"1595665018790","$symbol":"btcusd"),
// array("trade_id":"670833194240574915","price":"9579.00","size":"3972","side":"buy","timestamp":"1595665017662","$symbol":"btcusd"),
// array("trade_id":"670833194240573915","price":"9579.00","size":"1227","side":"buy","timestamp":"1595665017662","$symbol":"btcusd"),
// )
//
$trades = null;
if (gettype($response) === 'array' && count(array_filter(array_keys($response), 'is_string')) == 0) {
$trades = $response;
} else {
$data = $this->safe_value($response, 'data', array());
$trades = $this->safe_value_2($data, 'data', array());
}
return $this->parse_trades($trades, $market, $since, $limit);
}
public function parse_ohlcv($ohlcv, $market = null, $timeframe = '1m') {
//
// spot
//
// {
// "id":"1594694700000",
// "amount":"283.6811",
// "count":"234",
// "open":"9230.00",
// "close":"9227.15",
// "low":"9206.66",
// "high":"9232.33",
// "vol":"2618015.032504000000"
// }
//
// swap
//
// array(
// "1594693800000",
// "9240",
// "9241",
// "9222",
// "9228.5",
// "3913370",
// "424.003616350563"
// )
//
$options = $this->safe_value($this->options, 'parseOHLCV', array());
$volume = $this->safe_value($options, 'volume', array());
if (gettype($ohlcv) === 'array' && count(array_filter(array_keys($ohlcv), 'is_string')) == 0) {
$volumeIndex = $this->safe_string($volume, $market['type'], 'amount');
return array(
$this->safe_integer($ohlcv, 0), // timestamp
$this->safe_number($ohlcv, 1), // Open
$this->safe_number($ohlcv, 2), // High
$this->safe_number($ohlcv, 3), // Low
$this->safe_number($ohlcv, 4), // Close
// $this->safe_number($ohlcv, 5), // Quote Volume
// $this->safe_number($ohlcv, 6), // Base Volume
$this->safe_number($ohlcv, $volumeIndex), // Volume, bitget will return base $volume in the 7th element for future markets
);
} else {
$volumeIndex = $this->safe_value($volume, $market['type'], 6);
return array(
$this->safe_integer($ohlcv, 'id'),
$this->safe_number($ohlcv, 'open'), // Open
$this->safe_number($ohlcv, 'high'), // High
$this->safe_number($ohlcv, 'low'), // Low
$this->safe_number($ohlcv, 'close'), // Close
$this->safe_number($ohlcv, $volumeIndex), // Base Volume
);
}
}
public function fetch_ohlcv($symbol, $timeframe = '1m', $since = null, $limit = null, $params = array ()) {
$this->load_markets();
$market = $this->market($symbol);
$request = array(
'symbol' => $market['id'],
);
$method = null;
$type = $market['type'];
$options = $this->safe_value($this->options, 'timeframes', array());
$intervals = $this->safe_value($options, $type, array());
$interval = $this->safe_value($intervals, $this->timeframes[$timeframe]);
if ($market['spot']) {
$method = 'dataGetMarketHistoryKline';
$request['period'] = $interval;
if ($limit !== null) {
$request['size'] = $limit; // default 150, max 1000
}
} else if ($market['swap']) {
$duration = $this->parse_timeframe($timeframe);
$method = 'capiGetMarketCandles';
$request['granularity'] = $interval;
$now = $this->milliseconds();
if ($since === null) {
if ($limit === null) {
$limit = 1000;
}
$request['start'] = $this->iso8601($now - $limit * $duration * 1000);
$request['end'] = $this->iso8601($now);
} else {
$request['start'] = $this->iso8601($since);
if ($limit === null) {
$request['end'] = $this->iso8601($now);
} else {
$request['end'] = $this->iso8601($this->sum($since, $limit * $duration * 1000));
}
}
}
$response = $this->$method (array_merge($request, $params));
//
// spot
//
// {
// "status":"ok",
// "ch":"$market->btc_usdt.kline.15min",
// "ts":1595594183874,
// "data":array(
// array("id":"1594694700000","amount":"283.6811","count":"234","open":"9230.00","close":"9227.15","low":"9206.66","high":"9232.33","vol":"2618015.032504000000"),
// array("id":"1594695600000","amount":"457.2904","count":"238","open":"9227.15","close":"9229.46","low":"9223.80","high":"9235.14","vol":"4220734.684570000000"),
// array("id":"1594696500000","amount":"501.2353","count":"255","open":"9229.46","close":"9227.78","low":"9222.69","high":"9230.74","vol":"4625779.185006000000"),
// )
// }
//
// swap
//
// [
// ["1594764900000","9255.5","9261","9251","9255.5","3958946","427.742307964305"],
// ["1594765800000","9255.5","9264","9252","9258","3609496","389.832756058107"],
// ["1594766700000","9258","9260","9244.5","9250.5","3738600","403.97870345085"],
// ]
//
$candles = $response;
if (gettype($response) === 'array' && count(array_filter(array_keys($response), 'is_string')) != 0) {
$candles = $this->safe_value($response, 'data', array());
}
return $this->parse_ohlcvs($candles, $market, $timeframe, $since, $limit);
}
public function parse_spot_balance($response) {
//
// {
// "status":"ok",
// "ts":1595681450932,
// "$data":{
// "list":array(
// array("$balance":"0.0000000000000000","currency":"BTC","$type":"trade"),
// array("$balance":"0.0000000000000000","currency":"BTC","$type":"frozen"),
// array("$balance":"0.0000000000000000","currency":"BTC","$type":"lock"),
// ),
// "id":"7420922606",
// "$type":"spot",
// "state":"working"
// }
// }
//
$result = array( 'info' => $response );
$data = $this->safe_value($response, 'data');
$balances = $this->safe_value($data, 'list');
for ($i = 0; $i < count($balances); $i++) {
$balance = $balances[$i];
$currencyId = $this->safe_string($balance, 'currency');
$code = $this->safe_currency_code($currencyId);
if (!(is_array($result) && array_key_exists($code, $result))) {
$account = $this->account();
$result[$code] = $account;
}
$type = $this->safe_value($balance, 'type');
if ($type === 'trade') {
$result[$code]['free'] = $this->safe_string($balance, 'balance');
} else if (($type === 'frozen') || ($type === 'lock')) {
$used = $this->safe_string($result[$code], 'used');
$result[$code]['used'] = Precise::string_add($used, $this->safe_string($balance, 'balance'));
}
}
return $this->parse_balance($result);
}
public function parse_swap_balance($response) {
//
// swap
//
// array(
// array("equity":"0","fixed_balance":"0","total_avail_balance":"0","margin":"0","realized_pnl":"0","unrealized_pnl":"0","$symbol":"bchusd","margin_frozen":"0","timestamp":"1595673431547","margin_mode":"fixed","forwardContractFlag":false),
// array("equity":"0","fixed_balance":"0","total_avail_balance":"0","margin":"0","realized_pnl":"0","unrealized_pnl":"0","$symbol":"ethusd","margin_frozen":"0","timestamp":"1595673431573","margin_mode":"fixed","forwardContractFlag":false),
// array("equity":"0","fixed_balance":"0","total_avail_balance":"0","margin":"0","realized_pnl":"0","unrealized_pnl":"0","$symbol":"cmt_btcsusdt","margin_frozen":"0","timestamp":"1595673431577","margin_mode":"fixed","forwardContractFlag":true),
// )
//
//
$result = array();
for ($i = 0; $i < count($response); $i++) {
$balance = $response[$i];
$marketId = $this->safe_string($balance, 'symbol');
$symbol = $marketId;
if (is_array($this->markets_by_id) && array_key_exists($marketId, $this->markets_by_id)) {
$symbol = $this->markets_by_id[$marketId]['symbol'];
}
$account = $this->account();
// it may be incorrect to use total, free and used for swap accounts
$account['total'] = $this->safe_string($balance, 'equity');
$account['free'] = $this->safe_string($balance, 'total_avail_balance');
$result[$symbol] = $account;
}
return $this->parse_balance($result);
}
public function fetch_accounts($params = array ()) {
$request = array(
'method' => 'accounts',
);
$response = $this->apiGetAccountAccounts (array_merge($request, $params));
//
// {
// "status":"ok",
// "ts":1595679591824,
// "$data":array(
// array("id":"7420922606","$type":"spot","state":"working")
// )
// }
//
$data = $this->safe_value($response, 'data', array());
$result = array();
for ($i = 0; $i < count($data); $i++) {
$account = $data[$i];
$accountId = $this->safe_string($account, 'id');
$type = $this->safe_string_lower($account, 'type');
$result[] = array(
'id' => $accountId,
'type' => $type,
'currency' => null,
'info' => $account,
);
}
return $result;
}
public function find_account_by_type($type) {
$this->load_markets();
$this->load_accounts();
$accountsByType = $this->group_by($this->accounts, 'type');
$accounts = $this->safe_value($accountsByType, $type);
if ($accounts === null) {
throw new ExchangeError($this->id . " findAccountByType() could not find an accountId with $type '" . $type . "', specify the 'accountId' parameter instead"); // eslint-disable-line quotes
}
$numAccounts = is_array($accounts) ? count($accounts) : 0;
if ($numAccounts > 1) {
throw new ExchangeError($this->id . " findAccountByType() found more than one accountId with $type '" . $type . "', specify the 'accountId' parameter instead"); // eslint-disable-line quotes
}
return $accounts[0];
}
public function get_account_id($params) {
$this->load_markets();
$this->load_accounts();
$defaultAccountId = $this->safe_string($this->options, 'accountId');
$accountId = $this->safe_string($params, 'accountId', $defaultAccountId);
if ($accountId !== null) {
return $accountId;
}
$defaultType = $this->safe_string($this->options, 'defaultType', 'margin');
$type = $this->safe_string($params, 'type', $defaultType);
$params = $this->omit($params, 'type');
if ($type === null) {
throw new ArgumentsRequired($this->id . " getAccountId() requires an 'accountId' parameter");
}
$account = $this->find_account_by_type($type);
return $account['id'];
}
public function fetch_balance($params = array ()) {
$this->load_markets();
$this->load_accounts();
$defaultType = $this->safe_string_2($this->options, 'fetchBalance', 'defaultType');
$type = $this->safe_string($params, 'type', $defaultType);
if ($type === null) {
throw new ArgumentsRequired($this->id . " fetchBalance() requires a 'type' parameter, one of 'spot', 'swap'");
}
$method = null;
$query = $this->omit($params, 'type');
if ($type === 'spot') {
$accountId = $this->get_account_id($params);
$method = 'apiGetAccountsAccountIdBalance';
$query['account_id'] = $accountId;
$query['method'] = 'balance';
} else if ($type === 'swap') {
$method = 'swapGetAccountAccounts';
}
$response = $this->$method ($query);
//
// spot
//
// {
// "status":"ok",
// "ts":1595681450932,
// "data":{
// "list":array(
// array("balance":"0.0000000000000000","currency":"BTC","$type":"trade"),
// array("balance":"0.0000000000000000","currency":"BTC","$type":"frozen"),
// array("balance":"0.0000000000000000","currency":"BTC","$type":"lock"),
// ),
// "id":"7420922606",
// "$type":"spot",
// "state":"working"
// }
// }
//
// swap
//
// array(
// array("equity":"0","fixed_balance":"0","total_avail_balance":"0","margin":"0","realized_pnl":"0","unrealized_pnl":"0","symbol":"bchusd","margin_frozen":"0","timestamp":"1595673431547","margin_mode":"fixed","forwardContractFlag":false),
// array("equity":"0","fixed_balance":"0","total_avail_balance":"0","margin":"0","realized_pnl":"0","unrealized_pnl":"0","symbol":"ethusd","margin_frozen":"0","timestamp":"1595673431573","margin_mode":"fixed","forwardContractFlag":false),
// array("equity":"0","fixed_balance":"0","total_avail_balance":"0","margin":"0","realized_pnl":"0","unrealized_pnl":"0","symbol":"cmt_btcsusdt","margin_frozen":"0","timestamp":"1595673431577","margin_mode":"fixed","forwardContractFlag":true),
// )
//
return $this->parse_balance_by_type($type, $response);
}
public function parse_balance_by_type($type, $response) {
if ($type === 'spot') {
return $this->parse_spot_balance($response);
} else if ($type === 'swap') {
return $this->parse_swap_balance($response);
}
throw new NotSupported($this->id . " fetchBalance does not support the '" . $type . "' $type (the $type must be one of 'account', 'spot', 'margin', 'futures', 'swap')");
}
public function parse_order_status($status) {
$statuses = array(
'submitted' => 'open',
'partial-filled' => 'open',
'partial-canceled' => 'canceled',
'filled' => 'closed',
'canceled' => 'canceled',
'-2' => 'failed',
'-1' => 'canceled',
'0' => 'open',
'1' => 'open',
'2' => 'closed',
'3' => 'open',
'4' => 'canceled',
);
return $this->safe_string($statuses, $status, $status);
}
public function parse_order_side($side) {
$sides = array(
'buy-market' => 'buy',
'sell-market' => 'sell',
'buy-limit' => 'buy',
'sell-limit' => 'sell',
'1' => 'long', // open long
'2' => 'short', // open short
'3' => 'long', // close long
'4' => 'short', // close short
);
return $this->safe_string($sides, $side, $side);
}
public function parse_order_type($type) {
$types = array(
'buy-market' => 'market',
'sell-market' => 'market',
'buy-limit' => 'limit',
'sell-limit' => 'limit',
'1' => 'open', // open long
'2' => 'open', // open short
'3' => 'close', // close long
'4' => 'close', // close short
);
return $this->safe_string($types, $type, $type);
}
public function parse_order($order, $market = null) {
//
// createOrder
//
// spot
//
// {
// "$status":"ok",
// "ts":1595792596056,
// "data":671368296142774272
// }
//
// swap
//
// {
// "client_oid":"58775e54-0592-491c-97e8-e2369025f2d1",
// "order_id":"671757564085534713"
// }
//
// cancelOrder
//
// spot
//
// {
// "$status" => "ok",
// "ts" => 1595818631279,
// "data" => 671368296142774272
// }
//
// swap
//
// {
// "order_id":"671757564085534713",
// "client_oid":"58775e54-0592-491c-97e8-e2369025f2d1",
// "$symbol":"cmt_ethusdt",
// "result":true,
// "err_code":null,
// "err_msg":null
// }
//
// fetchOpenOrders, fetchClosedOrders, fetchOrder
//
// spot
//
// {
// "account_id":"7420922606",
// "$amount":"0.1000000000000000",
// "canceled_at":"1595872129618",
// "created_at":"1595872089525",
// "filled_amount":"0.000000000000",
// "filled_cash_amount":"0.000000000000",
// "filled_fees":"0.000000000000",
// "finished_at":"1595872129618",
// "$id":"671701716584665088",
// "$price":"150.000000000000",
// "source":"接口",
// "state":"canceled",
// "$symbol":"eth_usdt",
// "$type":"buy-limit"
// }
//
// swap
//
// {
// "$symbol":"cmt_ethusdt",
// "size":"1",
// "$timestamp":"1595885546770",
// "client_oid":"f3aa81d6-9a4c-4eab-bebe-ebc19da21cf2",
// "createTime":"1595885521200",
// "filled_qty":"0",
// "$fee":"0.00000000",
// "order_id":"671758053112020913",
// "$price":"150.00",
// "price_avg":"0.00",
// "$status":"0",
// "$type":"1",
// "order_type":"0",
// "totalProfits":null
// }
//
$id = $this->safe_string($order, 'order_id');
$id = $this->safe_string_2($order, 'id', 'data', $id);
$timestamp = $this->safe_integer_2($order, 'created_at', 'createTime');
$type = $this->safe_string($order, 'type');
$side = $this->parse_order_side($type);
$type = $this->parse_order_type($type);
// if (($side !== 'buy') && ($side !== 'sell')) {
// $side = $this->parse_order_side($type);
// }
// if (($type !== 'limit') && ($type !== 'market')) {
// if (is_array($order) && array_key_exists('pnl', $order)) {
// $type = 'futures';
// } else {
// $type = 'swap';
// }
// }
$symbol = null;
$marketId = $this->safe_string($order, 'symbol');
if ($marketId !== null) {
if (is_array($this->markets_by_id) && array_key_exists($marketId, $this->markets_by_id)) {
$market = $this->markets_by_id[$marketId];
} else {
$symbol = strtoupper($marketId);
}
}
if (($symbol === null) && ($market !== null)) {
$symbol = $market['symbol'];
}
$amount = $this->safe_number_2($order, 'amount', 'size');
$filled = $this->safe_number_2($order, 'filled_amount', 'filled_qty');
$cost = $this->safe_number($order, 'filled_cash_amount');
$price = $this->safe_number($order, 'price');
$average = $this->safe_number($order, 'price_avg');
$status = $this->parse_order_status($this->safe_string_2($order, 'state', 'status'));
$feeCost = $this->safe_number_2($order, 'filled_fees', 'fee');
$fee = null;
if ($feeCost !== null) {
$feeCurrency = null;
$fee = array(
'cost' => $feeCost,
'currency' => $feeCurrency,
);
}
$clientOrderId = $this->safe_string($order, 'client_oid');
return $this->safe_order(array(
'info' => $order,
'id' => $id,
'clientOrderId' => $clientOrderId,
'timestamp' => $timestamp,
'datetime' => $this->iso8601($timestamp),
'lastTradeTimestamp' => null,
'symbol' => $symbol,
'type' => $type,
'timeInForce' => null,
'postOnly' => null,
'side' => $side,
'price' => $price,
'stopPrice' => null,
'average' => $average,
'cost' => $cost,
'amount' => $amount,
'filled' => $filled,
'remaining' => null,
'status' => $status,
'fee' => $fee,
'trades' => null,
));
}
public function create_order($symbol, $type, $side, $amount, $price = null, $params = array ()) {
$this->load_markets();
$this->load_accounts();
$market = $this->market($symbol);
//
// spot
//
// account_id true string Account ID, obtained using the accounts $method-> Currency transactions use the accountid of the'spot' account; for loan asset transactions, please use the accountid of the'margin' account
// $amount true string A limit order indicates the quantity of the order, when a $market $price buy order indicates how much money to buy, and when a $market $price sell order indicates how much currency to sell
// $price false string Order $price, $market order does not pass this parameter
// source false string Order source api
// $symbol true string Trading pair btc_usdt, eth_btc ...
// $type true string Order Type buy-$market => buy at $market $price, sell-$market => sell at $market $price, buy-limit => buy at limit $price, sell-limit => sell at limit $price
//
// swap
//
// $symbol String Yes Contract ID
// client_oid String Yes customize order IDs to identify your orders. (Less than 50 characters without special characters,
// size String Yes Quantity to buy or sell (value not equal to 0 or negative)
// $type String Yes 1 Open long 2Open short 3 Close long 4 Close short
// order_type String Yes 0 => Normal order (Unfilled and 0 imply normal limit order) 1 => Post only 2 => Fill or Kill 3 => Immediate Or Cancel
// match_price String Yes 0 Limit $price 1 $market $price
// $price String No Price of each contract
//
$request = array(
'symbol' => $market['id'],
);
$clientOrderId = $this->safe_string_2($params, 'client_oid', 'clientOrderId', $this->uuid());
$params = $this->omit($params, array( 'client_oid', 'clientOrderId' ));
$method = null;
if ($market['spot']) {
$accountId = $this->get_account_id(array(
'type' => $market['type'],
));
$method = 'apiPostOrderOrdersPlace';
$request['account_id'] = $accountId;
$request['method'] = 'place';
$request['type'] = $side . '-' . $type;
if ($type === 'limit') {
$request['amount'] = $this->amount_to_precision($symbol, $amount);
$request['price'] = $this->price_to_precision($symbol, $price);
} else if ($type === 'market') {
// for $market buy it requires the $amount of quote currency to spend
if ($side === 'buy') {
$cost = $this->safe_number($params, 'amount');
$createMarketBuyOrderRequiresPrice = $this->safe_value($this->options, 'createMarketBuyOrderRequiresPrice', true);
if ($createMarketBuyOrderRequiresPrice) {
if ($price !== null) {
if ($cost === null) {
$cost = $amount * $price;
}
} else if ($cost === null) {
throw new InvalidOrder($this->id . " createOrder() requires the $price argument with $market buy orders to calculate total order $cost ($amount to spend), where $cost = $amount * $price-> Supply a $price argument to createOrder() call if you want the $cost to be calculated for you from $price and $amount, or, alternatively, add .options['createMarketBuyOrderRequiresPrice'] = false and supply the total $cost value in the 'amount' argument or in the 'amount' extra parameter (the exchange-specific behaviour)");
}
} else {
$cost = ($cost === null) ? $amount : $cost;
}
$request['amount'] = $this->cost_to_precision($symbol, $cost);
} else if ($side === 'sell') {
$request['amount'] = $this->amount_to_precision($symbol, $amount);
}
}
// ...
} else if ($market['swap']) {
$request['order_type'] = '0'; // '0' = Normal order, null and 0 imply a normal limit order, '1' = Post only, '2' = Fill or Kill, '3' = Immediate Or Cancel
$request['client_oid'] = $clientOrderId;
$orderType = $this->safe_string($params, 'type');
if ($orderType === null) {
throw new ArgumentsRequired($this->id . " createOrder() requires a $type parameter, '1' = open long, '2' = open short, '3' = close long, '4' = close short for " . $market['type'] . ' orders');
}
$request['size'] = $this->amount_to_precision($symbol, $amount);
$request['type'] = $orderType;
// if match_price is set to '1', the $price parameter will be ignored for $market orders
if ($type === 'limit') {
$request['match_price'] = '0';
$request['price'] = $this->price_to_precision($symbol, $price);
} else if ($type === 'market') {
$request['match_price'] = '1';
}
$method = 'swapPostOrderPlaceOrder';
}
$response = $this->$method (array_merge($request, $params));
//
// spot
//
// {
// "status":"ok",
// "ts":1595792596056,
// "data":"671368296142774272"
// }
//
// swap
//
// {
// "client_oid":"58775e54-0592-491c-97e8-e2369025f2d1",
// "order_id":"671757564085534713"
// }
//
return $this->parse_order($response, $market);
}
public function cancel_order($id, $symbol = null, $params = array ()) {
$this->load_markets();
$market = null;
$type = null;
if ($symbol === null) {
$defaultType = $this->safe_string_2($this->options, 'cancelOrder', 'defaultType');
$type = $this->safe_string($params, 'type', $defaultType);
if ($type === 'spot') {
if ($symbol === null) {
throw new ArgumentsRequired($this->id . ' cancelOrder() requires a $symbol argument for spot orders');
}
}
} else {
$market = $this->market($symbol);
$type = $market['type'];
}
$query = $this->omit($params, 'type');
$method = null;
$request = array();
if ($type === 'spot') {
$method = 'apiPostOrderOrdersOrderIdSubmitcancel';
$request['order_id'] = $id;
$request['method'] = 'submitcancel';
} else if ($type === 'swap') {
$method = 'swapPostOrderCancelOrder';
$request['orderId'] = $id;
$request['symbol'] = $market['id'];
}
$response = $this->$method (array_merge($request, $query));
//
// spot
//
// array( "status" => "ok", "ts" => 1595818631279, "data" => 671368296142774272 )
//
// swap
//
// {
// "order_id":"671757564085534713",
// "client_oid":"58775e54-0592-491c-97e8-e2369025f2d1",
// "$symbol":"cmt_ethusdt",
// "result":true,
// "err_code":null,
// "err_msg":null
// }
//
return $this->parse_order($response, $market);
}
public function cancel_orders($ids, $symbol = null, $params = array ()) {
if ($symbol === null) {
throw new ArgumentsRequired($this->id . ' cancelOrders() requires a $symbol argument');
}
$this->load_markets();
$market = $this->market($symbol);
$type = $this->safe_string($params, 'type', $market['type']);
if ($type === null) {
throw new ArgumentsRequired($this->id . " cancelOrders() requires a $type parameter (one of 'spot', 'swap').");
}
$params = $this->omit($params, 'type');
$request = array();
$method = null;
if ($type === 'spot') {
$method = 'apiPostOrderOrdersBatchcancel';
$request['method'] = 'batchcancel';
$jsonIds = $this->json($ids);
$parts = explode('"', $jsonIds);
$request['order_ids'] = implode('', $parts);
} else if ($type === 'swap') {
$method = 'swapPostOrderCancelBatchOrders';
$request['symbol'] = $market['id'];
$request['ids'] = $ids;
}
$response = $this->$method (array_merge($request, $params));
//
// spot
//
// {
// "status" => "ok",
// "data" => {
// "success" => array(
// "673451224205135872",
// ),
// "failed" => array(
// {
// "err-msg" => "invalid record",
// "order-id" => "673451224205135873",
// "err-code" => "base record invalid"
// }
// )
// }
// }
//
// swap
//
// {
// "result":true,
// "$symbol":"cmt_btcusdt",
// "order_ids":array(
// "258414711",
// "478585558"
// ),
// "fail_infos":array(
// {
// "order_id":"258414711",
// "err_code":"401",
// "err_msg":""
// }
// )
// }
//
return $response;
}
public function fetch_order($id, $symbol = null, $params = array ()) {
if ($symbol === null) {
throw new ArgumentsRequired($this->id . ' fetchOrder() requires a $symbol argument');
}
$this->load_markets();
$market = $this->market($symbol);
$type = $this->safe_string($params, 'type', $market['type']);
if ($type === null) {
throw new ArgumentsRequired($this->id . " fetchOrder() requires a $type parameter (one of 'spot', 'swap').");
}
$method = null;
$request = array();
if ($type === 'spot') {
$clientOid = $this->safe_string($params, 'client_oid');
if ($clientOid !== null) {
$method = 'apiPostOrderOrdersClientOid';
$request['client_oid'] = $clientOid;
} else {
$method = 'apiPostOrderOrdersOrderId';
$request['order_id'] = $id;
}
$request['method'] = 'getOrder';
} else if ($type === 'swap') {
$method = 'swapGetOrderDetail';
$request['symbol'] = $market['id'];
$request['orderId'] = $id;
}
$query = $this->omit($params, 'type');
$response = $this->$method (array_merge($request, $query));
//
// spot
//
// {
// "status":"ok",
// "ts":1595897886717,
// "$data":{
// "account_id":"7420922606",
// "amount":"0.1000000000000000",
// "canceled_at":"1595818631541",
// "created_at":"1595792595897",
// "filled_amount":"0.000000000000",
// "filled_cash_amount":"0.000000000000",
// "filled_fees":"0.000000000000",
// "finished_at":"1595818631541",
// "$id":"671368296142774272",
// "price":"150.000000000000",
// "source":"接口",
// "state":"canceled",
// "$symbol":"eth_usdt",
// "$type":"buy-limit"
// }
// }
//
//
// swap
//
// {
// "$symbol":"cmt_ethusdt",
// "size":"1",
// "timestamp":"1595896459890",
// "client_oid":"58775e54-0592-491c-97e8-e2369025f2d1",
// "createTime":"1595885404607",
// "filled_qty":"0",
// "fee":"0",
// "order_id":"671757564085534713",
// "price":"150",
// "price_avg":"0",
// "status":"-1",
// "$type":"1",
// "order_type":"0",
// "totalProfits":"0"
// }
//
$data = $this->safe_value($response, 'data', $response);
return $this->parse_order($data, $market);
}
public function fetch_open_orders($symbol = null, $since = null, $limit = null, $params = array ()) {
if ($symbol === null) {
throw new ArgumentsRequired($this->id . ' fetchOpenOrders() requires a $symbol argument');
}
$this->load_markets();
$market = $this->market($symbol);
$type = $this->safe_string($params, 'type', $market['type']);
$request = array(
'symbol' => $market['id'],
);
$method = null;
if ($type === 'spot') {
$method = 'apiGetOrderOrdersOpenOrders';
// $request['from'] = $this->safe_string($params, 'from'); // order id
// $request['direct'] = 'next'; // or 'prev'
$request['method'] = 'openOrders';
if ($limit === null) {
$request['size'] = $limit; // default 100, max 1000
}
} else if ($type === 'swap') {
$method = 'swapGetOrderOrders';
$request['status'] = '3'; // 0 Failed, 1 Partially Filled, 2 Fully Filled 3 = Open . Partially Filled, 4 Canceling
$request['from'] = '1';
$request['to'] = '1';
if ($limit === null) {
$request['limit'] = 100; // default 100, max 100
}
}
$query = $this->omit($params, 'type');
$response = $this->$method (array_merge($request, $query));
//
// spot
//
//
// {
// "status":"ok",
// "ts":1595875165865,
// "$data":array(
// {
// "account_id":"7420922606",
// "amount":"0.1000000000000000",
// "canceled_at":"1595872129618",
// "created_at":"1595872089525",
// "filled_amount":"0.000000000000",
// "filled_cash_amount":"0.000000000000",
// "filled_fees":"0.000000000000",
// "finished_at":"1595872129618",
// "id":"671701716584665088",
// "price":"150.000000000000",
// "source":"接口",
// "state":"canceled",
// "$symbol":"eth_usdt",
// "$type":"buy-$limit"
// }
// )
// }
//
// swap
//
// array(
// {
// "$symbol":"cmt_ethusdt",
// "size":"1",
// "timestamp":"1595885546770",
// "client_oid":"f3aa81d6-9a4c-4eab-bebe-ebc19da21cf2",
// "createTime":"1595885521200",
// "filled_qty":"0",
// "fee":"0.00000000",
// "order_id":"671758053112020913",
// "price":"150.00",
// "price_avg":"0.00",
// "status":"0",
// "$type":"1",
// "order_type":"0",
// "totalProfits":null
// }
// )
//
$data = $response;
if (gettype($response) === 'array' && count(array_filter(array_keys($response), 'is_string')) != 0) {
$data = $this->safe_value($response, 'data', array());
}
return $this->parse_orders($data, $market, null, $limit);
}
public function fetch_closed_orders($symbol = null, $since = null, $limit = null, $params = array ()) {
if ($symbol === null) {
throw new ArgumentsRequired($this->id . ' fetchClosedOrders() requires a $symbol argument');
}
$this->load_markets();
$market = $this->market($symbol);
$type = $this->safe_string($params, 'type', $market['type']);
$request = array(
'symbol' => $market['id'],
);
$method = null;
if ($type === 'spot') {
$method = 'apiGetOrderOrdersHistory';
// Value range [((end_time) – 48h), (end_time)]
// the $query window is 48 hours at most
// the window shift range is the last 30 days
if ($since !== null) {
$request['start_time'] = $since;
}
// $request['end_time'] = $this->safe_integer($params, 'end_time');
// $request['from'] = $this->safe_string($params, 'from'); // order id
// $request['direct'] = 'next'; // or 'prev'
$request['method'] = 'openOrders';
if ($limit === null) {
$request['size'] = $limit; // default 100, max 1000
}
} else if ($type === 'swap') {
$method = 'swapGetOrderOrders';
$request['status'] = '2'; // 0 Failed, 1 Partially Filled, 2 Fully Filled 3 = Open . Partially Filled, 4 Canceling
$request['from'] = '1';
$request['to'] = '1';
if ($limit === null) {
$request['limit'] = 100; // default 100, max 100
}
}
$query = $this->omit($params, 'type');
$response = $this->$method (array_merge($request, $query));
//
// spot
//
//
// {
// "status":"ok",
// "ts":1595875165865,
// "$data":array(
// {
// "account_id":"7420922606",
// "amount":"0.1000000000000000",
// "canceled_at":"1595872129618",
// "created_at":"1595872089525",
// "filled_amount":"0.000000000000",
// "filled_cash_amount":"0.000000000000",
// "filled_fees":"0.000000000000",
// "finished_at":"1595872129618",
// "id":"671701716584665088",
// "price":"150.000000000000",
// "source":"接口",
// "state":"canceled",
// "$symbol":"eth_usdt",
// "$type":"buy-$limit"
// }
// )
// }
//
// swap
//
// array(
// {
// "$symbol":"cmt_ethusdt",
// "size":"1",
// "timestamp":"1595885546770",
// "client_oid":"f3aa81d6-9a4c-4eab-bebe-ebc19da21cf2",
// "createTime":"1595885521200",
// "filled_qty":"0",
// "fee":"0.00000000",
// "order_id":"671758053112020913",
// "price":"150.00",
// "price_avg":"0.00",
// "status":"0",
// "$type":"1",
// "order_type":"0",
// "totalProfits":null
// }
// )
//
$data = $response;
if (gettype($response) === 'array' && count(array_filter(array_keys($response), 'is_string')) != 0) {
$data = $this->safe_value($response, 'data', array());
}
return $this->parse_orders($data, $market, null, $limit);
}
public function fetch_deposits($code = null, $since = null, $limit = null, $params = array ()) {
if ($code === null) {
throw new ArgumentsRequired($this->id . ' fetchDeposits() requires a $currency $code argument');
}
$this->load_markets();
$currency = $this->currency($code);
$request = array(
'currency' => $currency['id'],
'method' => 'deposit_withdraw',
'type' => 'deposit',
'size' => 12,
);
$response = $this->apiGetOrderDepositWithdraw (array_merge($request, $params));
//
// {
// "status" => "ok",
// "$data" => array(
// array(
// "id" => 1171,
// "type" => "deposit",
// "$currency" => "usdt",
// "tx_hash" => "ed03094b84eafbe4bc16e7ef766ee959885ee5bcb265872baaa9c64e1cf86c2b",
// "amount" => 7.457467,
// "address" => "rae93V8d2mdoUQHwBDBdM4NHCMehRJAsbm",
// "address_tag" => "100040",
// "fee" => 0,
// "state" => "safe",
// "created_at" => 1510912472199,
// "updated_at" => 1511145876575
// ),
// )
// }
//
$data = $this->safe_value($response, 'data', array());
return $this->parse_transactions($data, $currency, $since, $limit, $params);
}
public function fetch_withdrawals($code = null, $since = null, $limit = null, $params = array ()) {
if ($code === null) {
throw new ArgumentsRequired($this->id . ' fetchWithdrawals() requires a $currency $code argument');
}
$this->load_markets();
$currency = $this->currency($code);
$request = array(
'currency' => $currency['id'],
'method' => 'deposit_withdraw',
'type' => 'withdraw',
'size' => 12,
);
$response = $this->apiGetOrderDepositWithdraw (array_merge($request, $params));
//
// {
// "status" => "ok",
// "$data" => array(
// array(
// "id" => 1171,
// "type" => "withdraw",
// "$currency" => "usdt",
// "tx_hash" => "ed03094b84eafbe4bc16e7ef766ee959885ee5bcb265872baaa9c64e1cf86c2b",
// "amount" => 7.457467,
// "address" => "rae93V8d2mdoUQHwBDBdM4NHCMehRJAsbm",
// "address_tag" => "100040",
// "fee" => 0,
// "state" => "safe",
// "created_at" => 1510912472199,
// "updated_at" => 1511145876575
// ),
// )
// }
//
$data = $this->safe_value($response, 'data', array());
return $this->parse_transactions($data, $currency, $since, $limit, $params);
}
public function parse_transaction_status($status) {
$statuses = array(
// withdrawals
'WaitForOperation' => 'pending', // 等待提现
'OperationLock' => 'pending', // 初审锁定成功
'OperationSuccess' => 'ok', // 提现成功
'Cancel' => 'canceled', // 用户撤销
'Sure' => 'ok', // 复审锁定成功
'Fail' => 'failed', // 出币异常
'WaitForChainSure' => 'ok', // 等待链上确认
// deposits
'WAIT_0' => 'pending', // 待确认
'WAIT_1' => 'pending', // 待确认
'DATA_CHANGE' => 'pending', // 待确认中
'SUCCESS' => 'ok', // 充值成功
);
return $this->safe_string($statuses, $status, $status);
}
public function parse_transaction($transaction, $currency = null) {
//
// fetchDeposits, fetchWithdrawals
//
// {
// "$id" => 1171,
// "$type" => "withdraw",
// "$currency" => "usdt",
// "tx_hash" => "ed03094b84eafbe4bc16e7ef766ee959885ee5bcb265872baaa9c64e1cf86c2b",
// "$amount" => 7.457467,
// "$address" => "rae93V8d2mdoUQHwBDBdM4NHCMehRJAsbm",
// "address_tag" => "100040",
// "$fee" => 0,
// "state" => "safe",
// "created_at" => 1510912472199,
// "updated_at" => 1511145876575
// }
//
$id = $this->safe_string($transaction, 'id');
$address = $this->safe_string($transaction, 'address');
$tag = $this->safe_string($transaction, 'address_tag');
$tagFrom = null;
$tagTo = $tag;
$addressFrom = null;
$addressTo = $address;
$type = $this->safe_string($transaction, 'type');
if ($type === 'withdraw') {
$type = 'withdrawal';
} else if ($type === 'deposit') {
$type = 'deposit';
}
$currencyId = $this->safe_string($transaction, 'currency');
$code = $this->safe_currency_code($currencyId);
$amount = $this->safe_number($transaction, 'amount');
$status = $this->parse_transaction_status($this->safe_string($transaction, 'state'));
$txid = $this->safe_string($transaction, 'tx_hash');
$timestamp = $this->safe_integer($transaction, 'created_at');
$updated = $this->safe_integer($transaction, 'updated_at');
$feeCost = $this->safe_number($transaction, 'fee');
$fee = null;
if ($feeCost !== null) {
$fee = array(
'currency' => $code,
'cost' => $feeCost,
);
}
return array(
'info' => $transaction,
'id' => $id,
'currency' => $code,
'amount' => $amount,
'addressFrom' => $addressFrom,
'addressTo' => $addressTo,
'address' => $address,
'tagFrom' => $tagFrom,
'tagTo' => $tagTo,
'tag' => $tag,
'status' => $status,
'type' => $type,
'updated' => $updated,
'txid' => $txid,
'timestamp' => $timestamp,
'datetime' => $this->iso8601($timestamp),
'fee' => $fee,
);
}
public function fetch_my_trades($symbol = null, $since = null, $limit = null, $params = array ()) {
if ($symbol === null) {
throw new ArgumentsRequired($this->id . ' fetchMyTrades() requires a $symbol argument');
}
$this->load_markets();
$market = $this->market($symbol);
$type = $this->safe_string($params, 'type', $market['type']);
$query = $this->omit($params, 'type');
if ($type === 'swap') {
throw new ArgumentsRequired($this->id . ' fetchMyTrades() is not supported for ' . $type . ' type');
}
//
// spot
//
// POST /api/v1/order/matchresults Query current order, order history
// $symbol true string trading pair btc_usdt, eth_btc ...
// types false string Query order $type combination buy-$market, sell-$market, buy-$limit, sell-$limit
// start_date false string Query start date, date format yyyy-mm-dd -61 days [-61day, $end-date]
// end_date false string Query $end date, date format yyyy-mm-dd Now [start-date, now]
// from false string Query start ID order record id
// direct false string Query direction ‘next’ is default , the transaction record ID is sorted from large to small prev,next
// size false string Query record size 100 <=100
//
$request = array(
'symbol' => $market['id'],
'method' => 'matchresults',
// 'types' => 'buy-$market,sell-$market,buy-$limit,sell-limit',
// 'start_date' => $this->ymd($since),
// 'end_date' => $this->ymd($this->milliseconds()),
// 'size' => 100,
// 'direct' => 'next',
);
if ($since !== null) {
$request['start_date'] = $this->ymd($since);
$end = $this->sum($since, 2 * 24 * 60 * 60 * 1000);
$request['end_date'] = $this->ymd($end);
}
if ($limit !== null) {
$request['size'] = $limit; // default 100, max 100
}
$response = $this->apiPostOrderMatchresults (array_merge($request, $query));
//
// {
// "status" => "ok",
// "$data" => array(
// {
// "id" => 29555,
// "order_id" => 59378,
// "match_id" => 59335,
// "$symbol" => "eth_usdt",
// "$type" => "buy-$limit",
// "source" => "api",
// "price" => "100.1000000000",
// "filled_amount" => "0.9845000000",
// "filled_fees" => "0.0019690000",
// "created_at" => 1494901400487
// }
// )
// }
//
$data = $this->safe_value($response, 'data', array());
return $this->parse_trades($data, $market, $since, $limit);
}
public function fetch_order_trades($id, $symbol = null, $since = null, $limit = null, $params = array ()) {
if ($symbol === null) {
throw new ArgumentsRequired($this->id . ' fetchOrderTrades() requires a $symbol argument');
}
$this->load_markets();
$market = $this->market($symbol);
$type = $this->safe_string($params, 'type', $market['type']);
$params = $this->omit($params, 'type');
$method = null;
$request = array();
if ($type === 'spot') {
$request['order_id'] = $id;
$request['method'] = 'matchresults';
$method = 'apiPostOrderOrdersOrderIdMatchresults';
} else if ($type === 'swap') {
$request['orderId'] = $id;
$request['symbol'] = $market['id'];
$method = 'swapGetOrderFills';
}
$response = $this->$method (array_merge($request, $params));
//
// spot
//
// {
// "status":"ok",
// "ts":1596298917277,
// "$data":array(
// {
// "$id":"614164775",
// "created_at":"1596298860602",
// "filled_amount":"0.0417000000000000",
// "filled_fees":"0.0000834000000000",
// "match_id":"673491702661292033",
// "order_id":"673491720340279296",
// "price":"359.240000000000",
// "source":"接口",
// "$symbol":"eth_usdt",
// "$type":"buy-$market"
// }
// )
// }
//
// swap
//
//
// array(
// {
// "trade_id":"6667390",
// "$symbol":"cmt_btcusdt",
// "order_id":"525946425993854915",
// "price":"9839.00",
// "order_qty":"3466",
// "fee":"-0.0000528407360000",
// "timestamp":"1561121514442",
// "exec_type":"M",
// "side":"3"
// }
// )
//
$data = $response;
if (gettype($data) === 'array' && count(array_filter(array_keys($data), 'is_string')) != 0) {
$data = $this->safe_value($response, 'data', array());
}
return $this->parse_trades($data, $market, $since, $limit);
}
public function fetch_position($symbol, $params = array ()) {
$this->load_markets();
$market = $this->market($symbol);
$request = array(
'symbol' => $market['id'],
);
$response = $this->swapGetPositionSinglePosition (array_merge($request, $params));
//
// {
// "margin_mode":"fixed", // Margin mode => crossed / fixed
// "holding":array(
// {
// "$symbol":"cmt_btcusdt", // Contract name
// "liquidation_price":"0.00", // Estimated liquidation price
// "position":"0", // Position Margin, the margin for holding current positions
// "avail_position":"0", // Available position
// "avg_cost":"0.00", // Transaction average price
// "leverage":"2", // Leverage
// "realized_pnl":"0.00000000", // Realized Profit and loss
// "keepMarginRate":"0.005", // Maintenance margin rate
// "side":"1", // Position Direction Long or short, Mark obsolete
// "holdSide":"1", // Position Direction Long or short
// "timestamp":"1557571623963", // System timestamp
// "margin":"0.0000000000000000", // Used margin
// "unrealized_pnl":"0.00000000", // Unrealized profit and loss
// }
// )
// }
return $response;
}
public function fetch_positions($symbols = null, $params = array ()) {
$this->load_markets();
$response = $this->swapGetPositionAllPosition ($params);
//
// array(
// array(
// "margin_mode":"fixed",
// "holding":array(
// array(
// "liquidation_price":"0.00",
// "position":"0",
// "avail_position":"0",
// "avg_cost":"0.00",
// "symbol":"btcusd",
// "leverage":"20",
// "keepMarginRate":"0.005",
// "realized_pnl":"0.00000000",
// "unrealized_pnl":"0",
// "side":"long",
// "holdSide":"1",
// "timestamp":"1595698564915",
// "margin":"0.0000000000000000"
// ),
// )
// ),
// )
//
// todo unify parsePosition/parsePositions
return $response;
}
public function sign($path, $api = 'public', $method = 'GET', $params = array (), $headers = null, $body = null) {
$request = '/' . $this->implode_params($path, $params);
if (($api === 'capi') || ($api === 'swap')) {
$request = '/api/swap/' . $this->version . $request;
} else {
$request = '/' . $api . '/v1' . $request;
}
$query = $this->omit($params, $this->extract_params($path));
$url = $this->implode_hostname($this->urls['api'][$api]) . $request;
if (($api === 'data') || ($api === 'capi')) {
if ($query) {
$url .= '?' . $this->urlencode($query);
}
} else if ($api === 'swap') {
$this->check_required_credentials();
$timestamp = (string) $this->milliseconds();
$auth = $timestamp . $method . $request;
if ($method === 'POST') {
$body = $this->json($params);
$auth .= $body;
} else {
if ($params) {
$query = $this->urlencode($this->keysort($params));
$url .= '?' . $query;
$auth .= '?' . $query;
}
}
$signature = $this->hmac($this->encode($auth), $this->encode($this->secret), 'sha256', 'base64');
$headers = array(
'ACCESS-KEY' => $this->apiKey,
'ACCESS-SIGN' => $signature,
'ACCESS-TIMESTAMP' => $timestamp,
'ACCESS-PASSPHRASE' => $this->password,
);
if ($method === 'POST') {
$headers['Content-Type'] = 'application/json';
}
} else if ($api === 'api') {
$timestamp = (string) $this->milliseconds();
$auth = '';
$query = $this->keysort($query);
$auth = $this->rawencode($query);
$hash = $this->hash($this->encode($this->secret), 'sha1');
$signed = $auth;
$signature = $this->hmac($this->encode($auth), $this->encode($hash), 'md5');
if (strlen($auth) > 0) {
$signed .= '&';
}
$signed .= 'sign=' . $signature . '&req_time=' . $timestamp . '&accesskey=' . $this->apiKey;
if ($method === 'GET') {
if ($query) {
$url .= '?' . $signed;
}
} else if ($method === 'POST') {
$url .= '?sign=' . $signature . '&req_time=' . $timestamp . '&accesskey=' . $this->apiKey;
$body = $auth;
$headers = array(
'Content-Type' => 'application/x-www-form-urlencoded',
);
}
}
return array( 'url' => $url, 'method' => $method, 'body' => $body, 'headers' => $headers );
}
public function handle_errors($code, $reason, $url, $method, $headers, $body, $response, $requestHeaders, $requestBody) {
if (!$response) {
return; // fallback to default error handler
}
//
// spot
//
// array("status":"fail","err_code":"01001","err_msg":"系统异常,请稍后重试")
// array("status":"error","ts":1595594160149,"err_code":"invalid-parameter","err_msg":"invalid size, valid range => [1,2000]")
// array("status":"error","ts":1595684716042,"err_code":"invalid-parameter","err_msg":"illegal sign invalid")
// array("status":"error","ts":1595700216275,"err_code":"bad-request","err_msg":"your balance is low!")
// array("status":"error","ts":1595700344504,"err_code":"invalid-parameter","err_msg":"invalid type")
// array("status":"error","ts":1595703343035,"err_code":"bad-request","err_msg":"order cancel fail")
// array("status":"error","ts":1595704360508,"err_code":"invalid-parameter","err_msg":"accesskey not null")
// array("status":"error","ts":1595704490084,"err_code":"invalid-parameter","err_msg":"permissions not right")
// array("status":"error","ts":1595711862763,"err_code":"system exception","err_msg":"system exception")
// array("status":"error","ts":1595730308979,"err_code":"bad-request","err_msg":"20003")
//
// swap
//
// array("$code":"40015","msg":"","requestTime":1595698564931,"data":null)
// array("$code":"40017","msg":"Order id must not be blank","requestTime":1595702477835,"data":null)
// array("$code":"40017","msg":"Order Type must not be blank","requestTime":1595698516162,"data":null)
// array("$code":"40301","msg":"","requestTime":1595667662503,"data":null)
// array("$code":"40017","msg":"Contract $code must not be blank","requestTime":1595703151651,"data":null)
// array("$code":"40108","msg":"","requestTime":1595885064600,"data":null)
// array("order_id":"513468410013679613","client_oid":null,"symbol":"ethusd","result":false,"err_code":"order_no_exist_error","err_msg":"订单不存在!")
//
$message = $this->safe_string($response, 'err_msg');
$errorCode = $this->safe_string_2($response, 'code', 'err_code');
$feedback = $this->id . ' ' . $body;
$nonEmptyMessage = (($message !== null) && ($message !== ''));
if ($nonEmptyMessage) {
$this->throw_exactly_matched_exception($this->exceptions['exact'], $message, $feedback);
$this->throw_broadly_matched_exception($this->exceptions['broad'], $message, $feedback);
}
$nonZeroErrorCode = ($errorCode !== null) && ($errorCode !== '00000');
if ($nonZeroErrorCode) {
$this->throw_exactly_matched_exception($this->exceptions['exact'], $errorCode, $feedback);
}
if ($nonZeroErrorCode || $nonEmptyMessage) {
throw new ExchangeError($feedback); // unknown $message
}
}
}
|
@extends('admin.layouts.master')
@section('main-content')
<section class="section">
<div class="section-header">
<h1>{{ __('Orders') }}</h1>
</div>
<div class="section-body">
<div class="row">
<div class="col-4 col-md-4 col-lg-4">
<div class="card">
<div class="card-body card-profile">
<img class="profile-user-img img-responsive img-circle" src="{{ $order->delivery->images }}" alt="User profile picture">
<h3 class="text-center">{{ $order->delivery->name }}</h3>
<p class="text-center">
{{ $order->delivery->getrole->name }}
</p>
</div>
<!-- /.box-body -->
</div>
</div>
<div class="col-8 col-md-8 col-lg-8">
<div class="card">
<div class="card-body">
<div class="profile-desc">
<div class="single-profile">
<p><b>{{ __('First Name') }}: </b> {{ $order->delivery->first_name}}</p>
</div>
<div class="single-profile">
<p><b>{{ __('Last Name') }}: </b> {{ $order->delivery->last_name}}</p>
</div>
<div class="single-profile">
<p><b>{{ __('Email') }}: </b> {{ $order->delivery->email}}</p>
</div>
<div class="single-profile">
<p><b>{{ __('Phone') }}: </b> {{ $order->delivery->phone}}</p>
</div>
<div class="single-full-profile">
<p><b>{{ __('Address') }}: </b> {{ $order->delivery->address}}</p>
</div>
<div class="single-profile">
<p><b>{{ __('Status') }}: </b>
@php
$status = $order->delivery->status;
echo trans('user_statuses.'.$status);
@endphp
</p>
</div>
<div class="single-profile">
<p><b>{{ __('Username') }}: </b> {{ $order->delivery->username}}</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
@endsection
|
{{-- @if (Session::has('sussess'))
<h1>
{{ Session::get('sussess') }}
</h1>
@endif
@if (Session::has('error'))
<h1>
{{ Session::get('error') }}
</h1>
@endif
<form action="{{ route('process_login') }}" method="post">
@csrf
Email
<input type="email" name="email" value="">
<br>
password
<input type="password" name="password" value="">
<br>
<button type="submit">login</button>
</form> --}}
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Sufee Admin - HTML5 Admin Template</title>
<meta name="description" content="Sufee Admin - HTML5 Admin Template">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-icon.png">
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="{{ asset('public/vendors/bootstrap/dist/css/bootstrap.min.css') }}">
<link rel="stylesheet" href="{{ asset('public/vendors/font-awesome/css/font-awesome.min.css') }}">
<link rel="stylesheet" href="{{ asset('public/vendors/themify-icons/css/themify-icons.css') }}">
<link rel="stylesheet" href="{{ asset('public/vendors/flag-icon-css/css/flag-icon.min.css') }}">
<link rel="stylesheet" href="{{ asset('public/vendors/selectFX/css/cs-skin-elastic.css') }}">
<link rel="stylesheet" href="{{ asset('public/vendors/jqvmap/dist/jqvmap.min.css') }}">
<link rel="stylesheet" href="{{ asset('public/assets/css/style.css') }}">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800' rel='stylesheet' type='text/css'>
<{{-- link rel="stylesheet" href="vendors/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="vendors/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="vendors/themify-icons/css/themify-icons.css">
<link rel="stylesheet" href="vendors/flag-icon-css/css/flag-icon.min.css">
<link rel="stylesheet" href="vendors/selectFX/css/cs-skin-elastic.css">
<link rel="stylesheet" href="assets/css/style.css">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800' rel='stylesheet' type='text/css'> --}}
</head>
<body class="bg-dark">
<div class="sufee-login d-flex align-content-center flex-wrap">
<div class="container">
<div class="login-content">
<div class="login-logo">
<h1 style="color: white">Login</h1>
</div>
<div class="login-form">
<form method="post">
{{-- <div class="form-group">
<label>Email address</label>
<input type="email" class="form-control" placeholder="Email" readonly="readonly">
</div>
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control" placeholder="Password" readonly="readonly">
</div> --}}
<div class="register-link m-t-15 text-center">
</div>
<div class="social-login-content">
<div class="social-button">
{{-- <button type="" class="btn social facebook btn-flat btn-addon mb-3">Sign in Admin</button> --}}
<a href="{{ route('login_admin') }}" class="btn social facebook btn-flat btn-addon mb-3">Sign in Admin</a>
<a href="{{ route('login_teacher') }}" class="btn btn-success btn-flat m-b-30 m-t-30">Sign Teacher</a>
<a href="{{ route('login_student') }}" class="btn social twitter btn-flat btn-addon mt-2">Sign in Student</a>
{{-- <button type="" class="btn btn-success btn-flat m-b-30 m-t-30">Sign Teacher</button>
<button type="" class="btn social twitter btn-flat btn-addon mt-2">Sign in Student</button> --}}
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<script src="{{ asset('public/vendors/jquery/dist/jquery.min.js') }}"></script>
<script src="{{ asset('public/vendors/popper.js/dist/umd/popper.min.js') }}"></script>
<script src="{{ asset('public/vendors/bootstrap/dist/js/bootstrap.min.js') }}"></script>
<script src="{{ asset('public/assets/js/main.js') }}"></script>
</body>
</html>
|
@extends('admin_templates')
@section('title','Danh sách thương hiệu')
@section('content_admin')
<section class="wrapper">
<h3 class="text-center">Danh sách thương hiệu</h3>
@if(session('success'))
<strong class="text-success">{{ session('success') }}</strong>
@endif
<div class="listproduct">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th class="text-center">STT</th>
<th class="text-center">Tên thương hiệu</th>
<th class="text-center">Mô tả</th>
<th class="text-center">Loại sản phẩm</th>
<th class="text-center">Edit</th>
</tr>
</thead>
<tbody>
@foreach ($brand_pag as $value)
@foreach ($category as $item)
@if($value->category_id==$item->category_id)
<?php
$type=$item->name_category;
?>
@endif
@endforeach
<tr>
<td class="text-center">{{ $value->brand_id }}</td>
<td class="text-center">{{ $value->name_brand }}</td>
<td class="text-center">{{ $value->des_brand }}</td>
<td class="text-center">{{ $type }}</td>
<td class="text-center">
<a href=" {{route('Product_Brand.show',$value->brand_id) }}" class="fa fa-edit rounded bg-success"></a>
<form action="{{ route('Product_Brand.destroy',$value->brand_id) }}" method="post">
{{ csrf_field() }}
{{ method_field('DELETE') }}
<button class="fa fa-trash bg-danger" style="border: none;"></button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="text-center">
{{ $brand_pag->links() }}
</div>
</div>
</section>
@endsection
|
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Customer_model extends CI_Model {
public function getCustomerById($id)
{
return $this->db->get_where('customer', ['id_customer' => $id])->row_array();
}
public function aksiTambahCustomer()
{
$data = [
'nama' => $this->input->post('nama', true),
'username' => $this->input->post('username', true),
'alamat' => $this->input->post('alamat', true),
'kelamin' => $this->input->post('jk', true),
'telepon' => $this->input->post('telepon', true),
'no_ktp' => $this->input->post('ktp', true),
'password' => password_hash($this->input->post('password', true), PASSWORD_DEFAULT),
'role_id' => '2'
];
$this->db->insert('customer', $data);
}
public function aksiEditCustomer()
{
$id = $this->input->post('id', true);
$data = [
'nama' => $this->input->post('nama', true),
'username' => $this->input->post('username', true),
'alamat' => $this->input->post('alamat', true),
'kelamin' => $this->input->post('jk', true),
'telepon' => $this->input->post('telepon', true),
'no_ktp' => $this->input->post('ktp', true),
'password' => password_hash($this->input->post('password', true), PASSWORD_DEFAULT),
'role_id' => '2'
];
$this->db->where('id_customer', $id);
$this->db->update('customer', $data);
}
public function getCustomer($limit, $start, $keyword)
{
if($keyword)
{
$this->db->like('nama', $keyword);
$this->db->or_like('username', $keyword);
$this->db->or_like('telepon', $keyword);
$this->db->or_like('no_ktp', $keyword);
}
return $this->db->get('customer', $limit, $start)->result_array();
}
public function countCustomer()
{
return $this->db->get('customer')->num_rows();
}
}
|
<?php
declare(strict_types=1);
/**
* Copyright © André Flitsch. All rights reserved.
* See license.md for license details.
*/
namespace Pixelperfect\ActiveCampaign\Tests\Unit;
use PHPUnit\Framework\TestCase as PhpUnitTestCase;
/**
* Class TestCase
*
* @package Pixelperfect\ActiveCampaign\Tests\Unit
*/
class TestCase extends PhpUnitTestCase
{
protected static function getMethod(object $obj, string $name, array $args)
{
$class = new \ReflectionClass($obj);
$method = $class->getMethod($name);
$method->setAccessible(true);
return $method;
}
}
|
<?php
require 'start.php';
?>
<style>
#tradetestLink {
background-color: #DDE9FF;
}
</style>
<div class="headerSpacer">
</div>
Setup tests for trades here.
<?php
require_once('menubar.php');
require_once ('end.php');
?>
|
@php
$NavCategories = \App\Category::orderBy('id' , 'desc')->limit(6)->get();
$NavCities = \App\City::orderBy('id' , 'desc')->limit(6)->get();
$NavJobs = \App\Job::orderBy('id' , 'desc')->limit(2)->get();
@endphp
<a href="javascript:" id="return-to-top"><i class="fas fa-angle-double-up"></i></a>
<nav class="cd-dropdown d-block d-sm-block d-md-block d-lg-none d-xl-none">
<h2><a href="{{route('home')}}"> <span><img src="{{url('public/main/images')}}/logo.png" width="60" height="60" alt="img"></span></a></h2>
<a href="#0" class="cd-close">@lang('layout/parts.Close')</a>
<ul class="cd-dropdown-content">
<li><form class="cd-search" action="{{route('search')}}" method="get"><input type="search" name="query" placeholder="@lang('layout/parts.SearchPH')"></form></li>
<li><a href="{{route('home')}}">@lang('layout/parts.Home')</a></li>
<li><a href="{{route('jobs')}}">@lang('layout/parts.Jobs')</a></li>
<li><a href="{{route('about')}}">@lang('layout/parts.About')</a></li>
<li><a href="{{route('companies')}}">@lang('layout/parts.Companies')</a></li>
<li><a href="{{route('blog')}}">@lang('layout/parts.Blog')</a></li>
<li><a href="{{route('contact')}}">@lang('layout/parts.Contact')</a></li>
@guest
<li><a href="{{route('login')}}">@lang('layout/parts.Login')</a></li>
@endguest
@auth
<li>
<a href="{{auth()->user()->DashLink()}}">
@if(auth()->user()->type == 'user')
<i class="fas fa-user"></i>
@else
<i class="fas fa-building"></i>
@endif
{{auth()->user()->name}}</a>
</li>
<li><a href="{{route('logout')}}">@lang('layout/parts.Logout')</a></li>
@endauth
</ul>
<!-- .cd-dropdown-content -->
</nav>
<div class="cp_navi_main_wrapper jb_cover">
<div class="container-fluid">
<div class="cp_logo_wrapper">
<a href="{{route('home')}}">
<img width="100" height="80" src="{{url('public/main/images')}}/logo.png" alt="logo">
</a>
</div>
<!-- mobile menu area start -->
<header class="mobail_menu d-block d-sm-block d-md-block d-lg-none d-xl-none">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="cd-dropdown-wrapper">
<a class="house_toggle" href="#0">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 31.177 31.177" style="enable-background:new 0 0 31.177 31.177;"
xml:space="preserve" width="25px" height="25px">
<g>
<g>
<path class="menubar" d="M30.23,1.775H0.946c-0.489,0-0.887-0.398-0.887-0.888S0.457,0,0.946,0H30.23 c0.49,0,0.888,0.398,0.888,0.888S30.72,1.775,30.23,1.775z" fill="#004165" />
</g>
<g>
<path class="menubar" d="M30.23,9.126H12.069c-0.49,0-0.888-0.398-0.888-0.888c0-0.49,0.398-0.888,0.888-0.888H30.23 c0.49,0,0.888,0.397,0.888,0.888C31.118,8.729,30.72,9.126,30.23,9.126z" fill="#004165" />
</g>
<g>
<path class="menubar" d="M30.23,16.477H0.946c-0.489,0-0.887-0.398-0.887-0.888c0-0.49,0.398-0.888,0.887-0.888H30.23 c0.49,0,0.888,0.397,0.888,0.888C31.118,16.079,30.72,16.477,30.23,16.477z"
fill="#004165" />
</g>
<g>
<path class="menubar" d="M30.23,23.826H12.069c-0.49,0-0.888-0.396-0.888-0.887c0-0.49,0.398-0.888,0.888-0.888H30.23 c0.49,0,0.888,0.397,0.888,0.888C31.118,23.43,30.72,23.826,30.23,23.826z"
fill="#004165" />
</g>
<g>
<path class="menubar" d="M30.23,31.177H0.946c-0.489,0-0.887-0.396-0.887-0.887c0-0.49,0.398-0.888,0.887-0.888H30.23 c0.49,0,0.888,0.398,0.888,0.888C31.118,30.78,30.72,31.177,30.23,31.177z"
fill="#004165" />
</g>
</g>
</svg>
</a>
<!-- .cd-dropdown -->
</div>
</div>
</div>
</div>
<!-- .cd-dropdown-wrapper -->
</header>
<div class="menu_btn_box header_btn jb_cover">
@guest
<ul>
<li>
<a href="{{route('signup')}}"><i class="flaticon-man-user"></i> @lang('layout/parts.Signup')</a>
</li>
<li>
<a href="{{route('login')}}"> <i class="flaticon-login"></i> @lang('layout/parts.Login')</a>
</li>
</ul>
@endguest
@auth
<ul>
<li>
<a href="{{auth()->user()->DashLink()}}">
@if(auth()->user()->type == 'user')
<i class="fas fa-user"></i>
@else
<i class="fas fa-building"></i>
@endif
{{auth()->user()->name}}
</a>
</li>
</ul>
@endauth
</div>
<div class="jb_navigation_wrapper">
<div class="mainmenu d-xl-block d-lg-block d-md-none d-sm-none d-none">
<ul class="main_nav_ul">
<li class="gc_main_navigation"><a href="{{route('home')}}" class="gc_main_navigation active_class">@lang('layout/parts.Home')</a></li>
<li class="gc_main_navigation"><a href="{{route('jobs')}}" class="gc_main_navigation">@lang('layout/parts.Jobs')</a></li>
<li class="has-mega gc_main_navigation kv_sub_menu">
<a href="#" class="gc_main_navigation"> @lang('layout/parts.Candidates')</a>
<!-- mega menu start -->
<ul class="kv_mega_menu">
<li class="kv_mega_menu_width">
<div class="container">
<div class="jn_menu_partion_div">
<div class="candidate_width">
<div class="jen_tabs_conent_list jb_cover">
<h1>@lang('layout/parts.JobType')</h1>
<ul>
<li><a href="{{route('search' , ['type','full'])}}"><i class="fas fa-square"></i>@lang('layout/parts.FullTime')</a></li>
<li><a href="{{route('search' , ['type','part'])}}"><i class="fas fa-square"></i>@lang('layout/parts.PartTime')</a></li>
<li><a href="{{route('search' , ['type','rotation'])}}"><i class="fas fa-square"></i>@lang('layout/parts.Rotation')</a></li>
<li><a href="{{route('search' , ['type','temporary'])}}"><i class="fas fa-square"></i>@lang('layout/parts.Temporary')</a></li>
<li><a href="{{route('search' , ['type','remotely'])}}"><i class="fas fa-square"></i>@lang('layout/parts.Remotely')</a></li>
</ul>
</div>
</div>
<div class="candidate_width">
<div class="jen_tabs_conent_list jb_cover">
<h1>@lang('layout/parts.Categories')</h1>
<ul>
@forelse($NavCategories as $Category)
<li>
<a href="{{route('search' , ['category' , $Category->id])}}"><i class="fas fa-square"></i>{{$Category->title}}</a>
</li>
@empty
<li>@lang('layout/parts.NoData')</li>
@endforelse
</ul>
</div>
</div>
<div class="candidate_width">
<div class="jen_tabs_conent_list jb_cover">
<h1>@lang('layout/parts.JobLocation')</h1>
<ul>
@forelse($NavCities as $City)
<li>
<a href="{{route('search' , ['city' , $City->id])}}"><i class="fas fa-square"></i>{{$City->name}}</a>
</li>
@empty
<li>@lang('layout/parts.NoData')</li>
@endforelse
</ul>
</div>
</div>
<div class="candidate_width">
<div class="jen_tabs_conent_list jb_cover">
<h1>@lang('layout/parts.OpenJobs')</h1>
<div class="open_jobs_wrapper">
@forelse($NavJobs as $Job)
<div class="open_jobs_wrapper_1 jb_cover">
<img src="{{$Job->Company->profile_image}}" alt="{{$Job->Company->name}}">
<div class="open_job_text">
<h3><a href="{{route('job' , $Job->id)}}">{{$Job->title}}</a></h3>
</div>
</div>
@empty
@lang('layout/parts.NoData')
@endforelse
<div class="view_all_job jb_cover"><a href="{{route('jobs')}}">@lang('layout/parts.ViewAllJobs')</a></div>
</div>
</div>
</div>
</div>
</div>
</li>
</ul>
</li>
<li class="gc_main_navigation"><a href="{{route('about')}}" class="gc_main_navigation">@lang('layout/parts.About')</a></li>
<li class="gc_main_navigation"><a href="{{route('companies')}}" class="gc_main_navigation">@lang('layout/parts.Companies')</a></li>
<li class="gc_main_navigation"><a href="{{route('blog')}}" class="gc_main_navigation">@lang('layout/parts.Blog')</a>
<li><a href="{{route('contact')}}" class="gc_main_navigation">@lang('layout/parts.Contact')</a></li>
</ul>
</div>
<!-- mainmenu end -->
<div class="jb_search_btn_wrapper d-none d-sm-none d-md-none d-lg-block d-xl-block">
<!-- extra nav -->
<div class="extra-nav">
<div class="extra-cell">
<button id="quik-search-btn" type="button" class="site-button radius-xl"><i class="fas fa-search"></i></button>
</div>
</div>
<!-- Quik search -->
<div class="dez-quik-search bg-primary-dark">
<form action="{{route('search')}}" method="get">
<input name="search" value="" name="query" type="text" class="form-control" placeholder="@lang('layout/parts.SearchPH')">
<span id="quik-search-remove"><i class="fas fa-times"></i></span>
</form>
</div>
</div>
</div>
</div>
</div>
@if ($errors->any())
<div class="container-fluid">
<div class="row my-5 text-center" width="100%">
<div class="col-md-12 col-xs-12 col-sm-12">
@foreach ($errors->all() as $error)
<div class="notofication-message error-message text-center">{{ $error }}</div>
<br>
@endforeach
</div>
</div>
</div>
@endif
@if(session()->has('success'))
<div class="container-fluid">
<div class="row my-5 text-center" width="100%">
<div class="notofication-message success-message text-center">{{ session()->get('success') }}</div>
</div>
</div>
@endif
@auth
@if(auth()->user()->active == 0 && auth()->user()->type == 'user')
<div>@lang('layout/parts.AccountConfirmP') <a href="{{route('account.activate.resend' , auth()->user()->id)}}">@lang('layout/parts.AccountConfirmAction')</a></div>
@endif
@endauth
|
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\CountrySearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="country-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<?= $form->field($model, 'id') ?>
<?= $form->field($model, 'name') ?>
<?= $form->field($model, 'status') ?>
<?= $form->field($model, 'created_at') ?>
<?= $form->field($model, 'updated_at') ?>
<div class="form-group">
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
|
<?php
/**
* SMILFileAppAction
*
* PHP version 5
*
* @category Class
* @package WowzaApi
* @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Topix\Hackademy\WowzaApi\Model;
/**
* SMILFileAppAction Class Doc Comment
*
* @category Class
* @package WowzaApi
* @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
* @link https://github.com/swagger-api/swagger-codegen
*/
class SMILFileAppAction extends SwaggerModel
{
/**
* The original name of the model.
* @var string
*/
protected static $swaggerModelName = 'SMILFileAppAction';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
*/
protected static $swaggerTypes = array(
'vhostName' => 'string',
'smilfileName' => 'string',
'appName' => 'string',
'serverName' => 'string'
);
/**
* Array of attributes where the key is the local name, and the value is the original name
* @var string[]
*/
protected static $attributeMap = array(
'vhostName' => 'vhostName',
'smilfileName' => 'smilfileName',
'appName' => 'appName',
'serverName' => 'serverName'
);
/**
* Array of attributes to setter functions (for deserialization of responses)
* @var string[]
*/
protected static $setters = array(
'vhostName' => 'setVhostName',
'smilfileName' => 'setSmilfileName',
'appName' => 'setAppName',
'serverName' => 'setServerName'
);
/**
* Array of attributes to getter functions (for serialization of requests)
* @var string[]
*/
protected static $getters = array(
'vhostName' => 'getVhostName',
'smilfileName' => 'getSmilfileName',
'appName' => 'getAppName',
'serverName' => 'getServerName'
);
/**
* Associative array for storing property values
* @var mixed[]
*/
protected $container = array();
/**
* Constructor
* @param mixed[] $data Associated array of property value initalizing the model
*/
public function __construct(array $data = null)
{
$this->container['vhostName'] = isset($data['vhostName']) ? $data['vhostName'] : null;
$this->container['smilfileName'] = isset($data['smilfileName']) ? $data['smilfileName'] : null;
$this->container['appName'] = isset($data['appName']) ? $data['appName'] : null;
$this->container['serverName'] = isset($data['serverName']) ? $data['serverName'] : null;
}
/**
* show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalid_properties = array();
if ($this->container['vhostName'] === null) {
$invalid_properties[] = "'vhostName' can't be null";
}
if ($this->container['smilfileName'] === null) {
$invalid_properties[] = "'smilfileName' can't be null";
}
if ($this->container['appName'] === null) {
$invalid_properties[] = "'appName' can't be null";
}
if ($this->container['serverName'] === null) {
$invalid_properties[] = "'serverName' can't be null";
}
return $invalid_properties;
}
/**
* validate all the properties in the model
* return true if all passed
*
* @return bool True if all properteis are valid
*/
public function valid()
{
if ($this->container['vhostName'] === null) {
return false;
}
if ($this->container['smilfileName'] === null) {
return false;
}
if ($this->container['appName'] === null) {
return false;
}
if ($this->container['serverName'] === null) {
return false;
}
return true;
}
/**
* Gets vhostName
* @return string
*/
public function getVhostName()
{
return $this->container['vhostName'];
}
/**
* Sets vhostName
* @param string $vhostName
* @return $this
*/
public function setVhostName($vhostName)
{
$this->container['vhostName'] = $vhostName;
return $this;
}
/**
* Gets smilfileName
* @return string
*/
public function getSmilfileName()
{
return $this->container['smilfileName'];
}
/**
* Sets smilfileName
* @param string $smilfileName
* @return $this
*/
public function setSmilfileName($smilfileName)
{
$this->container['smilfileName'] = $smilfileName;
return $this;
}
/**
* Gets appName
* @return string
*/
public function getAppName()
{
return $this->container['appName'];
}
/**
* Sets appName
* @param string $appName
* @return $this
*/
public function setAppName($appName)
{
$this->container['appName'] = $appName;
return $this;
}
/**
* Gets serverName
* @return string
*/
public function getServerName()
{
return $this->container['serverName'];
}
/**
* Sets serverName
* @param string $serverName
* @return $this
*/
public function setServerName($serverName)
{
$this->container['serverName'] = $serverName;
return $this;
}
}
|
<?php
/**
* @return int
*/
function intCounter() {
static $counter = 0;
return $counter++;
}
function intRandom($min, $max) {
$range = $max - $min;
if ($range < 1) return $min; // not so random...
$log = ceil(log($range, 2));
$bytes = (int)($log / 8) + 1; // length in bytes
$bits = (int)$log + 1; // length in bits
$filter = (int)(1 << $bits) - 1; // set all lower bits to 1
do {
$rnd = hexdec(bin2hex(openssl_random_pseudo_bytes($bytes)));
$rnd = $rnd & $filter; // discard irrelevant bits
} while ($rnd > $range);
return $min + $rnd;
}
function intFromFloat($float) {
return intval($float);
}
function intFromHex($hex) {
return hexdec($hex);
}
function intFromStr($str) {
return intval($str);
}
function intIsValid($value) {
return is_int($value);
}
function intToHex($value, $zeroPadding = null) {
$result = dechex($value);
return !empty($zeroPadding)
? str_pad($result, $zeroPadding, '0', STR_PAD_LEFT)
: $result;
}
function intToStr($value, $zeroPadding = null) {
$result = (string)(integer)$value;
return !empty($zeroPadding)
? str_pad($result, $zeroPadding, '0', STR_PAD_LEFT)
: $result;
};
|
<?php
namespace Psecio\Parse\Rule;
class BooleanIdentityTest extends RuleTestCase
{
public function parseSampleProvider()
{
return [
['$var === true;', true],
['false === $var;', true],
['$var == $var;', true],
['true == $var;', false],
['false == $var;', false],
['$var == true;', false],
['$var == false;', false],
];
}
protected function buildTest()
{
return new BooleanIdentity;
}
}
|
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\Validator\Test\Unit\Test;
/**
* Integer test validator
*/
class IsInt extends \Zend_Validate_Int implements \Magento\Framework\Validator\ValidatorInterface
{
}
|
<?php
namespace App\Models;
use App\Http\Controllers\CityController;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Customer extends Model
{
use HasFactory;
public function city(){
return $this->belongsTo('App\Models\City');
}
}
|
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePublicationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('publications', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('publications');
}
}
|
<?php
use yii\db\Schema;
use yii\db\Migration;
class m150523_195251_init extends Migration
{
public function up()
{
$this->createTable('document', [
'id' => 'int(21) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY',
'name' => 'varchar(255) NOT NULL',
'description' => 'TEXT NULL'
]);
$this->createTable('file', [
'id' => 'int(21) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY',
'name' => 'VARCHAR(255) NOT NULL',
'original_name' => 'VARCHAR(255) NOT NULL',
'owner_id' => 'INT(21) UNSIGNED NOT NULL',
]);
$this->createIndex('name', 'file', 'name', true);
}
public function down()
{
$this->dropTable('file');
$this->dropTable('document');
}
}
|
@extends('layouts.admin')
@section('title')
<title>Chi tiết hóa đơn </title>
@endsection
@section('breadcrumb')
<div class="page-bar">
<ul class="page-breadcrumb">
<li><a href="{{url('admin') }}">Trang chủ</a><i class="fa fa-circle"></i></li>
<li><a href="{{url('admin/order') }}">Chi tiết hóa đơn</a></li>
</ul>
</div>
@endsection
@section('content')
<h3 class="page-title">
Chi tiết hóa đơn <small>quản lý</small>
</h3>
<div class="row">
<div class="col-md-12">
@include('partials.alert')
<div class="portlet box green margin-top-10">
<div class="portlet-title">
<div class="caption"><i class="fa fa-cogs"></i>Chi tiết hóa đơn </div>
<div class="tools">
<a href="javascript:;" class="collapse"> </a>
<a href="#portlet-config" data-toggle="modal" class="config"> </a>
<a href="javascript:;" class="reload"></a>
<a href="javascript:;" class="remove"></a>
</div>
</div>
<div class="portlet-body flip-scroll">
<table class="table table-bordered table-striped table-condensed flip-content">
<thead class="flip-content">
<tr>
<th> #</th>
<th> Mã hóa đơn</th>
<th> Sản phẩm</th>
<th> Số lượng </th>
<th> Đơn giá</th>
<th> Thành tiền</th>
</tr>
</thead>
<tbody>
@foreach ($list as $key => $item)
<tr>
<td> {{ $key+ $list->firstItem() }} </td>
<td> {{ $item->order_id }} </td>
<td> {{ $item->product->name }} </td>
<td> {{ $item->quantity }} </td>
<td style="color: green;">
<?= number_format($item->price )." " ."VNĐ" ;?>
</td>
<td style="color: red;">
<?= number_format($item->price * $item->quantity)." " ."VNĐ" ;?>
</td>
<td> {{ $item->created_at }} </td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-offset-3 col-md-9">
<a href="{{ url('admin/order') }}" class="btn default">Quay lại</a>
</div>
</div>
<div class="pani">
<ul class="pagination pull-right">
<li>
{!! $list->links() !!}
</li>
</ul>
</div>
</div>
@endsection
|
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model app\models\Subscription */
$this->title = Yii::t('app', 'Update {modelClass}: ', [
'modelClass' => 'Subscription',
]) . ' ' . $model->id;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Subscription'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Yii::t('app', 'Update');
?>
<div class="subscription-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
|
<?php
function db_query($query) {
$connection = mysqli_connect("localhost","root","","guinda");
$result = mysqli_query($connection,$query);
return $result;
}
function edit($tblname,$form_data,$field_id,$id){
$sql = "UPDATE ".$tblname." SET ";
$data = array();
foreach($form_data as $column=>$value){
$data[] =$column."="."'".$value."'";
}
$sql .= implode(',',$data);
$sql.=" where ".$field_id." = ".$id."";
return db_query($sql);
}
function select_id($tblname,$field_name,$field_id){
$sql = "Select * from ".$tblname." where ".$field_name." = ".$field_id."";
$db=db_query($sql);
$GLOBALS['row'] = mysqli_fetch_object($db);
return $sql;
}
function borrar($tblname,$field_id,$id){
$sql = "DELETE FROM `".$tblname."` WHERE `reportes`.`".$field_id."` = ".$id."";
return $db=db_query($sql);
}
?>
|
<?php
/*
+------------------------------------------------------------------------+
| Phalcon Framework |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2016 Phalcon Team (http://www.phalconphp.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file docs/LICENSE.txt. |
| |
| If you did not receive a copy of the license and are unable to |
| obtain it through the world-wide-web, please send an email |
| to license@phalconphp.com so we can send you a copy immediately. |
+------------------------------------------------------------------------+
| Authors: Nikita Vershinin <endeveit@gmail.com> |
+------------------------------------------------------------------------+
*/
namespace Phalcon\Cache\Backend;
/**
* Phalcon\Cache\Backend\Prefixable
*
* Trait for backend cache adapters with support of "prefix" option.
*
* @property string _prefix
* @package Phalcon\Cache\Backend
*/
trait Prefixable
{
/**
* Returns prefixed identifier.
*
* @param string $id
* @return string
*/
protected function getPrefixedIdentifier($id)
{
return $this->_prefix . $id;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.