Changeset 1465826
- Timestamp:
- 08/02/2016 07:35:57 AM (10 years ago)
- Location:
- taknod/trunk
- Files:
-
- 5 edited
-
functions/core.php (modified) (1 diff)
-
js/taknode.js (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
-
taknode.php (modified) (2 diffs)
-
template/main.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
taknod/trunk/functions/core.php
r1434791 r1465826 1 <?php 1 <?php 2 2 3 define('taknode_base_api_url', 'http://taknod.com/eset/sell/');3 define('taknode_base_api_url', 'http://taknod.com/eset/sell/'); 4 4 5 5 function taknode_json_price($apiKey) 6 6 { 7 if (empty($apiKey)) {8 return null;9 }7 if (empty($apiKey)) { 8 return null; 9 } 10 10 11 return file_get_contents(taknode_base_api_url.'esResellerPrice/'.$apiKey);11 return file_get_contents(taknode_base_api_url . 'esResellerPrice/' . $apiKey); 12 12 } 13 13 14 14 function taknode_core_check_callbak() 15 15 { 16 //file_put_contents('postdata.dat',var_export($_POST, true));17 if (isset($_POST['error'])) {18 if ($_POST['error']=='200') {19 //success20 return $_POST;21 }else{22 return taknode_callback_error((int)$_POST['error']);23 }24 }16 //file_put_contents('postdata.dat',var_export($_POST, true)); 17 if (isset($_POST['error'])) { 18 if ($_POST['error'] == '200') { 19 //success 20 return $_POST; 21 } else { 22 return taknode_callback_error((int) $_POST['error']); 23 } 24 } 25 25 } 26 26 27 27 function taknode_callback_error($code) 28 28 { 29 $errors=['کلید API نامعتبر.',30 'اطلاعات محصول اشتباه است.',31 'اطلاعات کاربر اشتباه است.',32 'اطلاعات لایسنس اشتباه است.',33 'کد درخواست لایسنس نا معتبر',34 'کد درخواست لایسنس قبلا استفاده شده است.',35 'خطا در دریافت لایسنس از سرور Eset .',36 -1=>'پارامتر ها کامل ارسال نشده است.',37 -2=>'عدم برقراری ارتباط با بانک.',38 -3=>'پرداخت ناموفق.'];39 return empty($error[$code]) ? 'خطای تعریف نشده!': $error[$code];29 $errors = ['کلید API نامعتبر.', 30 'اطلاعات محصول اشتباه است.', 31 'اطلاعات کاربر اشتباه است.', 32 'اطلاعات لایسنس اشتباه است.', 33 'کد درخواست لایسنس نا معتبر', 34 'کد درخواست لایسنس قبلا استفاده شده است.', 35 'خطا در دریافت لایسنس از سرور Eset .', 36 -1 => 'پارامتر ها کامل ارسال نشده است.', 37 -2 => 'عدم برقراری ارتباط با بانک.', 38 -3 => 'پرداخت ناموفق.']; 39 return empty($errors[$code]) ? 'خطای تعریف نشده!' : $errors[$code]; 40 40 } -
taknod/trunk/js/taknode.js
r1434791 r1465826 1 1 var app = angular.module('taknodeApp', ['ngRoute']); 2 app.config( function($routeProvider, $locationProvider) {2 app.config(['$routeProvider', '$locationProvider',function($routeProvider, $locationProvider) { 3 3 $routeProvider.when('/', { 4 4 templateUrl: 'main.tpl', 5 5 controller: 'main' 6 6 }).otherwise({redirectTo:'/'}); 7 } );7 }]); 8 8 9 app.controller('main', function($scope,$http,$window,$timeout){9 app.controller('main', ['$scope','$http','$window','$timeout',function($scope,$http,$window,$timeout){ 10 10 var s = $scope; 11 11 s.setPrice = function(pr,proId){ … … 17 17 }; 18 18 s.setYear = function(type){ 19 console.log(type);19 20 20 s.finalPrice = null ; 21 21 s.year = s.price[type]; … … 25 25 }; 26 26 s.setPerUser = function(per,year) { 27 console.log(per);28 console.log(year);27 28 29 29 s.finalPrice = null ; 30 s.prFin = null ; 30 31 s.perUser = per.perUser ; 31 32 s.pr.year = year; 32 33 }; 33 s.calcPrice = function(amount,quan){ 34 s.finalPrice =Math.round( (s.plan.dollarPrice * amount) * (1+(s.plan.profit / 100)) ) / 10; 35 s.pr.quantity = quan; 36 s.pr.amount = amount ; 37 console.log(s.pr); 34 s.calcPrice = function(p){ 35 s.finalPrice =Math.round( (s.plan.dollarPrice * p.price) * (1+(s.plan.profit / 100)) ) / 10; 36 s.pr.quantity = p.count; 37 s.pr.amount = p.price ; 38 s.prFin = p ; 39 38 40 }; 39 41 40 42 s.esLicReq = function() { 41 $http.post(s.plan.apiUrl+'/esLicRequest', s.pr ).then(function(resp) {43 $http.post(s.plan.apiUrl+'/esLicRequest', s.pr,{headers:{'Content-Type': undefined}}).then(function(resp) { 42 44 resp.data.error === 0 ? 43 45 ($window.location.href=s.plan.apiUrl+"/esGetLic/"+resp.data.licReqCode) : … … 51 53 $timeout(function() { 52 54 angular.forEach(s.plan.price,function(pro,key) { 53 console.log(pro);55 54 56 angular.forEach(pro,function(p,pKey) { 55 57 if (pKey == 'ENAHE') { … … 57 59 s.setYear('new'); 58 60 angular.forEach(s.year,function(yPer,yKey) { 59 //console.log(per);console.log(yKey);60 61 if (yKey==1) { 61 62 s.setPerUser(yPer,yKey); 62 angular.forEach(yPer.perUser,function(dollar,count) { 63 count==1 ? s.calcPrice(dollar,count) : null ; 64 }); 63 s.calcPrice(yPer.perUser[0]); 65 64 } 66 65 }); 67 68 //s.calcPrice(s.perUser[0],1);69 66 } 70 67 }); … … 74 71 75 72 s.init(); 76 } );73 }]); 77 74 78 75 app.factory('object', function() { -
taknod/trunk/readme.txt
r1464084 r1465826 1 === taknod===1 === Plugin Name === 2 2 Donate link: http://taknod.com/ 3 Tags: لایسنس انتی ویروس,taknod,نمایندگی انتی ویروس , nod32,licencha.Com,taknod.com3 Tags: payment_ha,taknod,hostbaran , nod32,licencha 4 4 Requires at least: 3.0.1 5 Tested up to: 4.5.36 Stable tag: 4.3 .35 Tested up to: 3.4 6 Stable tag: 4.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 52 52 == Changelog == 53 53 54 = 1.2 =55 *Fix bug56 57 = 1.1 =58 *change CSS59 60 54 = 1.0 = 61 55 * Initial release. -
taknod/trunk/taknode.php
r1464089 r1465826 3 3 /** 4 4 * @package taknode 5 * @version 1. 25 * @version 1.0 6 6 */ 7 7 /* … … 10 10 Description: با استفاده از این پلاگین میتوانید با API خود به فروش محصولات نود بپردازید. 11 11 Author: taknod.com 12 Version: 1. 212 Version: 1.3 13 13 Author URI: taknod.com 14 14 */ -
taknod/trunk/template/main.php
r1434791 r1465826 65 65 <td ng-show="perUser"> 66 66 <div class="form-group"> 67 <select class="form-control" >68 <option ng-repeat="(key, licPrice) in perUser" ng-click="calcPrice(licPrice,key)" value="{{key}}" ng-model="pr.quantity">{{key}} کاربره</option>69 </select>67 <select class="form-control" ng-options="val as val.count for val in perUser track by val.count" ng-model="prFin" ng-change="calcPrice(prFin)"> 68 <!-- <option ng-repeat="(key, licPrice) in perUser" value="{{key}}" >{{key}} کاربره</option> 69 --> </select> 70 70 </div> 71 71 </td>
Note: See TracChangeset
for help on using the changeset viewer.