function actionModify()
 {
     $id = (int) $this->_context->get('id');
     $rs = Account::find('user_id = ?', $id)->getOne();
     if (!$rs->id()) {
         return $this->msg($tip = '参数错误', url('manage::account'));
     }
     $form = Form_Common::createForm('', 'manage/profile');
     if ($this->_context->isPOST() && $form->validate($_POST)) {
         $post = $form->values();
         $user_mail = $post['user_mail'];
         $user_pass = $post['user_pass'];
         $is_locked = $post['is_locked'] ? '1' : '0';
         #dump($post);
         if ($user_pass) {
             $user_pass = sha1(md5('sike' . $post['user_pass'] . Q::ini('appini/secret_key')));
             $rs->user_pass;
         }
         $rs->user_mail = $user_mail;
         $rs->is_locked = $is_locked;
         $rs->save();
         return $this->msg($tip = '修改成功', url('manage::account/modify', array('id' => $id)));
     }
     $form->import($rs->toArray());
     $form->element('user_pass')->value = '';
     $form->element('is_locked')->checked = $rs->is_locked;
     #dump($form->element('is_locked'));
     $this->_view['form'] = $form;
     $this->_view['rs'] = $rs;
     $order = Order::find('user_id = ?', $id)->order('created DESC')->getAll();
     $this->_view['order'] = $order;
     $this->_view['_UDI'] = 'manage::account/index';
 }
 public function show()
 {
     if (!isset($_SESSION['id'])) {
         return false;
     }
     $order = null;
     require 'models/product.php';
     require_once 'models/order_detail.php';
     if (isAdmin()) {
         if (!isset($_GET['id'])) {
             return call('pages', 'error');
         }
         $order = Order::find($_GET['id']);
     } else {
         if (isset($_SESSION['orderID'])) {
             if (!isset($_GET['id'])) {
                 $order = Order::find($_SESSION['orderID']);
             } else {
                 if (Order::isSaved($_GET['id'])) {
                     $order = Order::find($_GET['id']);
                 } else {
                     return call('pages', 'error');
                 }
             }
         } else {
             if (isset($_GET['id'])) {
                 if (Order::isSaved($_GET['id'])) {
                     $order = Order::find($_GET['id']);
                 }
             }
         }
     }
     require_once 'views/orders/show.php';
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     Log::debug('IPN receiver - $_POST array: ' . print_r($_POST, TRUE));
     $ipnOrder = IPN::getOrder();
     Log::debug('IPN receiver - After processing... IPN order: ' . print_r($ipnOrder, TRUE));
     $orderItem = $ipnOrder->items->first();
     $order = Order::find((int) $orderItem->item_number);
     $order->paypal_txn_id = $ipnOrder->txn_id;
     $order->paypal_fee = $ipnOrder->mc_fee;
     $order->ipn_order_id = $ipnOrder->id;
     //$order->id = (int) $orderItem->item_number;
     if ($ipnOrder->memo) {
         $order->order_notes .= "\n\n" . $ipnOrder->memo;
     }
     if ($order->delivery_terms == 'mp3_only') {
         $order->order_status = 'Completed';
     } else {
         $order->order_status = 'Payment Received';
     }
     $order->save();
     // After the order is persisted to IPN tables,
     // we send e-mail notification to customer.
     // This ensures that e-mail confirmation is sent,
     // if customer does NOT return to our site.
     $result = OrdersController::sendEmailConfirmationExternal($order);
 }
 public function getItems($id)
 {
     $order = Order::find($id);
     if ($order) {
         $Orderitem = Orderitem::where('order_id', $id)->get();
         return View::make('items')->with('Orderitem', $Orderitem);
     }
 }
 public function actionVisit($id)
 {
     $model = Order::find()->where(['id' => $id])->one();
     $model->is_new = 1;
     $model->save();
     //return $this->redirect('/order/index',302);
     $this->redirect(\Yii::$app->urlManager->createUrl("order/index"));
 }
