Skip to content

Commit

Permalink
Fixes of v1.0 is updated. (v1.1.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
itzmeank committed Sep 20, 2018
1 parent 4ed6413 commit ba54722
Show file tree
Hide file tree
Showing 538 changed files with 73,444 additions and 73,311 deletions.
4 changes: 2 additions & 2 deletions server/php/Slim/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"slim/slim": "3.*",
"illuminate/database": "*",
"illuminate/pagination": "^5.2",
"illuminate/events": "*",
"illuminate/events": "5.4.27",
"illuminate/validation": "^5.3",
"swiftmailer/swiftmailer": "@stable",
"swiftmailer/swiftmailer": "5.4.5",
"pavlakis/slim-cli": "*",
"dereuromark/media-embed": "0.*",
"illuminate/translation": "*",
Expand Down
400 changes: 263 additions & 137 deletions server/php/Slim/composer.lock

Large diffs are not rendered by default.

Empty file modified server/php/Slim/lib/Models/Activity.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Bid.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/BidStatus.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Certification.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/City.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Contact.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Contest.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ContestStatus.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ContestType.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ContestTypesPricingDay.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ContestTypesPricingPackage.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ContestUser.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Country.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Education.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/EmailTemplate.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Exam.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ExamAnswer.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ExamCategory.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ExamLevel.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ExamsQuestion.php
100755 → 100644
Empty file.
8 changes: 8 additions & 0 deletions server/php/Slim/lib/Models/ExamsUser.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ public function zazpay_payment()
{
return $this->belongsTo('Models\ZazpayPayment', 'zazpay_payment_id', 'id');
}
public function transaction()
{
return $this->belongsTo('Models\ExamsUser', 'id', 'id')->select('id', 'user_id');
}
public function foreign_transactions()
{
return $this->morphMany('Models\Transaction', 'foreign_transaction');
}
public function scopeFilter($query, $params = array())
{
parent::scopeFilter($query, $params);
Expand Down
Empty file modified server/php/Slim/lib/Models/Flag.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/FlagCategory.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Follower.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/FormField.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/FormFieldGroup.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/FormFieldSubmission.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Ip.php
100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions server/php/Slim/lib/Models/Job.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ public function jobCategoryCountUpdation($jobId = '', $jobCategoryId = '', $user
}
public function processCaptured($payment_response, $id)
{
global $_server_domain_url;
$job = Job::whereIn('job_status_id', [\Constants\JobStatus::PaymentPending, \Constants\JobStatus::Draft])->find($id);
if (!empty($job)) {
$job->makeVisible(array(
Expand Down
Empty file modified server/php/Slim/lib/Models/JobApply.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/JobApplyClick.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/JobCategory.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/JobType.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Language.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Message.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Milestone.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/MoneyTransferAccount.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Page.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Payment.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/PaymentGateway.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Portfolio.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/PricingDay.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/PricingPackage.php
100755 → 100644
Empty file.
2 changes: 0 additions & 2 deletions server/php/Slim/lib/Models/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,6 @@ public function processCaptured($payment_response, $id)
if (!empty($payment_response['paykey'])) {
$wallet->paypal_pay_key = $payment_response['paykey'];
}
$dispatcher = Project::getEventDispatcher();
Project::unsetEventDispatcher();
$project->is_paid = true;
$project->zazpay_pay_key = $payment_response['paykey'];
$project->update();
Expand Down
Empty file modified server/php/Slim/lib/Models/ProjectBid.php
100755 → 100644
Empty file.
15 changes: 3 additions & 12 deletions server/php/Slim/lib/Models/ProjectBidInvoice.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,7 @@ protected static function boot()
{
global $authUser;
parent::boot();
self::updating(function ($projectBidInvoice) use ($authUser) {
$bids = Bid::where('id', $projectBidInvoice->bid_id)->select('user_id')->first();
if (($authUser['role_id'] == \Constants\ConstUserTypes::Admin) || ($authUser['id'] == $bids->user_id)) {
ProjectBidInvoice::ProjectBidInvoiceCountUpdation($projectBidInvoice->project_id);
return true;
}
return false;
});
self::saving(function ($projectBidInvoice) use ($authUser) {
self::saved(function ($projectBidInvoice) use ($authUser) {
$bids = Bid::where('id', $projectBidInvoice->bid_id)->select('user_id')->first();
if (($authUser['role_id'] == \Constants\ConstUserTypes::Admin) || ($authUser['id'] == $bids->user_id)) {
ProjectBidInvoice::ProjectBidInvoiceCountUpdation($projectBidInvoice->project_id);
Expand Down Expand Up @@ -111,10 +103,9 @@ public function scopeFilter($query, $params = array())
}
public function processCaptured($payment_response, $id)
{
global $_server_domain_url;
$projectBidInvoice = ProjectBidInvoice::with('bid', 'project', 'projectbidinvoiceitems')->where('id', $id)->where('is_paid', false)->first();
if (!empty($projectBidInvoice)) {
$dispatcher = ProjectBidInvoice::getEventDispatcher();
ProjectBidInvoice::unsetEventDispatcher();
$projectBidInvoice->is_paid = true;
if (!empty($payment_response['paykey'])) {
$projectBidInvoice->paypal_pay_key = $payment_response['paykey'];
Expand All @@ -123,7 +114,6 @@ public function processCaptured($payment_response, $id)
$projectBidInvoice->zazpay_pay_key = $payment_response['paykey'];
$projectBidInvoice->update();
insertActivities($projectBidInvoice->project->user_id, $projectBidInvoice->user_id, 'ProjectBidInvoice', $projectBidInvoice->id, 0, 0, \Constants\ActivityType::ProjectBidInvoicePaid, $projectBidInvoice->project_id);
ProjectBidInvoice::setEventDispatcher($dispatcher);

updateSiteCommissionFromEmployer($projectBidInvoice->site_commission_from_employer, $projectBidInvoice->bid_id, $projectBidInvoice->project_id, $projectBidInvoice->project->user_id);

Expand Down Expand Up @@ -169,6 +159,7 @@ public function processCaptured($payment_response, $id)
Bid::where('id', $projectBidInvoice->bid_id)->update(array(
'total_invoice_got_paid' => $total_invoice_got_paid
));
UpdatePaidAmountForProject($projectBidInvoice->bid_id, $projectBidInvoice->project_id);
}
$response = array(
'data' => $payment_response,
Expand Down
Empty file modified server/php/Slim/lib/Models/ProjectBidInvoiceItems.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ProjectCategory.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ProjectDispute.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ProjectRange.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ProjectStatus.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ProjectsProjectCategory.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Provider.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ProviderUser.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Publication.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Question.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/QuestionAnswerOptions.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/QuestionCategory.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/QuestionDisplayType.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/QuoteBid.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/QuoteCategoriesQuoteService.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/QuoteCategory.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/QuoteCategoryQuoteService.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/QuoteFaqAnswer.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/QuoteFaqQuestionTemplate.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/QuoteRequest.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/QuoteRequestFormField.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/QuoteService.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/QuoteServiceAudio.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/QuoteServicePhoto.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/QuoteServiceVideo.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/QuoteUserFaqQuestion.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ResumeRating.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Review.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/SalaryType.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Setting.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Skill.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/SkillsPortfolios.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/State.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Timezone.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Transaction.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/User.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/UserCashWithdrawal.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Vault.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/View.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/Wallet.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/WorkProfile.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ZazpayIpnLog.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ZazpayPaymentGateway.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ZazpayPaymentGroup.php
100755 → 100644
Empty file.
Empty file modified server/php/Slim/lib/Models/ZazpayTransactionLog.php
100755 → 100644
Empty file.
28 changes: 8 additions & 20 deletions server/php/Slim/lib/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ function saveImageData($class_name, $file, $foreign_id, $is_multi = false)
{
if (!empty($file)) {
$data = explode(',', $file);
$file = $data[1];
$file = (!empty($data[1])) ? $data[1] : $data[0];
$image = base64_decode($file);
$f = finfo_open();
$mime_type = finfo_buffer($f, $image, FILEINFO_MIME_TYPE);
Expand Down Expand Up @@ -1473,21 +1473,15 @@ function sendEntryStatusChangeAlert($contestUser, $new_status, $old_status)
}
function updateSiteCommissionFromEmployer($commision_amount, $bid_id, $project_id, $user_id)
{
$milestoneTotalAmount = Models\Milestone::where('project_id', $project_id)->where('bid_id', $bid_id)->whereIn('milestone_status_id', [\Constants\MilestoneStatus::EscrowFunded, \Constants\MilestoneStatus::Completed, \Constants\MilestoneStatus::RequestedForRelease, \Constants\MilestoneStatus::EscrowReleased])->selectRaw('sum(site_commission_from_employer) as site_commission_from_employer')->first()->toArray();
$invoiceTotalAmount = Models\ProjectBidInvoice::where('project_id', $project_id)->where('is_paid', 1)->where('bid_id', $bid_id)->selectRaw('sum(site_commission_from_employer) as site_commission_from_employer')->first()->toArray();
$dispatcher = Models\Bid::getEventDispatcher();
Models\Bid::unsetEventDispatcher();
$milestoneTotalAmount = Models\Milestone::where('project_id', $project_id)->where('bid_id', $bid_id)->whereIn('milestone_status_id', [\Constants\MilestoneStatus::EscrowFunded, \Constants\MilestoneStatus::Completed, \Constants\MilestoneStatus::RequestedForRelease, \Constants\MilestoneStatus::EscrowReleased])->selectRaw('sum(site_commission_from_employer) as site_commission_from_employer')->first();
$invoiceTotalAmount = Models\ProjectBidInvoice::where('project_id', $project_id)->where('is_paid', 1)->where('bid_id', $bid_id)->selectRaw('sum(site_commission_from_employer) as site_commission_from_employer')->first();
Models\Bid::where('id', $bid_id)->update(array(
'site_commission_from_employer' => ($milestoneTotalAmount['site_commission_from_employer'] + $invoiceTotalAmount['site_commission_from_employer'])
));
Models\Bid::setEventDispatcher($dispatcher);
$dispatcher = Models\Project::getEventDispatcher();
Models\Project::unsetEventDispatcher();
Models\Project::where('id', $project_id)->update(array(
'site_commission_from_employer' => ($milestoneTotalAmount['site_commission_from_employer'] + $invoiceTotalAmount['site_commission_from_employer'])
));
Models\Project::setEventDispatcher($dispatcher);
$employerCommission = Models\Project::where('user_id', $user_id)->selectRaw('sum(site_commission_from_employer) as site_commission_from_employer')->first()->toArray();
$employerCommission = Models\Project::where('user_id', $user_id)->selectRaw('sum(site_commission_from_employer) as site_commission_from_employer')->first();
if (!empty($employerCommission['site_commission_from_employer'])) {
Models\User::where('id', $user_id)->update(array(
'total_site_revenue_as_employer' => $employerCommission['site_commission_from_employer']
Expand All @@ -1496,21 +1490,15 @@ function updateSiteCommissionFromEmployer($commision_amount, $bid_id, $project_i
}
function updateSiteCommissionFromFreelancer($commision_amount, $bid_id, $project_id, $user_id)
{
$milestoneTotalAmount = Models\Milestone::where('project_id', $project_id)->where('bid_id', $bid_id)->where('milestone_status_id', \Constants\MilestoneStatus::EscrowReleased)->selectRaw('sum(site_commission_from_freelancer) as site_commission_from_freelancer')->first()->toArray();
$milestoneTotalAmount = Models\Milestone::where('project_id', $project_id)->where('bid_id', $bid_id)->where('milestone_status_id', \Constants\MilestoneStatus::EscrowReleased)->selectRaw('sum(site_commission_from_freelancer) as site_commission_from_freelancer')->first();
$invoiceTotalAmount = Models\ProjectBidInvoice::where('project_id', $project_id)->where('is_paid', 1)->where('bid_id', $bid_id)->selectRaw('sum(site_commission_from_freelancer) as site_commission_from_freelancer')->first()->toArray();
$dispatcher = Models\Bid::getEventDispatcher();
Models\Bid::unsetEventDispatcher();
Models\Bid::where('id', $bid_id)->update(array(
'site_commission_from_freelancer' => ($milestoneTotalAmount['site_commission_from_freelancer'] + $invoiceTotalAmount['site_commission_from_freelancer'])
));
Models\Bid::setEventDispatcher($dispatcher);
$dispatcher = Models\Project::getEventDispatcher();
Models\Project::unsetEventDispatcher();
Models\Project::where('id', $project_id)->update(array(
'site_commission_from_freelancer' => ($milestoneTotalAmount['site_commission_from_freelancer'] + $invoiceTotalAmount['site_commission_from_freelancer'])
));
Models\Project::setEventDispatcher($dispatcher);
$freelancerCommission = Models\Project::where('freelancer_user_id', $user_id)->selectRaw('sum(site_commission_from_freelancer) as site_commission_from_freelancer')->first()->toArray();
$freelancerCommission = Models\Project::where('freelancer_user_id', $user_id)->selectRaw('sum(site_commission_from_freelancer) as site_commission_from_freelancer')->first();
if (!empty($freelancerCommission['site_commission_from_freelancer'])) {
Models\User::where('id', $user_id)->update(array(
'total_site_revenue_as_freelancer' => $freelancerCommission['site_commission_from_freelancer']
Expand All @@ -1519,10 +1507,10 @@ function updateSiteCommissionFromFreelancer($commision_amount, $bid_id, $project
}
function UpdatePaidAmountForProject($bid_id, $project_id)
{
$projectTotalAmount = Models\Bid::where('project_id', $project_id)->selectRaw('sum(paid_escrow_amount) as escrow_amount, sum(total_invoice_got_paid) as invoice_amount')->first()->toArray();
$projectTotalAmount = Models\Bid::where('project_id', $project_id)->selectRaw('sum(paid_escrow_amount) as escrow_amount, sum(total_invoice_got_paid) as invoice_amount')->first();
if (!empty($projectTotalAmount)) {
$amount = $projectTotalAmount['escrow_amount'] + $projectTotalAmount['invoice_amount'];
Models\Project::where('id', $project_id)->increment('total_paid_amount', $amount);
Models\Project::where('id', $project_id)->update(['total_paid_amount' => $amount]);
}
}
function getFormFields($form_field_submission)
Expand Down
96 changes: 48 additions & 48 deletions server/php/Slim/lib/vendors/OAuth2/Autoloader.php
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
<?php

namespace OAuth2;

/**
* Autoloads OAuth2 classes
*
* @author Brent Shaffer <bshafs at gmail dot com>
* @license MIT License
*/
class Autoloader
{
private $dir;

public function __construct($dir = null)
{
if (is_null($dir)) {
$dir = dirname(__FILE__).'/..';
}
$this->dir = $dir;
}
/**
* Registers OAuth2\Autoloader as an SPL autoloader.
*/
public static function register($dir = null)
{
ini_set('unserialize_callback_func', 'spl_autoload_call');
spl_autoload_register(array(new self($dir), 'autoload'));
}

/**
* Handles autoloading of classes.
*
* @param string $class A class name.
*
* @return boolean Returns true if the class has been loaded
*/
public function autoload($class)
{
if (0 !== strpos($class, 'OAuth2')) {
return;
}

if (file_exists($file = $this->dir.'/'.str_replace('\\', '/', $class).'.php')) {
require $file;
}
}
}
<?php

namespace OAuth2;

/**
* Autoloads OAuth2 classes
*
* @author Brent Shaffer <bshafs at gmail dot com>
* @license MIT License
*/
class Autoloader
{
private $dir;

public function __construct($dir = null)
{
if (is_null($dir)) {
$dir = dirname(__FILE__).'/..';
}
$this->dir = $dir;
}
/**
* Registers OAuth2\Autoloader as an SPL autoloader.
*/
public static function register($dir = null)
{
ini_set('unserialize_callback_func', 'spl_autoload_call');
spl_autoload_register(array(new self($dir), 'autoload'));
}

/**
* Handles autoloading of classes.
*
* @param string $class A class name.
*
* @return boolean Returns true if the class has been loaded
*/
public function autoload($class)
{
if (0 !== strpos($class, 'OAuth2')) {
return;
}

if (file_exists($file = $this->dir.'/'.str_replace('\\', '/', $class).'.php')) {
require $file;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

namespace OAuth2\ClientAssertionType;

use OAuth2\RequestInterface;
use OAuth2\ResponseInterface;

/**
* Interface for all OAuth2 Client Assertion Types
*/
interface ClientAssertionTypeInterface
{
//public function validateRequest(RequestInterface $request, ResponseInterface $response);
//public function getClientId();
}
<?php

namespace OAuth2\ClientAssertionType;

use OAuth2\RequestInterface;
use OAuth2\ResponseInterface;

/**
* Interface for all OAuth2 Client Assertion Types
*/
interface ClientAssertionTypeInterface
{
//public function validateRequest(RequestInterface $request, ResponseInterface $response);
//public function getClientId();
}
Loading

0 comments on commit ba54722

Please sign in to comment.