@ -0,0 +1,40 @@ |
||||
<?php |
||||
|
||||
include './functions.php'; |
||||
|
||||
$hash = $_REQUEST['hash']; |
||||
$tableId = $_REQUEST['tableId']; |
||||
|
||||
|
||||
if(!isset($hash) || !isset($tableId)) die(); |
||||
|
||||
$cnn = db__connect(); |
||||
|
||||
$data = getFinalData($cnn, $tableId); |
||||
|
||||
if($data['average'] > $data['virtualTotals'][$hash]){ |
||||
foreach($data['users'] as $user){ |
||||
$to = $user; |
||||
if($to != $hash) break; |
||||
} |
||||
setBalance($hash, $to, $data['average'] - $data['virtualTotals'][$hash], $tableId, $cnn); |
||||
} |
||||
|
||||
if($data['average'] < $data['virtualTotals'][$hash]){ |
||||
foreach($data['users'] as $user){ |
||||
$to = $user; |
||||
if($to != $hash) break; |
||||
} |
||||
setBalance($to, $hash, - $data['average'] + $data['virtualTotals'][$hash], $tableId, $cnn); |
||||
} |
||||
|
||||
|
||||
db__pushData($cnn, "user", array( |
||||
"state" => '0', |
||||
"updated_at" => date("Y-m-d H:i:s", time()) |
||||
), array( |
||||
"user" => $hash, |
||||
"table" => $tableId |
||||
)); |
||||
|
||||
echo '<script>alert("您已退出!请根据邮件提示进行checkout!!");window.location.href="https://cp-acc.yimian.xyz/"</script>'; |
@ -0,0 +1,28 @@ |
||||
<?php |
||||
include './functions.php'; |
||||
|
||||
$first = $_REQUEST['first']; |
||||
$last = $_REQUEST['last']; |
||||
|
||||
|
||||
if(!isset($first) || !isset($last)) die(); |
||||
|
||||
$cnn = db__connect(); |
||||
|
||||
db__pushData($cnn, "account", array( |
||||
"state" => '1' |
||||
), array( |
||||
"id" => $first |
||||
)); |
||||
|
||||
db__pushData($cnn, "account", array( |
||||
"state" => '1' |
||||
), array( |
||||
"id" => $last |
||||
)); |
||||
|
||||
|
||||
echo '<script> |
||||
alert("收款确认成功"); |
||||
window.location.href="https://cp-acc.yimian.xyz/"; |
||||
</script>'; |
@ -0,0 +1,39 @@ |
||||
<?php |
||||
include './functions.php'; |
||||
|
||||
header("Content-type:application/json"); |
||||
|
||||
$hash = $_REQUEST['hash']; |
||||
$name = $_REQUEST['name']; |
||||
$threshold = $_REQUEST['threshold']; |
||||
|
||||
|
||||
if(!isset($hash) || !isset($name) || !isset($threshold)) die(); |
||||
|
||||
|
||||
$tableId = hash('sha256', time().$hash.$name); |
||||
|
||||
$cnn = db__connect(); |
||||
db__pushData($cnn, "table", array( |
||||
"id" => $tableId, |
||||
"state" => '1', |
||||
"name" => $name, |
||||
"threshold" => $threshold, |
||||
"created_by" => $hash, |
||||
"created_at" => date("Y-m-d H:i:s", time()) |
||||
)); |
||||
|
||||
db__pushData($cnn, "user", array( |
||||
"user" => $hash, |
||||
"table" => $tableId, |
||||
"state" => '1', |
||||
"created_at" => date("Y-m-d H:i:s", time()) |
||||
), array( |
||||
"user" => $hash, |
||||
"table" => $tableId |
||||
)); |
||||
|
||||
|
||||
return json_encode(array( |
||||
"tableId" => $tableId |
||||
)); |
@ -0,0 +1,21 @@ |
||||
<?php |
||||
include './functions.php'; |
||||
header("Content-type:application/json"); |
||||
|
||||
$hash = $_REQUEST['hash']; |
||||
|
||||
|
||||
if(!isset($hash)) die(); |
||||
|
||||
$cnn = connect(); |
||||
$res = db__getData($cnn, "user", "user", $hash, "state", '1'); |
||||
|
||||
$o = []; |
||||
|
||||
foreach($res as $item){ |
||||
array_push($o, getFinalData($cnn, $item['table'])); |
||||
} |
||||
|
||||
|
||||
|
||||
echo json_encode($o); |
@ -0,0 +1,24 @@ |
||||
<?php |
||||
include './functions.php'; |
||||
|
||||
$hash = $_REQUEST['hash']; |
||||
$tableId = $_REQUEST['tableId']; |
||||
|
||||
|
||||
if(!isset($hash) || !isset($tableId)) die(); |
||||
|
||||
|
||||
|
||||
$cnn = db__connect(); |
||||
|
||||
db__pushData($cnn, "user", array( |
||||
"user" => $hash, |
||||
"table" => $tableId, |
||||
"state" => '1', |
||||
"created_at" => date("Y-m-d H:i:s", time()) |
||||
), array( |
||||
"user" => $hash, |
||||
"table" => $tableId |
||||
)); |
||||
|
||||
echo '<script>alert("加入成功!");window.location.href="../"</script>'; |
@ -0,0 +1,52 @@ |
||||
<?php |
||||
|
||||
include './functions.php'; |
||||
|
||||
|
||||
$url = $_REQUEST['url']; |
||||
$passby = $_REQUEST['passby']; |
||||
|
||||
|
||||
if(!isset($hash) || !isset($passby)) die(); |
||||
|
||||
$passby = json_decode(base64_decode($passby), true); |
||||
|
||||
$tableId = $passby['tableId']; |
||||
$value = $passby['value']; |
||||
$hash = $passby['hash']; |
||||
|
||||
$itemId = hash('sha256', time().$hash.$tableId); |
||||
|
||||
$cnn = db__connect(); |
||||
|
||||
db__pushData($cnn, "account", array( |
||||
"id" => $itemId, |
||||
"table" => $tableId, |
||||
"user" => $hash, |
||||
"type" => 'external', |
||||
"state" => '1', |
||||
"value" => $value, |
||||
"url" => $url, |
||||
"created_at" => date("Y-m-d H:i:s", time()) |
||||
)); |
||||
|
||||
|
||||
$data = getFinalData($cnn, $tableId); |
||||
|
||||
$threshold = getThreshold($cnn, $tableId); |
||||
|
||||
while(!checkBalance($data, $threshold)){ |
||||
asort($data['virtualTotals']); |
||||
reset($data['virtualTotals']); |
||||
$first = key($data['virtualTotals']); |
||||
end($data['virtualTotals']); |
||||
$last = key($data['virtualTotals']); |
||||
if($data['average'] - $data['virtualTotals'][$first] > $threshold){ |
||||
setBalance($first, $last, $threshold, $tableId, $cnn); |
||||
} |
||||
$data = getFinalData($cnn, $tableId); |
||||
} |
||||
|
||||
|
||||
|
||||
header("Location: https://cp-acc.yimian.xyz/"); |
@ -0,0 +1,22 @@ |
||||
<?php |
||||
include './functions.php'; |
||||
|
||||
$tableId = $_REQUEST['tableId']; |
||||
$name = $_REQUEST['name']; |
||||
$threshold = $_REQUEST['threshold']; |
||||
|
||||
|
||||
if(!isset($tableId) || !isset($name) || !isset($threshold)) die(); |
||||
|
||||
|
||||
$cnn = db__connect(); |
||||
db__pushData($cnn, "table", array( |
||||
"id" => $tableId, |
||||
"state" => '1', |
||||
"name" => $name, |
||||
"threshold" => $threshold, |
||||
"created_by" => $hash, |
||||
"created_at" => date("Y-m-d H:i:s", time()) |
||||
), array( |
||||
"id" => $tableId |
||||
)); |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 567 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 884 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1019 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 892 B |
After Width: | Height: | Size: 393 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1019 B |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 9.4 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 417 B |
After Width: | Height: | Size: 567 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 884 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 892 B |
After Width: | Height: | Size: 393 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1019 B |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 73 KiB |
After Width: | Height: | Size: 104 KiB |
After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,577 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
|
||||
<head> |
||||
<meta charset="UTF-8"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0"> |
||||
<title>CP Accountant</title> |
||||
|
||||
<!-- Google font file. If you want you can change. --> |
||||
<link href="https://fonts.googleapis.com/css?family=Nunito:300,400,600,700,900" rel="stylesheet"> |
||||
|
||||
<!-- Fontawesome font file css --> |
||||
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css"> |
||||
|
||||
<!-- Animate css file for css3 animations. for more : https://daneden.github.io/animate.css --> |
||||
<!-- Only use animate action. If you dont use animation, you don't have to add.--> |
||||
<link rel="stylesheet" type="text/css" href="https://cdn.yimian.xyz/smart-settlement/css/animate.css"> |
||||
<link rel="stylesheet" type="text/css" href="https://cdn.yimian.xyz/smart-settlement/css/cryptocoins.css"> |
||||
<link rel="stylesheet" type="text/css" href="https://cdn.yimian.xyz/smart-settlement/plugins/c3-chart/c3.css"> |
||||
|
||||
<!-- Template global css file. Requared all pages --> |
||||
<link rel="stylesheet" type="text/css" href="https://cdn.yimian.xyz/smart-settlement/css/global.style.css"> |
||||
|
||||
<!-- Swiper slider css file --> |
||||
<link rel="stylesheet" href="https://cdn.yimian.xyz/smart-settlement/css/swiper.min.css"> |
||||
|
||||
<!--turbo slider plugin css file --> |
||||
<link rel="stylesheet" type="text/css" href="https://cdn.yimian.xyz/smart-settlement/css/bootstrap.min.css"> |
||||
<link rel="stylesheet" type="text/css" href="https://cdn.yimian.xyz/smart-settlement/plugins/turbo-slider/turbo.css"> |
||||
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.yimian.xyz/shaky/shaky.css"> |
||||
<script>var block_aplayer = true;</script> |
||||
<script type="text/javascript" src="https://cdn.yimian.xyz/ushio-js/ushio-head.min.js"></script> |
||||
<script type="text/javascript">page.auth = ['email', 'nickname'];</script> |
||||
</head> |
||||
|
||||
<body> |
||||
|
||||
<div class="wrapper "> |
||||
<div class="nav-menu"> |
||||
<nav class="menu"> |
||||
|
||||
<!-- Menu navigation start --> |
||||
<div class="nav-container"> |
||||
<ul class="main-menu"> |
||||
<li class="active"> |
||||
<a href="index.html"><img src="https://cdn.yimian.xyz/smart-settlement/img/content/icons/1.png" alt=""><strong class="special">Dashboard</strong> </a> |
||||
</li> |
||||
<li class=""> |
||||
<a href="records.html"><img src="https://cdn.yimian.xyz/smart-settlement/img/content/icons/6.png" alt=""><strong class="special">History Payment</strong> </a> |
||||
</li> |
||||
|
||||
<li class=""> |
||||
<a href="setTable.html"><img src="img/content/icons/11.png" alt=""><strong>Settings</strong> </a> |
||||
</li> |
||||
<li class=""> |
||||
<a href="https://login.yimian.xyz/logout.html" data-loader="show"><img src="https://cdn.yimian.xyz/smart-settlement/img/content/icons/7.png" alt=""><strong>Log out</strong></a> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
<!-- Menu navigation end --> |
||||
</nav> |
||||
</div> |
||||
<div class="wrapper-inline"> |
||||
<!-- Header area start --> |
||||
<header class="no-background"> <!-- extra class no-background --> |
||||
|
||||
<div class="search-button" data-search="open"> |
||||
<img id="no-icon" src="https://cdn.yimian.xyz/smart-settlement/img/content/notification-no.png" class="not-icon1" alt=""> |
||||
<img id="no-icon2" src="https://cdn.yimian.xyz/smart-settlement/img/content/notification2-no.png" class="not-icon2" alt=""> |
||||
</div> |
||||
|
||||
<div class="navi-menu-button"> |
||||
<em></em> |
||||
<em></em> |
||||
<em></em> |
||||
</div> |
||||
|
||||
</header> |
||||
<!-- Header area end --> |
||||
|
||||
<!--NOTIFICATION BOX CONTENT START--> |
||||
<div class="search-form"> |
||||
<span class="close-search-form" data-search="close"><i class="fa fa-times"></i> </span> |
||||
<form> |
||||
<div class="search-input"> |
||||
<br/> |
||||
</div> |
||||
</form> |
||||
<ul class="notification-list list-unstyled" id="no-content"> |
||||
</ul> |
||||
</div> |
||||
<!--NOTIFICATION BOX CONTENT END--> |
||||
|
||||
<!-- Page content start --> |
||||
<main class="margin mt-0"> |
||||
|
||||
<div class="dash-balance"> |
||||
<div class="dash-content relative"> |
||||
<h3 class="w-text">ERP for CP Home</h3> |
||||
<div class="notification"> |
||||
<h3 class="w-text" id="usr">xxx</h3> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<section class="bal-section container"> |
||||
<div class="balance-card mb-15"> |
||||
<div class="d-flex align-items-center"> |
||||
<div class="d-flex flex-grow"> |
||||
<div class="mr-auto"> |
||||
<h1 class="b-val"> £<span id="week-avg"></span> </h1> |
||||
<p class="g-text mb-10">Weekly Payment</p> |
||||
<div class="badge badge-pill" id="week-avg-rate"> 43.55% <i style="color:red;" class="fa fa-arrow-down ml-10"></i></div> |
||||
</div> |
||||
<div class="ml-auto align-self-end"> |
||||
<div id="sparkline1"></div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="resources-card-wrapper"> |
||||
<div class="resources-card mr-10"> |
||||
<div class="d-flex flex-column flex-md-row"> |
||||
<i class="fa fa-shield text-primary"></i> |
||||
<div class="d-flex flex-column ml-md-2"> |
||||
<p class="text-muted mb-10 font-weight-medium">Total Payment</p> |
||||
<div class="progress"> |
||||
<div class="progress-bar bg-primary" id="total-bar" role="progressbar" style="width: 97%"></div> |
||||
</div> |
||||
<h4 class="mt-10 mb-0">£<span id="total"></span> </h4> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="resources-card ml-10"> |
||||
<div class="d-flex flex-column flex-md-row"> |
||||
<i class="fa fa fa-shopping-cart txt-green"></i> |
||||
<div class="d-flex flex-column ml-md-2"> |
||||
<p class="text-muted mb-10 font-weight-medium">Your Payment</p> |
||||
<div class="progress"> |
||||
<div class="progress-bar bg-success" id="total-usr-bar" role="progressbar" style="width: 67%"></div> |
||||
</div> |
||||
<h4 class="mt-10 mb-0">£<span id="total-usr"></span> </h4> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</section> |
||||
<br/> |
||||
<section> |
||||
<div class="content"> |
||||
<div class="wallet-address"> |
||||
<h4 class="w-text mt-0">Report New Payment</h4> |
||||
<div class="form-row-group with-icons"> |
||||
<div class="form-row no-padding"> |
||||
<i>£</i> |
||||
<input type="text" id="aaa" class="form-element"> |
||||
</div> |
||||
</div> |
||||
<h4><a id="submit-a" href="#">Submit</a></h4> |
||||
<p class="g-text mb-0">Be Careful when Input..</p> |
||||
</div> |
||||
</div> |
||||
</section> |
||||
|
||||
<section class="container"> |
||||
<div class="content"> |
||||
<h4 class="title-main">Daily Payment Trend</h4> |
||||
<div class="c-panel pl-0"> |
||||
|
||||
<div class="row align-items-center"> |
||||
<div class="col-12"> |
||||
<div class="advertising-wrapper"> |
||||
<div id="barAreaGraph" ></div> |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
</section> |
||||
<section class="container"> |
||||
<div class="content"> |
||||
<h4 class="title-main">Bill Split</h4> |
||||
<div class="c-panel"> |
||||
|
||||
<div class="row align-items-center"> |
||||
<div class="col-12 col-sm-6"> |
||||
<div class="advertising-wrapper"> |
||||
<div id="advertising" class="chart-height-sm"></div> |
||||
<h3 class="info-label"><span>Variance</span> <span id="a-balance"></span></h3> |
||||
</div> |
||||
</div> |
||||
<div class="col-12 col-sm-6"> |
||||
<div class="split-list"> |
||||
<ul class="adv-stats"> |
||||
<li> |
||||
<i class="fa fa-circle-o"></i> |
||||
mingran <span id="a-mingran">22%</span> |
||||
</li> |
||||
<li> |
||||
<i class="fa fa-circle-o "></i> |
||||
boyao <span id="a-boyao">11%</span> |
||||
</li> |
||||
<li> |
||||
<i class="fa fa-circle-o"></i> |
||||
yimian <span id="a-yimian">40%</span> |
||||
</li> |
||||
<li> |
||||
<i class="fa fa-circle-o"></i> |
||||
xiaotian <span id="a-xiaotian">17%</span> |
||||
</li> |
||||
<li> |
||||
<i class="fa fa-circle-o"></i> |
||||
hao <span id="a-hao">10%</span> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</section> |
||||
|
||||
<section class="container"> |
||||
<h4 class="title-main">Recent Transactions</h4> |
||||
<ul class="transaction-list list-unstyled" id="account-events"> |
||||
</ul> |
||||
</section> |
||||
|
||||
<footer> |
||||
<div class="container"> |
||||
<ul> |
||||
<li><a id="ushio-blog" href="https://www.eee.dog"><i class="fa fa-home"></i></a></li> |
||||
<li><a href="https://github.com/iotcat"><i class="fa fa-github"></i></a></li> |
||||
<li><a href="mailto:i@yimian.xyz"><i class="fa fa-envelope"></i></a></li> |
||||
<li><a href="https://www.eee.dog/feed"><i class="fa fa-rss"></i></a></li> |
||||
</ul> |
||||
<p>© 2018-<script type="text/javascript">document.write(new Date().getFullYear());</script> Made with <span class="shaky"><i style="color:red;" class="fa fa-heart"></i></span> by <a id="ushio-tome" href="https://iotcat.me">iotcat</a></p> |
||||
</div> |
||||
</footer> |
||||
</main> |
||||
<!-- Page content end --> |
||||
</div> |
||||
</div> |
||||
|
||||
<!--Page loader DOM Elements. Requared all pages--> |
||||
<div class="sweet-loader"> |
||||
<div class="box"> |
||||
<div class="circle1"></div> |
||||
<div class="circle2"></div> |
||||
<div class="circle3"></div> |
||||
</div> |
||||
</div> |
||||
<script type="text/javascript" src="https://cdn.yimian.xyz/ushio-js/ushio-footer.min.js"></script> |
||||
|
||||
<!-- JQuery library file. requared all pages --> |
||||
<script src="https://cdn.yimian.xyz/smart-settlement/js/jquery-3.2.1.min.js"></script> |
||||
|
||||
<!-- Swiper JS --> |
||||
<script src="https://cdn.yimian.xyz/smart-settlement/js/swiper.min.js"></script> |
||||
|
||||
<!-- Initialize Swiper --> |
||||
|
||||
<!-- Flot Charts --> |
||||
<script src="https://cdn.yimian.xyz/smart-settlement/plugins/c3-chart/c3.min.js"></script> |
||||
<script src="https://cdn.yimian.xyz/smart-settlement/plugins/c3-chart/d3.min.js"></script> |
||||
<script src="https://cdn.yimian.xyz/smart-settlement/plugins/c3-chart/c3.custom.js"></script> |
||||
<!-- Flot Charts --> |
||||
<script src="https://cdn.yimian.xyz/smart-settlement/plugins/flot/jquery.flot.min.js"></script> |
||||
<script src="https://cdn.yimian.xyz/smart-settlement/plugins/flot/jquery.flot.time.min.js"></script> |
||||
<script src="https://cdn.yimian.xyz/smart-settlement/plugins/flot/jquery.flot.pie.min.js"></script> |
||||
<script src="https://cdn.yimian.xyz/smart-settlement/plugins/flot/jquery.flot.tooltip.min.js"></script> |
||||
<script src="https://cdn.yimian.xyz/smart-settlement/plugins/flot/jquery.flot.resize.min.js"></script> |
||||
<!-- Sparkline--> |
||||
<script src="https://cdn.yimian.xyz/smart-settlement/plugins/jquery-sparkline/jquery.sparkline.js"></script> |
||||
|
||||
<!-- Template global script file. requared all pages --> |
||||
<script src="https://cdn.yimian.xyz/smart-settlement/js/app-charts.js"></script> |
||||
<script src="https://cdn.yimian.xyz/smart-settlement/js/global.script.js"></script> |
||||
|
||||
|
||||
<script type="text/javascript"> |
||||
session.onload(function(){ |
||||
if(page.params.hasOwnProperty('type') && page.params.type == 'join'){ |
||||
|
||||
window.location.href="./api/joinTable.php?hash="+session.get('hash')+'&tableId='+page.params.tableId; |
||||
return; |
||||
} |
||||
|
||||
$.get('./api/getData.php?hash='+session.get('hash'), function(data){ |
||||
if(!data.length){ |
||||
alert('请先创建一个公共账户!'); |
||||
window.location.href="./setTable.html"; |
||||
return; |
||||
} |
||||
|
||||
window.data = data; |
||||
|
||||
$('#usr').html('Hi~ '+session.get('nickname')); |
||||
$('#total').html(Number(data.total)); |
||||
$('#total-usr').html(Number(data['actualTotals'][session.get('hash')])); |
||||
$('#total-usr-bar').css('width', (data['actualTotals'][session.get('hash')] / data.average)*100+'%'); |
||||
|
||||
|
||||
|
||||
|
||||
var lastWeekTotal, lastSecodeWeekTotal; |
||||
data.items.foreach(function(item)=>{ |
||||
if(item.tiemstamp > new Date().valueOf() - 7*24*60*1000){ |
||||
lastWeekTotal += item.value; |
||||
}else if(item.tiemstamp > new Date().valueOf() - 14*24*60*1000){ |
||||
lastSecodeWeekTotal += item.value; |
||||
} |
||||
}); |
||||
|
||||
|
||||
$('#week-avg').html(Number(lastWeekTotal/7).toFixed(2)); |
||||
$('#total-bar').css('width', (data['actualTotals'][session.get('hash')] / lastWeekTotal)*100+'%'); |
||||
if(lastWeekTotal > lastSecodeWeekTotal) $('#week-avg-rate').html(((lastWeekTotal - lastSecodeWeekTotal)/lastSecodeWeekTotal).toFixed(2)+'% <i style="color:red;" class="fa fa-arrow-up ml-10"></i>'); |
||||
if(lastSecodeWeekTotal < lastSecodeWeekTotal) $('#week-avg-rate').html(((lastSecodeWeekTotal - lastWeekTotal)/lastSecodeWeekTotal).toFixed(2)+'% <i style="color:green;" class="fa fa-arrow-down ml-10"></i>'); |
||||
|
||||
|
||||
|
||||
var show = []; |
||||
for(var i = data['items'].length; i > data['items'].length-10; i --){ |
||||
if(data['items'][i]['value'] > 0 && data['items'][i]['type'] != 'innerT') |
||||
show.push(data['items'][i]); |
||||
} |
||||
var s = ''; |
||||
show.forEach((i)=>{ |
||||
|
||||
|
||||
s += ` |
||||
<li> |
||||
<div class="d-flex align-items-center justify-content-between"> |
||||
<div class="d-flex align-items-center"> |
||||
<img class="img-xs" src="https://cdn.yimian.xyz/smart-settlement/img/content/coin`; |
||||
if(i.type == "external") s += 3; |
||||
if(i.type == "innerF" && !i.state) s += 4; |
||||
if(i.type == "innerF" && i.state) s += 5; |
||||
s += `.png" alt="coin image"> |
||||
<div class="ml-10"> |
||||
<h4 class="coin-name">`; |
||||
s += i.type; |
||||
if(i.type == "external") s += ' - ' + data.usersName[i.user] |
||||
if(i.type == "innerF" && !i.state) s += ' - ' + data.usersName[i.user] + ' -> ' + data.usersName[i.comments]; |
||||
if(i.type == "innerF" && i.state) s += ' - ' + data.usersName[i.user] + ' 👍 ' + data.usersName[i.comments]; |
||||
s += `</h4> |
||||
<small class="text-muted">`; |
||||
s += i.created_at; |
||||
s += `</small> |
||||
</div> |
||||
</div> |
||||
<div> |
||||
`; |
||||
if(i.type == 'external') s += `<small class="d-block mb-0 txt-red">£`+(i.value.toFixed(2) + `</small>`; |
||||
|
||||
s += ` |
||||
<small class="text-muted d-block">£`; |
||||
s += Number(i.value); |
||||
|
||||
s += `</small> |
||||
</div> |
||||
</div> |
||||
</li> |
||||
`; |
||||
|
||||
|
||||
|
||||
}); |
||||
|
||||
|
||||
$('#account-events').html(s); |
||||
|
||||
|
||||
var userNotice = []; |
||||
data['itemsByUser'][session.get('hash')].forEach((item)=>{ |
||||
if(!item.state){ |
||||
userNotice.push(item); |
||||
} |
||||
}); |
||||
|
||||
function notice(){ |
||||
var s = ''; |
||||
|
||||
if(!userNotice.length){ |
||||
s += ` |
||||
<li> |
||||
<div class="d-flex align-items-center justify-content-between"> |
||||
<div class="d-flex align-items-center"> |
||||
<div class=""> |
||||
<h5 class="coin-name">You have NO notifications!!</h5> |
||||
</div> |
||||
</div> |
||||
<div> |
||||
<a href=""></a> |
||||
</div> |
||||
</div> |
||||
</li>`; |
||||
$('#no-content').html(s); |
||||
$("#no-icon").attr("src", 'https://cdn.yimian.xyz/smart-settlement/img/content/notification-no.png'); |
||||
$("#no-icon2").attr("src", 'https://cdn.yimian.xyz/smart-settlement/img/content/notification2-no.png'); |
||||
return; |
||||
} |
||||
|
||||
|
||||
s += ` |
||||
<li> |
||||
<div class="d-flex align-items-center justify-content-between"> |
||||
<div class="d-flex align-items-center"> |
||||
<div class=""> |
||||
<h5 class="coin-name">Your last `; |
||||
|
||||
s += userNotice.length; |
||||
s += ` notifications</h5> |
||||
</div> |
||||
</div> |
||||
<div> |
||||
<a href=""></a> |
||||
</div> |
||||
</div> |
||||
</li>`; |
||||
|
||||
userNotice.forEach(function(item){ |
||||
s += ` |
||||
<li> |
||||
<div class="d-flex align-items-center justify-content-between"> |
||||
<div class="d-flex align-items-center"> |
||||
<div class="notice-icon `; |
||||
if(item.value < 0) s += `available`; |
||||
if(item.value > 0) s += `away`; |
||||
|
||||
s += `"> |
||||
<i class="fa fa-`; |
||||
if(item.value < 0) s += `check`; |
||||
if(item.value > 0) s += `clock-o`; |
||||
s += `"></i> |
||||
</div> |
||||
<div class="ml-10"> |
||||
<h4 class="coin-name">`; |
||||
|
||||
if(item.value < 0) s += `You will Get £50 from `+ data.usersName[item.comments] + ` <button style="color: green;" onClick="javascript:confirm(`+item.created_at+`);">Confirm to Recived</button>`; |
||||
if(item.value > 0) s += `Please Give £50 to `+ data.usersName[item.comments]; |
||||
|
||||
s += `</h4> |
||||
<small class="text-muted">`; |
||||
s += timeago(new Date(item.created_at.replace(/-/g, '/')).getTime()); |
||||
s += `</small> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</li>`; |
||||
}); |
||||
|
||||
s += ` |
||||
<li> |
||||
<div class="d-flex align-items-center justify-content-between"> |
||||
<div class="d-flex align-items-center"> |
||||
<a href="" class="text-muted">The end of all notifications</a> |
||||
</div> |
||||
</div> |
||||
</li>`; |
||||
|
||||
$('#no-content').html(s); |
||||
$("#no-icon").attr("src", 'https://cdn.yimian.xyz/smart-settlement/img/content/notification-yes.png'); |
||||
$("#no-icon2").attr("src", 'https://cdn.yimian.xyz/smart-settlement/img/content/notification2-yes.png'); |
||||
|
||||
}; |
||||
|
||||
|
||||
|
||||
notice(); |
||||
|
||||
|
||||
}); |
||||
|
||||
}); |
||||
|
||||
$("#aaa").bind("input propertychange",function(event){ |
||||
console.log($("#aaa").val()); |
||||
$("#aaa").val(clearNoNum($("#aaa").val())) |
||||
}); |
||||
$("#submit-a").click(function(){ |
||||
if(!$('#aaa').val()) { |
||||
alert('illegal input'); |
||||
return; |
||||
} |
||||
window.location.href='https://imgbed.yimian.xyz/imgbed/api.html?redirect=https://cp-acc.yimian.xyz/api/newItem.php&passby='+btoa(JSON.stringify({ |
||||
tableId: data.id, |
||||
hash: session.get('hash'), |
||||
value: $("#aaa").val() |
||||
})); |
||||
}); |
||||
|
||||
|
||||
/* notification func */ |
||||
|
||||
function timeago(dateTimeStamp){ //dateTimeStamp是一个时间毫秒,注意时间戳是秒的形式,在这个毫秒的基础上除以1000,就是十位数的时间戳。13位数的都是时间毫秒。 |
||||
var minute = 1000 * 60; //把分,时,天,周,半个月,一个月用毫秒表示 |
||||
var hour = minute * 60; |
||||
var day = hour * 24; |
||||
var week = day * 7; |
||||
var halfamonth = day * 15; |
||||
var month = day * 30; |
||||
var now = new Date().getTime(); //获取当前时间毫秒 |
||||
var diffValue = now - dateTimeStamp;//时间差 |
||||
|
||||
if(diffValue < 0){ |
||||
return; |
||||
} |
||||
var minC = diffValue/minute; //计算时间差的分,时,天,周,月 |
||||
var hourC = diffValue/hour; |
||||
var dayC = diffValue/day; |
||||
var weekC = diffValue/week; |
||||
var monthC = diffValue/month; |
||||
if(monthC >= 1 && monthC <= 3){ |
||||
result = " " + parseInt(monthC) + "month ago" |
||||
}else if(weekC >= 1 && weekC <= 3){ |
||||
result = " " + parseInt(weekC) + "week ago" |
||||
}else if(dayC >= 1 && dayC <= 6){ |
||||
result = " " + parseInt(dayC) + "day ago" |
||||
}else if(hourC >= 1 && hourC <= 23){ |
||||
result = " " + parseInt(hourC) + "hours ago" |
||||
}else if(minC >= 1 && minC <= 59){ |
||||
result =" " + parseInt(minC) + "minutes ago" |
||||
}else if(diffValue >= 0 && diffValue <= minute){ |
||||
result = "just now" |
||||
}else { |
||||
var datetime = new Date(); |
||||
datetime.setTime(dateTimeStamp); |
||||
var Nyear = datetime.getFullYear(); |
||||
var Nmonth = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1; |
||||
var Ndate = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate(); |
||||
var Nhour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours(); |
||||
var Nminute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes(); |
||||
var Nsecond = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds(); |
||||
result = Nyear + "-" + Nmonth + "-" + Ndate |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
function confirm(created_at){ |
||||
|
||||
var arr = []; |
||||
|
||||
data['items'].forEach((item)=>{ |
||||
if(item.created_at == created_at){ |
||||
arr.push(item.id); |
||||
} |
||||
}); |
||||
|
||||
$.post('https://cp-acc.yimian.xyz/api/confirmBalance.php&first='+arr[0]+'&last='+arr[1], function(res){ |
||||
notice(); |
||||
}); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
|
||||
<script language="JavaScript" type="text/javascript"> |
||||
function clearNoNum(value){ |
||||
value = value.replace(/[^\d.]/g,""); //清除“数字”和“.”以外的字符 |
||||
value = value.replace(/^\./g,""); //验证第一个字符是数字而不是. |
||||
value = value.replace(/\.{2,}/g,"."); //只保留第一个. 清除多余的. |
||||
value = value.replace(".","$#$").replace(/\./g,"").replace("$#$","."); |
||||
return value; |
||||
} |
||||
</script> |
||||
|
||||
</body> |
||||
|
||||
</html> |
@ -0,0 +1,177 @@ |
||||
var $danger = "#D66061"; |
||||
var $yellow = "#ffee00"; |
||||
|
||||
|
||||
// Sparkline Graphs
|
||||
$(function () { |
||||
$('#projects').sparkline([320,250,400,380,280,320,220,385,450], { |
||||
type: 'line', |
||||
lineWidth: 3, |
||||
fillColor: false, |
||||
lineColor: '#058DC7', |
||||
spotColor: '#e13f3d', |
||||
minSpotColor: '#50B432', |
||||
maxSpotColor: '#f7b53c', |
||||
highlightSpotColor: '#', |
||||
height: 60, |
||||
width: 120, |
||||
spotRadius: 6, |
||||
}); |
||||
$('#sparkline1').sparkline([5, 6, 2, 8, 9, 4, 7, 10, 11, 12, 7], { |
||||
type: 'bar', |
||||
height: '80', |
||||
barWidth: '10', |
||||
barWidth: 2, |
||||
barSpacing: 10, |
||||
chartRangeMin: 0, |
||||
barColor: '#e6ecf5' |
||||
}); |
||||
|
||||
$("#downloads").sparkline([290,320,310,365,420,320,350,370,320], { |
||||
type: 'bar', |
||||
barWidth: 10, |
||||
height: 60, |
||||
width: 120,
|
||||
barSpacing: 5, |
||||
barColor: '#058DC7', |
||||
negBarColor: '#ffffaa' |
||||
}); |
||||
$(".watch1").sparkline([2,4,4,6,8,5,6,4,8,6,6,2 ], { |
||||
type: 'line', |
||||
width: '100%', |
||||
height: '80', |
||||
lineColor: '#13dafe', |
||||
fillColor: 'rgba(19, 218, 254, 0.3)', |
||||
maxSpotColor: '#99d683', |
||||
highlightLineColor: 'rgba(0, 0, 0, 0.2)', |
||||
highlightSpotColor: 'rgba(0,0,0,.2)' |
||||
}); |
||||
$('.watch2').sparkline([0,13,10,14,15,10,18,15,19], { |
||||
type: 'line', |
||||
width: '100%', |
||||
height: '80', |
||||
lineColor: '#6164c1', |
||||
fillColor: 'rgba(97, 100, 193, 0.3)', |
||||
highlightLineColor: 'rgba(0,0,0,.1)', |
||||
highlightSpotColor: 'rgba(0,0,0,.2)' |
||||
}); |
||||
$(".watch3").sparkline([0,2,8,6,8,5,6,4,8,6,6,2 ], { |
||||
type: 'line', |
||||
width: '100%', |
||||
height: '80', |
||||
lineColor: '#fa8282', |
||||
fillColor: 'rgba(255,211,152,.8)', |
||||
minSpotColor:'#13dafe', |
||||
maxSpotColor: '#13dafe', |
||||
highlightLineColor: 'rgba(0, 0, 0, 0.2)', |
||||
highlightSpotColor: '#13dafe' |
||||
}); |
||||
$(".watch4").sparkline([3,7,5,6,8,7,6,7,8,6,6,9 ], { |
||||
type: 'line', |
||||
width: '100%', |
||||
height: '80', |
||||
lineColor: '#13dafe', |
||||
fillColor: 'rgba(153,214,131,.7)', |
||||
minSpotColor:'#13dafe', |
||||
maxSpotColor: '#13dafe', |
||||
highlightLineColor: 'rgba(0, 0, 0, 0.2)', |
||||
highlightSpotColor: '#13dafe' |
||||
}); |
||||
$(".watch5").sparkline([2,5,6,6,9,5,7,7,8,5,6,8 ], { |
||||
type: 'line', |
||||
width: '100%', |
||||
height: '80', |
||||
lineColor: '#fc6180', |
||||
fillColor: 'rgba(252, 97, 128, 0.3)', |
||||
maxSpotColor: '#99d683', |
||||
highlightLineColor: 'rgba(0, 0, 0, 0.2)', |
||||
highlightSpotColor: 'rgba(0,0,0,.2)' |
||||
}); |
||||
|
||||
$(".profile1").sparkline([0,2,8,6,8,5,6,4,8,6,6,2 ], { |
||||
type: 'bar', |
||||
width: '100%', |
||||
height: '50', |
||||
barColor: '#fa8282', |
||||
fillColor: 'rgba(255,211,152,.8)', |
||||
minSpotColor:'#13dafe', |
||||
maxSpotColor: '#13dafe', |
||||
highlightLineColor: 'rgba(0, 0, 0, 0.2)', |
||||
highlightSpotColor: '#13dafe' |
||||
}); |
||||
$(".profile2").sparkline([3,7,5,6,8,7,6,7,8,6,6,9 ], { |
||||
type: 'bar', |
||||
width: '100%', |
||||
height: '50', |
||||
barColor: '#13dafe', |
||||
fillColor: 'rgba(153,214,131,.7)', |
||||
minSpotColor:'#13dafe', |
||||
maxSpotColor: '#13dafe', |
||||
highlightLineColor: 'rgba(0, 0, 0, 0.2)', |
||||
highlightSpotColor: '#13dafe' |
||||
}); |
||||
$(".profile3").sparkline([2,5,6,6,9,5,7,7,8,5,6,8 ], { |
||||
type: 'bar', |
||||
width: '100%', |
||||
height: '50', |
||||
barColor: '#72a1ec' |
||||
}); |
||||
|
||||
$("#total-applications").sparkline([212,257,284,315,365,383,358,371,329,295,321,392,316,423,477,495,419], { |
||||
type: 'line', |
||||
lineWidth: 3, |
||||
fillColor: false, |
||||
lineColor: '#058DC7', |
||||
spotColor: '#e13f3d', |
||||
minSpotColor: '#50B432', |
||||
maxSpotColor: '#f7b53c', |
||||
highlightSpotColor: '#', |
||||
height: 40, |
||||
width: 180, |
||||
spotRadius: 5, |
||||
}); |
||||
}); |
||||
|
||||
|
||||
// Flot Donut Chart
|
||||
$(function () { |
||||
var data, chartOptions; |
||||
data = [ |
||||
{ label: "", data: Math.floor (Math.random() * 100 + 140) },
|
||||
{ label: "", data: Math.floor (Math.random() * 100 + 30) }, |
||||
{ label: "", data: Math.floor (Math.random() * 100 + 60) },
|
||||
{ label: "", data: Math.floor (Math.random() * 100 + 90) },
|
||||
{ label: "", data: Math.floor (Math.random() * 100 + 120) },
|
||||
]; |
||||
chartOptions = {
|
||||
series: { |
||||
pie: { |
||||
show: true,
|
||||
innerRadius: .8,
|
||||
stroke: { |
||||
width: 1, |
||||
} |
||||
} |
||||
},
|
||||
shadowSize: 0, |
||||
legend: { |
||||
position: 'sw' |
||||
}, |
||||
tooltip: true, |
||||
|
||||
tooltipOpts: { |
||||
content: '%s: %y' |
||||
}, |
||||
grid:{ |
||||
hoverable: false, |
||||
clickable: false, |
||||
borderWidth: 0, |
||||
}, |
||||
shadowSize: 0, |
||||
colors: ['#F782AA', '#0084B4', '#3FC5AC', '#FFD06B', '#CCCCCC'], |
||||
}; |
||||
var holder = $('#advertising'); |
||||
if (holder.length) { |
||||
$.plot(holder, data, chartOptions ); |
||||
}
|
||||
}); |
@ -0,0 +1,281 @@ |
||||
"use strict"; |
||||
|
||||
$(document).ready(function(){ |
||||
|
||||
$('.navi-menu-button').on('click', function(e){ |
||||
navMenuOpen(); |
||||
}); |
||||
|
||||
$('.nav-menu').on('click', function(e){ |
||||
if ($(e.target).hasClass('nav-menu')){ |
||||
navMenuClose(); |
||||
} |
||||
}); |
||||
|
||||
$('nav.menu ul.main-menu>li>a').on('click', function(e){ |
||||
var that = $(this); |
||||
if (that.parent().find('ul:first').length) |
||||
{ |
||||
e.preventDefault(); |
||||
if (!that.parent().hasClass('active')) |
||||
{ |
||||
$('nav.menu ul.main-menu ul').slideUp('fast',function(){ |
||||
$('nav.menu ul.main-menu > li').removeClass('active'); |
||||
}); |
||||
|
||||
$('nav.menu ul li a span').removeClass('fa-angle-up').addClass('fa-angle-down'); |
||||
|
||||
|
||||
that.parent().find('ul:first').slideDown('fast',function(){ |
||||
that.parent().addClass('active'); |
||||
}); |
||||
|
||||
that.find('span').removeClass('fa-angle-down').addClass('fa-angle-up'); |
||||
} |
||||
else |
||||
{ |
||||
|
||||
that.parent().find('ul:first').slideUp('fast',function(){ |
||||
$(this).parent().removeClass('active'); |
||||
}); |
||||
that.find('span').removeClass('fa-angle-up').addClass('fa-angle-down'); |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
$('nav.menu ul.main-menu ul').slideUp('fast'); |
||||
$('nav.menu ul.main-menu > li').removeClass('active'); |
||||
that.parent().addClass('active'); |
||||
} |
||||
}); |
||||
|
||||
|
||||
$('.tab-item .fix-width .menu-item').css({'width': 100/$('.tab-item .fix-width .menu-item').length+'%'}); |
||||
|
||||
if ($('.wizard').length) |
||||
{ |
||||
wizardFixHeight(); |
||||
$(window).resize(); |
||||
} |
||||
|
||||
if ($('.wizard').length) { |
||||
$(".wizard").Turbo({ |
||||
items:1, |
||||
circular:false |
||||
}); |
||||
} |
||||
|
||||
if ($('.animated-text').length) |
||||
animateText(); |
||||
|
||||
}); |
||||
|
||||
|
||||
$(".wrapper-inline").on("scroll", function(e) { |
||||
if (this.scrollTop > 150) { |
||||
$('header.no-background').addClass("set-bg"); |
||||
} else { |
||||
$('header.no-background').removeClass("set-bg"); |
||||
} |
||||
|
||||
}); |
||||
|
||||
var navMenuOpen = function(){ |
||||
$('.navi-menu-button').addClass('focused'); |
||||
|
||||
$('div.nav-menu').fadeIn(50,function(e){ |
||||
$('nav.menu').addClass('opened'); |
||||
}); |
||||
} |
||||
|
||||
var navMenuClose = function(){ |
||||
$('.navi-menu-button').removeClass('focused'); |
||||
|
||||
$('nav.menu').removeClass('opened'); |
||||
$('div.nav-menu').fadeOut(200); |
||||
} |
||||
|
||||
var wizardFixHeight = function(){ |
||||
$(window).on('resize', function(e){ |
||||
$('.wizard .wizard-item').height($(window).height()-50); |
||||
}); |
||||
} |
||||
|
||||
var animateText = function(){ |
||||
$('.vertical-center').css({'margin-top':$(window).height()/2 - $('.vertical-center').height()/2}); |
||||
$('.animated-text').removeClass('zero-opacity'); |
||||
$('[data-transation]').each(function(e,i){ |
||||
var that = $(this); |
||||
that.addClass('hide'); |
||||
|
||||
var transation = that.attr('data-transation'); |
||||
if (transation == '') |
||||
transation = 'fadeInDown'; |
||||
|
||||
var startTime = parseInt(that.attr('data-start-time')); |
||||
if (isNaN(startTime)) |
||||
startTime = 0; |
||||
|
||||
setTimeout(function(){ |
||||
that.addClass('animated '+transation); |
||||
},startTime); |
||||
}) |
||||
} |
||||
|
||||
|
||||
/*sweet checkbox scripts*/ |
||||
$('.sweet-check :checkbox:checked').each(function(e,i){ |
||||
$(this).parent().addClass('checked'); |
||||
}); |
||||
|
||||
|
||||
$(document).on('click', '.sweet-check', function(){ |
||||
if ($(this).hasClass('checked')) |
||||
{ |
||||
$(this).removeClass('checked'); |
||||
$(this).find('input').prop('checked', false); |
||||
} |
||||
else |
||||
{ |
||||
$(this).addClass('checked'); |
||||
$(this).find('input').prop('checked', true); |
||||
} |
||||
|
||||
//console.log($(this).find('input').prop('checked'));
|
||||
}); |
||||
|
||||
$(document).on('click','[data-loader]', function(){ |
||||
$('.sweet-loader').show().addClass('show'); |
||||
}); |
||||
|
||||
|
||||
/*expandable list scrips****/ |
||||
$(document).on('click', '.expandable-item .expandable-header', function(){ |
||||
if ($(this).parent().hasClass('accordion')) |
||||
{ |
||||
if ($(this).parent().hasClass('active')) |
||||
{ |
||||
$(this).parent().removeClass('active'); |
||||
$(this).parent().find('.expandable-content').attr('style',''); |
||||
} |
||||
else |
||||
{ |
||||
var accordionGroup = $(this).parent().attr('data-group'); |
||||
$('[data-group="'+accordionGroup+'"]').removeClass('active'); |
||||
$('[data-group="'+accordionGroup+'"]').find('.expandable-content').attr('style',''); |
||||
$(this).parent().find('.expandable-content').css({'max-height':$(this).parent().find('.expandable-content')[0].scrollHeight}); |
||||
$(this).parent().addClass('active'); |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
if ($(this).parent().hasClass('active')) |
||||
$(this).parent().find('.expandable-content').attr('style',''); |
||||
else |
||||
$(this).parent().find('.expandable-content').css({'max-height':$(this).parent().find('.expandable-content')[0].scrollHeight}); |
||||
|
||||
$(this).parent().toggleClass('active'); |
||||
} |
||||
}); |
||||
|
||||
|
||||
|
||||
$(document).on('click', '.tab-item .menu-item', function(e){ |
||||
e.preventDefault(); |
||||
var tabContentId = $(this).attr('data-content'); |
||||
|
||||
$(this).parents('.tab-item').find('.menu-item').removeClass('active'); |
||||
$(this).addClass('active'); |
||||
|
||||
$(this).parents('.tab-item').find('.content-item').removeClass('active'); |
||||
$('#'+tabContentId).addClass('active'); |
||||
}); |
||||
|
||||
|
||||
/*post item scripts **************/ |
||||
$(document).on('click', '.post-item .post-share > i', function(e){ |
||||
e.preventDefault(); |
||||
$(this).parent().find('.social-links').fadeToggle('fast'); |
||||
}); |
||||
|
||||
|
||||
/*popup actions ******************/ |
||||
$(document).on('click', '[data-dismiss="true"]', function(){ |
||||
$(this).parents('.popup-overlay').fadeOut('fast'); |
||||
}); |
||||
|
||||
$(document).on('click', '[data-popup]', function(){ |
||||
var modalId = $(this).attr('data-popup'); |
||||
$('#'+modalId).fadeIn('fast'); |
||||
}); |
||||
|
||||
$(document).on('click', '.popup-overlay', function(e){ |
||||
if ($(e.target).hasClass('popup-overlay')) |
||||
{ |
||||
$(this).fadeOut('fast'); |
||||
} |
||||
}); |
||||
|
||||
|
||||
|
||||
/*search popup actions ************/ |
||||
|
||||
var openSearchPopup = function(){ |
||||
$('.search-form').fadeIn('fast'); |
||||
$('.search-form input').focus(); |
||||
} |
||||
|
||||
var closeSearchPopup = function(){ |
||||
$('.search-form').fadeOut('fast'); |
||||
} |
||||
|
||||
$(document).on('click', '[data-search="open"]', function(){ |
||||
openSearchPopup(); |
||||
}); |
||||
|
||||
$(document).on('click', '[data-search="close"]', function(){ |
||||
closeSearchPopup(); |
||||
}); |
||||
|
||||
|
||||
// ------------------------------------------------------- //
|
||||
// Swiper Slider
|
||||
// ------------------------------------------------------ //
|
||||
if($('.swiper-container').length || $('.swiper-recievers').length){ |
||||
var swiper = new Swiper('.swiper-container', { |
||||
slidesPerView: 2, |
||||
breakpoints: { |
||||
400: { |
||||
slidesPerView: 1 |
||||
} |
||||
}, |
||||
pagination: { |
||||
el: '.swiper-pagination', |
||||
}, |
||||
}); |
||||
|
||||
var swiper = new Swiper('.swiper-recievers', { |
||||
slidesPerView: 4, |
||||
breakpoints: { |
||||
400: { |
||||
slidesPerView:3 |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
|
||||
// ------------------------------------------------------- //
|
||||
// Map
|
||||
// ------------------------------------------------------ //
|
||||
|
||||
function initMap() { |
||||
var coords = {lat: 40.7127837, lng: -74.00594130000002}; |
||||
var map = new google.maps.Map(document.getElementById('map'), { |
||||
zoom: 17, |
||||
center: coords |
||||
}); |
||||
var marker = new google.maps.Marker({ |
||||
position: coords, |
||||
map: map |
||||
}); |
||||
} |
@ -0,0 +1,191 @@ |
||||
.c3 svg { |
||||
font-size: 12px; |
||||
-webkit-tap-highlight-color: transparent |
||||
} |
||||
|
||||
.c3 line, |
||||
.c3 path { |
||||
fill: none; |
||||
stroke: #ccc |
||||
} |
||||
|
||||
.c3-legend-item-tile { |
||||
stroke-width: 5 |
||||
} |
||||
|
||||
.c3 text { |
||||
-webkit-user-select: none; |
||||
-moz-user-select: none; |
||||
user-select: none; |
||||
fill: #666 |
||||
} |
||||
|
||||
.c3-bars path, |
||||
.c3-event-rect, |
||||
.c3-legend-item-tile, |
||||
.c3-xgrid-focus, |
||||
.c3-ygrid { |
||||
shape-rendering: crispEdges |
||||
} |
||||
|
||||
.c3-chart-arc path { |
||||
stroke: #FFF |
||||
} |
||||
|
||||
.c3-chart-arc text { |
||||
fill: #fff; |
||||
font-size: 13px |
||||
} |
||||
|
||||
.c3-grid line { |
||||
stroke: #ccc |
||||
} |
||||
|
||||
.c3-grid text { |
||||
fill: #535D6F |
||||
} |
||||
|
||||
.c3-xgrid, |
||||
.c3-ygrid { |
||||
stroke-dasharray: 3 3 |
||||
} |
||||
|
||||
.c3-text.c3-empty { |
||||
fill: grey; |
||||
font-size: 2em |
||||
} |
||||
|
||||
.c3-line { |
||||
stroke-width: 2px |
||||
} |
||||
|
||||
.c3-circle._expanded_ { |
||||
stroke-width: 1px; |
||||
stroke: #fff |
||||
} |
||||
|
||||
.c3-selected-circle { |
||||
fill: #fff; |
||||
stroke-width: 4px |
||||
} |
||||
|
||||
.c3-bar { |
||||
stroke-width: 0 |
||||
} |
||||
|
||||
.c3-bar._expanded_ { |
||||
fill-opacity: .75 |
||||
} |
||||
|
||||
.c3-target.c3-focused { |
||||
opacity: 1 |
||||
} |
||||
|
||||
.c3-target.c3-focused path.c3-line, |
||||
.c3-target.c3-focused path.c3-step { |
||||
stroke-width: 2px |
||||
} |
||||
|
||||
.c3-target.c3-defocused { |
||||
opacity: .3 |
||||
} |
||||
|
||||
.c3-region { |
||||
fill: #4682b4; |
||||
fill-opacity: .1 |
||||
} |
||||
|
||||
.c3-brush .extent { |
||||
fill-opacity: .1 |
||||
} |
||||
|
||||
.c3-legend-item { |
||||
font-size: 12px |
||||
} |
||||
|
||||
.c3-legend-item-hidden { |
||||
opacity: .15 |
||||
} |
||||
|
||||
.c3-legend-background { |
||||
opacity: .75; |
||||
fill: #fff; |
||||
stroke: #d3d3d3; |
||||
stroke-width: 1 |
||||
} |
||||
|
||||
.c3-title { |
||||
font-size: 14px |
||||
} |
||||
|
||||
.c3-tooltip-container { |
||||
z-index: 10 |
||||
} |
||||
|
||||
.c3-tooltip { |
||||
padding: 10px; |
||||
border-collapse: collapse; |
||||
border-spacing: 0; |
||||
background-color: #222; |
||||
fill: #BBB; |
||||
color: #BBB; |
||||
font-size: 12px; |
||||
display: block; |
||||
min-width: 90px |
||||
} |
||||
|
||||
.c3-tooltip td { |
||||
font-size: 13px; |
||||
padding: 3px; |
||||
background-color: #1E2229 |
||||
} |
||||
|
||||
.c3-tooltip td>span { |
||||
display: inline-block; |
||||
width: 10px; |
||||
height: 10px; |
||||
margin-right: 6px |
||||
} |
||||
|
||||
.c3-tooltip td.value { |
||||
text-align: right |
||||
} |
||||
|
||||
.c3-area { |
||||
stroke-width: 0; |
||||
opacity: .2 |
||||
} |
||||
|
||||
.c3-chart-arcs-title { |
||||
dominant-baseline: middle; |
||||
font-size: 1.3em |
||||
} |
||||
|
||||
.c3-chart-arcs .c3-chart-arcs-background { |
||||
fill: #e0e0e0; |
||||
stroke: none |
||||
} |
||||
|
||||
.c3-chart-arcs .c3-chart-arcs-gauge-unit { |
||||
fill: #ccc; |
||||
font-size: 16px |
||||
} |
||||
|
||||
.c3-chart-arc .c3-gauge-value, |
||||
.c3-chart-arcs .c3-chart-arcs-gauge-max, |
||||
.c3-chart-arcs .c3-chart-arcs-gauge-min { |
||||
fill: #ccc |
||||
} |
||||
|
||||
.panel-blue .c3-grid line { |
||||
stroke: #11436d |
||||
} |
||||
|
||||
.panel-blue .c3 line, |
||||
.panel-blue .c3 path { |
||||
stroke: #4a8fca |
||||
} |
||||
|
||||
.panel-blue .c3 text { |
||||
fill: #abd8ff |
||||
} |
@ -0,0 +1,271 @@ |
||||
var chart1=c3.generate( { |
||||
bindto:"#lineGraph", data: { |
||||
columns:[["data1", 14, 28, 31, 49, 57, 59, 52, 48, 55, 58, 62, 60, 62, 58, 55, 61, 70, 80, 77, 78, 82, 98, 99, 121, 136, 115, 112, 120, 103, 117, 121, 126], ["data2", 3, 16, 19, 24, 27, 32, 38, 36, 32, 36, 40, 48, 41, 44, 46, 53, 58, 62, 65, 61, 64, 62, 59, 63, 87, 92, 72, 81, 75, 80, 97, 97]], names: { |
||||
data1: "onGoing", data2: "Completed" |
||||
} |
||||
, colors: { |
||||
data1: "#f0b518", data2: "#3a86c8" |
||||
} |
||||
} |
||||
} |
||||
|
||||
), |
||||
chart2=c3.generate( { |
||||
bindto:"#splineGraph", data: { |
||||
columns:[["data1", 24, 28, 31, 49, 57, 59, 52, 48, 55, 58, 62, 60, 62, 58, 55, 61, 70, 80, 77, 78, 82, 98, 99, 105, 102, 95, 92, 100, 103, 117, 121, 126], ["data2", 15, 16, 19, 24, 27, 32, 38, 36, 32, 36, 40, 48, 41, 44, 46, 53, 58, 62, 65, 61, 64, 62, 59, 63, 67, 69, 72, 71, 75, 80, 65, 71]], types: { |
||||
data1: "spline", data2: "area-spline" |
||||
} |
||||
, names: { |
||||
data1: "Likes", data2: "Clicks" |
||||
} |
||||
, colors: { |
||||
data1: "#3a86c8", data2: "#c282e0" |
||||
} |
||||
} |
||||
} |
||||
|
||||
), |
||||
chart3=c3.generate( { |
||||
bindto:"#areaSplineGraph", data: { |
||||
columns:[["data1", 24, 49, 52, 48, 62, 60, 62, 70, 80, 82, 95, 92, 100, 103, 117, 121, 136], ["data2", 15, 27, 39, 32, 40, 48, 46, 57, 64, 62, 59, 71, 75, 80, 65, 71, 102]], types: { |
||||
data1: "area-spline", data2: "area-spline" |
||||
} |
||||
, names: { |
||||
data1: "Male", data2: "Female" |
||||
} |
||||
, colors: { |
||||
data1: "#F782AA", data2: "#3a86c8" |
||||
} |
||||
} |
||||
} |
||||
|
||||
), |
||||
chart4=c3.generate( { |
||||
bindto:"#stepGraph", data: { |
||||
columns:[["data1", 52, 59, 78, 102, 95, 92, 100, 48, 55, 58, 62, 60, 24, 28, 31, 49, 57, 103, 117, 121, 126], ["data2", 27, 32, 38, 36, 32, 36, 40, 15, 16, 82, 81, 85, 90, 95, 71, 19, 24, 44, 59, 73, 77, 89]], types: { |
||||
data1: "step", data2: "area-step" |
||||
} |
||||
, names: { |
||||
data1: "Twitter", data2: "LinkedIn" |
||||
} |
||||
, colors: { |
||||
data1: "#3a86c8", data2: "#f0b518" |
||||
} |
||||
} |
||||
} |
||||
|
||||
), |
||||
chart5=c3.generate( { |
||||
bindto:"#barAreaGraph", data: { |
||||
columns:[["data1", 24, 28, 31, 49, 57, 59, 52, 48, 55, 58, 62, 60, 62, 58, 55, 61, 70, 80, 77, 78, 82, 98, 99, 105, 102, 95, 92, 100, 103, 117, 121, 126], ["data2", 15, 16, 19, 24, 27, 32, 38, 36, 32, 36, 40, 48, 41, 44, 46, 53, 58, 62, 65, 61, 64, 62, 59, 63, 67, 69, 72, 71, 75, 80, 65, 71]], types: { |
||||
data1: "bar", data2: "area" |
||||
} |
||||
, names: { |
||||
data1: "Twitter", data2: "LinkedIn" |
||||
} |
||||
, colors: { |
||||
data1: "#E9BB27", data2: "#3a86c8" |
||||
} |
||||
} |
||||
} |
||||
|
||||
), |
||||
chart6=c3.generate( { |
||||
bindto:"#barGraph", data: { |
||||
columns:[["data1", 15, 58, 62, 87, 32, 58, 55, 21, 20, 30, 98, 10, 22, 98, 99, 105, 82, 57, 121, 78], ["data2", 21, 26, 30, 38, 11, 24, 36, 53, 58, 62, 65, 61, 64, 32, 45, 71, 38, 23, 65, 11]], type:"bar", names: { |
||||
data1: "Referrals", data2: "Signups" |
||||
} |
||||
, colors: { |
||||
data1: "#fee074", data2: "#66c0dc" |
||||
} |
||||
} |
||||
} |
||||
|
||||
), |
||||
chart7=c3.generate( { |
||||
bindto:"#stackedBarGraph", data: { |
||||
columns:[["data1", 30, 90, 200, 400, 590, 250, 330, 120, 480, 560, 220, 300, 240, 470, 680, 550, 250, 330, 120, 90]], type:"bar", names: { |
||||
data1: "Crypto Balance" |
||||
} |
||||
, colors: { |
||||
data1: "#1d73bd" |
||||
} |
||||
, groups:[["data1"]] |
||||
} |
||||
, grid: { |
||||
x: { |
||||
show: !0 |
||||
} |
||||
, y: { |
||||
show: !0 |
||||
} |
||||
} |
||||
} |
||||
|
||||
), |
||||
chart8=c3.generate( { |
||||
bindto:"#scatterPlot", data: { |
||||
xs: { |
||||
Male: "male_x", Female: "female_x" |
||||
} |
||||
, columns:[["male_x", 3.5, 3, 3.2, 3.1, 3.6, 3.9, 3.4, 3.4, 2.9, 3.1, 3.7, 3.4, 3, 3, 4, 4.4, 3.9, 3.5, 3.8, 3.8, 3.4, 3.7, 3.6, 3.3, 3.4, 3, 3.4, 3.5, 3.4, 3.2, 3.1, 3.4, 4.1, 4.2, 3.1, 3.2, 3.5, 3.6, 3, 3.4, 3.5, 2.3, 3.2, 3.5, 3.8, 3, 3.8, 3.2, 3.7, 3.3], ["female_x", 3.2, 3.2, 3.1, 2.3, 2.8, 2.8, 3.3, 2.4, 2.9, 2.7, 2, 3, 2.2, 2.9, 2.9, 3.1, 3, 2.7, 2.2, 2.5, 3.2, 2.8, 2.5, 2.8, 2.9, 3, 2.8, 3, 2.9, 2.6, 2.4, 2.4, 2.7, 2.7, 3, 3.4, 3.1, 2.3, 3, 2.5, 2.6, 3, 2.6, 2.3, 2.7, 3, 2.9, 2.9, 2.5, 2.8], ["Male", .2, .2, .2, .2, .2, .4, .3, .2, .2, .1, .2, .2, .1, .1, .2, .4, .4, .3, .3, .3, .2, .4, .2, .5, .2, .2, .4, .2, .2, .2, .2, .4, .1, .2, .2, .2, .2, .1, .2, .2, .3, .3, .2, .6, .4, .3, .2, .2, .2, .2], ["Female", 1.4, 1.5, 1.5, 1.3, 1.5, 1.3, 1.6, 1, 1.3, 1.4, 1, 1.5, 1, 1.4, 1.3, 1.4, 1.5, 1, 1.5, 1.1, 1.8, 1.3, 1.5, 1.2, 1.3, 1.4, 1.4, 1.7, 1.5, 1, 1.1, 1, 1.2, 1.6, 1.5, 1.6, 1.5, 1.3, 1.3, 1.3, 1.2, 1.4, 1.2, 1, 1.3, 1.2, 1.3, 1.3, 1.1, 1.3]], type:"scatter", colors: { |
||||
Male: "#3a86c8", Female: "#dd5826" |
||||
} |
||||
} |
||||
, axis: { |
||||
x: { |
||||
label:"Male Visitors", tick: { |
||||
fit: !1 |
||||
} |
||||
} |
||||
, y: { |
||||
label: "Female Visitors" |
||||
} |
||||
} |
||||
} |
||||
|
||||
), |
||||
chart9=c3.generate( { |
||||
bindto:"#pieChart", data: { |
||||
columns:[["Likes", 36], ["Shares", 62]], type:"pie", colors: { |
||||
Likes: "#91c46b", Shares: "#3a86c8" |
||||
} |
||||
, onclick:function(a, b) { |
||||
console.log("onclick", a, b) |
||||
} |
||||
, onmouseover:function(a, b) { |
||||
console.log("onmouseover", a, b) |
||||
} |
||||
, onmouseout:function(a, b) { |
||||
console.log("onmouseout", a, b) |
||||
} |
||||
} |
||||
} |
||||
|
||||
), |
||||
chart10=c3.generate( { |
||||
bindto:"#donutChart", data: { |
||||
columns:[["Likes", 32], ["Shares", 87], ["Clicks", 51]], type:"donut", colors: { |
||||
Likes: "#c282e0", Shares: "#c38fbb", Clicks: "#F782AA" |
||||
} |
||||
, onclick:function(a, b) { |
||||
console.log("onclick", a, b) |
||||
} |
||||
, onmouseover:function(a, b) { |
||||
console.log("onmouseover", a, b) |
||||
} |
||||
, onmouseout:function(a, b) { |
||||
console.log("onmouseout", a, b) |
||||
} |
||||
} |
||||
} |
||||
|
||||
), |
||||
chart11=c3.generate( { |
||||
bindto:".accountValue", padding: { |
||||
top: 10, left: 40 |
||||
} |
||||
, data: { |
||||
columns:[["data1", 18, 22, 90, 33, 19, 21, 28, 21, 19, 43, 23, 34, 55, 43, 33, 77, 33, 87, 46, 39, 51, 32, 66, 99, 32, 54, 33, 24, 54, 22, 37, 76, 67, 89, 34, 12, 77, 99, 59, 66, 28, 77, 39, 60, 66, 99, 32, 54, 33, 24, 54, 22, 37, 76, 67, 89, 34, 12, 77, 99, 59, 66, 28, 77, 39, 60]], types: { |
||||
data1: "area" |
||||
} |
||||
, names: { |
||||
data1: "Account Val" |
||||
} |
||||
, colors: { |
||||
data1: "#c38fbb" |
||||
} |
||||
} |
||||
, axis: { |
||||
y: { |
||||
tick: { |
||||
count: 3 |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
), |
||||
chart12=c3.generate( { |
||||
bindto:"#domestic", data: { |
||||
columns:[["Domestic", 70], ["International", 120]], type:"pie", colors: { |
||||
Domestic: "#E24B46", International: "#1d73bd" |
||||
} |
||||
} |
||||
, legend: { |
||||
show: !1 |
||||
} |
||||
, tooltip: { |
||||
show: !1 |
||||
} |
||||
, pie: { |
||||
label: { |
||||
show: !1 |
||||
} |
||||
} |
||||
} |
||||
|
||||
), |
||||
chart13=c3.generate( { |
||||
bindto:"#domain", data: { |
||||
columns:[["Com", 100], ["Org", 20], ["Net", 15], ["Biz", 10], ["Others", 5]], type:"pie", colors: { |
||||
Com: "#fa9255", Org: "#fee074", Net: "#47BCC7", Biz: "#F782AA", Others: "#aed048" |
||||
} |
||||
} |
||||
, legend: { |
||||
show: !1 |
||||
} |
||||
, tooltip: { |
||||
show: !1 |
||||
} |
||||
, pie: { |
||||
label: { |
||||
show: !1 |
||||
} |
||||
} |
||||
} |
||||
|
||||
), |
||||
chart14=c3.generate( { |
||||
bindto:"#imgFonts", data: { |
||||
columns:[["Images", 170], ["Fonts", 50], ["Text", 30]], type:"pie", colors: { |
||||
Images: "#5c6bc2", Fonts: "#C790E1", Text: "#F782AA" |
||||
} |
||||
} |
||||
, legend: { |
||||
show: !1 |
||||
} |
||||
, tooltip: { |
||||
show: !1 |
||||
} |
||||
, pie: { |
||||
label: { |
||||
show: !1 |
||||
} |
||||
} |
||||
} |
||||
|
||||
), |
||||
chart5=c3.generate( { |
||||
bindto:"#globalLocal", data: { |
||||
columns:[["data2", 15, 19, 27, 32, 38, 36, 32, 36, 40, 48, 46, 53, 58, 62, 65, 99]], types: { |
||||
data2: "area-spline" |
||||
} |
||||
, names: { |
||||
data2: "Active Users" |
||||
} |
||||
, colors: { |
||||
data2: "#52bf8a" |
||||
} |
||||
} |
||||
, axis: { |
||||
x: { |
||||
show: !1 |
||||
} |
||||
, y: { |
||||
show: !1 |
||||
} |
||||
} |
||||
} |
||||
|
||||
); |