Exemple #6
0
 public function delete($id)
 {
     $table = Order::find($id);
     if ($table->delete()) {
         $name = trans("name.{$this->name}");
         return Redirect::to("admin/{$this->name}")->with('success', trans("message.{$this->action}", ['name' => $name]));
     }
     return Redirect::to("admin/{$this->name}")->with('error', trans('message.error'));
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     //
     $order = Order::find($id);
     $order->cliente = 'Stefano';
     $order->indirizzo = 'via Rossi, 150';
     $order->totale = '45';
     $order->save();
 }
Exemple #8
0
 /**
  * postCheckOut
  */
 public function postCheckOut()
 {
     $customer = Input::get('customer');
     $customer = Customer::find($customer);
     $customer_address = CustomerReceivedAddress::where('customer_id', $customer->id)->where('default', 1)->first();
     //订单编号
     $orderno = OrderGeneration::where('customer_no', $customer->customer_no)->where('used', 0)->first();
     if (!$orderno) {
         foreach (range(1001, 9998) as $index) {
             if ($index == 1111 || $index == 2222 || $index == 3333 || $index == 4444 || $index == 5555 || $index == 6666 || $index == 7777 || $index == 8888) {
                 continue;
             }
             OrderGeneration::create(['customer_no' => $customer->customer_no, 'order_no' => $index, 'used' => 0]);
         }
         $order_no = $index;
         $no = $order_no . $customer->customer_no;
     } else {
         $order_no = $orderno->order_no;
         $no = $order_no . $customer->customer_no;
     }
     $order = new Order();
     $order->no = $no;
     $order->customer_id = $customer->id;
     $order->customer_address_id = $customer_address->id;
     $order->payment_method_id = 1;
     $order->shipping_method_id = 1;
     $order->order_status = 'order_price_confirmed';
     $order->item_fee = 0.0;
     $order->shipping_fee = 0;
     $order->amount_fee = 0.0;
     $order->point_fee = 0;
     $order->credit_fee = 0;
     $order->pay_fee = 0.0;
     $order->caution_money = 0;
     $order->save();
     $ordergeneration = OrderGeneration::where('order_no', $order_no)->where('customer_no', $customer->customer_no)->first();
     $ordergeneration->used = 1;
     $ordergeneration->save();
     //orderdetail
     $carts = Cart::where('customer_id', $customer->id)->get();
     $sum = 0;
     foreach ($carts as $cart) {
         $total = 0;
         if ($cart->confirm_price == 0.0) {
             $cart->confirm_price = $cart->item->price_market;
         }
         OrderDetail::create(['order_id' => $order->id, 'item_id' => $cart->item_id, 'craft_description' => $cart->craft_description, 'quantity' => $cart->quantity, 'confirm_price' => $cart->confirm_price, 'confirm_quantity' => 0, 'delivery_quantity' => 0]);
         $total = $cart->confirm_price * $cart->quantity;
         $sum += $total;
     }
     $order = Order::find($order->id);
     $order->item_fee = $sum;
     $order->save();
     //查看订单详细页面
     return Redirect::to('admin/orders');
 }
