public function __construct(FreightPrice $freightprice, Truck $truck, Party $party, Station $station)
 {
     $this->truck = $truck->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'));
     $this->party = $party->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'));
     $this->station = $station->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'));
     $this->freightprice = $freightprice->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'));
 }
Exemple #2
0
 public function legacyid(Request $request)
 {
     $partys = Party::where('legacyid', $request->student);
     // think twice if this checking is needed
     // since the dropdown will show a reliable results
     if ($partys->count() > 0) {
         $party = $partys->first();
         return redirect("{$request->redirect}/{$party->id}");
     } else {
         return back();
     }
     // TODO: return back with error
 }
Exemple #3
0
 /**
  * Get top matching parties for one questionnaire under current user
  *
  * @param int $questionnaireId
  * @return array $topMatchingParties
  */
 public function topMatchingParties($questionnaireId)
 {
     $baseScore = $this->baseScore($questionnaireId);
     $parties = Party::where('questionnaire_id', $questionnaireId)->get()->toArray();
     foreach ($parties as &$party) {
         $partyScore = $this->partyScore($party['id'], $questionnaireId);
         $party['matchingScore'] = $partyScore / $baseScore;
     }
     usort($parties, function ($a, $b) {
         return $b['matchingScore'] <=> $a['matchingScore'];
     });
     // Return top 3 matching parties
     return array_slice($parties, 0, 3);
 }
<script>
    function closeModal() {
        /*$('#sale').modal('hide');
         $('body').removeClass('modal-open');
         $('.modal-backdrop').hide();*/
        $("#sale").modal('hide').on('hidden.bs.modal', functionThatEndsUpDestroyingTheDOM);
        $('.modal-backdrop').hide();
    }
</script>
<div class="modal-dialog shape">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" onclick="closeModal()" class="close" data-dismiss="modal" aria-hidden="true"></button>
            <h3>Sales Detail for {{$sr->branch->name}}</h3>
            <?php 
$party = \App\Party::where('id', '=', $sr->party_id)->first();
?>

            <h4>Party Name : <?php 
echo $party->name;
?>
</h4>
            <h4>Product Status: <?php 
echo $sr->product_status;
?>
</h4>
            <h4>Ref noe : <?php 
echo $sr->ref_no;
?>
</h4>
        </div>
 /**
  * Display a listing of parties under this questionnaire.
  *
  * @param  int  $questionnaireId
  * @return \Illuminate\Http\Response
  */
 public function index($questionnaireId)
 {
     $questionnaire = Questionnaire::findOrFail($questionnaireId);
     $parties = Party::where('questionnaire_id', $questionnaireId)->get();
     return view('parties.index')->with(compact('questionnaire', 'parties'));
 }
 public function __construct(Godown $godown, Branch $branch, Party $party)
 {
     $this->branch = $branch->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'));
     $this->party = $party->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'));
     $this->godown = $godown->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'));
 }