コード例 #1
0
 public function saveReceipt()
 {
     $data = Input::all();
     //We update log of "All time customers", Sales record
     $customer_id = $this->updateCustomerlog($data['others']);
     //saveReceiptToTable
     $this->saveReceiptToTable($data['others'], $customer_id);
     //Save payment details
     $this->savePaymentDetails($data['paymentdetails']);
     unset($data['paymentdetails']);
     //updateProductTable
     $datax = $data;
     unset($datax['others']);
     $this->updateProductTable($datax);
     //Keep sale log
     $this->keepSalesLog($data, $customer_id);
     //EmptyCart
     $this->emptyCart();
     $ajax['status'] = 'success';
     $ajax['message'] = 'Operations completed';
     $ajax['receipt_number'] = Receipt::buildReceipt($this->receiptID);
     //Lets work the datetime
     $ajax['receipt_date'] = ng_date_format($this->receipt_created_at);
     $ajax['receipt_time'] = ng_time_format($this->receipt_created_at);
     return Response::json($ajax);
 }
コード例 #2
0
            <span class="pull-left">
                <strong>{{ucwords($dob['name'])}}</strong>
                <br>
                <br>{{$dob['phone']}}
                <br><span class="bolder red">{{currency()}}{{format_money($dob['customerlog']['alltime_spent'])}}k</span>
            </span>
            <span class="pull-right">
              <span class="label {{$label}} pull-right">
               {{--tt($dob['birthday'], true)--}}
                {{dob_date_format($dob['birthday'])}}
              </span>
              <br>
              <br><span class="pull-right">{{$when}}</span>
              @if( $dob['customerlog']['updated_at'] !== NULL )
              <?php 
$lastvisited = ng_date_format($dob['customerlog']['updated_at']);
?>
              @else
                <?php 
$lastvisited = 'Never purchased';
?>
              @endif
              <br><span class="blue bolder">{{$lastvisited}}</span>
            </span>
          </div>
        </a>
      </li>
        <?php 
++$displayCounter;
if ($displayCounter === $totalToDisplay) {
    $totalRemaining = $count - $displayCounter;