Exemple #9
0
function remove($cp_id, $order_id)
{
    $val = Validation::own_cus_product($cp_id, $_SESSION["user_id"]);
    if ($val) {
        $cus_pro = CusProduct::find($cp_id);
        $order = Order::find($order_id);
        $order->remove_product($cus_pro);
        $order->update();
    }
}
 function admin_report_pdf()
 {
     $orders = $this->Order->find('all');
     //pr($orders);
     //die;
     //Configure::write('debug', 0);
     $this->layout = 'pdf';
     $this->set('orders', $orders);
     $this->render();
 }
 /**
  * change the paid status of an order
  *
  * @param integer $orderId
  * @internal param bool $paid
  * @return \Illuminate\Http\RedirectResponse
  */
 public function postChangePaid($orderId)
 {
     $order = Order::find($orderId);
     // if order not loaded or user is not the delivery owner
     if (!$order || !$order->allowedToChangePaid(Auth::user())) {
         return Redirect::back()->with('errors', new MessageBag(['An error has occurred.']));
     }
     $order->paid = (bool) (!$order->paid);
     $order->save();
     return Redirect::back();
 }
 public function delete($id)
 {
     $order = Order::find($id);
     foreach ($order->detail()->getResults() as $detail) {
         $detail->softDeletes();
     }
     $order->softDeletes();
     // redirect
     Session::flash('message', 'Successfully deleted the product!');
     return Redirect::to('orders');
 }
 /**
  * Is order flagged to not queue
  *
  * @param Order $Model
  * @param $id
  * @return array|bool
  */
 public function noQueueFlagged(Order $Model, $id)
 {
     if (empty($id)) {
         $id = $Model->id;
     }
     $r = $Model->find('first', ['conditions' => ['id' => $id, 'NOT' => ['order_status_id' => Order::STATUS_PENDINGPAYMENT], 'OR' => ['secondary_order_status_id' => [Order::SECONDARY_HOLD_FOR_REVIEW, Order::SECONDARY_NETSUITE_SKIP]]]]);
     if (empty($r)) {
         return false;
     } else {
         return true;
     }
 }
 function actionIndex()
 {
     //新进订单
     $order = Order::find()->order('order_id DESC')->get(5);
     //新进帐号
     #$users = Account::find()->order('user_id DESC')->get(5);
     $this->_view['order'] = $order;
     #$this->_view['users'] = $users;
     $sql = "SELECT SUM( acctinputoctets + acctoutputoctets ) as total FROM radacct WHERE 1";
     $traffic_total = QDB::getConn()->getOne($sql);
     $this->_view['traffic_total'] = $traffic_total;
     /*
     $ttt = Invoice::find('trade_status = ?','TRADE_FINISHED')->getAll();
     foreach($ttt as $t)
     {
         $t->due_time = ($t->per_day * 24 * 3600) + $t->trade_time;
         $t->save();
     }
     */
     $nowt = time();
     $dayt = 24 * 3600;
     $tips = $nowt - 25 * $dayt;
     $sql = "SELECT i.`order_id`,i.`total_fee`,i.`per_day`,i.`due_time`,i.`order_number` FROM `vpn_invoice` i, `vpn_order` o WHERE i.`order_id` = o.`order_id` AND o.`status` IN ('expired','approve') AND i.`is_expired` = '0' AND i.`trade_status` = 'TRADE_FINISHED' AND i.`due_time` < " . $tips;
     $niv = QDB::getConn()->getAll($sql);
     // 这里的 due_time 其实不用设置,因为这系统账单不会过期。。。当用户付款后,自动更新下期账单时间。
     foreach ($niv as $new) {
         $old = $new['order_number'];
         $due_time = $nowt > $new['due_time'] ? $nowt : $new['due_time'];
         $new['due_time'] = $due_time + $new['per_day'] * $dayt;
         $new['order_number'] = 'x' . date('YmdHis') . rand(111, 999);
         $test = QDB::getConn()->getOne("SELECT `order_number` FROM `vpn_invoice` WHERE `order_id` = {$new['order_id']} AND `trade_status` LIKE 'WAIT_BUYER_PAY'");
         // 如果不存在未支付的账单,则生成之。
         if (!$test) {
             $new_sql = "INSERT INTO `vpn_invoice` (`order_id`, `order_number`, `buyer_email`, `total_fee`, `trade_time`, `trade_status`, `trade_no`, `trade_ip`, `per_day`, `due_time`, `created`, `updated`) VALUES ({$new['order_id']}, '{$new['order_number']}', '0', {$new['total_fee']}, 0, 'WAIT_BUYER_PAY', '0', '0', {$new['per_day']}, {$new['due_time']}, {$nowt}, 0);";
             #QDB::getConn()->execute($new_sql);
             //设置上一账单失效。
             $ext_sql = "UPDATE `vpn_invoice` SET `is_expired` = '1' WHERE `order_number` = '{$old}'";
             QDB::getConn()->execute($ext_sql);
             #dump($ext_sql);
         }
     }
     #exit;
     // 过期用户
     $exts = $nowt - 30 * $dayt;
     $sql = "SELECT o.`username`,o.`order_id` FROM `vpn_invoice` i, `vpn_order` o WHERE i.`order_id` = o.`order_id` AND i.`is_expired` = '0' AND i.`trade_status` = 'TRADE_FINISHED' AND o.`status` != 'expired' AND i.`due_time` < " . $exts;
     $ext = QDB::getConn()->getAll($sql);
     foreach ($ext as $tmp) {
         $old_sql = "UPDATE `vpn_order` SET `status` = 'expired' WHERE `order_id` = {$tmp['order_id']}";
         $nop_sql = "UPDATE `radusergroup` SET `groupname` = 'NOP' WHERE `username` = '{$tmp['username']}'";
         QDB::getConn()->execute($old_sql);
         QDB::getConn()->execute($nop_sql);
     }
 }
 /**
  * Backorder Notice Orders 30 days old
  *
  * @param Order $Model
  * @param int $days
  * @param bool|true $count
  * @return mixed
  */
 public function backorderNotice(Order $Model, $days = 30, $count = false)
 {
     $Model->useDbConfig = 'replicated';
     if ($count == true) {
         $find = 'count';
         $fields = ['COUNT(DISTINCT Order.id) as count'];
     } else {
         $find = 'all';
         $fields = ['DISTINCT date(Order.date_completed)', 'User.first_name', 'User.last_name', 'User.user_default_locale', 'Order.id', 'Order.order_market_id', 'Email.email', 'OrderItem.quantity', 'OrderItem.ns_warehouse_id', 'Item.sku'];
     }
     $result = $Model->find($find, ['fields' => $fields, 'joins' => [['table' => 'order_customers', 'alias' => 'OrderCustomer', 'type' => 'INNER', 'conditions' => ['OrderCustomer.order_id = Order.id']], ['table' => 'order_items', 'alias' => 'OrderItem', 'type' => 'INNER', 'conditions' => ['OrderItem.order_customer_id = OrderCustomer.id']], ['table' => 'items', 'alias' => 'Item', 'type' => 'INNER', 'conditions' => ['Item.id = OrderItem.item_id']], ['table' => 'users', 'alias' => 'User', 'type' => 'INNER', 'conditions' => ['User.id = Order.user_id']], ['table' => 'emails', 'alias' => 'Email', 'type' => 'INNER', 'conditions' => ['Email.user_id = User.id', 'Email.email_type_id' => 1]]], 'conditions' => ['Order.order_status_id' => [Order::STATUS_ENTERED, Order::STATUS_PROCESSING, Order::STATUS_SHIPPED], 'NOT' => ['Order.order_type_id' => Order::TYPE_REPLACEMENT], 'OrderItem.order_item_hold_code_id' => OrderItemHoldCode::BACKORDERED, "date(Order.date_completed) > '2015-11-01'", "TIMESTAMPDIFF(DAY, Order.date_completed, NOW()) = {$days}"]]);
     return $result;
 }
 public function postEventBuy($event_id)
 {
     $validator = Validator::make(Input::all(), array('email' => 'required|email', 'first_name' => 'required', 'last_name' => 'required', 'address' => 'required', 'city' => 'required', 'zip_code' => 'required', 'phone' => 'required'));
     if ($validator->fails()) {
         return Redirect::route('events.event-buy')->withErrors($validator)->withInput();
     } else {
         $price = Order::find($event_id)->price;
         $user_id = Auth::user()->id;
         $order = Order::create(array('customer_id' => $user_id, 'event_id' => $event_id, 'price' => $price));
         if ($order) {
             return Redirect::route('events')->with('global', 'Thank you for your order.');
         }
     }
 }
 public function get_invoice()
 {
     $id = Request::segment(3);
     $order = Order::find($id);
     if ($order) {
         if ($order->user_id == Auth::user()->id && ($order->status = 'Delivered')) {
             $user = User::find($order->user_id);
             $products = OrderProduct::where('order_id', $order->id)->where(function ($query) {
                 $query->where('fulfilment_status', 'Fullfilled')->orWhere('fulfilment_status', 'Replacement');
             })->get();
             return View::make('invoice')->with('user', $user)->with('order', $order)->with('products', $products);
         }
     }
 }
 public function update($id)
 {
     try {
         $updateModel = Input::json()->all();
         $updateOrder = Order::find($id);
         $updateOrder->status = $updateModel['status'];
         $updateOrder->save();
         if ($updateOrder->status == 0) {
             $updateOrder->open = 'no';
         } else {
             $updateOrder->open = 'yes';
         }
         return $updateOrder->toJson();
     } catch (Exception $e) {
         return '{"error":{"text":' . $e->getMessage() . '}}';
     }
 }
 public function adminInvoice($id)
 {
     if (isset($id)) {
         $order = Order::find($id);
         if (isset($order)) {
             //  Session::put('order_id', $id);
             $orderItems = OrderItem::where('order_id', $order->id)->get();
             $couriers = Courier::where('status', 'active')->get();
             $pdf = PDF::loadView('pdf.adminInvoice', ['order' => $order, 'orderItems' => $orderItems, 'couriers' => $couriers]);
             //                return $pdf->download('invoice.pdf');
             return $pdf->stream();
         } else {
             return Redirect::to('/');
         }
     } else {
         return Redirect::to('/');
     }
 }
 public function paypal_DECP($token, $payer_id, $order_id)
 {
     $order = Order::find($order_id);
     $DECPFields = array('token' => $token, 'payerid' => $payer_id, 'returnfmfdetails' => '1', 'giftmessage' => '', 'giftreceiptenable' => '', 'giftwrapname' => '', 'giftwrapamount' => '', 'buyermarketingemail' => '', 'surveyquestion' => '', 'surveychoiceselected' => '', 'allowedpaymentmethod' => '', 'buttonsource' => '');
     $Payments = array();
     $Payment = array('amt' => $order->total_taxed, 'currencycode' => $this->currency, 'itemamt' => $order->total, 'shippingamt' => '', 'insuranceoptionoffered' => '', 'handlingamt' => '', 'taxamt' => $order->total_taxed - $order->total, 'desc' => 'Order #' . $this->app->hashids->encrypt($order->id), 'custom' => '', 'invnum' => '', 'notifyurl' => '', 'shiptoname' => '', 'shiptostreet' => '', 'shiptostreet2' => '', 'shiptocity' => '', 'shiptostate' => '', 'shiptozip' => '', 'shiptocountry' => '', 'shiptophonenum' => '', 'notetext' => '', 'allowedpaymentmethod' => '', 'paymentaction' => 'Sale', 'paymentrequestid' => '', 'sellerpaypalaccountid' => '');
     $orderTable = $order->toTable();
     $descriptions = array_merge($orderTable['listings'], $orderTable['bulk']);
     $PaymentOrderItems = array();
     foreach ($descriptions as $idx => $d) {
         $Item = array('name' => $d['listing']->description->name, 'desc' => '', 'amt' => $d['listing']->price, 'number' => $d['listing']->description->id, 'qty' => $d['qty'], 'taxamt' => '', 'itemurl' => '', 'itemweightvalue' => '', 'itemweightunit' => '', 'itemheightvalue' => '', 'itemheightunit' => '', 'itemwidthvalue' => '', 'itemwidthunit' => '', 'itemlengthvalue' => '', 'itemlengthunit' => '', 'ebayitemnumber' => '', 'ebayitemauctiontxnid' => '', 'ebayitemorderid' => '', 'ebayitemcartid' => '');
         array_push($PaymentOrderItems, $Item);
     }
     $Payment['order_items'] = $PaymentOrderItems;
     array_push($Payments, $Payment);
     $PayPalRequest = array('DECPFields' => $DECPFields, 'Payments' => $Payments);
     $_SESSION['PayPalRequestResult'] = $this->paypal->DoExpressCheckoutPayment($PayPalRequest);
     return $_SESSION['PayPalRequestResult'];
 }
Exemple #21
0
 public static function saveInvoice($id)
 {
     if (isset($id)) {
         $order = Order::find($id);
         if (isset($order)) {
             //  Session::put('order_id', $id);
             $orderItems = OrderItem::where('order_id', $order->id)->get();
             $couriers = Courier::where('status', 'active')->get();
             $pdf = PDF::loadView('pdf.adminInvoice', ['order' => $order, 'orderItems' => $orderItems, 'couriers' => $couriers]);
             $output = $pdf->output();
             $file_to_save = './public/uploads/pdf/order_' . $order->id . '.pdf';
             file_put_contents($file_to_save, $output);
             return true;
         } else {
             return Redirect::to('/');
         }
     } else {
         return Redirect::to('/');
     }
 }
Exemple #22
0
 public function indexAction()
 {
     $userInfo = $this->session->get('userInfo');
     //验证会员是否已登录
     if (empty($userInfo)) {
         $url = $this->url->get('user/login');
         header("Location:{$url}");
         exit;
     }
     $uid = $userInfo['id'];
     //分页
     $page = $this->request->get('page') ? $this->request->get('page') : 1;
     $filter = array("uid={$uid}", 'order' => 'ctime desc');
     //总数
     $count = \Order::count($filter);
     $limit = 5;
     $filter['offset'] = ($page - 1) * $limit;
     $filter['limit'] = $limit;
     //查询订单信息
     $userOrder = \Order::find($filter) ? \Order::find($filter)->toArray() : '';
     //查询订单影片信息
     foreach ($userOrder as &$val) {
         $val['film'] = Film::findFirst('id=' . $val['film_id'])->toArray();
         $val['film_heat'] = FilmHeat::findFirst('film_id=' . $val['film_id'])->toArray();
         $schedule = FilmSchedule::findFirst('id=' . $val['schedule_id'])->toArray();
         if ($schedule) {
             $time = strtotime($schedule['starttime']);
             $week_arr = array('日', '一', '二', '三', '四', '五', '六');
             $val['film_schedule'] = date('n', $time) . '月' . date('j', $time) . '日 周' . $week_arr[date('w', $time)] . ' ' . date('H:i', $time);
         } else {
             $val['film_schedule'] = '';
         }
     }
     $page_html = \ToolStr::GetPage($count, $limit);
     $this->view->setVar('page_html', $page_html);
     $this->view->setVar('userInfo', $userInfo);
     $this->view->setVar('user_order', $userOrder);
     $this->view->setVar('title', '会员中心');
 }
 public static function userInvoiceMail($id)
 {
     if (isset($id)) {
         $order = Order::find($id);
         if (isset($order)) {
             $pdf = PdfHelper::saveInvoice($id);
             $pathToFile = './public/uploads/pdf/order_' . $order->id . '.pdf';
             if ($pdf) {
                 Mail::send('emails.invoiceCopy', ['order' => $order], function ($message) use($order, $pathToFile) {
                     $message->to($order->email, 'Coboo');
                     $message->from('*****@*****.**');
                     $message->subject('Invoice Copy');
                     $message->attach($pathToFile);
                 });
                 return true;
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
Exemple #24
0
$tito->reload();
echo "{$tito->name} has " . count($tito->orders) . " orders for: " . join(', ', ActiveRecord\collect($tito->orders, 'item_name')) . "\n\n";
// get all orders placed by Tito
foreach (Order::find_all_by_person_id($tito->id) as $order) {
    echo "Order #{$order->id} for {$order->item_name} (\${$order->price} + \${$order->tax} tax) ordered by " . $order->person->name . "\n";
    if (count($order->payments) > 0) {
        // display each payment for this order
        foreach ($order->payments as $payment) {
            echo "  payment #{$payment->id} of \${$payment->amount} by " . $payment->person->name . "\n";
        }
    } else {
        echo "  no payments\n";
    }
    echo "\n";
}
// display summary of all payments made by Tito and Jax
$conditions = array('conditions' => array('id IN(?)', array($tito->id, $jax->id)), 'order' => 'name desc');
foreach (Person::all($conditions) as $person) {
    $n = count($person->payments);
    $total = array_sum(ActiveRecord\collect($person->payments, 'amount'));
    echo "{$person->name} made {$n} payments for a total of \${$total}\n\n";
}
// using order has_many people through payments with options
// array('people', 'through' => 'payments', 'select' => 'people.*, payments.amount', 'conditions' => 'payments.amount < 200'));
// this means our people in the loop below also has the payment information since it is part of an inner join
// we will only see 2 of the people instead of 3 because 1 of the payments is greater than 200
$order = Order::find($pokemon->id);
echo "Order #{$order->id} for {$order->item_name} (\${$order->price} + \${$order->tax} tax)\n";
foreach ($order->people as $person) {
    echo "  payment of \${$person->amount} by " . $person->name . "\n";
}
 public function allowJTS($order_id, $requested_jt_right)
 {
     $usergroup = User::find(Auth::id())->usergroup()->first();
     $job_id = Order::find($order_id)->Job_Id;
     $job = Jobs::find($job_id);
     $channel_id = $job->Channel_Id;
     $job_status_id = $job->Job_Status_Id;
     //select form usergroup channel rights where the channel_id and usergroup_id and ch_right
     $Right_list = DB::select(DB::raw("SELECT ugjtsr.* FROM usergroupsjtsrights ugjtsr, jobtypesrights jtr\n\t\t\t\tWHERE ugjtsr.Channel_Id = " . $channel_id . " and ugjtsr.UserGroup_Id = " . $usergroup->UserGroup_Id . "\n\t\t\t\t\tand ugjtsr.Job_Type_Status_Id = " . $job_status_id . "\n\t\t\t\t\tand ugjtsr.Job_Type_Right_Id =  jtr.JobType_Id\n\t\t\t\t\tand jtr.Job_Type_Right_Name = '" . $requested_jt_right . "'"));
     return Response::json(count($Right_list) > 0);
 }
Exemple #26
0
 public function take($companies, $order)
 {
     $offers = Order::find($order)->offers()->groupBy('date')->get();
     return View::make('offers.index', compact('offers', 'order', 'companies'));
 }
Exemple #27
0
<?php

require_once '../classes/session.php';
require_once '../classes/functions.php';
require __DIR__ . '/../vendor/autoload.php';
require '../config.php';
require '../classes/boot.php';
require_once '../classes/Item.php';
require_once '../classes/Restaurant.php';
require_once '../classes/User.php';
require_once '../classes/Order.php';
$session = new Session();
$session->forceLogin('../index.php');
if (isset($_POST['status'])) {
    $order = Order::find($_GET['id']);
    $order->status = $_POST['status'];
    $order->save();
}
$user = User::find($session->getUsername());
$order = Order::with('restaurant')->find($_GET['id']);
$items = json_decode($order->items, TRUE);
getTemplate(1, 'header', []);
?>
<body>
<?php 
getTemplate(1, 'admin_nav', []);
?>

<div class="orderscontainer" ng-controller="PageController">
  <div class="container">
    <div class="row">
 function thanks()
 {
     return view('thanks')->with(['transaction_id' => session('transaction_id'), 'order' => Order::find(session('order_id'))]);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Order::find($id)->delete();
     return redirect('emloyeeTerritories');
 }
 /**
  *  This function responses to
  *  the post request of /admin/employee/details/{id}
  *  and deactivated employee active order from list
  */
 public function postEmployeeOrderDeactive()
 {
     $orderId = Input::get('checked');
     $employeeId = Input::get('employee_id');
     foreach ($orderId as $id) {
         $order = Order::find($id);
         $order->status = '0';
         $order->save();
     }
     return Redirect::route('employee-details-get', array($employeeId, 1));
 }